ecplayer 1.0.3 → 1.0.8

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.
@@ -1,20 +1,21 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as Oe, createElement as Ie, useState as f, useRef as y, useEffect as C } from "react";
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ecp-full-width{width:100%}.ecp-h-full{height:100%}.ecp-relative{position:relative}.ecp-absolute{position:absolute}.ecp-inset-0{top:0;right:0;bottom:0;left:0}.ecp-z-10{z-index:10}.ecp-flex{display:flex}.ecp-inline-flex{display:inline-flex}.ecp-flex-col{flex-direction:column}.ecp-flex-wrap{flex-wrap:wrap}.ecp-flex-1{flex:1 1 0%}.ecp-flex-shrink-0{flex-shrink:0}.ecp-grid{display:grid}.ecp-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.ecp-hidden{display:none}.ecp-items-center{align-items:center}.ecp-items-end{align-items:flex-end}.ecp-items-start{align-items:flex-start}.ecp-justify-center{justify-content:center}.ecp-justify-between{justify-content:space-between}.ecp-justify-end{justify-content:flex-end}.ecp-justify-start{justify-content:flex-start}.ecp-text-center{text-align:center}.ecp-text-right{text-align:right}.ecp-self-center{align-self:center}.ecp-gap-1{gap:.25rem}.ecp-gap-2{gap:.5rem}.ecp-gap-3{gap:.75rem}.ecp-gap-px{gap:1px}.ecp-gap-05{gap:2px}.ecp-mb-1{margin-bottom:.25rem}.ecp-mb-2{margin-bottom:.5rem}.ecp-mb-4{margin-bottom:1rem}.ecp-mb-6{margin-bottom:1.5rem}.ecp-mr-2{margin-right:.5rem}.ecp-mt-4{margin-top:1rem}.ecp-mt-6{margin-top:1.5rem}.ecp-ml-auto{margin-left:auto}.ecp-p-1{padding:.25rem}.ecp-p-1-5{padding:.375rem}.ecp-p-2{padding:.5rem}.ecp-p-3{padding:.75rem}.ecp-p-4{padding:1rem}.ecp-p-6{padding:1.5rem}.ecp-p-8{padding:2rem}.ecp-px-2{padding-left:.5rem;padding-right:.5rem}.ecp-px-3{padding-left:.75rem;padding-right:.75rem}.ecp-px-4{padding-left:1rem;padding-right:1rem}.ecp-px-6{padding-left:1.5rem;padding-right:1.5rem}.ecp-py-1{padding-top:.25rem;padding-bottom:.25rem}.ecp-py-2{padding-top:.5rem;padding-bottom:.5rem}.ecp-py-3{padding-top:.75rem;padding-bottom:.75rem}.ecp-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.ecp-pb-2{padding-bottom:.5rem}.ecp-pt-2{padding-top:.5rem}.ecp-w-1{width:.25rem}.ecp-w-3{width:.75rem}.ecp-w-4{width:1rem}.ecp-w-10{width:2.5rem}.ecp-w-12{width:3rem}.ecp-w-20{width:5rem}.ecp-w-24{width:6rem}.ecp-w-px{width:1px}.ecp-w-full{width:100%}.ecp-max-w-xs{max-width:20rem}.ecp-max-w-lg{max-width:32rem}.ecp-max-w-4xl{max-width:56rem}.ecp-h-0-5{height:.125rem}.ecp-h-1{height:.25rem}.ecp-h-1-5{height:.375rem}.ecp-h-2{height:.5rem}.ecp-h-3{height:.75rem}.ecp-h-4{height:1rem}.ecp-h-6{height:1.5rem}.ecp-h-8{height:2rem}.ecp-h-10{height:2.5rem}.ecp-h-12{height:3rem}.ecp-h-20{height:5rem}.ecp-h-40{width:10rem;height:40px}.ecp-h-64{height:16rem}.ecp-h-screen{height:100vh}.ecp-min-h-screen{min-height:100vh}.ecp-min-h-0{min-height:0}.ecp-min-w-12{min-width:3rem}.ecp-min-w-0{min-width:0}.ecp-aspect-square{aspect-ratio:1 / 1}.ecp-text-xs{font-size:.75rem;line-height:1rem}.ecp-text-sm{font-size:.875rem;line-height:1.25rem}.ecp-text-lg{font-size:1.125rem;line-height:1.75rem}.ecp-text-2xl{font-size:1.5rem;line-height:2rem}.ecp-font-medium{font-weight:500}.ecp-font-semibold{font-weight:600}.ecp-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}.ecp-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ecp-text-white{color:#fff}.ecp-text-transparent{color:transparent}.ecp-text-gray-400{color:#9ca3af}.ecp-text-gray-500{color:#6b7280}.ecp-text-gray-600{color:#4b5563}.ecp-text-gray-700{color:#374151}.ecp-text-gray-800{color:#1f2937}.ecp-text-gray-100{color:#f3f4f6}.ecp-text-gray-200{color:#e5e7eb}.ecp-text-gray-300{color:#d1d5db}.ecp-text-red-500{color:#ef4444}.ecp-dark .ecp-text-dark-100{color:#f3f4f6}.ecp-dark .ecp-text-dark-200{color:#e5e7eb}.ecp-dark .ecp-text-dark-300{color:#d1d5db}.ecp-bg-white{background-color:#fff}.ecp-bg-black-20{background-color:#0003}.ecp-bg-black-30{background-color:#0000004d}.ecp-bg-black-40{background-color:#0006}.ecp-bg-black-50{background-color:#00000080}.ecp-bg-gray-100{background-color:#f3f4f6}.ecp-bg-gray-200{background-color:#e5e7eb}.ecp-bg-gray-300{background-color:#d1d5db}.ecp-bg-gray-700{background-color:#374151}.ecp-bg-gray-800{background-color:#1f2937}.ecp-bg-red-50{background-color:#fef2f2}.ecp-bg-transparent{background-color:transparent}.ecp-border{border-width:1px}.ecp-border-2{border-width:2px}.ecp-border-r{border-right-width:1px}.ecp-border-transparent{border-color:transparent}.ecp-border-gray-300{border-color:#d1d5db}.ecp-border-red-300{border-color:#fca5a5}.ecp-border-current{border-color:currentColor}.ecp-border-none{border:none}.ecp-outline-none{outline:none}.ecp-rounded{border-radius:.25rem}.ecp-rounded-lg{border-radius:.5rem}.ecp-rounded-xl{border-radius:.75rem}.ecp-rounded-2xl{border-radius:1rem}.ecp-rounded-full{border-radius:9999px}.ecp-rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.ecp-shadow-sm{box-shadow:0 1px 2px #0000000d}.ecp-shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}.ecp-shadow-2xl{box-shadow:0 25px 50px -12px #00000040}.ecp-opacity-20{opacity:.2}.ecp-opacity-40{opacity:.4}.ecp-opacity-70{opacity:.7}.ecp-opacity-80{opacity:.8}.ecp-cursor-pointer{cursor:pointer}.ecp-cursor-not-allowed{cursor:not-allowed}.ecp-pointer-events-none{pointer-events:none}.ecp-transition{transition-property:color,background-color,border-color,opacity,box-shadow,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ecp-transition-all{transition:all .15s cubic-bezier(.4,0,.2,1)}.ecp-duration-75{transition-duration:75ms}.ecp-duration-100{transition-duration:.1s}.ecp-duration-150{transition-duration:.15s}.ecp-duration-300{transition-duration:.3s}.ecp-scale-0{transform:scale(0)}.ecp-translate-y-10{transform:translateY(2.5rem)}.ecp--translate-y-10{transform:translateY(-2.5rem)}.ecp-rotate-180{transform:rotate(180deg)}.ecp-hover-scale-105:hover{transform:scale(1.05)}.ecp-hover-scale-110:hover{transform:scale(1.1)}@keyframes ecp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ecp-animation-spin{animation:ecp-spin 15s infinite linear}.ecp-object-contain{-o-object-fit:contain;object-fit:contain}.ecp-backdrop-blur-xl{-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}.ecp-overflow-hidden{overflow:hidden}.ecp-top-0{top:0}.ecp-left-0{left:0}.ecp-fixed{position:fixed}.ecp-z-9999{z-index:9999}.ecp-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.ecp-page-wrapper{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem}@media (min-width: 768px){.ecp-page-wrapper{padding:2rem}}.ecp-demo-container{width:100%;height:100%}@media (min-width: 768px){.ecp-demo-container{height:auto;max-width:56rem}}.ecp-container-glass{border-radius:.75rem;padding:2rem}.ecp-demo-header{margin-bottom:1.5rem;display:flex;justify-content:space-between;align-items:flex-start}.ecp-demo-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin-bottom:.25rem}.ecp-demo-title--dark{color:#e5e7eb}.ecp-demo-subtitle{font-size:.875rem;color:#6b7280}.ecp-theme-btn{background:#fff;border:1px solid #d1d5db;color:#374151;padding:.5rem 1rem;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:.5rem}.ecp-theme-btn:hover{background:#f9fafb}.ecp-demo-actions{margin-top:1.5rem;display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-action-btn{background:#fff;border:1px solid #d1d5db;color:#374151;padding:.5rem 1.5rem;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:.5rem}.ecp-action-btn:hover{background:#f9fafb}.ecp-file-input-hidden{display:none}.ecp-theme-selector-panel{border-radius:.75rem;padding:1.5rem;margin-bottom:1.5rem}.ecp-theme-selector-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.ecp-theme-selector-title{font-size:1.125rem;font-weight:600;color:#1f2937}.ecp-theme-selector-close{color:#6b7280;font-size:.875rem;font-weight:500;background:none;border:none;cursor:pointer}.ecp-theme-selector-close:hover{color:#374151}.ecp-theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}@media (min-width: 640px){.ecp-theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.ecp-theme-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.ecp-theme-card{background:#fff;padding:1rem;border-radius:.5rem;cursor:pointer;border:2px solid transparent;transition:all .15s cubic-bezier(.4,0,.2,1)}.ecp-theme-card--active{border-color:currentColor;box-shadow:0 10px 15px -3px #0000001a}.ecp-theme-color-preview{height:2.5rem;border-radius:.25rem;margin-bottom:.5rem}.ecp-theme-name{font-size:.875rem;font-weight:500;color:#374151}.ecp-vp-wrapper{width:100%;border-radius:.75rem;overflow:hidden}.ecp-vp-bg{padding:1rem}.ecp-vp-vu-outer{position:relative}.ecp-vp-vu-bg{border-radius:.5rem;margin-bottom:1.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d}.ecp-vp-vu-bg--light{background:#ffffffb3}.ecp-vp-vu-bg--dark{background:#0006}.ecp-vp-vu-bg--transparent{background:transparent!important;padding:0!important;box-shadow:none!important}.ecp-vp-vu-bg--dimmed{opacity:.3}.ecp-vp-vu-bg--no-margin{margin-bottom:0}.ecp-vp-vu-bars{display:flex;justify-content:center;align-items:flex-end;gap:.25rem;height:16rem}.ecp-vp-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100%;justify-content:center;z-index:10;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s cubic-bezier(.4,0,.2,1)}.ecp-vp-eq-overlay--light{background:#fffc}.ecp-vp-eq-overlay--dark{background:#00000080}.ecp-vp-eq-title{font-size:.875rem;font-weight:500;margin-bottom:1rem}.ecp-vp-eq-title--light{color:#374151}.ecp-vp-eq-title--dark{color:#e5e7eb}.ecp-vp-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-vp-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-vp-eq-band-label{font-size:.75rem}.ecp-vp-eq-band-label--light{color:#4b5563}.ecp-vp-eq-band-label--dark{color:#d1d5db}.ecp-vp-eq-band-range{display:flex;align-items:center;gap:.75rem}.ecp-vp-eq-range-bound{font-size:.75rem}.ecp-vp-eq-range-bound--light{color:#6b7280}.ecp-vp-eq-range-bound--dark{color:#9ca3af}.ecp-vp-eq-slider{flex:1;height:2rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-vp-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-vp-eq-footer{display:flex;justify-content:flex-end;margin-top:1rem}.ecp-vp-eq-reset{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;transition:all .15s;border:none}.ecp-vp-eq-reset--light{background:#e5e7eb;color:#374151}.ecp-vp-eq-reset--light:hover{background:#d1d5db}.ecp-vp-eq-reset--dark{background:#374151;color:#e5e7eb}.ecp-vp-eq-reset--dark:hover{background:#4b5563}.ecp-vp-track{margin-bottom:1.5rem;display:flex;align-items:center}.ecp-vp-thumbnail-wrap{margin-right:.5rem;width:3rem;flex-shrink:0}.ecp-vp-thumbnail{height:3rem;width:3rem;border-radius:9999px}.ecp-vp-track-info{width:100%;min-width:0}.ecp-vp-track-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ecp-vp-track-name--light{color:#374151}.ecp-vp-track-name--dark{color:#f3f4f6}.ecp-vp-track-author{font-size:.75rem}.ecp-vp-track-author--light{color:#6b7280}.ecp-vp-track-author--dark{color:#d1d5db}.ecp-vp-seekbar{margin-bottom:1.5rem}.ecp-vp-seekbar-row{display:flex;align-items:center;gap:.25rem}.ecp-vp-time{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:3rem}.ecp-vp-time--right{text-align:right}.ecp-vp-time--light{color:#4b5563}.ecp-vp-time--dark{color:#f3f4f6}.ecp-vp-seek-input{flex:1;height:.5rem;background:#e5e7eb;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-seek-input:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-seek-input::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-seek-input::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-vp-controls--sm{gap:.5rem}.ecp-vp-play-btn{padding:.5rem 1rem;min-width:6rem;border-radius:9999px;font-size:.875rem;font-weight:500;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:opacity .15s}.ecp-vp-play-btn:hover{opacity:.9}.ecp-vp-play-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-play-btn--compact{padding:1.25rem .75rem;min-width:unset}.ecp-vp-play-icon-wrap{position:relative;width:1rem;display:flex;align-items:center}.ecp-vp-stop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-stop-btn--light{background:#374151;color:#fff}.ecp-vp-stop-btn--light:hover{background:#1f2937}.ecp-vp-stop-btn--dark{background:#f3f4f6;color:#000}.ecp-vp-stop-btn--dark:hover{background:#d1d5db}.ecp-vp-stop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-stop-btn--wide{padding:.5rem 1rem}.ecp-vp-eq-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-eq-btn--off{background:#f3f4f6;color:#374151}.ecp-vp-eq-btn--off:hover{background:#d1d5db}.ecp-vp-eq-btn--on{color:#fff}.ecp-vp-eq-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-eq-btn--wide{padding:.5rem 1rem}.ecp-vp-loop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-vp-loop-btn--off{background:#f3f4f6;color:#374151}.ecp-vp-loop-btn--off:hover{background:#d1d5db}.ecp-vp-loop-btn--on{color:#fff}.ecp-vp-loop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-vp-loop-btn--wide{padding:.5rem 1rem}.ecp-vp-loop-icon--active{transform:rotate(180deg)}.ecp-vp-speed-wrap{display:flex;align-items:center}.ecp-vp-speed-select{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;outline:none;cursor:pointer;transition:all .15s;background:transparent}.ecp-vp-speed-select--light{color:#1f2937}.ecp-vp-speed-select--dark{color:#e5e7eb}.ecp-vp-speed-option--light{background:#fff;color:#1f2937}.ecp-vp-speed-option--dark{background:#1f2937;color:#f3f4f6}.ecp-vp-volume{display:flex;align-items:center;gap:.25rem;margin-left:auto}@media (min-width: 768px){.ecp-vp-volume{gap:.75rem}}.ecp-vp-mute-btn{padding:.5rem;border-radius:9999px;background:none;border:none;cursor:pointer;transition:all .15s}.ecp-vp-mute-btn:hover{background:#f3f4f680}.ecp-vp-mute-icon--light{color:#4b5563}.ecp-vp-mute-icon--dark{color:#f3f4f6}.ecp-vp-volume-slider{width:6rem;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-vp-volume-slider::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-vp-volume-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}@media (max-width: 460px){.ecp-vp-volume-slider{display:none}}.ecp-vp-volume-pct{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:2.5rem;text-align:right}.ecp-vp-volume-pct--light{color:#374151}.ecp-vp-volume-pct--dark{color:#f3f4f6}.ecp-vp-error{font-size:.875rem;color:#ef4444;background:#fef2f2;padding:.75rem;border-radius:.25rem;margin-bottom:1rem;border:1px solid #fca5a5}.ecp-wave-outer{width:100%;max-width:32rem;position:relative}.ecp-wave-audio-el{display:none}.ecp-wave-card{border-radius:1rem;box-shadow:0 25px 50px -12px #00000040}.ecp-wave-card-inner{border-radius:1rem;padding:1.5rem;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}.ecp-wave-thumbnail-wrap{width:100%;padding:1rem}.ecp-wave-thumbnail{width:100%;aspect-ratio:1 / 1;border-radius:.75rem}.ecp-wave-seek{position:relative;height:5rem;margin-bottom:1.5rem;cursor:pointer}.ecp-wave-bars{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:flex-end;justify-content:center;height:100%;width:100%;gap:1px}.ecp-wave-bar{width:.25rem;border-radius:.25rem .25rem 0 0;transition:all .15s}.ecp-wave-progress-line{position:absolute;top:0;height:100%;width:.25rem;background:#fff;border-right:1px solid black;border-radius:9999px;transition:all .15s;transform:translate(-50%)}.ecp-wave-times{display:flex;justify-content:space-between;font-size:.875rem;margin-bottom:1.5rem}.ecp-wave-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;justify-content:space-between;margin-bottom:1rem}.ecp-wave-left-controls{display:flex;align-items:center;gap:.5rem}.ecp-wave-vol-btn{padding:.5rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s}.ecp-wave-vol-slider{width:5rem;height:.375rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-wave-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 1px 3px #0003}.ecp-wave-vol-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none}.ecp-wave-center-controls{display:flex;justify-content:center}.ecp-wave-play-btn{padding:1rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s;box-shadow:0 10px 15px -3px #0000001a}.ecp-wave-play-btn:hover{transform:scale(1.05)}.ecp-wave-right-controls{display:flex;align-items:center;gap:.75rem}.ecp-wave-speed-select{padding:.25rem .5rem;border-radius:.5rem;font-size:.875rem;border:none;cursor:pointer}.ecp-wave-speed-select--light{background:#f3f4f6;color:#374151}.ecp-wave-speed-select--dark{background:#1f2937;color:#f3f4f6}.ecp-wave-eq-btn{padding:.5rem;border-radius:9999px;border:none;cursor:pointer;transition:all .15s}.ecp-wave-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0003;display:flex;align-items:center;justify-content:center;z-index:10;border-radius:1rem;padding:1rem}.ecp-wave-eq-panel{max-width:20rem;width:100%;padding:.5rem 1rem 1rem;border-radius:.75rem}.ecp-wave-eq-panel--light{background:#fff}.ecp-wave-eq-panel--dark{background:#1f2937}.ecp-wave-eq-title{font-size:1.125rem;font-weight:500;margin-bottom:.5rem}.ecp-wave-eq-title--light{color:#374151}.ecp-wave-eq-title--dark{color:#e5e7eb}.ecp-wave-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-wave-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-wave-eq-label--light{font-size:.75rem;color:#4b5563}.ecp-wave-eq-label--dark{font-size:.75rem;color:#d1d5db}.ecp-wave-eq-range-row{display:flex;align-items:center;gap:.75rem}.ecp-wave-eq-bound--light{font-size:.75rem;color:#6b7280}.ecp-wave-eq-bound--dark{font-size:.75rem;color:#9ca3af}.ecp-wave-eq-slider{flex:1;height:1rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-wave-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-wave-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none}.ecp-wave-eq-footer{display:flex;justify-content:space-between;margin-top:1.5rem}.ecp-wave-eq-footer-btn{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;border:none;transition:all .15s}.ecp-wave-eq-footer-btn--light{background:#e5e7eb;color:#374151}.ecp-wave-eq-footer-btn--light:hover{background:#d1d5db}.ecp-wave-eq-footer-btn--dark{background:#374151;color:#e5e7eb}.ecp-wave-eq-footer-btn--dark:hover{background:#4b5563}.ecp-wave-error{padding:1.5rem;border-radius:.75rem;text-align:center}.ecp-wave-error-title{font-weight:500}.ecp-wave-error-msg{font-size:.875rem}.ecp-wave-error--light{color:#dc2626}.ecp-wave-error--dark{color:#fca5a5}.ecp-nano-wrapper{position:relative;overflow:hidden;display:inline-flex;flex-direction:column;padding:.5rem .75rem;box-shadow:0 10px 15px -3px #0000001a}.ecp-nano-wrapper--pill{border-radius:9999px;width:110px;height:40px}.ecp-nano-wrapper--card{border-radius:1rem;width:120px;height:150px}.ecp-nano-progress-bg{position:absolute;top:0;left:0;height:100%;opacity:.2}.ecp-nano-content{position:absolute;display:flex;flex-direction:column}.ecp-nano-thumbnail-wrap{width:6rem;padding-bottom:.5rem}.ecp-nano-thumbnail{width:6rem;aspect-ratio:1 / 1;border-radius:.75rem}.ecp-nano-row{display:flex;align-items:center;gap:.5rem}.ecp-nano-play-btn{padding:.375rem;border-radius:9999px;border:none;cursor:pointer;flex-shrink:0;transition:transform .15s}.ecp-nano-play-btn:hover{transform:scale(1.1)}.ecp-nano-waveform{display:flex;width:100%;min-width:3rem;align-items:center;gap:2px;height:1.5rem}.ecp-nano-wave-bar{border-radius:9999px;width:100%;transition:height .2s}.ecp-video-wrapper{border-radius:.75rem;overflow:hidden;transition:all .3s cubic-bezier(.4,0,.2,1)}.ecp-video-wrapper--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;flex-direction:column;height:100vh;width:100vw;background:#000}.ecp-video-inner{height:auto}.ecp-video-inner--fullscreen{display:flex;flex-direction:column;flex:1;min-height:0}.ecp-video-inner--padded{padding:1rem}.ecp-video-name{margin-bottom:1rem;font-weight:500}.ecp-video-name--light{color:#374151}.ecp-video-name--dark{color:#f3f4f6}.ecp-video-layout{position:relative;margin-bottom:1rem}.ecp-video-layout--row{display:flex;gap:.75rem}.ecp-video-layout--col{display:flex;flex-direction:column;gap:.75rem}.ecp-video-layout--fullscreen{flex:1;min-height:0}.ecp-video-vu-top,.ecp-video-vu-bottom{width:100%;height:3rem}.ecp-video-vu-side{width:3rem;background:#00000080;border-radius:.5rem;padding:.25rem}.ecp-video-el-wrap{flex:1;border-radius:.5rem;overflow:hidden;position:relative}.ecp-video-el-wrap--light{background:#ffffffb3}.ecp-video-el-wrap--dark{background:#000000b3}.ecp-video-el{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.ecp-video-eq-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;width:100%;justify-content:center;z-index:10;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s}.ecp-video-eq-panel{max-width:600px;width:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:center;border-radius:.5rem;padding:1rem;box-shadow:0 1px 2px #0000000d;transition:all .3s}.ecp-video-eq-panel--light{background:#fffc}.ecp-video-eq-panel--dark{background:#000000b3}.ecp-video-eq-title{font-size:.875rem;font-weight:500;margin-bottom:1rem}.ecp-video-eq-title--light{color:#374151}.ecp-video-eq-title--dark{color:#e5e7eb}.ecp-video-eq-bands{display:flex;flex-direction:column;gap:1rem}.ecp-video-eq-band-header{display:flex;justify-content:space-between;margin-bottom:.25rem}.ecp-video-eq-label--light{font-size:.75rem;color:#4b5563}.ecp-video-eq-label--dark{font-size:.75rem;color:#d1d5db}.ecp-video-eq-range-row{display:flex;align-items:center;gap:.75rem}.ecp-video-eq-bound--light{font-size:.75rem;color:#6b7280}.ecp-video-eq-bound--dark{font-size:.75rem;color:#9ca3af}.ecp-video-eq-slider{flex:1;height:1.5rem;background:#d1d5db;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-eq-slider::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;background:transparent;border:none;box-shadow:none}.ecp-video-eq-slider::-moz-range-thumb{width:0;height:0;background:transparent;border:none}.ecp-video-eq-footer{display:flex;justify-content:space-between;margin-top:1.5rem}.ecp-video-eq-footer-btn{padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;cursor:pointer;border:none;transition:all .15s}.ecp-video-eq-footer-btn--light{background:#e5e7eb;color:#374151}.ecp-video-eq-footer-btn--light:hover{background:#d1d5db}.ecp-video-eq-footer-btn--dark{background:#374151;color:#e5e7eb}.ecp-video-eq-footer-btn--dark:hover{background:#4b5563}.ecp-video-seekbar{margin-bottom:1rem}.ecp-video-seekbar--fullscreen{margin-top:.75rem}.ecp-video-seekbar-row{display:flex;align-items:center;gap:.75rem}.ecp-video-time{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:3rem}.ecp-video-time--right{text-align:right}.ecp-video-time--light{color:#4b5563}.ecp-video-time--dark{color:#f3f4f6}.ecp-video-seek-input{flex:1;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-seek-input:disabled{opacity:.4;cursor:not-allowed}.ecp-video-seek-input::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-seek-input::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.ecp-video-play-btn{border-radius:9999px;font-size:.875rem;font-weight:500;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:opacity .15s;padding:.5rem 1rem}.ecp-video-play-btn:hover{opacity:.9}.ecp-video-play-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-play-btn--compact{padding:1.25rem .75rem}.ecp-video-play-icon-wrap{position:relative;width:1rem;display:flex;align-items:center}.ecp-video-stop-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-video-stop-btn--light{background:#374151;color:#fff}.ecp-video-stop-btn--light:hover{background:#1f2937}.ecp-video-stop-btn--dark{background:#f3f4f6;color:#000}.ecp-video-stop-btn--dark:hover{background:#d1d5db}.ecp-video-stop-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-fullscreen-btn{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s;padding:.75rem}.ecp-video-fullscreen-btn--light{background:#374151;color:#fff}.ecp-video-fullscreen-btn--light:hover{background:#1f2937}.ecp-video-fullscreen-btn--dark{background:#f3f4f6;color:#000}.ecp-video-fullscreen-btn--dark:hover{background:#d1d5db}.ecp-video-fullscreen-btn--wide{padding:.5rem 1rem}.ecp-video-eq-toggle-btn{padding:.75rem;border-radius:9999px;font-size:.875rem;font-weight:500;border:none;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .15s}.ecp-video-eq-toggle-btn--off{background:#f3f4f6;color:#374151}.ecp-video-eq-toggle-btn--off:hover{background:#d1d5db}.ecp-video-eq-toggle-btn--on{color:#fff}.ecp-video-eq-toggle-btn:disabled{opacity:.4;cursor:not-allowed}.ecp-video-eq-toggle-btn--wide{padding:.5rem 1rem}.ecp-video-speed-wrap{display:flex;align-items:center}.ecp-video-speed-select{border-radius:9999px;font-size:.875rem;font-weight:500;border:none;outline:none;cursor:pointer;background:transparent;transition:all .15s}.ecp-video-speed-select--light{color:#1f2937}.ecp-video-speed-select--dark{color:#e5e7eb}.ecp-video-speed-option--light{background:#f3f4f6;color:#1f2937}.ecp-video-speed-option--dark{background:#1f2937;color:#f3f4f6}.ecp-video-volume{display:flex;align-items:center;gap:.25rem;margin-left:auto}@media (min-width: 768px){.ecp-video-volume{gap:.75rem}}.ecp-video-mute-btn{padding:.5rem;border-radius:.5rem;background:none;border:none;cursor:pointer;transition:all .15s}.ecp-video-mute-btn:hover{background:#f3f4f6}.ecp-video-mute-icon--light{color:#4b5563}.ecp-video-mute-icon--dark{color:#f3f4f6}.ecp-video-vol-slider{width:6rem;height:.5rem;border-radius:.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.ecp-video-vol-slider::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}.ecp-video-vol-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;cursor:pointer;background:var(--thumb-color, #ffffff);border:none;box-shadow:0 2px 6px #0003}@media (max-width: 460px){.ecp-video-vol-slider{display:none}}.ecp-video-vol-pct{font-size:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;width:2.5rem;text-align:right}.ecp-video-vol-pct--light{color:#374151}.ecp-video-vol-pct--dark{color:#f3f4f6}.ecp-video-error{font-size:.875rem;color:#ef4444;background:#fef2f2;padding:.75rem;border-radius:.25rem;margin-bottom:1rem;border:1px solid #fca5a5}.ecp-vu-bar-wrap{flex:1;height:100%;position:relative;display:flex;flex-direction:column;justify-content:flex-end}.ecp-vu-bar-fill{border-radius:.25rem .25rem 0 0;transition:height 75ms}.ecp-vu-peak-line{position:absolute;width:100%;height:2px;transition:top .1s}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ import { jsx as e, Fragment as Ve, jsxs as c } from "react/jsx-runtime";
3
+ import { forwardRef as Qe, createElement as Ie, useState as m, useRef as b, useEffect as $ } from "react";
3
4
  /**
4
5
  * @license lucide-react v0.540.0 - ISC
5
6
  *
6
7
  * This source code is licensed under the ISC license.
7
8
  * See the LICENSE file in the root directory of this source tree.
8
9
  */
9
- const We = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Qe = (i) => i.replace(
10
+ const Ke = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xe = (s) => s.replace(
10
11
  /^([A-Z])|[\s-_]+(\w)/g,
11
- (c, g, p) => p ? p.toUpperCase() : g.toLowerCase()
12
- ), _e = (i) => {
13
- const c = Qe(i);
14
- return c.charAt(0).toUpperCase() + c.slice(1);
15
- }, Ve = (...i) => i.filter((c, g, p) => !!c && c.trim() !== "" && p.indexOf(c) === g).join(" ").trim(), Ge = (i) => {
16
- for (const c in i)
17
- if (c.startsWith("aria-") || c === "role" || c === "title")
12
+ (l, u, v) => v ? v.toUpperCase() : u.toLowerCase()
13
+ ), We = (s) => {
14
+ const l = Xe(s);
15
+ return l.charAt(0).toUpperCase() + l.slice(1);
16
+ }, Ye = (...s) => s.filter((l, u, v) => !!l && l.trim() !== "" && v.indexOf(l) === u).join(" ").trim(), Ze = (s) => {
17
+ for (const l in s)
18
+ if (l.startsWith("aria-") || l === "role" || l === "title")
18
19
  return !0;
19
20
  };
20
21
  /**
@@ -23,7 +24,7 @@ const We = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Qe = (
23
24
  * This source code is licensed under the ISC license.
24
25
  * See the LICENSE file in the root directory of this source tree.
25
26
  */
26
- var Ke = {
27
+ var Je = {
27
28
  xmlns: "http://www.w3.org/2000/svg",
28
29
  width: 24,
29
30
  height: 24,
@@ -40,32 +41,32 @@ var Ke = {
40
41
  * This source code is licensed under the ISC license.
41
42
  * See the LICENSE file in the root directory of this source tree.
42
43
  */
43
- const Xe = Oe(
44
+ const et = Qe(
44
45
  ({
45
- color: i = "currentColor",
46
- size: c = 24,
47
- strokeWidth: g = 2,
48
- absoluteStrokeWidth: p,
49
- className: q = "",
50
- children: m,
51
- iconNode: x,
52
- ...v
53
- }, P) => Ie(
46
+ color: s = "currentColor",
47
+ size: l = 24,
48
+ strokeWidth: u = 2,
49
+ absoluteStrokeWidth: v,
50
+ className: C = "",
51
+ children: f,
52
+ iconNode: y,
53
+ ...O
54
+ }, x) => Ie(
54
55
  "svg",
55
56
  {
56
- ref: P,
57
- ...Ke,
58
- width: c,
59
- height: c,
60
- stroke: i,
61
- strokeWidth: p ? Number(g) * 24 / Number(c) : g,
62
- className: Ve("lucide", q),
63
- ...!m && !Ge(v) && { "aria-hidden": "true" },
64
- ...v
57
+ ref: x,
58
+ ...Je,
59
+ width: l,
60
+ height: l,
61
+ stroke: s,
62
+ strokeWidth: v ? Number(u) * 24 / Number(l) : u,
63
+ className: Ye("lucide", C),
64
+ ...!f && !Ze(O) && { "aria-hidden": "true" },
65
+ ...O
65
66
  },
66
67
  [
67
- ...x.map(([T, U]) => Ie(T, U)),
68
- ...Array.isArray(m) ? m : [m]
68
+ ...y.map(([F, I]) => Ie(F, I)),
69
+ ...Array.isArray(f) ? f : [f]
69
70
  ]
70
71
  )
71
72
  );
@@ -75,20 +76,20 @@ const Xe = Oe(
75
76
  * This source code is licensed under the ISC license.
76
77
  * See the LICENSE file in the root directory of this source tree.
77
78
  */
78
- const ce = (i, c) => {
79
- const g = Oe(
80
- ({ className: p, ...q }, m) => Ie(Xe, {
81
- ref: m,
82
- iconNode: c,
83
- className: Ve(
84
- `lucide-${We(_e(i))}`,
85
- `lucide-${i}`,
86
- p
79
+ const le = (s, l) => {
80
+ const u = Qe(
81
+ ({ className: v, ...C }, f) => Ie(et, {
82
+ ref: f,
83
+ iconNode: l,
84
+ className: Ye(
85
+ `lucide-${Ke(We(s))}`,
86
+ `lucide-${s}`,
87
+ v
87
88
  ),
88
- ...q
89
+ ...C
89
90
  })
90
91
  );
91
- return g.displayName = _e(i), g;
92
+ return u.displayName = We(s), u;
92
93
  };
93
94
  /**
94
95
  * @license lucide-react v0.540.0 - ISC
@@ -96,41 +97,41 @@ const ce = (i, c) => {
96
97
  * This source code is licensed under the ISC license.
97
98
  * See the LICENSE file in the root directory of this source tree.
98
99
  */
99
- const Ze = [
100
+ const tt = [
100
101
  ["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
101
102
  ["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
102
103
  ["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
103
104
  ["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
104
- ], Ye = ce("maximize", Ze);
105
+ ], rt = le("maximize", tt);
105
106
  /**
106
107
  * @license lucide-react v0.540.0 - ISC
107
108
  *
108
109
  * This source code is licensed under the ISC license.
109
110
  * See the LICENSE file in the root directory of this source tree.
110
111
  */
111
- const Je = [
112
+ const nt = [
112
113
  ["path", { d: "M8 3v3a2 2 0 0 1-2 2H3", key: "hohbtr" }],
113
114
  ["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3", key: "5jw1f3" }],
114
115
  ["path", { d: "M3 16h3a2 2 0 0 1 2 2v3", key: "198tvr" }],
115
116
  ["path", { d: "M16 21v-3a2 2 0 0 1 2-2h3", key: "ph8mxp" }]
116
- ], et = ce("minimize", Je);
117
+ ], at = le("minimize", nt);
117
118
  /**
118
119
  * @license lucide-react v0.540.0 - ISC
119
120
  *
120
121
  * This source code is licensed under the ISC license.
121
122
  * See the LICENSE file in the root directory of this source tree.
122
123
  */
123
- const tt = [
124
+ const ct = [
124
125
  ["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1", key: "kaeet6" }],
125
126
  ["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1", key: "1wsw3u" }]
126
- ], Re = ce("pause", tt);
127
+ ], Pe = le("pause", ct);
127
128
  /**
128
129
  * @license lucide-react v0.540.0 - ISC
129
130
  *
130
131
  * This source code is licensed under the ISC license.
131
132
  * See the LICENSE file in the root directory of this source tree.
132
133
  */
133
- const rt = [
134
+ const st = [
134
135
  [
135
136
  "path",
136
137
  {
@@ -138,26 +139,26 @@ const rt = [
138
139
  key: "10ikf1"
139
140
  }
140
141
  ]
141
- ], Fe = ce("play", rt);
142
+ ], Me = le("play", st);
142
143
  /**
143
144
  * @license lucide-react v0.540.0 - ISC
144
145
  *
145
146
  * This source code is licensed under the ISC license.
146
147
  * See the LICENSE file in the root directory of this source tree.
147
148
  */
148
- const nt = [
149
+ const it = [
149
150
  ["path", { d: "m17 2 4 4-4 4", key: "nntrym" }],
150
151
  ["path", { d: "M3 11v-1a4 4 0 0 1 4-4h14", key: "84bu3i" }],
151
152
  ["path", { d: "m7 22-4-4 4-4", key: "1wqhfi" }],
152
153
  ["path", { d: "M21 13v1a4 4 0 0 1-4 4H3", key: "1rx37r" }]
153
- ], at = ce("repeat", nt);
154
+ ], ot = le("repeat", it);
154
155
  /**
155
156
  * @license lucide-react v0.540.0 - ISC
156
157
  *
157
158
  * This source code is licensed under the ISC license.
158
159
  * See the LICENSE file in the root directory of this source tree.
159
160
  */
160
- const st = [
161
+ const lt = [
161
162
  ["line", { x1: "4", x2: "4", y1: "21", y2: "14", key: "1p332r" }],
162
163
  ["line", { x1: "4", x2: "4", y1: "10", y2: "3", key: "gb41h5" }],
163
164
  ["line", { x1: "12", x2: "12", y1: "21", y2: "12", key: "hf2csr" }],
@@ -167,34 +168,34 @@ const st = [
167
168
  ["line", { x1: "2", x2: "6", y1: "14", y2: "14", key: "1uebub" }],
168
169
  ["line", { x1: "10", x2: "14", y1: "8", y2: "8", key: "1yglbp" }],
169
170
  ["line", { x1: "18", x2: "22", y1: "16", y2: "16", key: "1jxqpz" }]
170
- ], Ae = ce("sliders-vertical", st);
171
+ ], Fe = le("sliders-vertical", lt);
171
172
  /**
172
173
  * @license lucide-react v0.540.0 - ISC
173
174
  *
174
175
  * This source code is licensed under the ISC license.
175
176
  * See the LICENSE file in the root directory of this source tree.
176
177
  */
177
- const lt = [
178
+ const dt = [
178
179
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
179
- ], Ue = ce("square", lt);
180
+ ], Ge = le("square", dt);
180
181
  /**
181
182
  * @license lucide-react v0.540.0 - ISC
182
183
  *
183
184
  * This source code is licensed under the ISC license.
184
185
  * See the LICENSE file in the root directory of this source tree.
185
186
  */
186
- const it = [
187
+ const ut = [
187
188
  ["path", { d: "M12 3v12", key: "1x0j5s" }],
188
189
  ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
189
190
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
190
- ], ct = ce("upload", it);
191
+ ], pt = le("upload", ut);
191
192
  /**
192
193
  * @license lucide-react v0.540.0 - ISC
193
194
  *
194
195
  * This source code is licensed under the ISC license.
195
196
  * See the LICENSE file in the root directory of this source tree.
196
197
  */
197
- const ot = [
198
+ const mt = [
198
199
  [
199
200
  "path",
200
201
  {
@@ -204,14 +205,14 @@ const ot = [
204
205
  ],
205
206
  ["path", { d: "M16 9a5 5 0 0 1 0 6", key: "1q6k2b" }],
206
207
  ["path", { d: "M19.364 18.364a9 9 0 0 0 0-12.728", key: "ijwkga" }]
207
- ], He = ce("volume-2", ot);
208
+ ], De = le("volume-2", mt);
208
209
  /**
209
210
  * @license lucide-react v0.540.0 - ISC
210
211
  *
211
212
  * This source code is licensed under the ISC license.
212
213
  * See the LICENSE file in the root directory of this source tree.
213
214
  */
214
- const dt = [
215
+ const ft = [
215
216
  [
216
217
  "path",
217
218
  {
@@ -221,7 +222,7 @@ const dt = [
221
222
  ],
222
223
  ["line", { x1: "22", x2: "16", y1: "9", y2: "15", key: "1ewh16" }],
223
224
  ["line", { x1: "16", x2: "22", y1: "9", y2: "15", key: "5ykzw1" }]
224
- ], De = ce("volume-x", dt), be = {
225
+ ], _e = le("volume-x", ft), ge = {
225
226
  rainbow: {
226
227
  name: "Rainbow",
227
228
  bg: "linear-gradient(135deg, #ef444422 0%, #f9731622 15%, #f59e0b22 30%, #10b98122 45%, #06b6d422 60%, #3b82f622 75%, #6366f122 85%, #a855f722 92%, #ec489922 100%)",
@@ -321,46 +322,45 @@ const dt = [
321
322
  slider: "#ec4899"
322
323
  }
323
324
  };
324
- function ut({ theme: i, setTheme: c, close: g }) {
325
- const p = Object.keys(be).map((q) => ({
326
- key: q,
327
- name: be[q].name,
328
- colors: be[q].bars
325
+ function ht({ theme: s, setTheme: l, close: u }) {
326
+ const v = Object.keys(ge).map((C) => ({
327
+ key: C,
328
+ name: ge[C].name,
329
+ colors: ge[C].bars
329
330
  }));
330
- return /* @__PURE__ */ r("div", { className: "container-glass rounded-xl p-6 mb-6", children: [
331
- /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-4", children: [
332
- /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-800", children: "Choose Color Palette" }),
333
- /* @__PURE__ */ e(
334
- "button",
335
- {
336
- onClick: () => g(),
337
- className: "text-gray-500 hover:text-gray-700 text-sm font-medium",
338
- children: "Close"
339
- }
340
- )
331
+ return /* @__PURE__ */ c("div", { className: "ecp-theme-selector-panel", children: [
332
+ /* @__PURE__ */ c("div", { className: "ecp-theme-selector-header", children: [
333
+ /* @__PURE__ */ e("h2", { className: "ecp-theme-selector-title", children: "Choose Color Palette" }),
334
+ /* @__PURE__ */ e("button", { onClick: () => u(), className: "ecp-theme-selector-close", children: "Close" })
341
335
  ] }),
342
- /* @__PURE__ */ e("div", { className: "theme-selector grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3", children: p.map((q) => /* @__PURE__ */ r(
336
+ /* @__PURE__ */ e("div", { className: "ecp-theme-grid", children: v.map((C) => /* @__PURE__ */ c(
343
337
  "div",
344
338
  {
345
- className: `theme-card bg-white p-4 rounded-lg cursor-pointer border-2 transition-all ${i === q.key ? "border-current shadow-lg" : "border-transparent"}`,
346
- onClick: () => c(q.key),
339
+ className: `ecp-theme-card${s === C.key ? " ecp-theme-card--active" : ""}`,
340
+ onClick: () => l(C.key),
347
341
  children: [
348
- /* @__PURE__ */ e("div", { className: "color-preview h-10 rounded mb-2", style: { background: `linear-gradient(to right, ${q.colors.join(", ")})` } }),
349
- /* @__PURE__ */ e("div", { className: "text-sm font-medium text-gray-700", children: q.name })
342
+ /* @__PURE__ */ e(
343
+ "div",
344
+ {
345
+ className: "ecp-theme-color-preview",
346
+ style: { background: `linear-gradient(to right, ${C.colors.join(", ")})` }
347
+ }
348
+ ),
349
+ /* @__PURE__ */ e("div", { className: "ecp-theme-name", children: C.name })
350
350
  ]
351
351
  },
352
- q.key
352
+ C.key
353
353
  )) })
354
354
  ] });
355
355
  }
356
- function gt({
357
- audio: i,
358
- name: c = "No track loaded",
359
- author: g,
360
- theme: p = "rainbow",
361
- volume: q = 100,
362
- thumbnail: m = null,
363
- controls: x = {
356
+ function vt({
357
+ audio: s,
358
+ name: l = "No track loaded",
359
+ author: u,
360
+ theme: v = "rainbow",
361
+ volume: C = 100,
362
+ thumbnail: f = null,
363
+ controls: y = {
364
364
  play: !0,
365
365
  pause: !0,
366
366
  stop: !0,
@@ -371,45 +371,39 @@ function gt({
371
371
  equalizer: !0,
372
372
  speed: !0
373
373
  },
374
- mode: v = "light",
375
- bands: P = null,
376
- transparent: T = !1,
377
- autoPlay: U = !1,
378
- equalizer: I = {
379
- bass: 0,
380
- mid: 0,
381
- treble: 0
382
- }
374
+ mode: O = "light",
375
+ bands: x = null,
376
+ transparent: F = !1,
377
+ autoPlay: I = !1,
378
+ equalizer: z = { bass: 0, mid: 0, treble: 0 }
383
379
  }) {
384
- const [M, _] = f(!1), [H, z] = f(0), [S, N] = f(0), [E, oe] = f(q || 100), [ae, fe] = f(!1), [Q, G] = f(!1), [se, le] = f(!1), [O, de] = f([]), [R, F] = f(!1), [j, ie] = f({
385
- bass: I.bass || 0,
386
- mid: I.mid || 0,
387
- treble: I.treble || 0
388
- }), [ue, ee] = f(1), [K, k] = f(0), u = y(null), A = y(null), X = y(null), me = y(null), V = y(null), te = y(null), Z = y(null), $ = y(null), re = y(null), Y = y(null);
389
- C(() => {
390
- const t = Y.current;
380
+ const [E, H] = m(!1), [j, P] = m(0), [M, D] = m(0), [k, S] = m(C || 100), [ae, me] = m(!1), [V, ee] = m(!1), [se, ie] = m(!1), [ce, de] = m([]), [R, Q] = m(!1), [Y, oe] = m({
381
+ bass: z.bass || 0,
382
+ mid: z.mid || 0,
383
+ treble: z.treble || 0
384
+ }), [ue, te] = m(1), [G, w] = m(0), p = b(null), L = b(null), K = b(null), fe = b(null), W = b(null), re = b(null), X = b(null), N = b(null), T = b(null), Z = b(null);
385
+ $(() => {
386
+ const t = Z.current;
391
387
  if (!t) return;
392
- const n = new ResizeObserver((s) => {
393
- for (let l of s)
394
- k(l.contentRect.width);
388
+ const a = new ResizeObserver((o) => {
389
+ for (let i of o) w(i.contentRect.width);
395
390
  });
396
- return n.observe(t), () => n.disconnect();
397
- }, []), C(() => {
391
+ return a.observe(t), () => a.disconnect();
392
+ }, []), $(() => {
398
393
  const t = [];
399
- if (i && typeof i != "string" && t.push(["TypeError", "audio must be a string (URL or path)"]), c && typeof c != "string" && t.push(["TypeError", "name must be a string"]), p && typeof p != "string" && typeof p != "object")
400
- t.push(["TypeError", "theme must be a string or a valid theme object"]);
401
- else if (typeof p == "object") {
402
- const n = ["name", "bg", "bars", "peak", "button", "buttonHover", "slider"];
403
- for (const s of n)
404
- s in p || t.push(["ThemeError", `theme object missing key: ${s}`]);
394
+ if (s && typeof s != "string" && t.push(["TypeError", "audio must be a string (URL or path)"]), l && typeof l != "string" && t.push(["TypeError", "name must be a string"]), v && typeof v != "string" && typeof v != "object") t.push(["TypeError", "theme must be a string or a valid theme object"]);
395
+ else if (typeof v == "object") {
396
+ const a = ["name", "bg", "bars", "peak", "button", "buttonHover", "slider"];
397
+ for (const o of a)
398
+ o in v || t.push(["ThemeError", `theme object missing key: ${o}`]);
405
399
  }
406
- (typeof q != "number" || q < 0 || q > 100) && t.push(["TypeError", "volume must be a number between 0 and 100"]), typeof x != "object" || Array.isArray(x) ? t.push(["TypeError", "controls must be an object"]) : ["play", "pause", "stop", "seekbar", "volume", "loop", "trackName", "equalizer"].forEach((s) => {
407
- x && s in x && typeof x[s] != "boolean" && t.push(["TypeError", `controls.${s} must be a boolean`]);
408
- }), P && (Array.isArray(P) ? P.length === 0 ? t.push(["ValueError", "bands array cannot be empty"]) : P.forEach((n, s) => {
409
- typeof n.freq != "number" && t.push(["TypeError", `bands[${s}].freq must be a number`]);
410
- }) : t.push(["TypeError", "bands must be an array"])), t.length > 0 ? (de(t), console.group("%cVisualizePlayer: Prop validation failed", "color:red"), t.forEach((n) => console.error(`${n[0]}: ${n[1]}`)), console.groupEnd()) : de([]);
411
- }, [i, c, p, q, x, v, P]);
412
- const a = P || [
400
+ (typeof C != "number" || C < 0 || C > 100) && t.push(["TypeError", "volume must be a number between 0 and 100"]), typeof y != "object" || Array.isArray(y) ? t.push(["TypeError", "controls must be an object"]) : ["play", "pause", "stop", "seekbar", "volume", "loop", "trackName", "equalizer"].forEach((o) => {
401
+ y && o in y && typeof y[o] != "boolean" && t.push(["TypeError", `controls.${o} must be a boolean`]);
402
+ }), x && (Array.isArray(x) ? x.length === 0 ? t.push(["ValueError", "bands array cannot be empty"]) : x.forEach((a, o) => {
403
+ typeof a.freq != "number" && t.push(["TypeError", `bands[${o}].freq must be a number`]);
404
+ }) : t.push(["TypeError", "bands must be an array"])), t.length > 0 ? (de(t), console.group("%cVisualizePlayer: Prop validation failed", "color:red"), t.forEach((a) => console.error(`${a[0]}: ${a[1]}`)), console.groupEnd()) : de([]);
405
+ }, [s, l, v, C, y, O, x]);
406
+ const r = x || [
413
407
  { freq: 0 },
414
408
  { freq: 10 },
415
409
  { freq: 20 },
@@ -441,636 +435,448 @@ function gt({
441
435
  { freq: 8e3 },
442
436
  { freq: 1e4 },
443
437
  { freq: 12500 }
444
- ], d = y(a.map(() => 0)), b = y(a.map(() => 0)), B = y(a.map(() => 0)), D = y(!1), J = y(typeof p == "string" ? p : "purple");
445
- let o = typeof p == "string" ? be[p] || be.purple : typeof p == "object" ? p : be.purple;
446
- const h = v === "dark", ge = typeof x == "object" && Object.keys(x).length === 0;
447
- C(() => {
448
- typeof p == "string" ? J.current = p : J.current = "purple", pe();
449
- }, [p]), C(() => {
450
- u.current || (u.current = new Audio());
451
- const t = u.current, n = () => {
452
- se || z(t.currentTime);
453
- }, s = () => {
454
- N(t.duration);
455
- }, l = () => {
456
- Q || (_(!1), $.current && cancelAnimationFrame($.current));
457
- }, w = () => _(!0), L = () => _(!1);
458
- return t.addEventListener("timeupdate", n), t.addEventListener("loadedmetadata", s), t.addEventListener("ended", l), t.addEventListener("play", w), t.addEventListener("pause", L), () => {
459
- t.removeEventListener("timeupdate", n), t.removeEventListener("loadedmetadata", s), t.removeEventListener("ended", l), t.removeEventListener("play", w), t.removeEventListener("pause", L);
438
+ ], d = b(r.map(() => 0)), g = b(r.map(() => 0)), B = b(r.map(() => 0)), _ = b(!1), J = b(typeof v == "string" ? v : "purple"), h = typeof v == "string" ? ge[v] || ge.purple : typeof v == "object" ? v : ge.purple, A = O === "dark", ke = typeof y == "object" && Object.keys(y).length === 0;
439
+ $(() => {
440
+ typeof v == "string" ? J.current = v : J.current = "purple", ve();
441
+ }, [v]), $(() => {
442
+ p.current || (p.current = new Audio());
443
+ const t = p.current, a = () => {
444
+ se || P(t.currentTime);
445
+ }, o = () => D(t.duration), i = () => {
446
+ V || (H(!1), N.current && cancelAnimationFrame(N.current));
447
+ }, q = () => H(!0), U = () => H(!1);
448
+ return t.addEventListener("timeupdate", a), t.addEventListener("loadedmetadata", o), t.addEventListener("ended", i), t.addEventListener("play", q), t.addEventListener("pause", U), () => {
449
+ t.removeEventListener("timeupdate", a), t.removeEventListener("loadedmetadata", o), t.removeEventListener("ended", i), t.removeEventListener("play", q), t.removeEventListener("pause", U);
460
450
  };
461
- }, [se, Q]), C(() => () => {
462
- u.current && (u.current.pause(), u.current.src = "", u.current.load()), A.current && A.current.close().catch((t) => console.warn("AudioContext cleanup error:", t)), $.current && cancelAnimationFrame($.current);
463
- }, []), C(() => {
464
- if (i) {
465
- const t = M, n = E, s = Q;
466
- if ($.current && (cancelAnimationFrame($.current), $.current = null), me.current) {
451
+ }, [se, V]), $(() => () => {
452
+ p.current && (p.current.pause(), p.current.src = "", p.current.load()), L.current && L.current.close().catch((t) => console.warn("AudioContext cleanup error:", t)), N.current && cancelAnimationFrame(N.current);
453
+ }, []), $(() => {
454
+ if (s) {
455
+ const t = E, a = k, o = V;
456
+ if (N.current && (cancelAnimationFrame(N.current), N.current = null), fe.current) {
467
457
  try {
468
- me.current.disconnect();
469
- } catch (W) {
470
- console.warn("Source disconnect error:", W);
458
+ fe.current.disconnect();
459
+ } catch {
471
460
  }
472
- me.current = null;
461
+ fe.current = null;
473
462
  }
474
- if (X.current) {
463
+ if (K.current) {
475
464
  try {
476
- X.current.disconnect();
477
- } catch (W) {
478
- console.warn("Analyser disconnect error:", W);
465
+ K.current.disconnect();
466
+ } catch {
479
467
  }
480
- X.current = null;
468
+ K.current = null;
481
469
  }
482
- if (V.current) {
470
+ if (W.current) {
483
471
  try {
484
- V.current.disconnect();
485
- } catch (W) {
486
- console.warn("Bass filter disconnect error:", W);
472
+ W.current.disconnect();
473
+ } catch {
487
474
  }
488
- V.current = null;
475
+ W.current = null;
489
476
  }
490
- if (te.current) {
477
+ if (re.current) {
491
478
  try {
492
- te.current.disconnect();
493
- } catch (W) {
494
- console.warn("Mid filter disconnect error:", W);
479
+ re.current.disconnect();
480
+ } catch {
495
481
  }
496
- te.current = null;
482
+ re.current = null;
497
483
  }
498
- if (Z.current) {
484
+ if (X.current) {
499
485
  try {
500
- Z.current.disconnect();
501
- } catch (W) {
502
- console.warn("Treble filter disconnect error:", W);
486
+ X.current.disconnect();
487
+ } catch {
503
488
  }
504
- Z.current = null;
489
+ X.current = null;
505
490
  }
506
- A.current && (A.current.close().catch((W) => console.warn("AudioContext close error:", W)), A.current = null), u.current && (u.current.pause(), u.current.src = "", u.current.load()), u.current = new Audio();
491
+ L.current && (L.current.close().catch((ne) => console.warn("AudioContext close error:", ne)), L.current = null), p.current && (p.current.pause(), p.current.src = "", p.current.load()), p.current = new Audio();
507
492
  try {
508
- u.current.crossOrigin = "anonymous";
509
- } catch (W) {
510
- console.debug("Could not set crossOrigin on audio element", W);
493
+ p.current.crossOrigin = "anonymous";
494
+ } catch {
511
495
  }
512
- u.current.src = i, u.current.preload = "auto", u.current.muted = !1, u.current.volume = ae ? 0 : n / 100, u.current.loop = s, u.current.load();
513
- const l = u.current, w = () => {
514
- se || z(l.currentTime);
515
- }, L = () => {
516
- N(l.duration);
517
- }, ne = () => {
518
- Q || (_(!1), $.current && cancelAnimationFrame($.current));
519
- }, xe = () => _(!0), Ce = () => _(!1);
520
- l.addEventListener("timeupdate", w), l.addEventListener("loadedmetadata", L), l.addEventListener("ended", ne), l.addEventListener("play", xe), l.addEventListener("pause", Ce), z(0), _(!1), console.debug("Audio element created", { src: u.current.src, volume: u.current.volume, loop: u.current.loop }), d.current = a.map(() => 0), b.current = a.map(() => 0), B.current = a.map(() => 0), pe(), t && u.current.play().catch((W) => console.error("Play failed:", W));
496
+ p.current.src = s, p.current.preload = "auto", p.current.muted = !1, p.current.volume = ae ? 0 : a / 100, p.current.loop = o, p.current.load();
497
+ const i = p.current, q = () => {
498
+ se || P(i.currentTime);
499
+ }, U = () => D(i.duration), pe = () => {
500
+ V || (H(!1), N.current && cancelAnimationFrame(N.current));
501
+ }, ye = () => H(!0), $e = () => H(!1);
502
+ i.addEventListener("timeupdate", q), i.addEventListener("loadedmetadata", U), i.addEventListener("ended", pe), i.addEventListener("play", ye), i.addEventListener("pause", $e), P(0), H(!1), d.current = r.map(() => 0), g.current = r.map(() => 0), B.current = r.map(() => 0), ve(), t && p.current.play().catch((ne) => console.error("Play failed:", ne));
521
503
  }
522
- }, [i]), C(() => {
523
- u.current && (u.current.volume = ae ? 0 : E / 100);
524
- }, [E, ae]), C(() => {
525
- u.current && (u.current.loop = Q);
526
- }, [Q]), C(() => {
527
- u.current && (u.current.playbackRate = ue);
528
- }, [ue]), C(() => {
529
- A.current && (V.current && (V.current.gain.value = j.bass), te.current && (te.current.gain.value = j.mid), Z.current && (Z.current.gain.value = j.treble));
530
- }, [j]), C(() => {
531
- D.current = M, $.current && (cancelAnimationFrame($.current), $.current = null), M ? (A.current || qe(), ke()) : he();
532
- }, [M]);
533
- const qe = () => {
534
- if (!A.current && u.current)
504
+ }, [s]), $(() => {
505
+ p.current && (p.current.volume = ae ? 0 : k / 100);
506
+ }, [k, ae]), $(() => {
507
+ p.current && (p.current.loop = V);
508
+ }, [V]), $(() => {
509
+ p.current && (p.current.playbackRate = ue);
510
+ }, [ue]), $(() => {
511
+ L.current && (W.current && (W.current.gain.value = Y.bass), re.current && (re.current.gain.value = Y.mid), X.current && (X.current.gain.value = Y.treble));
512
+ }, [Y]), $(() => {
513
+ _.current = E, N.current && (cancelAnimationFrame(N.current), N.current = null), E ? (L.current || Ce(), Ne()) : he();
514
+ }, [E]);
515
+ const Ce = () => {
516
+ if (!L.current && p.current)
535
517
  try {
536
518
  const t = window.AudioContext || window.webkitAudioContext;
537
519
  if (t) {
538
- const n = new t();
539
- A.current = n;
540
- const s = n.createBiquadFilter();
541
- s.type = "lowshelf", s.frequency.value = 320, s.gain.value = j.bass;
542
- const l = n.createBiquadFilter();
543
- l.type = "peaking", l.frequency.value = 1e3, l.Q.value = 0.5, l.gain.value = j.mid;
544
- const w = n.createBiquadFilter();
545
- w.type = "highshelf", w.frequency.value = 3200, w.gain.value = j.treble;
546
- const L = n.createAnalyser();
547
- L.fftSize = 8192, L.smoothingTimeConstant = 0.7;
548
- const ne = n.createMediaElementSource(u.current);
549
- ne.connect(s), s.connect(l), l.connect(w), w.connect(L), L.connect(n.destination), V.current = s, te.current = l, Z.current = w, X.current = L, me.current = ne;
520
+ const a = new t();
521
+ L.current = a;
522
+ const o = a.createBiquadFilter();
523
+ o.type = "lowshelf", o.frequency.value = 320, o.gain.value = Y.bass;
524
+ const i = a.createBiquadFilter();
525
+ i.type = "peaking", i.frequency.value = 1e3, i.Q.value = 0.5, i.gain.value = Y.mid;
526
+ const q = a.createBiquadFilter();
527
+ q.type = "highshelf", q.frequency.value = 3200, q.gain.value = Y.treble;
528
+ const U = a.createAnalyser();
529
+ U.fftSize = 8192, U.smoothingTimeConstant = 0.7;
530
+ const pe = a.createMediaElementSource(p.current);
531
+ pe.connect(o), o.connect(i), i.connect(q), q.connect(U), U.connect(a.destination), W.current = o, re.current = i, X.current = q, K.current = U, fe.current = pe;
550
532
  }
551
533
  } catch (t) {
552
534
  console.error("Failed to setup audio context:", t);
553
535
  }
554
536
  }, we = (t) => {
555
- const n = A.current, s = X.current;
556
- if (!n || !s) return 0;
557
- const l = n.sampleRate / 2, w = Math.round(t / l * s.frequencyBinCount);
558
- return Math.min(w, s.frequencyBinCount - 1);
537
+ const a = L.current, o = K.current;
538
+ if (!a || !o) return 0;
539
+ const i = a.sampleRate / 2, q = Math.round(t / i * o.frequencyBinCount);
540
+ return Math.min(q, o.frequencyBinCount - 1);
559
541
  }, he = () => {
560
- if (D.current) return;
561
- d.current = d.current.map((l) => l * 0.7);
542
+ if (_.current) return;
543
+ d.current = d.current.map((i) => i * 0.7);
562
544
  const t = Date.now();
563
- b.current = b.current.map((l, w) => t - B.current[w] > 1500 ? l * 0.95 : l), pe();
564
- const n = Math.max(...d.current), s = Math.max(...b.current);
565
- n > 0.01 || s > 0.01 ? $.current = requestAnimationFrame(he) : (D.current || (d.current = a.map(() => 0), b.current = a.map(() => 0), B.current = a.map(() => 0), pe()), $.current && cancelAnimationFrame($.current), $.current = null);
566
- }, ke = () => {
567
- if (!X.current || !D.current) return;
568
- const t = X.current.frequencyBinCount, n = new Uint8Array(t);
569
- X.current.getByteFrequencyData(n), a.forEach((s, l) => {
570
- const w = we(s.freq), L = l < a.length - 1 ? we(a[l + 1].freq) : n.length;
571
- let ne = 0, xe = 0;
572
- for (let Be = w; Be < L; Be++)
573
- ne += n[Be], xe++;
574
- let Ce = xe > 0 ? ne / xe / 255 : 0;
575
- Ce = Math.pow(Ce, 0.6), d.current[l] = d.current[l] * 0.8 + Ce * 0.2;
576
- const W = Date.now();
577
- d.current[l] > b.current[l] ? (b.current[l] = d.current[l], B.current[l] = W) : W - B.current[l] > 1500 && (b.current[l] *= 0.95);
578
- }), pe(), $.current = requestAnimationFrame(ke);
579
- }, pe = () => {
580
- if (!re.current) return;
581
- const t = be[J.current] || be.rainbow;
582
- let n = "";
583
- a.forEach((s, l) => {
584
- const w = d.current[l] * 100, L = 100 - b.current[l] * 100, ne = Math.floor(l / a.length * t.bars.length), xe = t.bars[Math.min(ne, t.bars.length - 1)];
585
- n += `
586
- <div class="flex-1 h-full relative flex flex-col justify-end">
587
- <div class="rounded-t transition-all duration-75" style="height: ${w}%; background: ${xe};">
588
- ${b.current[l] > 0.1 ? `<div class="absolute w-full h-0.5 transition-all duration-100" style="top: ${L}%; background: ${t.peak};"></div>` : ""}
545
+ g.current = g.current.map((i, q) => t - B.current[q] > 1500 ? i * 0.95 : i), ve();
546
+ const a = Math.max(...d.current), o = Math.max(...g.current);
547
+ a > 0.01 || o > 0.01 ? N.current = requestAnimationFrame(he) : (_.current || (d.current = r.map(() => 0), g.current = r.map(() => 0), B.current = r.map(() => 0), ve()), N.current && cancelAnimationFrame(N.current), N.current = null);
548
+ }, Ne = () => {
549
+ if (!K.current || !_.current) return;
550
+ const t = K.current.frequencyBinCount, a = new Uint8Array(t);
551
+ K.current.getByteFrequencyData(a), r.forEach((o, i) => {
552
+ const q = we(o.freq), U = i < r.length - 1 ? we(r[i + 1].freq) : a.length;
553
+ let pe = 0, ye = 0;
554
+ for (let He = q; He < U; He++)
555
+ pe += a[He], ye++;
556
+ let $e = ye > 0 ? pe / ye / 255 : 0;
557
+ $e = Math.pow($e, 0.6), d.current[i] = d.current[i] * 0.8 + $e * 0.2;
558
+ const ne = Date.now();
559
+ d.current[i] > g.current[i] ? (g.current[i] = d.current[i], B.current[i] = ne) : ne - B.current[i] > 1500 && (g.current[i] *= 0.95);
560
+ }), ve(), N.current = requestAnimationFrame(Ne);
561
+ }, ve = () => {
562
+ if (!T.current) return;
563
+ const t = ge[J.current] || ge.rainbow;
564
+ let a = "";
565
+ r.forEach((o, i) => {
566
+ const q = d.current[i] * 100, U = 100 - g.current[i] * 100, pe = Math.floor(i / r.length * t.bars.length), ye = t.bars[Math.min(pe, t.bars.length - 1)];
567
+ a += `
568
+ <div class="ecp-vu-bar-wrap">
569
+ <div class="ecp-vu-bar-fill" style="height: ${q}%; background: ${ye};">
570
+ ${g.current[i] > 0.1 ? `<div class="ecp-vu-peak-line" style="top: ${U}%; background: ${t.peak};"></div>` : ""}
589
571
  </div>
590
572
  </div>
591
573
  `;
592
- }), re.current.innerHTML = n;
574
+ }), T.current.innerHTML = a;
575
+ }, xe = () => {
576
+ !p.current || !s || (E ? p.current.pause() : (L.current && L.current.state === "suspended" && L.current.resume(), p.current.play().catch((t) => console.error("Play failed:", t))));
593
577
  }, Ee = () => {
594
- !u.current || !i || (M ? u.current.pause() : (A.current && A.current.state === "suspended" && A.current.resume(), u.current.play().catch((t) => console.error("Play failed:", t))));
595
- }, Te = () => {
596
- u.current && (u.current.pause(), u.current.currentTime = 0, _(!1), z(0), d.current = a.map(() => 0), b.current = a.map(() => 0), B.current = a.map(() => 0), pe());
578
+ p.current && (p.current.pause(), p.current.currentTime = 0, H(!1), P(0), d.current = r.map(() => 0), g.current = r.map(() => 0), B.current = r.map(() => 0), ve());
597
579
  }, Le = (t) => {
598
- const s = parseFloat(t.target.value) / 100 * S;
599
- z(s), u.current && !se && (u.current.currentTime = s);
600
- }, Pe = () => {
601
- le(!0);
602
- }, Me = () => {
603
- u.current && (u.current.currentTime = H), le(!1);
604
- }, je = (t) => {
605
- const n = parseInt(t.target.value);
606
- oe(n), fe(n === 0);
607
- }, ze = () => {
608
- fe(!ae);
609
- }, Ne = (t) => {
610
- ee(parseFloat(t.target.value));
611
- }, Se = () => {
612
- G(!Q);
613
- }, ve = (t, n) => {
614
- ie((s) => ({
615
- ...s,
616
- [t]: n
617
- }));
618
- }, ye = () => {
619
- ie({ bass: 0, mid: 0, treble: 0 });
620
- };
621
- C(() => {
622
- ((typeof x == "object" && Object.keys(x).length === 0 || !x) && !M || U) && Ee();
623
- }, [x]);
624
- const $e = (t) => {
580
+ const o = parseFloat(t.target.value) / 100 * M;
581
+ P(o), p.current && !se && (p.current.currentTime = o);
582
+ }, Ae = () => ie(!0), Re = () => {
583
+ p.current && (p.current.currentTime = j), ie(!1);
584
+ }, ze = (t) => {
585
+ const a = parseInt(t.target.value);
586
+ S(a), me(a === 0);
587
+ }, Se = () => me(!ae), Be = (t) => te(parseFloat(t.target.value)), je = () => ee(!V), Te = (t, a) => oe((o) => ({ ...o, [t]: a })), be = () => oe({ bass: 0, mid: 0, treble: 0 });
588
+ $(() => {
589
+ ((typeof y == "object" && Object.keys(y).length === 0 || !y) && !E || I) && xe();
590
+ }, [y]);
591
+ const qe = (t) => {
625
592
  if (isNaN(t)) return "0:00";
626
- const n = Math.floor(t / 60), s = Math.floor(t % 60);
627
- return `${n}:${s.toString().padStart(2, "0")}`;
593
+ const a = Math.floor(t / 60), o = Math.floor(t % 60);
594
+ return `${a}:${o.toString().padStart(2, "0")}`;
628
595
  };
629
- return O && O.length > 0 ? O.map((t, n) => /* @__PURE__ */ r("div", { className: "text-red-500 text-sm bg-red-50 p-3 rounded mb-4 border border-red-300", children: [
630
- /* @__PURE__ */ r("strong", { children: [
631
- t[0],
632
- ":"
633
- ] }),
634
- " ",
635
- t[1]
636
- ] }, n)) : /* @__PURE__ */ e("div", { ref: Y, className: "w-full rounded-xl overflow-hidden", style: { backgroundColor: ge || T ? void 0 : h ? "#6060606a" : "#ffffffab" }, children: /* @__PURE__ */ r("div", { style: { background: ge || T ? void 0 : o.bg }, className: ge || T ? "" : "p-4", children: [
637
- /* @__PURE__ */ r("div", { className: "relative", children: [
638
- /* @__PURE__ */ e("div", { className: `${T && R ? "opacity-30" : ""} ${ge || T ? "" : h ? "bg-black/40" : "bg-white/70"} rounded-lg ${ge ? "" : "mb-6"} ${ge || T ? "" : "p-4"} shadow-sm`, children: /* @__PURE__ */ e("div", { className: "flex justify-center items-end gap-1 h-64", ref: re }) }),
639
- R && /* @__PURE__ */ r("div", { className: `absolute inset-0 flex flex-col w-full justify-center z-10 ${!(ge || T) && (h ? "bg-black/50" : "bg-white/80")} rounded-lg p-4 shadow-sm transition-all duration-300`, children: [
640
- /* @__PURE__ */ e("h3", { className: `text-sm font-medium mb-4 ${h ? "text-gray-200" : "text-gray-700"}`, children: "Equalizer" }),
641
- /* @__PURE__ */ r("div", { className: "space-y-4", children: [
642
- /* @__PURE__ */ r("div", { children: [
643
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
644
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-300" : "text-gray-600"}`, children: "Bass" }),
645
- /* @__PURE__ */ r("span", { className: `text-xs ${h ? "text-gray-300" : "text-gray-600"}`, children: [
646
- j.bass,
647
- " dB"
648
- ] })
649
- ] }),
650
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
651
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
652
- /* @__PURE__ */ e(
653
- "input",
654
- {
655
- type: "range",
656
- min: "-20",
657
- max: "20",
658
- value: j.bass,
659
- onChange: (t) => ve("bass", parseInt(t.target.value)),
660
- className: "flex-1 h-8 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
661
- style: {
662
- background: `linear-gradient(to right, ${o.slider} ${(j.bass + 20) / 40 * 100}%, ${o.slider + "30"} ${(j.bass + 20) / 40 * 100}%)`
663
- }
664
- }
665
- ),
666
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
667
- ] })
668
- ] }),
669
- /* @__PURE__ */ r("div", { children: [
670
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
671
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-300" : "text-gray-600"}`, children: "Mid" }),
672
- /* @__PURE__ */ r("span", { className: `text-xs ${h ? "text-gray-300" : "text-gray-600"}`, children: [
673
- j.mid,
674
- " dB"
675
- ] })
676
- ] }),
677
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
678
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
679
- /* @__PURE__ */ e(
680
- "input",
681
- {
682
- type: "range",
683
- min: "-20",
684
- max: "20",
685
- value: j.mid,
686
- onChange: (t) => ve("mid", parseInt(t.target.value)),
687
- className: "flex-1 h-8 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
688
- style: {
689
- background: `linear-gradient(to right, ${o.slider} ${(j.mid + 20) / 40 * 100}%, ${o.slider + "30"} ${(j.mid + 20) / 40 * 100}%)`
690
- }
691
- }
692
- ),
693
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
596
+ if (ce && ce.length > 0)
597
+ return /* @__PURE__ */ e(Ve, { children: ce.map((t, a) => /* @__PURE__ */ c("div", { className: "ecp-vp-error", children: [
598
+ /* @__PURE__ */ c("strong", { children: [
599
+ t[0],
600
+ ":"
601
+ ] }),
602
+ " ",
603
+ t[1]
604
+ ] }, a)) });
605
+ const Ue = ke || F ? void 0 : A ? "#6060606a" : "#ffffffab", Oe = ke || F ? void 0 : h.bg;
606
+ return /* @__PURE__ */ e("div", { ref: Z, className: "ecp-vp-wrapper", style: { backgroundColor: Ue }, children: /* @__PURE__ */ c("div", { className: "ecp-vp-bg", style: { background: Oe }, children: [
607
+ /* @__PURE__ */ c("div", { className: "ecp-vp-vu-outer", children: [
608
+ /* @__PURE__ */ e("div", { className: `ecp-vp-vu-bg ${F ? " ecp-vp-vu-bg--transparent" : A ? " ecp-vp-vu-bg--dark" : " ecp-vp-vu-bg--light"}${R && F ? " ecp-vp-vu-bg--dimmed" : ""}${ke ? " ecp-vp-vu-bg--no-margin" : ""}`, children: /* @__PURE__ */ e("div", { className: "ecp-vp-vu-bars", ref: T }) }),
609
+ R && /* @__PURE__ */ c("div", { className: `ecp-vp-eq-overlay${A ? " ecp-vp-eq-overlay--dark" : " ecp-vp-eq-overlay--light"}`, children: [
610
+ /* @__PURE__ */ e("h3", { className: `ecp-vp-eq-title${A ? " ecp-vp-eq-title--dark" : " ecp-vp-eq-title--light"}`, children: "Equalizer" }),
611
+ /* @__PURE__ */ e("div", { className: "ecp-vp-eq-bands", children: ["bass", "mid", "treble"].map((t) => /* @__PURE__ */ c("div", { className: "ecp-vp-eq-band", children: [
612
+ /* @__PURE__ */ c("div", { className: "ecp-vp-eq-band-header", children: [
613
+ /* @__PURE__ */ e("span", { className: `ecp-vp-eq-band-label${A ? " ecp-vp-eq-band-label--dark" : " ecp-vp-eq-band-label--light"}`, children: t.charAt(0).toUpperCase() + t.slice(1) }),
614
+ /* @__PURE__ */ c("span", { className: `ecp-vp-eq-band-label${A ? " ecp-vp-eq-band-label--dark" : " ecp-vp-eq-band-label--light"}`, children: [
615
+ Y[t],
616
+ " dB"
694
617
  ] })
695
618
  ] }),
696
- /* @__PURE__ */ r("div", { children: [
697
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
698
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-300" : "text-gray-600"}`, children: "Treble" }),
699
- /* @__PURE__ */ r("span", { className: `text-xs ${h ? "text-gray-300" : "text-gray-600"}`, children: [
700
- j.treble,
701
- " dB"
702
- ] })
703
- ] }),
704
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
705
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
706
- /* @__PURE__ */ e(
707
- "input",
708
- {
709
- type: "range",
710
- min: "-20",
711
- max: "20",
712
- value: j.treble,
713
- onChange: (t) => ve("treble", parseInt(t.target.value)),
714
- className: "flex-1 h-8 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
715
- style: {
716
- background: `linear-gradient(to right, ${o.slider} ${(j.treble + 20) / 40 * 100}%, ${o.slider + "30"} ${(j.treble + 20) / 40 * 100}%)`
717
- }
619
+ /* @__PURE__ */ c("div", { className: "ecp-vp-eq-band-range", children: [
620
+ /* @__PURE__ */ e("span", { className: `ecp-vp-eq-range-bound${A ? " ecp-vp-eq-range-bound--dark" : " ecp-vp-eq-range-bound--light"}`, children: "-20" }),
621
+ /* @__PURE__ */ e(
622
+ "input",
623
+ {
624
+ type: "range",
625
+ min: "-20",
626
+ max: "20",
627
+ value: Y[t],
628
+ onChange: (a) => Te(t, parseInt(a.target.value)),
629
+ className: "ecp-vp-eq-slider",
630
+ style: {
631
+ background: `linear-gradient(to right, ${h.slider} ${(Y[t] + 20) / 40 * 100}%, ${h.slider + "30"} ${(Y[t] + 20) / 40 * 100}%)`,
632
+ "--thumb-color": h.slider
718
633
  }
719
- ),
720
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
721
- ] })
634
+ }
635
+ ),
636
+ /* @__PURE__ */ e("span", { className: `ecp-vp-eq-range-bound${A ? " ecp-vp-eq-range-bound--dark" : " ecp-vp-eq-range-bound--light"}`, children: "+20" })
722
637
  ] })
723
- ] }),
724
- /* @__PURE__ */ e("div", { className: "flex justify-end mt-4", children: /* @__PURE__ */ e(
725
- "button",
726
- {
727
- onClick: ye,
728
- className: `px-3 py-1 rounded text-xs ${h ? "bg-gray-700 text-gray-200 hover:bg-gray-600" : "bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,
729
- children: "Reset"
730
- }
731
- ) })
638
+ ] }, t)) }),
639
+ /* @__PURE__ */ e("div", { className: "ecp-vp-eq-footer", children: /* @__PURE__ */ e("button", { onClick: be, className: `ecp-vp-eq-reset${A ? " ecp-vp-eq-reset--dark" : " ecp-vp-eq-reset--light"}`, children: "Reset" }) })
732
640
  ] })
733
641
  ] }),
734
- x.trackName && /* @__PURE__ */ r("div", { className: "mb-6 flex items-center", children: [
735
- m && /* @__PURE__ */ e("div", { className: "mr-2 w-12 flex-shrink-0", children: /* @__PURE__ */ e("img", { src: m, alt: "", className: `${M ? "animation-spin" : ""} h-12 w-12 rounded-full` }) }),
736
- /* @__PURE__ */ r("div", { className: "w-full min-w-0", children: [
737
- /* @__PURE__ */ e("div", { className: `${h ? "text-gray-100" : "text-gray-700"} font-medium truncate`, children: c }),
738
- g && typeof g == "string" && /* @__PURE__ */ e("div", { className: `${h ? "text-gray-300" : "text-gray-500"} text-xs`, children: g })
642
+ y.trackName && /* @__PURE__ */ c("div", { className: "ecp-vp-track", children: [
643
+ f && /* @__PURE__ */ e("div", { className: "ecp-vp-thumbnail-wrap", children: /* @__PURE__ */ e("img", { src: f, alt: "", className: `ecp-vp-thumbnail${E ? " ecp-animation-spin" : ""}` }) }),
644
+ /* @__PURE__ */ c("div", { className: "ecp-vp-track-info", children: [
645
+ /* @__PURE__ */ e("div", { className: `ecp-vp-track-name${A ? " ecp-vp-track-name--dark" : " ecp-vp-track-name--light"}`, children: l }),
646
+ u && typeof u == "string" && /* @__PURE__ */ e("div", { className: `ecp-vp-track-author${A ? " ecp-vp-track-author--dark" : " ecp-vp-track-author--light"}`, children: u })
739
647
  ] })
740
648
  ] }),
741
- x.seekbar && /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "flex items-center md:gap-1", children: [
742
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-100" : "text-gray-600"} font-mono w-12`, children: $e(H) }),
649
+ y.seekbar && /* @__PURE__ */ e("div", { className: "ecp-vp-seekbar", children: /* @__PURE__ */ c("div", { className: "ecp-vp-seekbar-row", children: [
650
+ /* @__PURE__ */ e("span", { className: `ecp-vp-time${A ? " ecp-vp-time--dark" : " ecp-vp-time--light"}`, children: qe(j) }),
743
651
  /* @__PURE__ */ e(
744
652
  "input",
745
653
  {
746
654
  type: "range",
747
655
  min: "0",
748
656
  max: "100",
749
- value: S > 0 ? H / S * 100 : 0,
657
+ value: M > 0 ? j / M * 100 : 0,
750
658
  onChange: Le,
751
- onMouseDown: Pe,
752
- onMouseUp: Me,
753
- onTouchStart: Pe,
754
- onTouchEnd: Me,
755
- disabled: !i,
756
- className: "flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",
659
+ onMouseDown: Ae,
660
+ onMouseUp: Re,
661
+ onTouchStart: Ae,
662
+ onTouchEnd: Re,
663
+ disabled: !s,
664
+ className: "ecp-vp-seek-input",
757
665
  style: {
758
- background: i && S > 0 ? `linear-gradient(to right, ${o.slider} ${H / S * 100}%, ${o.slider + "30"} ${H / S * 100}%)` : o.slider + "30"
666
+ background: s && M > 0 ? `linear-gradient(to right, ${h.slider} ${j / M * 100}%, ${h.slider + "30"} ${j / M * 100}%)` : h.slider + "30",
667
+ "--thumb-color": h.slider
759
668
  }
760
669
  }
761
670
  ),
762
- /* @__PURE__ */ e("span", { className: `text-xs ${h ? "text-gray-100" : "text-gray-600"} font-mono w-12 text-right`, children: $e(S) })
671
+ /* @__PURE__ */ e("span", { className: `ecp-vp-time ecp-vp-time--right${A ? " ecp-vp-time--dark" : " ecp-vp-time--light"}`, children: qe(M) })
763
672
  ] }) }),
764
- /* @__PURE__ */ r("div", { className: `flex flex-wrap items-center ${K < 330 ? "gap-2" : "gap-3"}`, children: [
765
- x.play && /* @__PURE__ */ r(
673
+ /* @__PURE__ */ c("div", { className: `ecp-vp-controls${G < 330 ? " ecp-vp-controls--sm" : ""}`, children: [
674
+ y.play && /* @__PURE__ */ c(
766
675
  "button",
767
676
  {
768
- onClick: Ee,
769
- disabled: !i,
770
- className: `${K < 350 ? "px-3 py-5" : "px-4 py-2 md:w-24"} rounded-full text-sm font-medium text-white disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all hover:opacity-90`,
771
- style: { backgroundColor: o.button },
677
+ onClick: xe,
678
+ disabled: !s,
679
+ className: `ecp-vp-play-btn${G < 350 ? " ecp-vp-play-btn--compact" : ""}`,
680
+ style: { backgroundColor: h.button },
772
681
  children: [
773
- /* @__PURE__ */ r("div", { className: "relative w-4 flex items-center", children: [
774
- /* @__PURE__ */ e(Re, { size: 16, className: `${M ? "" : "scale-0 translate-y-10"} transition-all absolute` }),
775
- /* @__PURE__ */ e(Fe, { size: 16, className: `${M ? "scale-0 -translate-y-10" : ""} transition-all absolute` })
682
+ /* @__PURE__ */ c("div", { className: "ecp-vp-play-icon-wrap", children: [
683
+ /* @__PURE__ */ e(Pe, { size: 16, style: { position: "absolute", transform: E ? void 0 : "scale(0) translateY(2.5rem)", transition: "all 150ms" } }),
684
+ /* @__PURE__ */ e(Me, { size: 16, style: { position: "absolute", transform: E ? "scale(0) translateY(-2.5rem)" : void 0, transition: "all 150ms" } })
776
685
  ] }),
777
- /* @__PURE__ */ e("span", { style: { display: K < 350 ? "none" : "block" }, children: M ? "Pause" : "Play" })
686
+ /* @__PURE__ */ e("span", { style: { display: G < 350 ? "none" : "block" }, children: E ? "Pause" : "Play" })
778
687
  ]
779
688
  }
780
689
  ),
781
- x.stop && /* @__PURE__ */ r(
690
+ y.stop && /* @__PURE__ */ c(
782
691
  "button",
783
692
  {
784
- onClick: Te,
785
- disabled: !i,
786
- className: `${h ? "bg-gray-100 text-black" : "bg-gray-700 text-white"} ${K < 600 ? "px-3 py-3" : "px-4 py-2"} rounded-full text-sm font-medium ${h ? "hover:bg-gray-300" : "hover:bg-gray-800"} disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all`,
693
+ onClick: Ee,
694
+ disabled: !s,
695
+ className: `ecp-vp-stop-btn${A ? " ecp-vp-stop-btn--dark" : " ecp-vp-stop-btn--light"}${G >= 600 ? " ecp-vp-stop-btn--wide" : ""}`,
787
696
  children: [
788
- /* @__PURE__ */ e(Ue, { size: 16 }),
789
- /* @__PURE__ */ e("span", { style: { display: K < 600 ? "none" : "block" }, children: "Stop" })
697
+ /* @__PURE__ */ e(Ge, { size: 16 }),
698
+ /* @__PURE__ */ e("span", { style: { display: G < 600 ? "none" : "block" }, children: "Stop" })
790
699
  ]
791
700
  }
792
701
  ),
793
- x.equalizer && /* @__PURE__ */ r(
702
+ y.equalizer && /* @__PURE__ */ c(
794
703
  "button",
795
704
  {
796
- onClick: () => F(!R),
797
- disabled: !i,
798
- className: `${K < 600 ? "px-3 py-3" : "px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${R ? "text-white" : "bg-gray-100 text-gray-700 hover:bg-gray-300"} disabled:opacity-40 disabled:cursor-not-allowed`,
799
- style: R ? { backgroundColor: o.button } : {},
705
+ onClick: () => Q(!R),
706
+ disabled: !s,
707
+ className: `ecp-vp-eq-btn${R ? " ecp-vp-eq-btn--on" : " ecp-vp-eq-btn--off"}${G >= 600 ? " ecp-vp-eq-btn--wide" : ""}`,
708
+ style: R ? { backgroundColor: h.button } : {},
800
709
  children: [
801
- /* @__PURE__ */ e(Ae, { size: 16 }),
802
- /* @__PURE__ */ e("span", { style: { display: K < 600 ? "none" : "block" }, children: "EQ" })
710
+ /* @__PURE__ */ e(Fe, { size: 16 }),
711
+ /* @__PURE__ */ e("span", { style: { display: G < 600 ? "none" : "block" }, children: "EQ" })
803
712
  ]
804
713
  }
805
714
  ),
806
- x.loop && /* @__PURE__ */ r(
715
+ y.loop && /* @__PURE__ */ c(
807
716
  "button",
808
717
  {
809
- onClick: Se,
810
- disabled: !i,
811
- className: `${K < 700 ? "px-3 py-3" : "px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${Q ? "text-white" : "bg-gray-100 text-gray-700 hover:bg-gray-300"} disabled:opacity-40 disabled:cursor-not-allowed`,
812
- style: Q ? { backgroundColor: o.button } : {},
718
+ onClick: je,
719
+ disabled: !s,
720
+ className: `ecp-vp-loop-btn${V ? " ecp-vp-loop-btn--on" : " ecp-vp-loop-btn--off"}${G >= 700 ? " ecp-vp-loop-btn--wide" : ""}`,
721
+ style: V ? { backgroundColor: h.button } : {},
813
722
  children: [
814
- /* @__PURE__ */ e(at, { size: 16, className: `${Q ? "rotate-180" : ""} transition-all` }),
815
- /* @__PURE__ */ e("span", { style: { display: K < 700 ? "none" : "block" }, children: "Loop" })
723
+ /* @__PURE__ */ e(ot, { size: 16, className: V ? "ecp-vp-loop-icon--active" : "" }),
724
+ /* @__PURE__ */ e("span", { style: { display: G < 700 ? "none" : "block" }, children: "Loop" })
816
725
  ]
817
726
  }
818
727
  ),
819
- x.speed && /* @__PURE__ */ e("div", { className: "flex items-center", children: /* @__PURE__ */ r(
820
- "select",
821
- {
822
- value: ue,
823
- onChange: Ne,
824
- className: `rounded-full text-sm font-medium border-none outline-none cursor-pointer transition-all bg-transparent ${h ? "text-gray-200" : "text-gray-800"}`,
825
- children: [
826
- /* @__PURE__ */ e("option", { value: "0.5", className: h ? "bg-gray-800 text-gray-100" : "bg-white text-gray-800", children: "0.5x" }),
827
- /* @__PURE__ */ e("option", { value: "0.75", className: h ? "bg-gray-800 text-gray-100" : "bg-white text-gray-800", children: "0.75x" }),
828
- /* @__PURE__ */ e("option", { value: "1", className: h ? "bg-gray-800 text-gray-100" : "bg-white text-gray-800", children: "1x" }),
829
- /* @__PURE__ */ e("option", { value: "1.25", className: h ? "bg-gray-800 text-gray-100" : "bg-white text-gray-800", children: "1.25x" }),
830
- /* @__PURE__ */ e("option", { value: "1.5", className: h ? "bg-gray-800 text-gray-100" : "bg-white text-gray-800", children: "1.5x" }),
831
- /* @__PURE__ */ e("option", { value: "2", className: h ? "bg-gray-800 text-gray-100" : "bg-white text-gray-800", children: "2x" })
832
- ]
833
- }
834
- ) }),
835
- x.volume && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 md:gap-3 ml-auto", children: [
836
- /* @__PURE__ */ e(
837
- "button",
838
- {
839
- onClick: ze,
840
- className: "p-2 rounded-full hover:bg-gray-100/50 transition-all",
841
- children: ae || E === 0 ? /* @__PURE__ */ e(De, { size: 20, className: h ? "text-gray-100" : "text-gray-600" }) : /* @__PURE__ */ e(He, { size: 20, className: h ? "text-gray-100" : "text-gray-600" })
842
- }
843
- ),
728
+ y.speed && /* @__PURE__ */ e("div", { className: "ecp-vp-speed-wrap", children: /* @__PURE__ */ e("select", { value: ue, onChange: Be, className: `ecp-vp-speed-select${A ? " ecp-vp-speed-select--dark" : " ecp-vp-speed-select--light"}`, children: ["0.5", "0.75", "1", "1.25", "1.5", "2"].map((t) => /* @__PURE__ */ c("option", { value: t, className: A ? "ecp-vp-speed-option--dark" : "ecp-vp-speed-option--light", children: [
729
+ t,
730
+ "x"
731
+ ] }, t)) }) }),
732
+ y.volume && /* @__PURE__ */ c("div", { className: "ecp-vp-volume", children: [
733
+ /* @__PURE__ */ e("button", { onClick: Se, className: "ecp-vp-mute-btn", children: ae || k === 0 ? /* @__PURE__ */ e(_e, { size: 20, className: A ? "ecp-vp-mute-icon--dark" : "ecp-vp-mute-icon--light" }) : /* @__PURE__ */ e(De, { size: 20, className: A ? "ecp-vp-mute-icon--dark" : "ecp-vp-mute-icon--light" }) }),
844
734
  /* @__PURE__ */ e(
845
735
  "input",
846
736
  {
847
737
  type: "range",
848
738
  min: "0",
849
739
  max: "100",
850
- value: E,
851
- onChange: je,
852
- className: "hide-for-xs w-24 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer",
740
+ value: k,
741
+ onChange: ze,
742
+ className: "ecp-vp-volume-slider",
853
743
  style: {
854
- background: `linear-gradient(to right, ${o.slider} ${E}%, ${o.slider + "30"} ${E}%)`,
855
- display: K < 460 ? "none" : "block"
744
+ background: `linear-gradient(to right, ${h.slider} ${k}%, ${h.slider + "30"} ${k}%)`,
745
+ "--thumb-color": h.slider,
746
+ display: G < 460 ? "none" : "block"
856
747
  }
857
748
  }
858
749
  ),
859
- /* @__PURE__ */ r("span", { style: { display: K < 800 ? "none" : "block" }, className: `hidden sm:block text-xs ${h ? "text-gray-100" : "text-gray-700"} font-mono w-10 text-right`, children: [
860
- E,
861
- "%"
862
- ] })
750
+ /* @__PURE__ */ c(
751
+ "span",
752
+ {
753
+ className: `ecp-vp-volume-pct${A ? " ecp-vp-volume-pct--dark" : " ecp-vp-volume-pct--light"}`,
754
+ style: { display: G < 800 ? "none" : "block" },
755
+ children: [
756
+ k,
757
+ "%"
758
+ ]
759
+ }
760
+ )
863
761
  ] })
864
- ] }),
865
- /* @__PURE__ */ e("style", { children: `
866
- input[type="range"]::-webkit-slider-thumb {
867
- -webkit-appearance: none;
868
- appearance: none;
869
- width: 16px;
870
- height: 16px;
871
- border-radius: 50%;
872
- background: ${o.slider};
873
- cursor: pointer;
874
- border: 2px solid white;
875
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
876
- }
877
-
878
- input[type="range"]::-moz-range-thumb {
879
- width: 16px;
880
- height: 16px;
881
- border-radius: 50%;
882
- background: ${o.slider};
883
- cursor: pointer;
884
- border: 2px solid white;
885
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
886
- }
887
- input[type="range"].eq-slider::-webkit-slider-thumb {
888
- -webkit-appearance: none;
889
- appearance: none;
890
- width: 0;
891
- height: 0;
892
- background: transparent;
893
- border: none;
894
- box-shadow: none;
895
- }
896
- input[type="range"].eq-slider::-moz-range-thumb {
897
- width: 0;
898
- height: 0;
899
- background: transparent;
900
- border: none;
901
- box-shadow: none;
902
- }
903
- .hide-for-xs {
904
- display: flex;
905
- }
906
- @media (max-width: 480px) {
907
- .hide-for-xs {
908
- display: none;
909
- }
910
- }
911
- .animation-spin {
912
- animation: spin 15s infinite linear;
913
- }
914
-
915
- @keyframes spin {
916
- from {
917
- transform: rotate(0deg);
918
- }
919
- to {
920
- transform: rotate(360deg)
921
- }
922
- }
923
- ` })
762
+ ] })
924
763
  ] }) });
925
764
  }
926
- function ft({
927
- audio: i,
928
- gradient: c = ["#cd7eff", "#ff00f2"],
929
- background: g = "#f4e4ffff",
930
- autoPlay: p = !1,
931
- thumbnail: q = null,
932
- width: m,
933
- equalizer: x = {
934
- bass: 0,
935
- mid: 0,
936
- treble: 0
937
- },
938
- mode: v = "light"
765
+ function bt({
766
+ audio: s,
767
+ gradient: l = ["#cd7eff", "#ff00f2"],
768
+ background: u = "#f4e4ffff",
769
+ autoPlay: v = !1,
770
+ thumbnail: C = null,
771
+ width: f,
772
+ equalizer: y = { bass: 0, mid: 0, treble: 0 },
773
+ mode: O = "light"
939
774
  }) {
940
- const [P, T] = f(!1), [U, I] = f(0), [M, _] = f(0), [H, z] = f(!1), [S, N] = f(80), [E, oe] = f(1), [ae, fe] = f([]), [Q, G] = f(null), [se, le] = f(!1), [O, de] = f({
941
- bass: x.bass || 0,
942
- mid: x.mid || 0,
943
- treble: x.treble || 0
944
- }), R = y(null), F = y(null), j = y(null), ie = y(null), ue = y(null), ee = y(null), K = () => {
945
- const a = [];
946
- for (let d = 0; d < 100; d++) {
947
- const b = 20 + Math.random() * 60;
948
- a.push(b);
949
- }
950
- return a;
775
+ const [x, F] = m(!1), [I, z] = m(0), [E, H] = m(0), [j, P] = m(!1), [M, D] = m(80), [k, S] = m(1), [ae, me] = m([]), [V, ee] = m(null), [se, ie] = m(!1), [ce, de] = m({ bass: y.bass || 0, mid: y.mid || 0, treble: y.treble || 0 }), R = b(null), Q = b(null), Y = b(null), oe = b(null), ue = b(null), te = b(null), G = () => {
776
+ const r = [];
777
+ for (let d = 0; d < 100; d++) r.push(20 + Math.random() * 60);
778
+ return r;
951
779
  };
952
- C(() => {
953
- if (!i)
954
- return;
955
- if (!Array.isArray(c) || c.length < 2) {
956
- G("Gradient must be an array with at least 2 colors");
780
+ $(() => {
781
+ if (!s) return;
782
+ if (!Array.isArray(l) || l.length < 2) {
783
+ ee("Gradient must be an array with at least 2 colors");
957
784
  return;
958
785
  }
959
- const a = R.current;
960
- if (!a) return;
961
- const d = () => I(a.currentTime), b = () => {
962
- _(a.duration), fe(K());
963
- }, B = () => T(!1), D = (J) => {
964
- var o, h;
965
- G(`Audio error: ${((h = (o = J.target) == null ? void 0 : o.error) == null ? void 0 : h.message) || "Failed to load audio"}`);
786
+ const r = R.current;
787
+ if (!r) return;
788
+ const d = () => z(r.currentTime), g = () => {
789
+ H(r.duration), me(G());
790
+ }, B = () => F(!1), _ = (J) => {
791
+ var h, A;
792
+ return ee(`Audio error: ${((A = (h = J.target) == null ? void 0 : h.error) == null ? void 0 : A.message) || "Failed to load audio"}`);
966
793
  };
967
- return a.addEventListener("timeupdate", d), a.addEventListener("loadedmetadata", b), a.addEventListener("ended", B), a.addEventListener("error", D), () => {
968
- a.removeEventListener("timeupdate", d), a.removeEventListener("loadedmetadata", b), a.removeEventListener("ended", B), a.removeEventListener("error", D);
794
+ return r.addEventListener("timeupdate", d), r.addEventListener("loadedmetadata", g), r.addEventListener("ended", B), r.addEventListener("error", _), () => {
795
+ r.removeEventListener("timeupdate", d), r.removeEventListener("loadedmetadata", g), r.removeEventListener("ended", B), r.removeEventListener("error", _);
969
796
  };
970
- }, [i, c, v]), C(() => {
971
- i && R.current && p && (R.current.play().catch((a) => {
972
- console.error("Play failed:", a), T(!1);
973
- }), T(!0));
974
- }, [i]), C(() => {
975
- if (R.current && !F.current && R.current) {
976
- const a = window.AudioContext || window.webkitAudioContext;
977
- if (a) {
978
- const d = new a();
979
- F.current = d;
980
- const b = d.createMediaElementSource(R.current);
981
- j.current = b;
797
+ }, [s, l, O]), $(() => {
798
+ s && R.current && v && (R.current.play().catch((r) => {
799
+ console.error("Play failed:", r), F(!1);
800
+ }), F(!0));
801
+ }, [s]), $(() => {
802
+ if (R.current && !Q.current && R.current) {
803
+ const r = window.AudioContext || window.webkitAudioContext;
804
+ if (r) {
805
+ const d = new r();
806
+ Q.current = d;
807
+ const g = d.createMediaElementSource(R.current);
808
+ Y.current = g;
982
809
  const B = d.createBiquadFilter();
983
- B.type = "lowshelf", B.frequency.value = 200, ie.current = B;
984
- const D = d.createBiquadFilter();
985
- D.type = "peaking", D.frequency.value = 1e3, D.Q.value = 1, ue.current = D;
810
+ B.type = "lowshelf", B.frequency.value = 200, oe.current = B;
811
+ const _ = d.createBiquadFilter();
812
+ _.type = "peaking", _.frequency.value = 1e3, _.Q.value = 1, ue.current = _;
986
813
  const J = d.createBiquadFilter();
987
- J.type = "highshelf", J.frequency.value = 3e3, ee.current = J, b.connect(B).connect(D).connect(J).connect(d.destination);
814
+ J.type = "highshelf", J.frequency.value = 3e3, te.current = J, g.connect(B).connect(_).connect(J).connect(d.destination);
988
815
  }
989
816
  }
990
- }, [i]), C(() => {
991
- R.current && (R.current.volume = H ? 0 : S / 100);
992
- }, [S, H]), C(() => {
993
- R.current && (R.current.playbackRate = E);
994
- }, [E]);
995
- const k = () => {
996
- R.current && (P ? R.current.pause() : R.current.play().catch((a) => {
997
- G(`Playback failed: ${a instanceof Error ? a.message : String(a)}`);
998
- }), T(!P));
999
- }, u = () => {
1000
- z(!H);
1001
- }, A = (a) => {
1002
- N(parseInt(a.target.value)), H && parseInt(a.target.value) > 0 && z(!1);
1003
- }, X = (a) => {
1004
- oe(parseFloat(a.target.value));
1005
- }, me = (a) => {
1006
- const d = a.currentTarget.getBoundingClientRect(), D = (a.clientX - d.left) / d.width * M;
1007
- R.current && (R.current.currentTime = D, I(D));
1008
- }, V = (a, d) => {
1009
- de((b) => ({ ...b, [a]: d })), a === "bass" && ie.current && (ie.current.gain.value = d), a === "mid" && ue.current && (ue.current.gain.value = d), a === "treble" && ee.current && (ee.current.gain.value = d);
1010
- }, te = () => {
1011
- V("bass", 0), V("mid", 0), V("treble", 0);
1012
- }, Z = (a) => {
1013
- if (isNaN(a)) return "0:00";
1014
- const d = Math.floor(a / 60), b = Math.floor(a % 60);
1015
- return `${d}:${b.toString().padStart(2, "0")}`;
1016
- }, $ = M > 0 ? U / M * 100 : 0;
1017
- if (Q)
1018
- return /* @__PURE__ */ e("div", { className: "w-lg p-6 rounded-xl", style: { background: g }, children: /* @__PURE__ */ r("div", { className: `text-center ${v === "dark" ? "text-red-300" : "text-red-600"}`, children: [
1019
- /* @__PURE__ */ e("p", { className: "font-medium", children: "Error" }),
1020
- /* @__PURE__ */ e("p", { className: "text-sm", children: Q })
1021
- ] }) });
1022
- if (!i) return null;
1023
- const re = v === "dark" ? "text-gray-300" : "text-gray-700", Y = v === "dark" ? "text-gray-400" : "text-gray-500";
1024
- return /* @__PURE__ */ r("div", { className: "w-full max-w-lg relative", style: { width: m + "px" }, children: [
1025
- /* @__PURE__ */ e("audio", { ref: R, src: i }),
1026
- /* @__PURE__ */ e("div", { className: "rounded-2xl shadow-2xl", children: /* @__PURE__ */ r("div", { className: "rounded-2xl p-6 backdrop-blur-xl", style: { background: g }, children: [
1027
- q && /* @__PURE__ */ e("div", { className: "w-full p-4", children: /* @__PURE__ */ e("img", { src: q, alt: "", className: "w-full aspect-square rounded-xl" }) }),
1028
- /* @__PURE__ */ r(
1029
- "div",
1030
- {
1031
- className: "relative h-20 mb-6 cursor-pointer",
1032
- onClick: me,
1033
- children: [
1034
- /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-end justify-center h-full w-full gap-px", children: ae.map((a, d) => {
1035
- const B = d / ae.length * 100 <= $;
1036
- return /* @__PURE__ */ e(
1037
- "div",
1038
- {
1039
- className: "w-1 rounded-t transition-all duration-150",
1040
- style: {
1041
- height: `${a}%`,
1042
- background: B ? c[0] : c[1],
1043
- opacity: B ? 1 : 0.4
1044
- }
1045
- },
1046
- d
1047
- );
1048
- }) }),
1049
- /* @__PURE__ */ e(
1050
- "div",
1051
- {
1052
- className: "absolute top-0 h-full w-1 bg-white border-r border-black rounded-full transition-all duration-150",
1053
- style: { left: `${$}%`, transform: "translateX(-50%)" }
817
+ }, [s]), $(() => {
818
+ R.current && (R.current.volume = j ? 0 : M / 100);
819
+ }, [M, j]), $(() => {
820
+ R.current && (R.current.playbackRate = k);
821
+ }, [k]);
822
+ const w = () => {
823
+ R.current && (x ? R.current.pause() : R.current.play().catch((r) => ee(`Playback failed: ${r instanceof Error ? r.message : String(r)}`)), F(!x));
824
+ }, p = () => P(!j), L = (r) => {
825
+ D(parseInt(r.target.value)), j && parseInt(r.target.value) > 0 && P(!1);
826
+ }, K = (r) => S(parseFloat(r.target.value)), fe = (r) => {
827
+ const d = r.currentTarget.getBoundingClientRect(), B = (r.clientX - d.left) / d.width * E;
828
+ R.current && (R.current.currentTime = B, z(B));
829
+ }, W = (r, d) => {
830
+ de((g) => ({ ...g, [r]: d })), r === "bass" && oe.current && (oe.current.gain.value = d), r === "mid" && ue.current && (ue.current.gain.value = d), r === "treble" && te.current && (te.current.gain.value = d);
831
+ }, re = () => {
832
+ W("bass", 0), W("mid", 0), W("treble", 0);
833
+ }, X = (r) => {
834
+ if (isNaN(r)) return "0:00";
835
+ const d = Math.floor(r / 60), g = Math.floor(r % 60);
836
+ return `${d}:${g.toString().padStart(2, "0")}`;
837
+ }, N = E > 0 ? I / E * 100 : 0, T = O === "dark";
838
+ if (V)
839
+ return /* @__PURE__ */ c("div", { className: "ecp-wave-error", style: { background: u }, children: [
840
+ /* @__PURE__ */ e("p", { className: `ecp-wave-error-title${T ? " ecp-wave-error--dark" : " ecp-wave-error--light"}`, children: "Error" }),
841
+ /* @__PURE__ */ e("p", { className: `ecp-wave-error-msg${T ? " ecp-wave-error--dark" : " ecp-wave-error--light"}`, children: V })
842
+ ] });
843
+ if (!s) return null;
844
+ const Z = T ? "#9ca3af" : "#6b7280";
845
+ return /* @__PURE__ */ c("div", { className: "ecp-wave-outer", style: { width: f ? `${f}px` : void 0 }, children: [
846
+ /* @__PURE__ */ e("audio", { ref: R, src: s, className: "ecp-wave-audio-el" }),
847
+ /* @__PURE__ */ e("div", { className: "ecp-wave-card", children: /* @__PURE__ */ c("div", { className: "ecp-wave-card-inner", style: { background: u }, children: [
848
+ C && /* @__PURE__ */ e("div", { className: "ecp-wave-thumbnail-wrap", children: /* @__PURE__ */ e("img", { src: C, alt: "", className: "ecp-wave-thumbnail" }) }),
849
+ /* @__PURE__ */ c("div", { className: "ecp-wave-seek", onClick: fe, children: [
850
+ /* @__PURE__ */ e("div", { className: "ecp-wave-bars", children: ae.map((r, d) => {
851
+ const g = d / ae.length * 100 <= N;
852
+ return /* @__PURE__ */ e(
853
+ "div",
854
+ {
855
+ className: "ecp-wave-bar",
856
+ style: {
857
+ height: `${r}%`,
858
+ background: g ? l[0] : l[1],
859
+ opacity: g ? 1 : 0.4
1054
860
  }
1055
- )
1056
- ]
1057
- }
1058
- ),
1059
- /* @__PURE__ */ r("div", { className: `flex justify-between text-sm ${Y} mb-6`, children: [
1060
- /* @__PURE__ */ e("span", { children: Z(U) }),
1061
- /* @__PURE__ */ e("span", { children: Z(M) })
861
+ },
862
+ d
863
+ );
864
+ }) }),
865
+ /* @__PURE__ */ e("div", { className: "ecp-wave-progress-line", style: { left: `${N}%` } })
866
+ ] }),
867
+ /* @__PURE__ */ c("div", { className: "ecp-wave-times", style: { color: Z }, children: [
868
+ /* @__PURE__ */ e("span", { children: X(I) }),
869
+ /* @__PURE__ */ e("span", { children: X(E) })
1062
870
  ] }),
1063
- /* @__PURE__ */ r("div", { className: "grid grid-cols-3 items-center justify-between mb-4", children: [
1064
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
871
+ /* @__PURE__ */ c("div", { className: "ecp-wave-controls", children: [
872
+ /* @__PURE__ */ c("div", { className: "ecp-wave-left-controls", children: [
1065
873
  /* @__PURE__ */ e(
1066
874
  "button",
1067
875
  {
1068
- onClick: u,
1069
- className: "p-2 rounded-full transition-all",
1070
- style: {
1071
- background: `linear-gradient(135deg, ${c[0]}, ${c[1]})`
1072
- },
1073
- children: H || S === 0 ? /* @__PURE__ */ e(De, { className: "w-4 h-4 text-white" }) : /* @__PURE__ */ e(He, { className: "w-4 h-4 text-white" })
876
+ onClick: p,
877
+ className: "ecp-wave-vol-btn",
878
+ style: { background: `linear-gradient(135deg, ${l[0]}, ${l[1]})` },
879
+ children: j || M === 0 ? /* @__PURE__ */ e(_e, { style: { width: "1rem", height: "1rem", color: "white" } }) : /* @__PURE__ */ e(De, { style: { width: "1rem", height: "1rem", color: "white" } })
1074
880
  }
1075
881
  ),
1076
882
  /* @__PURE__ */ e(
@@ -1079,285 +885,160 @@ function ft({
1079
885
  type: "range",
1080
886
  min: "0",
1081
887
  max: "100",
1082
- value: S,
1083
- onChange: A,
1084
- className: `${m ? "" : "hidden sm:block"} w-20 h-1.5 rounded-lg appearance-none cursor-pointer`,
888
+ value: M,
889
+ onChange: L,
890
+ className: "ecp-wave-vol-slider",
1085
891
  style: {
1086
- background: `linear-gradient(to right, ${c[0]} ${S}%, ${v === "dark" ? "#374151" : "#d1d5db"} ${S}%)`,
1087
- display: m && m < 400 ? "none" : void 0
892
+ background: `linear-gradient(to right, ${l[0]} ${M}%, ${T ? "#374151" : "#d1d5db"} ${M}%)`,
893
+ "--thumb-color": l[0],
894
+ display: f && f < 400 ? "none" : void 0
1088
895
  }
1089
896
  }
1090
897
  ),
1091
- m && m < 400 && /* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ e(
898
+ f && f < 400 && /* @__PURE__ */ e(
1092
899
  "button",
1093
900
  {
1094
- onClick: () => le(!se),
1095
- className: "p-2 rounded-full transition-all",
1096
- style: {
1097
- background: `linear-gradient(135deg, ${c[0]}, ${c[1]})`
1098
- },
1099
- children: /* @__PURE__ */ e(Ae, { className: "w-4 h-4 text-white" })
901
+ onClick: () => ie(!se),
902
+ className: "ecp-wave-eq-btn",
903
+ style: { background: `linear-gradient(135deg, ${l[0]}, ${l[1]})` },
904
+ children: /* @__PURE__ */ e(Fe, { style: { width: "1rem", height: "1rem", color: "white" } })
1100
905
  }
1101
- ) })
906
+ )
1102
907
  ] }),
1103
- /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
908
+ /* @__PURE__ */ e("div", { className: "ecp-wave-center-controls", children: /* @__PURE__ */ e(
1104
909
  "button",
1105
910
  {
1106
- onClick: k,
1107
- className: "p-4 rounded-full transition-all hover:scale-105 shadow-lg",
1108
- style: {
1109
- background: `linear-gradient(135deg, ${c[0]}, ${c[1]})`
1110
- },
1111
- children: P ? /* @__PURE__ */ e(Re, { className: "w-6 h-6 text-white fill-white" }) : /* @__PURE__ */ e(Fe, { className: "w-6 h-6 text-white fill-white" })
911
+ onClick: w,
912
+ className: "ecp-wave-play-btn",
913
+ style: { background: `linear-gradient(135deg, ${l[0]}, ${l[1]})` },
914
+ children: x ? /* @__PURE__ */ e(Pe, { style: { width: "1.5rem", height: "1.5rem", color: "white", fill: "white" } }) : /* @__PURE__ */ e(Me, { style: { width: "1.5rem", height: "1.5rem", color: "white", fill: "white" } })
1112
915
  }
1113
916
  ) }),
1114
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1115
- /* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ r(
917
+ /* @__PURE__ */ c("div", { className: "ecp-wave-right-controls", children: [
918
+ /* @__PURE__ */ e(
1116
919
  "select",
1117
920
  {
1118
- value: E,
1119
- style: { background: g, color: c[0] },
1120
- onChange: X,
1121
- className: `py-1 px-2 rounded-lg text-sm ${re} ${v === "dark" ? "bg-gray-800" : "bg-gray-100"}`,
1122
- children: [
1123
- /* @__PURE__ */ e("option", { value: "0.5", children: "0.5x" }),
1124
- /* @__PURE__ */ e("option", { value: "0.75", children: "0.75x" }),
1125
- /* @__PURE__ */ e("option", { value: "1", children: "1x" }),
1126
- /* @__PURE__ */ e("option", { value: "1.25", children: "1.25x" }),
1127
- /* @__PURE__ */ e("option", { value: "1.5", children: "1.5x" }),
1128
- /* @__PURE__ */ e("option", { value: "2", children: "2x" })
1129
- ]
921
+ value: k,
922
+ onChange: K,
923
+ className: `ecp-wave-speed-select${T ? " ecp-wave-speed-select--dark" : " ecp-wave-speed-select--light"}`,
924
+ style: { background: u, color: l[0] },
925
+ children: ["0.5", "0.75", "1", "1.25", "1.5", "2"].map((r) => /* @__PURE__ */ c("option", { value: r, children: [
926
+ r,
927
+ "x"
928
+ ] }, r))
1130
929
  }
1131
- ) }),
1132
- !(m && m < 400) && /* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ e(
930
+ ),
931
+ !(f && f < 400) && /* @__PURE__ */ e(
1133
932
  "button",
1134
933
  {
1135
- onClick: () => le(!se),
1136
- className: "p-2 rounded-full transition-all",
1137
- style: {
1138
- background: `linear-gradient(135deg, ${c[0]}, ${c[1]})`
1139
- },
1140
- children: /* @__PURE__ */ e(Ae, { className: "w-4 h-4 text-white" })
934
+ onClick: () => ie(!se),
935
+ className: "ecp-wave-eq-btn",
936
+ style: { background: `linear-gradient(135deg, ${l[0]}, ${l[1]})` },
937
+ children: /* @__PURE__ */ e(Fe, { style: { width: "1rem", height: "1rem", color: "white" } })
1141
938
  }
1142
- ) })
939
+ )
1143
940
  ] })
1144
941
  ] })
1145
942
  ] }) }),
1146
- se && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black bg-opacity-20 flex items-center justify-center z-10 rounded-2xl p-4", children: /* @__PURE__ */ r("div", { className: `max-w-xs w-full p-4 pt-2 rounded-xl ${v === "dark" ? "bg-gray-800" : "bg-white"}`, children: [
1147
- /* @__PURE__ */ e("h3", { className: `text-lg font-medium mb-2 ${v === "dark" ? "text-gray-200" : "text-gray-700"}`, children: "Equalizer" }),
1148
- /* @__PURE__ */ r("div", { className: "space-y-4", children: [
1149
- /* @__PURE__ */ r("div", { children: [
1150
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
1151
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Bass" }),
1152
- /* @__PURE__ */ r("span", { className: `text-xs ${v === "dark" ? "text-gray-300" : "text-gray-600"}`, children: [
1153
- O.bass,
1154
- " dB"
1155
- ] })
1156
- ] }),
1157
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1158
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
1159
- /* @__PURE__ */ e(
1160
- "input",
1161
- {
1162
- type: "range",
1163
- min: "-20",
1164
- max: "20",
1165
- value: O.bass,
1166
- onChange: (a) => V("bass", parseInt(a.target.value)),
1167
- className: "flex-1 h-4 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
1168
- style: {
1169
- background: `linear-gradient(to right, ${c[0]} ${(O.bass + 20) / 40 * 100}%, ${c[1] + "30"} ${(O.bass + 20) / 40 * 100}%)`
1170
- }
1171
- }
1172
- ),
1173
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
943
+ se && /* @__PURE__ */ e("div", { className: "ecp-wave-eq-overlay", children: /* @__PURE__ */ c("div", { className: `ecp-wave-eq-panel${T ? " ecp-wave-eq-panel--dark" : " ecp-wave-eq-panel--light"}`, children: [
944
+ /* @__PURE__ */ e("h3", { className: `ecp-wave-eq-title${T ? " ecp-wave-eq-title--dark" : " ecp-wave-eq-title--light"}`, children: "Equalizer" }),
945
+ /* @__PURE__ */ e("div", { className: "ecp-wave-eq-bands", children: ["bass", "mid", "treble"].map((r) => /* @__PURE__ */ c("div", { children: [
946
+ /* @__PURE__ */ c("div", { className: "ecp-wave-eq-band-header", children: [
947
+ /* @__PURE__ */ e("span", { className: T ? "ecp-wave-eq-label--dark" : "ecp-wave-eq-label--light", children: r.charAt(0).toUpperCase() + r.slice(1) }),
948
+ /* @__PURE__ */ c("span", { className: T ? "ecp-wave-eq-label--dark" : "ecp-wave-eq-label--light", children: [
949
+ ce[r],
950
+ " dB"
1174
951
  ] })
1175
952
  ] }),
1176
- /* @__PURE__ */ r("div", { children: [
1177
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
1178
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Mid" }),
1179
- /* @__PURE__ */ r("span", { className: `text-xs ${v === "dark" ? "text-gray-300" : "text-gray-600"}`, children: [
1180
- O.mid,
1181
- " dB"
1182
- ] })
1183
- ] }),
1184
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1185
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
1186
- /* @__PURE__ */ e(
1187
- "input",
1188
- {
1189
- type: "range",
1190
- min: "-20",
1191
- max: "20",
1192
- value: O.mid,
1193
- onChange: (a) => V("mid", parseInt(a.target.value)),
1194
- className: "flex-1 h-4 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
1195
- style: {
1196
- background: `linear-gradient(to right, ${c[0]} ${(O.mid + 20) / 40 * 100}%, ${c[1] + "30"} ${(O.mid + 20) / 40 * 100}%)`
1197
- }
1198
- }
1199
- ),
1200
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
1201
- ] })
1202
- ] }),
1203
- /* @__PURE__ */ r("div", { children: [
1204
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
1205
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Treble" }),
1206
- /* @__PURE__ */ r("span", { className: `text-xs ${v === "dark" ? "text-gray-300" : "text-gray-600"}`, children: [
1207
- O.treble,
1208
- " dB"
1209
- ] })
1210
- ] }),
1211
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1212
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
1213
- /* @__PURE__ */ e(
1214
- "input",
1215
- {
1216
- type: "range",
1217
- min: "-20",
1218
- max: "20",
1219
- value: O.treble,
1220
- onChange: (a) => V("treble", parseInt(a.target.value)),
1221
- className: "flex-1 h-4 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
1222
- style: {
1223
- background: `linear-gradient(to right, ${c[0]} ${(O.treble + 20) / 40 * 100}%, ${c[1] + "30"} ${(O.treble + 20) / 40 * 100}%)`
1224
- }
953
+ /* @__PURE__ */ c("div", { className: "ecp-wave-eq-range-row", children: [
954
+ /* @__PURE__ */ e("span", { className: T ? "ecp-wave-eq-bound--dark" : "ecp-wave-eq-bound--light", children: "-20" }),
955
+ /* @__PURE__ */ e(
956
+ "input",
957
+ {
958
+ type: "range",
959
+ min: "-20",
960
+ max: "20",
961
+ value: ce[r],
962
+ onChange: (d) => W(r, parseInt(d.target.value)),
963
+ className: "ecp-wave-eq-slider",
964
+ style: {
965
+ background: `linear-gradient(to right, ${l[0]} ${(ce[r] + 20) / 40 * 100}%, ${l[1] + "30"} ${(ce[r] + 20) / 40 * 100}%)`,
966
+ "--thumb-color": l[0]
1225
967
  }
1226
- ),
1227
- /* @__PURE__ */ e("span", { className: `text-xs ${v === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
1228
- ] })
968
+ }
969
+ ),
970
+ /* @__PURE__ */ e("span", { className: T ? "ecp-wave-eq-bound--dark" : "ecp-wave-eq-bound--light", children: "+20" })
1229
971
  ] })
1230
- ] }),
1231
- /* @__PURE__ */ r("div", { className: "flex justify-between mt-6", children: [
1232
- /* @__PURE__ */ e(
1233
- "button",
1234
- {
1235
- onClick: te,
1236
- className: `px-3 py-1 rounded text-xs ${v === "dark" ? "bg-gray-700 text-gray-200 hover:bg-gray-600" : "bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,
1237
- children: "Reset"
1238
- }
1239
- ),
1240
- /* @__PURE__ */ e(
1241
- "button",
1242
- {
1243
- onClick: () => le(!1),
1244
- className: `px-3 py-1 rounded text-xs ${v === "dark" ? "bg-gray-700 text-gray-200 hover:bg-gray-600" : "bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,
1245
- children: "Close"
1246
- }
1247
- )
972
+ ] }, r)) }),
973
+ /* @__PURE__ */ c("div", { className: "ecp-wave-eq-footer", children: [
974
+ /* @__PURE__ */ e("button", { onClick: re, className: `ecp-wave-eq-footer-btn${T ? " ecp-wave-eq-footer-btn--dark" : " ecp-wave-eq-footer-btn--light"}`, children: "Reset" }),
975
+ /* @__PURE__ */ e("button", { onClick: () => ie(!1), className: `ecp-wave-eq-footer-btn${T ? " ecp-wave-eq-footer-btn--dark" : " ecp-wave-eq-footer-btn--light"}`, children: "Close" })
1248
976
  ] })
1249
- ] }) }),
1250
- /* @__PURE__ */ e("style", { children: `
1251
- input[type="range"].eq-slider::-webkit-slider-thumb {
1252
- -webkit-appearance: none;
1253
- appearance: none;
1254
- width: 0;
1255
- height: 0;
1256
- background: transparent;
1257
- border: none;
1258
- box-shadow: none;
1259
- }
1260
- input[type="range"].eq-slider::-moz-range-thumb {
1261
- width: 0;
1262
- height: 0;
1263
- background: transparent;
1264
- border: none;
1265
- box-shadow: none;
1266
- }
1267
- ` })
977
+ ] }) })
1268
978
  ] });
1269
979
  }
1270
- function mt({ audio: i, thumbnail: c, gradient: g = ["#cd7eff", "#fe59f6"], background: p = "#1f273a", autoPlay: q = !1 }) {
1271
- const [m, x] = f(!1), [, v] = f(0), P = y(null), [T, U] = f(0), [I, M] = f(0), [_, H] = f(0);
1272
- C(() => {
1273
- const N = P.current;
1274
- if (!N) return;
1275
- const E = () => v(N.currentTime);
1276
- return N.addEventListener("timeupdate", E), () => N.removeEventListener("timeupdate", E);
1277
- }, []), C(() => {
1278
- const N = setInterval(() => {
1279
- m && U((E) => E + 0.1);
980
+ function gt({ audio: s, thumbnail: l, gradient: u = ["#cd7eff", "#fe59f6"], background: v = "#1f273a", autoPlay: C = !1 }) {
981
+ const [f, y] = m(!1), [, O] = m(0), x = b(null), [F, I] = m(0), [z, E] = m(0), [H, j] = m(0);
982
+ $(() => {
983
+ const k = x.current;
984
+ if (!k) return;
985
+ const S = () => O(k.currentTime);
986
+ return k.addEventListener("timeupdate", S), () => k.removeEventListener("timeupdate", S);
987
+ }, []), $(() => {
988
+ const k = setInterval(() => {
989
+ f && I((S) => S + 0.1);
1280
990
  }, 100);
1281
- return () => clearInterval(N);
1282
- }, [m]), C(() => {
1283
- const N = setInterval(() => {
1284
- m && H((E) => E + 0.1);
991
+ return () => clearInterval(k);
992
+ }, [f]), $(() => {
993
+ const k = setInterval(() => {
994
+ f && j((S) => S + 0.1);
1285
995
  }, 100);
1286
- return () => clearInterval(N);
1287
- }, [m]), C(() => {
1288
- i && P.current && q && (P.current.play().catch(() => x(!1)), x(!0));
1289
- }, [i]), C(() => {
1290
- const N = P.current;
1291
- if (!N) return;
1292
- const E = () => {
1293
- M(N.duration), console.log("Audio duration:", N.duration);
1294
- };
1295
- return H(0), N.addEventListener("loadedmetadata", E), () => {
1296
- N.removeEventListener("loadedmetadata", E);
1297
- };
1298
- }, [i]);
1299
- const z = () => {
1300
- P.current && (m ? P.current.pause() : P.current.play().catch((N) => console.error("NanoPlayer play failed:", N)), x(!m));
1301
- };
1302
- if (!i) return null;
1303
- const S = {
1304
- background: `linear-gradient(135deg, ${g[0]}, ${g[1]})`
996
+ return () => clearInterval(k);
997
+ }, [f]), $(() => {
998
+ s && x.current && C && (x.current.play().catch(() => y(!1)), y(!0));
999
+ }, [s]), $(() => {
1000
+ const k = x.current;
1001
+ if (!k) return;
1002
+ const S = () => E(k.duration);
1003
+ return j(0), k.addEventListener("loadedmetadata", S), () => k.removeEventListener("loadedmetadata", S);
1004
+ }, [s]);
1005
+ const P = () => {
1006
+ x.current && (f ? x.current.pause() : x.current.play().catch((k) => console.error("NanoPlayer play failed:", k)), y(!f));
1305
1007
  };
1306
- return /* @__PURE__ */ r(
1008
+ if (!s) return null;
1009
+ const M = `linear-gradient(135deg, ${u[0]}, ${u[1]})`, D = `${(z > 0 ? H / z : 0) * 100}%`;
1010
+ return /* @__PURE__ */ c(
1307
1011
  "div",
1308
1012
  {
1309
- style: { backgroundColor: p },
1310
- className: `
1311
- relative overflow-hidden inline-flex flex-col
1312
- ${c ? "rounded-2xl" : "rounded-full"}
1313
- px-3 py-2 shadow-lg
1314
- ${c ? "w-[120px] h-[150px]" : "w-[110px] h-[40px]"}
1315
- `,
1013
+ className: `ecp-nano-wrapper${l ? " ecp-nano-wrapper--card" : " ecp-nano-wrapper--pill"}`,
1014
+ style: { backgroundColor: v },
1316
1015
  children: [
1317
1016
  /* @__PURE__ */ e(
1318
1017
  "audio",
1319
1018
  {
1320
- ref: P,
1321
- src: i,
1019
+ ref: x,
1020
+ src: s,
1322
1021
  onEnded: () => {
1323
- x(!1), H(0);
1022
+ y(!1), j(0);
1324
1023
  }
1325
1024
  }
1326
1025
  ),
1327
- /* @__PURE__ */ e(
1328
- "div",
1329
- {
1330
- style: {
1331
- width: `${(I > 0 ? _ / I : 0) * 100}%`,
1332
- backgroundImage: S.background
1333
- },
1334
- className: "absolute top-0 left-0 h-full opacity-20"
1335
- }
1336
- ),
1337
- /* @__PURE__ */ r("div", { className: "absolute flex flex-col", children: [
1338
- c && /* @__PURE__ */ e("div", { className: "w-24 pb-2", children: /* @__PURE__ */ e("img", { src: c, alt: "", className: "w-24 aspect-square rounded-xl" }) }),
1339
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1340
- /* @__PURE__ */ e(
1341
- "button",
1342
- {
1343
- onClick: z,
1344
- style: S,
1345
- className: "p-1.5 rounded-full hover:scale-110 transition-transform flex-shrink-0",
1346
- children: m ? /* @__PURE__ */ e(Re, { fill: p, className: "w-3 h-3 text-transparent" }) : /* @__PURE__ */ e(Fe, { fill: p, className: "w-3 h-3 text-transparent" })
1347
- }
1348
- ),
1349
- /* @__PURE__ */ e("div", { className: "flex w-full min-w-12 items-center gap-0.5 h-6", children: [...Array(12)].map((N, E) => /* @__PURE__ */ e(
1026
+ /* @__PURE__ */ e("div", { className: "ecp-nano-progress-bg", style: { width: D, backgroundImage: M } }),
1027
+ /* @__PURE__ */ c("div", { className: "ecp-nano-content", children: [
1028
+ l && /* @__PURE__ */ e("div", { className: "ecp-nano-thumbnail-wrap", children: /* @__PURE__ */ e("img", { src: l, alt: "", className: "ecp-nano-thumbnail" }) }),
1029
+ /* @__PURE__ */ c("div", { className: "ecp-nano-row", children: [
1030
+ /* @__PURE__ */ e("button", { onClick: P, className: "ecp-nano-play-btn", style: { background: M }, children: f ? /* @__PURE__ */ e(Pe, { fill: v, style: { width: "0.75rem", height: "0.75rem", color: "transparent" } }) : /* @__PURE__ */ e(Me, { fill: v, style: { width: "0.75rem", height: "0.75rem", color: "transparent" } }) }),
1031
+ /* @__PURE__ */ e("div", { className: "ecp-nano-waveform", children: [...Array(12)].map((k, S) => /* @__PURE__ */ e(
1350
1032
  "div",
1351
1033
  {
1352
- className: "rounded-full transition-all duration-200",
1034
+ className: "ecp-nano-wave-bar",
1353
1035
  style: {
1354
- width: "100%",
1355
- background: `linear-gradient(to top, ${g[0]}, ${g[1]})`,
1356
- height: m ? `${8 + Math.sin((T * 8 + E) * 0.6) * 10}px` : "8px",
1357
- opacity: m ? 0.8 : 0.4
1036
+ background: `linear-gradient(to top, ${u[0]}, ${u[1]})`,
1037
+ height: f ? `${8 + Math.sin((F * 8 + S) * 0.6) * 10}px` : "8px",
1038
+ opacity: f ? 0.8 : 0.4
1358
1039
  }
1359
1040
  },
1360
- E
1041
+ S
1361
1042
  )) })
1362
1043
  ] })
1363
1044
  ] })
@@ -1365,13 +1046,13 @@ function mt({ audio: i, thumbnail: c, gradient: g = ["#cd7eff", "#fe59f6"], back
1365
1046
  }
1366
1047
  );
1367
1048
  }
1368
- function yt({
1369
- video: i,
1370
- name: c = "No video loaded",
1371
- audioVisual: g = null,
1372
- volume: p = 100,
1373
- thumbnail: q = null,
1374
- controls: m = {
1049
+ function wt({
1050
+ video: s,
1051
+ name: l = "No video loaded",
1052
+ audioVisual: u = null,
1053
+ volume: v = 100,
1054
+ thumbnail: C = null,
1055
+ controls: f = {
1375
1056
  play: !0,
1376
1057
  pause: !0,
1377
1058
  stop: !0,
@@ -1382,526 +1063,364 @@ function yt({
1382
1063
  equalizer: !0,
1383
1064
  speed: !0
1384
1065
  },
1385
- mode: x = "light",
1386
- transparent: v = !1,
1387
- autoPlay: P = !1,
1388
- color: T = "#3b82f6",
1389
- equalizer: U = {
1390
- bass: 0,
1391
- mid: 0,
1392
- treble: 0
1393
- }
1066
+ mode: y = "light",
1067
+ transparent: O = !1,
1068
+ autoPlay: x = !1,
1069
+ color: F = "#3b82f6",
1070
+ equalizer: I = { bass: 0, mid: 0, treble: 0 }
1394
1071
  }) {
1395
- const [I, M] = f(!1), [_, H] = f(0), [z, S] = f(0), [N, E] = f(p || 100), [oe, ae] = f(!1), [fe, Q] = f(!1), [G, se] = f(!1), [le, O] = f([]), [de, R] = f(!1), [F, j] = f({
1396
- bass: U.bass || 0,
1397
- mid: U.mid || 0,
1398
- treble: U.treble || 0
1399
- }), [ie, ue] = f(1), [ee, K] = f(0), k = y(null), u = y(null), A = y(null), X = y(null), me = y(null), V = y(null), te = y(null), Z = y(null), $ = y(null), re = y(null), Y = y(0), a = y(0), d = y(0), b = y(0), B = y(0), D = y(0), J = y(!1), o = x === "dark" || G, h = typeof m == "object" && Object.keys(m).length === 0;
1400
- C(() => {
1401
- const t = u.current;
1402
- if (!t) return;
1403
- const n = new ResizeObserver((s) => {
1404
- for (let l of s)
1405
- K(l.contentRect.width);
1072
+ const [z, E] = m(!1), [H, j] = m(0), [P, M] = m(0), [D, k] = m(v || 100), [S, ae] = m(!1), [me, V] = m(!1), [ee, se] = m(!1), [ie, ce] = m([]), [de, R] = m(!1), [Q, Y] = m({ bass: I.bass || 0, mid: I.mid || 0, treble: I.treble || 0 }), [oe, ue] = m(1), [te, G] = m(0), w = b(null), p = b(null), L = b(null), K = b(null), fe = b(null), W = b(null), re = b(null), X = b(null), N = b(null), T = b(null), Z = b(0), r = b(0), d = b(0), g = b(0), B = b(0), _ = b(0), J = b(!1), h = y === "dark" || ee, A = typeof f == "object" && Object.keys(f).length === 0;
1073
+ $(() => {
1074
+ const n = p.current;
1075
+ if (!n) return;
1076
+ const t = new ResizeObserver((a) => {
1077
+ for (let o of a) G(o.contentRect.width);
1406
1078
  });
1407
- return n.observe(t), () => n.disconnect();
1408
- }, []), C(() => {
1409
- const t = [];
1410
- i && typeof i != "string" && t.push(["TypeError", "video must be a string (URL or path)"]), c && typeof c != "string" && t.push(["TypeError", "name must be a string"]), (typeof p != "number" || p < 0 || p > 100) && t.push(["TypeError", "volume must be a number between 0 and 100"]), g && typeof g != "object" ? t.push(["TypeError", "audioVisual must be an object"]) : g && (["left", "right", "top", "bottom"].includes(g.side) || t.push(["ValueError", "audioVisual.side must be 'left', 'right', 'top', or 'bottom'"])), t.length > 0 ? (O(t), console.group("%cVideoPlayer: Prop validation failed", "color:red"), t.forEach((n) => console.error(`${n[0]}: ${n[1]}`)), console.groupEnd()) : O([]);
1411
- }, [i, c, p, g, m, x]), C(() => {
1412
- if (!k.current) return;
1413
- const t = k.current, n = () => {
1414
- fe || H(t.currentTime);
1415
- }, s = () => {
1416
- S(t.duration);
1417
- }, l = () => {
1418
- M(!1), $.current && cancelAnimationFrame($.current);
1419
- }, w = () => M(!0), L = () => M(!1);
1420
- return t.addEventListener("timeupdate", n), t.addEventListener("loadedmetadata", s), t.addEventListener("ended", l), t.addEventListener("play", w), t.addEventListener("pause", L), () => {
1421
- t.removeEventListener("timeupdate", n), t.removeEventListener("loadedmetadata", s), t.removeEventListener("ended", l), t.removeEventListener("play", w), t.removeEventListener("pause", L);
1079
+ return t.observe(n), () => t.disconnect();
1080
+ }, []), $(() => {
1081
+ const n = [];
1082
+ s && typeof s != "string" && n.push(["TypeError", "video must be a string (URL or path)"]), l && typeof l != "string" && n.push(["TypeError", "name must be a string"]), (typeof v != "number" || v < 0 || v > 100) && n.push(["TypeError", "volume must be a number between 0 and 100"]), u && typeof u != "object" ? n.push(["TypeError", "audioVisual must be an object"]) : u && !["left", "right", "top", "bottom"].includes(u.side) && n.push(["ValueError", "audioVisual.side must be 'left', 'right', 'top', or 'bottom'"]), n.length > 0 ? ce(n) : ce([]);
1083
+ }, [s, l, v, u, f, y]), $(() => {
1084
+ if (!w.current) return;
1085
+ const n = w.current, t = () => {
1086
+ me || j(n.currentTime);
1087
+ }, a = () => M(n.duration), o = () => {
1088
+ E(!1), N.current && cancelAnimationFrame(N.current);
1089
+ }, i = () => E(!0), q = () => E(!1);
1090
+ return n.addEventListener("timeupdate", t), n.addEventListener("loadedmetadata", a), n.addEventListener("ended", o), n.addEventListener("play", i), n.addEventListener("pause", q), () => {
1091
+ n.removeEventListener("timeupdate", t), n.removeEventListener("loadedmetadata", a), n.removeEventListener("ended", o), n.removeEventListener("play", i), n.removeEventListener("pause", q);
1422
1092
  };
1423
- }, [fe]), C(() => {
1424
- if (i) {
1425
- const t = I, n = N;
1426
- if (k.current && k.current.pause(), k.current) {
1427
- k.current.pause(), k.current.src = i, k.current.volume = oe ? 0 : n / 100;
1428
- const s = () => {
1429
- t && k.current && k.current.play().catch((l) => console.error("Play failed:", l)), k.current && k.current.removeEventListener("canplay", s);
1093
+ }, [me]), $(() => {
1094
+ if (s) {
1095
+ const n = z, t = D;
1096
+ if (w.current) {
1097
+ w.current.pause(), w.current.src = s, w.current.volume = S ? 0 : t / 100;
1098
+ const a = () => {
1099
+ n && w.current && w.current.play().catch((o) => console.error("Play failed:", o)), w.current && w.current.removeEventListener("canplay", a);
1430
1100
  };
1431
- k.current.addEventListener("canplay", s), k.current.load();
1101
+ w.current.addEventListener("canplay", a), w.current.load();
1432
1102
  }
1433
- H(0), M(!1), Y.current = 0, a.current = 0, d.current = 0, b.current = 0, B.current = 0, D.current = 0, he();
1103
+ j(0), E(!1), Z.current = 0, r.current = 0, d.current = 0, g.current = 0, B.current = 0, _.current = 0, he();
1434
1104
  }
1435
- }, [i]), C(() => {
1436
- k.current && (k.current.volume = oe ? 0 : N / 100);
1437
- }, [N, oe]), C(() => {
1438
- k.current && (k.current.playbackRate = ie);
1439
- }, [ie]), C(() => {
1440
- A.current && (V.current && (V.current.gain.value = F.bass), te.current && (te.current.gain.value = F.mid), Z.current && (Z.current.gain.value = F.treble));
1441
- }, [F]), C(() => {
1442
- J.current = I, $.current && (cancelAnimationFrame($.current), $.current = null), I && g ? (A.current || ge(), we()) : !I && g && qe();
1443
- }, [I, g]), C(() => {
1444
- const t = () => {
1445
- se(!!document.fullscreenElement);
1446
- };
1447
- return document.addEventListener("fullscreenchange", t), () => document.removeEventListener("fullscreenchange", t);
1448
- }, []), C(() => () => {
1449
- $.current && cancelAnimationFrame($.current), A.current && A.current.close().catch((t) => console.warn("AudioContext cleanup error:", t));
1105
+ }, [s]), $(() => {
1106
+ w.current && (w.current.volume = S ? 0 : D / 100);
1107
+ }, [D, S]), $(() => {
1108
+ w.current && (w.current.playbackRate = oe);
1109
+ }, [oe]), $(() => {
1110
+ L.current && (W.current && (W.current.gain.value = Q.bass), re.current && (re.current.gain.value = Q.mid), X.current && (X.current.gain.value = Q.treble));
1111
+ }, [Q]), $(() => {
1112
+ J.current = z, N.current && (cancelAnimationFrame(N.current), N.current = null), z && u ? (L.current || ke(), we()) : !z && u && Ce();
1113
+ }, [z, u]), $(() => {
1114
+ const n = () => se(!!document.fullscreenElement);
1115
+ return document.addEventListener("fullscreenchange", n), () => document.removeEventListener("fullscreenchange", n);
1116
+ }, []), $(() => () => {
1117
+ N.current && cancelAnimationFrame(N.current), L.current && L.current.close().catch((n) => console.warn("AudioContext cleanup error:", n));
1450
1118
  }, []);
1451
- const ge = () => {
1452
- if (!A.current && k.current)
1119
+ const ke = () => {
1120
+ if (!L.current && w.current)
1453
1121
  try {
1454
- const t = window.AudioContext || window.webkitAudioContext;
1455
- if (t) {
1456
- const n = new t();
1457
- A.current = n;
1458
- const s = n.createBiquadFilter();
1459
- s.type = "lowshelf", s.frequency.value = 320, s.gain.value = F.bass;
1460
- const l = n.createBiquadFilter();
1461
- l.type = "peaking", l.frequency.value = 1e3, l.Q.value = 0.5, l.gain.value = F.mid;
1462
- const w = n.createBiquadFilter();
1463
- w.type = "highshelf", w.frequency.value = 3200, w.gain.value = F.treble;
1464
- const L = n.createAnalyser();
1465
- L.fftSize = 2048, L.smoothingTimeConstant = 0.8;
1466
- const ne = n.createMediaElementSource(k.current);
1467
- ne.connect(s), s.connect(l), l.connect(w), w.connect(L), w.connect(n.destination), V.current = s, te.current = l, Z.current = w, X.current = L, me.current = ne;
1122
+ const n = window.AudioContext || window.webkitAudioContext;
1123
+ if (n) {
1124
+ const t = new n();
1125
+ L.current = t;
1126
+ const a = t.createBiquadFilter();
1127
+ a.type = "lowshelf", a.frequency.value = 320, a.gain.value = Q.bass;
1128
+ const o = t.createBiquadFilter();
1129
+ o.type = "peaking", o.frequency.value = 1e3, o.Q.value = 0.5, o.gain.value = Q.mid;
1130
+ const i = t.createBiquadFilter();
1131
+ i.type = "highshelf", i.frequency.value = 3200, i.gain.value = Q.treble;
1132
+ const q = t.createAnalyser();
1133
+ q.fftSize = 2048, q.smoothingTimeConstant = 0.8;
1134
+ const U = t.createMediaElementSource(w.current);
1135
+ U.connect(a), a.connect(o), o.connect(i), i.connect(q), i.connect(t.destination), W.current = a, re.current = o, X.current = i, K.current = q, fe.current = U;
1468
1136
  }
1469
- } catch (t) {
1470
- console.error("Failed to setup audio context:", t);
1137
+ } catch (n) {
1138
+ console.error("Failed to setup audio context:", n);
1471
1139
  }
1472
- }, qe = () => {
1140
+ }, Ce = () => {
1473
1141
  if (J.current) return;
1474
- Y.current *= 0.7, a.current *= 0.7;
1475
- const t = Date.now();
1476
- t - B.current > 1500 && (d.current *= 0.95), t - D.current > 1500 && (b.current *= 0.95), he();
1477
- const n = Math.max(Y.current, a.current), s = Math.max(d.current, b.current);
1478
- n > 0.01 || s > 0.01 ? $.current = requestAnimationFrame(qe) : (J.current || (Y.current = 0, a.current = 0, d.current = 0, b.current = 0, he()), $.current && cancelAnimationFrame($.current), $.current = null);
1142
+ Z.current *= 0.7, r.current *= 0.7;
1143
+ const n = Date.now();
1144
+ n - B.current > 1500 && (d.current *= 0.95), n - _.current > 1500 && (g.current *= 0.95), he();
1145
+ const t = Math.max(Z.current, r.current), a = Math.max(d.current, g.current);
1146
+ t > 0.01 || a > 0.01 ? N.current = requestAnimationFrame(Ce) : (J.current || (Z.current = 0, r.current = 0, d.current = 0, g.current = 0, he()), N.current && cancelAnimationFrame(N.current), N.current = null);
1479
1147
  }, we = () => {
1480
- if (!X.current || !J.current) return;
1481
- const t = X.current.frequencyBinCount, n = new Uint8Array(t);
1482
- X.current.getByteFrequencyData(n);
1483
- let s = 0;
1484
- for (let L = 0; L < t; L++)
1485
- s += n[L];
1486
- let l = s / t / 255;
1487
- l = Math.pow(l, 0.5), Y.current = Y.current * 0.7 + l * 0.3, a.current = a.current * 0.7 + l * 0.3;
1488
- const w = Date.now();
1489
- Y.current > d.current ? (d.current = Y.current, B.current = w) : w - B.current > 1500 && (d.current *= 0.95), a.current > b.current ? (b.current = a.current, D.current = w) : w - D.current > 1500 && (b.current *= 0.95), he(), $.current = requestAnimationFrame(we);
1148
+ if (!K.current || !J.current) return;
1149
+ const n = K.current.frequencyBinCount, t = new Uint8Array(n);
1150
+ K.current.getByteFrequencyData(t);
1151
+ let a = 0;
1152
+ for (let q = 0; q < n; q++) a += t[q];
1153
+ let o = Math.pow(a / n / 255, 0.5);
1154
+ Z.current = Z.current * 0.7 + o * 0.3, r.current = r.current * 0.7 + o * 0.3;
1155
+ const i = Date.now();
1156
+ Z.current > d.current ? (d.current = Z.current, B.current = i) : i - B.current > 1500 && (d.current *= 0.95), r.current > g.current ? (g.current = r.current, _.current = i) : i - _.current > 1500 && (g.current *= 0.95), he(), N.current = requestAnimationFrame(we);
1490
1157
  }, he = () => {
1491
- if (!re.current || !g) return;
1492
- const t = g.color || "#00ff00", n = g.peak || "#ff0000", s = Y.current * 100, l = a.current * 100, w = 100 - d.current * 100, L = 100 - b.current * 100;
1493
- g.side === "top" || g.side === "bottom" ? re.current.innerHTML = `
1494
- <div class="flex flex-col gap-1 h-full justify-center">
1495
- <div class="flex items-center justify-center gap-2">
1496
- <div class="text-xs ${o ? "text-gray-100" : "text-gray-900"} opacity-80 w-4 text-center">L</div>
1497
- <div class="relative flex-1 h-3 bg-black/40 rounded-full overflow-hidden flex justify-end">
1498
- <div class="h-full rounded-l-full transition-all duration-75" style="width: ${s}%; background: ${t};"></div>
1499
- ${d.current > 0.1 ? `<div class="absolute top-0 w-1 h-full transition-all duration-100" style="right: ${d.current * 100}%; background: ${n};"></div>` : ""}
1158
+ if (!T.current || !u) return;
1159
+ const n = u.color || "#00ff00", t = u.peak || "#ff0000", a = Z.current * 100, o = r.current * 100, i = 100 - d.current * 100, q = 100 - g.current * 100;
1160
+ u.side === "top" || u.side === "bottom" ? T.current.innerHTML = `
1161
+ <div style="display:flex;flex-direction:column;gap:0.25rem;height:100%;justify-content:center;">
1162
+ <div style="display:flex;align-items:center;justify-content:center;gap:0.5rem;">
1163
+ <div style="font-size:0.75rem;opacity:0.8;width:1rem;text-align:center;color:${h ? "#f3f4f6" : "#111827"}">L</div>
1164
+ <div style="position:relative;flex:1;height:0.75rem;background:rgba(0,0,0,0.4);border-radius:9999px;overflow:hidden;display:flex;justify-content:flex-end;">
1165
+ <div style="height:100%;border-radius:9999px 0 0 9999px;transition:width 75ms;width:${a}%;background:${n};"></div>
1166
+ ${d.current > 0.1 ? `<div style="position:absolute;top:0;width:0.25rem;height:100%;transition:right 100ms;right:${d.current * 100}%;background:${t};"></div>` : ""}
1500
1167
  </div>
1501
- <div class="w-px h-4 bg-white/20"></div>
1502
- <div class="relative flex-1 h-3 bg-black/40 rounded-full overflow-hidden flex justify-start">
1503
- <div class="h-full rounded-r-full transition-all duration-75" style="width: ${l}%; background: ${t};"></div>
1504
- ${b.current > 0.1 ? `<div class="absolute top-0 w-1 h-full transition-all duration-100" style="left: ${b.current * 100}%; background: ${n};"></div>` : ""}
1168
+ <div style="width:1px;height:1rem;background:rgba(255,255,255,0.2)"></div>
1169
+ <div style="position:relative;flex:1;height:0.75rem;background:rgba(0,0,0,0.4);border-radius:9999px;overflow:hidden;display:flex;justify-content:flex-start;">
1170
+ <div style="height:100%;border-radius:0 9999px 9999px 0;transition:width 75ms;width:${o}%;background:${n};"></div>
1171
+ ${g.current > 0.1 ? `<div style="position:absolute;top:0;width:0.25rem;height:100%;transition:left 100ms;left:${g.current * 100}%;background:${t};"></div>` : ""}
1505
1172
  </div>
1506
- <div class="text-xs ${o ? "text-gray-100" : "text-gray-900"} opacity-80 w-4 text-center">R</div>
1173
+ <div style="font-size:0.75rem;opacity:0.8;width:1rem;text-align:center;color:${h ? "#f3f4f6" : "#111827"}">R</div>
1507
1174
  </div>
1508
1175
  </div>
1509
- ` : re.current.innerHTML = `
1510
- <div class="flex gap-2 h-full">
1511
- <div class="flex-1 flex flex-col">
1512
- <div class="text-xs text-white opacity-70 text-center mb-1">L</div>
1513
- <div class="flex-1 relative flex flex-col justify-end bg-black/30 rounded-lg overflow-hidden">
1514
- <div class="rounded-t transition-all duration-75" style="height: ${s}%; background: ${t};">
1515
- ${d.current > 0.1 ? `<div class="absolute w-full h-1 transition-all duration-100" style="top: ${w}%; background: ${n};"></div>` : ""}
1176
+ ` : T.current.innerHTML = `
1177
+ <div style="display:flex;gap:0.5rem;height:100%;">
1178
+ <div style="flex:1;display:flex;flex-direction:column;">
1179
+ <div style="font-size:0.75rem;color:white;opacity:0.7;text-align:center;margin-bottom:0.25rem;">L</div>
1180
+ <div style="flex:1;position:relative;display:flex;flex-direction:column;justify-content:flex-end;background:rgba(0,0,0,0.3);border-radius:0.5rem;overflow:hidden;">
1181
+ <div style="border-radius:0.25rem 0.25rem 0 0;transition:height 75ms;height:${a}%;background:${n};">
1182
+ ${d.current > 0.1 ? `<div style="position:absolute;width:100%;height:0.25rem;transition:top 100ms;top:${i}%;background:${t};"></div>` : ""}
1516
1183
  </div>
1517
1184
  </div>
1518
1185
  </div>
1519
- <div class="flex-1 flex flex-col">
1520
- <div class="text-xs text-white opacity-70 text-center mb-1">R</div>
1521
- <div class="flex-1 relative flex flex-col justify-end bg-black/30 rounded-lg overflow-hidden">
1522
- <div class="rounded-t transition-all duration-75" style="height: ${l}%; background: ${t};">
1523
- ${b.current > 0.1 ? `<div class="absolute w-full h-1 transition-all duration-100" style="top: ${L}%; background: ${n};"></div>` : ""}
1186
+ <div style="flex:1;display:flex;flex-direction:column;">
1187
+ <div style="font-size:0.75rem;color:white;opacity:0.7;text-align:center;margin-bottom:0.25rem;">R</div>
1188
+ <div style="flex:1;position:relative;display:flex;flex-direction:column;justify-content:flex-end;background:rgba(0,0,0,0.3);border-radius:0.5rem;overflow:hidden;">
1189
+ <div style="border-radius:0.25rem 0.25rem 0 0;transition:height 75ms;height:${o}%;background:${n};">
1190
+ ${g.current > 0.1 ? `<div style="position:absolute;width:100%;height:0.25rem;transition:top 100ms;top:${q}%;background:${t};"></div>` : ""}
1191
+ </div>
1524
1192
  </div>
1525
1193
  </div>
1526
1194
  </div>
1527
1195
  `;
1528
- }, ke = () => {
1529
- !k.current || !i || (I ? k.current.pause() : (A.current && A.current.state === "suspended" && A.current.resume(), k.current.play().catch((t) => console.error("Play failed:", t))));
1530
- }, pe = () => {
1531
- k.current && (k.current.pause(), k.current.currentTime = 0, M(!1), H(0), Y.current = 0, a.current = 0, d.current = 0, b.current = 0, he());
1532
- }, Ee = (t) => {
1533
- const s = parseFloat(t.target.value) / 100 * z;
1534
- H(s), k.current && !fe && (k.current.currentTime = s);
1535
- }, Te = () => Q(!0), Le = () => {
1536
- k.current && (k.current.currentTime = _), Q(!1);
1537
- }, Pe = (t) => {
1538
- const n = parseInt(t.target.value);
1539
- E(n), ae(n === 0);
1540
- }, Me = (t) => {
1541
- ue(parseFloat(t.target.value));
1542
- }, je = () => ae(!oe), ze = () => {
1543
- u.current && (document.fullscreenElement ? document.exitFullscreen() : u.current.requestFullscreen().catch((t) => console.error("Fullscreen failed:", t)));
1544
- }, Ne = (t, n) => {
1545
- j((s) => ({
1546
- ...s,
1547
- [t]: n
1548
- })), A.current && (t === "bass" && V.current && (V.current.gain.value = n), t === "mid" && te.current && (te.current.gain.value = n), t === "treble" && Z.current && (Z.current.gain.value = n));
1549
- }, Se = () => {
1550
- j({ bass: 0, mid: 0, treble: 0 });
1551
- }, ve = (t) => {
1552
- if (isNaN(t)) return "0:00";
1553
- const n = Math.floor(t / 60), s = Math.floor(t % 60);
1554
- return `${n}:${s.toString().padStart(2, "0")}`;
1196
+ }, Ne = () => {
1197
+ !w.current || !s || (z ? w.current.pause() : (L.current && L.current.state === "suspended" && L.current.resume(), w.current.play().catch((n) => console.error("Play failed:", n))));
1198
+ }, ve = () => {
1199
+ w.current && (w.current.pause(), w.current.currentTime = 0, E(!1), j(0), Z.current = 0, r.current = 0, d.current = 0, g.current = 0, he());
1200
+ }, xe = (n) => {
1201
+ const a = parseFloat(n.target.value) / 100 * P;
1202
+ j(a), w.current && !me && (w.current.currentTime = a);
1203
+ }, Ee = () => V(!0), Le = () => {
1204
+ w.current && (w.current.currentTime = H), V(!1);
1205
+ }, Ae = (n) => {
1206
+ const t = parseInt(n.target.value);
1207
+ k(t), ae(t === 0);
1208
+ }, Re = (n) => ue(parseFloat(n.target.value)), ze = () => ae(!S), Se = () => {
1209
+ p.current && (document.fullscreenElement ? document.exitFullscreen() : p.current.requestFullscreen().catch((n) => console.error("Fullscreen failed:", n)));
1210
+ }, Be = (n, t) => {
1211
+ Y((a) => ({ ...a, [n]: t })), L.current && (n === "bass" && W.current && (W.current.gain.value = t), n === "mid" && re.current && (re.current.gain.value = t), n === "treble" && X.current && (X.current.gain.value = t));
1212
+ }, je = () => Y({ bass: 0, mid: 0, treble: 0 }), Te = (n) => {
1213
+ if (isNaN(n)) return "0:00";
1214
+ const t = Math.floor(n / 60), a = Math.floor(n % 60);
1215
+ return `${t}:${a.toString().padStart(2, "0")}`;
1555
1216
  };
1556
- if (C(() => {
1557
- (h && !I || P) && ke();
1558
- }, [m]), le && le.length > 0)
1559
- return le.map((t, n) => /* @__PURE__ */ r("div", { className: "text-red-500 text-sm bg-red-50 p-3 rounded mb-4 border border-red-300", children: [
1560
- /* @__PURE__ */ r("strong", { children: [
1561
- t[0],
1217
+ if ($(() => {
1218
+ (A && !z || x) && Ne();
1219
+ }, [f]), ie && ie.length > 0)
1220
+ return /* @__PURE__ */ e(Ve, { children: ie.map((n, t) => /* @__PURE__ */ c("div", { className: "ecp-video-error", children: [
1221
+ /* @__PURE__ */ c("strong", { children: [
1222
+ n[0],
1562
1223
  ":"
1563
1224
  ] }),
1564
1225
  " ",
1565
- t[1]
1566
- ] }, n));
1567
- const ye = g ? g.side : null, $e = ye === "top" || ye === "bottom";
1226
+ n[1]
1227
+ ] }, t)) });
1228
+ const be = u ? u.side : null, qe = be === "top" || be === "bottom";
1568
1229
  return /* @__PURE__ */ e(
1569
1230
  "div",
1570
1231
  {
1571
- ref: u,
1572
- className: `rounded-xl overflow-hidden transition-all duration-300 ${G ? "fixed inset-0 z-[9999] flex flex-col h-screen w-screen bg-black" : "relative"}`,
1573
- style: { backgroundColor: h || v ? void 0 : o ? "#49494937" : "white" },
1574
- children: /* @__PURE__ */ r("div", { style: { background: h || v ? void 0 : o ? "#1a1a1ab0" : "#f5f5f5", height: G ? "100%" : "auto" }, className: `${h || v ? "" : "p-4"} ${G ? "flex flex-col flex-1" : ""}`, children: [
1575
- m.videoName && !G && /* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e("div", { className: `${o ? "text-gray-100" : "text-gray-700"} font-medium`, children: c }) }),
1576
- /* @__PURE__ */ r("div", { className: `relative ${$e ? "flex flex-col gap-3" : "flex gap-3"} ${G ? "flex-1 min-h-0" : "mb-4"}`, children: [
1577
- g && ye === "top" && /* @__PURE__ */ e("div", { className: "w-full h-12", ref: re }),
1578
- /* @__PURE__ */ r("div", { className: `flex ${!$e && "flex-1"} gap-3`, children: [
1579
- g && ye === "left" && /* @__PURE__ */ e("div", { className: "w-12 bg-black/50 rounded-lg p-1", ref: re }),
1580
- /* @__PURE__ */ r("div", { className: `flex-1 ${o ? "bg-black/70" : "bg-white/70"} rounded-lg overflow-hidden relative`, children: [
1581
- /* @__PURE__ */ r(
1582
- "video",
1583
- {
1584
- ref: k,
1585
- className: "w-full h-full object-contain",
1586
- poster: q || void 0,
1587
- children: [
1588
- i && /* @__PURE__ */ e("source", { src: i }),
1232
+ ref: p,
1233
+ className: `ecp-video-wrapper${ee ? " ecp-video-wrapper--fullscreen" : ""}`,
1234
+ style: { backgroundColor: A || O ? void 0 : h ? "#49494937" : "white" },
1235
+ children: /* @__PURE__ */ c(
1236
+ "div",
1237
+ {
1238
+ className: `ecp-video-inner${ee ? " ecp-video-inner--fullscreen" : ""}${O ? "" : " ecp-video-inner--padded"}`,
1239
+ style: { background: A || O ? void 0 : h ? "#1a1a1ab0" : "#f5f5f5" },
1240
+ children: [
1241
+ f.videoName && !ee && /* @__PURE__ */ e("div", { className: `ecp-video-name${h ? " ecp-video-name--dark" : " ecp-video-name--light"}`, children: l }),
1242
+ /* @__PURE__ */ c("div", { className: `ecp-video-layout${qe ? " ecp-video-layout--col" : " ecp-video-layout--row"}${ee ? " ecp-video-layout--fullscreen" : ""}`, children: [
1243
+ u && be === "top" && /* @__PURE__ */ e("div", { className: "ecp-video-vu-top", ref: T }),
1244
+ /* @__PURE__ */ c("div", { style: { display: "flex", flex: qe ? void 0 : 1, gap: "0.75rem" }, children: [
1245
+ u && be === "left" && /* @__PURE__ */ e("div", { className: "ecp-video-vu-side", ref: T }),
1246
+ /* @__PURE__ */ c("div", { className: `ecp-video-el-wrap${h ? " ecp-video-el-wrap--dark" : " ecp-video-el-wrap--light"}`, children: [
1247
+ /* @__PURE__ */ c("video", { ref: w, className: "ecp-video-el", poster: C || void 0, children: [
1248
+ s && /* @__PURE__ */ e("source", { src: s }),
1589
1249
  "Your browser does not support the video tag."
1590
- ]
1591
- }
1592
- ),
1593
- de && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex flex-col w-full justify-center z-10 rounded-lg p-4 shadow-sm transition-all duration-300", children: /* @__PURE__ */ r("div", { className: `max-w-[600px] w-full mx-auto flex flex-col justify-center z-10 ${o ? "bg-black/70" : "bg-white/80"} rounded-lg p-4 shadow-sm transition-all duration-300`, children: [
1594
- /* @__PURE__ */ e("h3", { className: `text-sm font-medium mb-4 ${o ? "text-gray-200" : "text-gray-700"}`, children: "Equalizer" }),
1595
- /* @__PURE__ */ r("div", { className: "space-y-4", children: [
1596
- /* @__PURE__ */ r("div", { children: [
1597
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
1598
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-300" : "text-gray-600"}`, children: "Bass" }),
1599
- /* @__PURE__ */ r("span", { className: `text-xs ${o ? "text-gray-300" : "text-gray-600"}`, children: [
1600
- F.bass,
1601
- " dB"
1602
- ] })
1603
- ] }),
1604
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1605
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
1606
- /* @__PURE__ */ e(
1607
- "input",
1608
- {
1609
- type: "range",
1610
- min: "-20",
1611
- max: "20",
1612
- value: F.bass,
1613
- onChange: (t) => Ne("bass", parseInt(t.target.value)),
1614
- className: "flex-1 h-6 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
1615
- style: {
1616
- background: `linear-gradient(to right, ${T} ${(F.bass + 20) / 40 * 100}%, #e5e7eb ${(F.bass + 20) / 40 * 100}%)`
1617
- }
1618
- }
1619
- ),
1620
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
1621
- ] })
1622
1250
  ] }),
1623
- /* @__PURE__ */ r("div", { children: [
1624
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
1625
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-300" : "text-gray-600"}`, children: "Mid" }),
1626
- /* @__PURE__ */ r("span", { className: `text-xs ${o ? "text-gray-300" : "text-gray-600"}`, children: [
1627
- F.mid,
1628
- " dB"
1629
- ] })
1630
- ] }),
1631
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1632
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
1633
- /* @__PURE__ */ e(
1634
- "input",
1635
- {
1636
- type: "range",
1637
- min: "-20",
1638
- max: "20",
1639
- value: F.mid,
1640
- onChange: (t) => Ne("mid", parseInt(t.target.value)),
1641
- className: "flex-1 h-6 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
1642
- style: {
1643
- background: `linear-gradient(to right, ${T} ${(F.mid + 20) / 40 * 100}%, #e5e7eb ${(F.mid + 20) / 40 * 100}%)`
1251
+ de && /* @__PURE__ */ e("div", { className: "ecp-video-eq-overlay", children: /* @__PURE__ */ c("div", { className: `ecp-video-eq-panel${h ? " ecp-video-eq-panel--dark" : " ecp-video-eq-panel--light"}`, children: [
1252
+ /* @__PURE__ */ e("h3", { className: `ecp-video-eq-title${h ? " ecp-video-eq-title--dark" : " ecp-video-eq-title--light"}`, children: "Equalizer" }),
1253
+ /* @__PURE__ */ e("div", { className: "ecp-video-eq-bands", children: ["bass", "mid", "treble"].map((n) => /* @__PURE__ */ c("div", { children: [
1254
+ /* @__PURE__ */ c("div", { className: "ecp-video-eq-band-header", children: [
1255
+ /* @__PURE__ */ e("span", { className: h ? "ecp-video-eq-label--dark" : "ecp-video-eq-label--light", children: n.charAt(0).toUpperCase() + n.slice(1) }),
1256
+ /* @__PURE__ */ c("span", { className: h ? "ecp-video-eq-label--dark" : "ecp-video-eq-label--light", children: [
1257
+ Q[n],
1258
+ " dB"
1259
+ ] })
1260
+ ] }),
1261
+ /* @__PURE__ */ c("div", { className: "ecp-video-eq-range-row", children: [
1262
+ /* @__PURE__ */ e("span", { className: h ? "ecp-video-eq-bound--dark" : "ecp-video-eq-bound--light", children: "-20" }),
1263
+ /* @__PURE__ */ e(
1264
+ "input",
1265
+ {
1266
+ type: "range",
1267
+ min: "-20",
1268
+ max: "20",
1269
+ value: Q[n],
1270
+ onChange: (t) => Be(n, parseInt(t.target.value)),
1271
+ className: "ecp-video-eq-slider",
1272
+ style: {
1273
+ background: `linear-gradient(to right, ${F} ${(Q[n] + 20) / 40 * 100}%, #e5e7eb ${(Q[n] + 20) / 40 * 100}%)`,
1274
+ "--thumb-color": F
1275
+ }
1644
1276
  }
1645
- }
1646
- ),
1647
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
1648
- ] })
1649
- ] }),
1650
- /* @__PURE__ */ r("div", { children: [
1651
- /* @__PURE__ */ r("div", { className: "flex justify-between mb-1", children: [
1652
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-300" : "text-gray-600"}`, children: "Treble" }),
1653
- /* @__PURE__ */ r("span", { className: `text-xs ${o ? "text-gray-300" : "text-gray-600"}`, children: [
1654
- F.treble,
1655
- " dB"
1277
+ ),
1278
+ /* @__PURE__ */ e("span", { className: h ? "ecp-video-eq-bound--dark" : "ecp-video-eq-bound--light", children: "+20" })
1656
1279
  ] })
1657
- ] }),
1658
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1659
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-400" : "text-gray-500"}`, children: "-20" }),
1660
- /* @__PURE__ */ e(
1661
- "input",
1662
- {
1663
- type: "range",
1664
- min: "-20",
1665
- max: "20",
1666
- value: F.treble,
1667
- onChange: (t) => Ne("treble", parseInt(t.target.value)),
1668
- className: "flex-1 h-6 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",
1669
- style: {
1670
- background: `linear-gradient(to right, ${T} ${(F.treble + 20) / 40 * 100}%, #e5e7eb ${(F.treble + 20) / 40 * 100}%)`
1671
- }
1672
- }
1673
- ),
1674
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-400" : "text-gray-500"}`, children: "+20" })
1280
+ ] }, n)) }),
1281
+ /* @__PURE__ */ c("div", { className: "ecp-video-eq-footer", children: [
1282
+ /* @__PURE__ */ e("button", { onClick: je, className: `ecp-video-eq-footer-btn${h ? " ecp-video-eq-footer-btn--dark" : " ecp-video-eq-footer-btn--light"}`, children: "Reset" }),
1283
+ /* @__PURE__ */ e("button", { onClick: () => R(!1), className: `ecp-video-eq-footer-btn${h ? " ecp-video-eq-footer-btn--dark" : " ecp-video-eq-footer-btn--light"}`, style: { marginLeft: "0.5rem" }, children: "Close" })
1675
1284
  ] })
1676
- ] })
1285
+ ] }) })
1677
1286
  ] }),
1678
- /* @__PURE__ */ r("div", { className: "flex justify-between mt-6", children: [
1679
- /* @__PURE__ */ e(
1680
- "button",
1681
- {
1682
- onClick: Se,
1683
- className: `px-3 py-1 rounded text-xs ${o ? "bg-gray-700 text-gray-200 hover:bg-gray-600" : "bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,
1684
- children: "Reset"
1685
- }
1686
- ),
1687
- /* @__PURE__ */ e(
1688
- "button",
1689
- {
1690
- onClick: () => R(!1),
1691
- className: `ml-2 px-3 py-1 rounded text-xs ${o ? "bg-gray-700 text-gray-200 hover:bg-gray-600" : "bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,
1692
- children: "Close"
1693
- }
1694
- )
1695
- ] })
1696
- ] }) })
1287
+ u && be === "right" && /* @__PURE__ */ e("div", { className: "ecp-video-vu-side", ref: T })
1288
+ ] }),
1289
+ u && be === "bottom" && /* @__PURE__ */ e("div", { className: "ecp-video-vu-bottom", ref: T })
1697
1290
  ] }),
1698
- g && ye === "right" && /* @__PURE__ */ e("div", { className: "w-12 bg-black/50 rounded-lg p-1", ref: re })
1699
- ] }),
1700
- g && ye === "bottom" && /* @__PURE__ */ e("div", { className: "w-full h-12", ref: re })
1701
- ] }),
1702
- m.seekbar && /* @__PURE__ */ e("div", { className: `mb-4 ${G ? "mt-3" : ""}`, children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1703
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-100" : "text-gray-600"} font-mono w-12`, children: ve(_) }),
1704
- /* @__PURE__ */ e(
1705
- "input",
1706
- {
1707
- type: "range",
1708
- min: "0",
1709
- max: "100",
1710
- value: z > 0 ? _ / z * 100 : 0,
1711
- onChange: Ee,
1712
- onMouseDown: Te,
1713
- onMouseUp: Le,
1714
- onTouchStart: Te,
1715
- onTouchEnd: Le,
1716
- disabled: !i,
1717
- className: "flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",
1718
- style: {
1719
- background: i && z > 0 ? `linear-gradient(to right, ${T} ${_ / z * 100}%, #e5e7eb ${_ / z * 100}%)` : "#e5e7eb"
1720
- }
1721
- }
1722
- ),
1723
- /* @__PURE__ */ e("span", { className: `text-xs ${o ? "text-gray-100" : "text-gray-600"} font-mono w-12 text-right`, children: ve(z) })
1724
- ] }) }),
1725
- /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3", children: [
1726
- m.play && /* @__PURE__ */ r(
1727
- "button",
1728
- {
1729
- onClick: ke,
1730
- disabled: !i,
1731
- style: { backgroundColor: T },
1732
- className: `${ee > 400 ? " px-4 py-2" : "px-3 py-5"} rounded-full text-sm font-medium text-white hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all`,
1733
- children: [
1734
- /* @__PURE__ */ r("div", { className: "relative w-4 flex items-center", children: [
1735
- /* @__PURE__ */ e(Re, { size: 16, className: `${I ? "" : "scale-0 translate-y-10"} transition-all absolute` }),
1736
- /* @__PURE__ */ e(Fe, { size: 16, className: `${I ? "scale-0 -translate-y-10" : ""} transition-all absolute` })
1737
- ] }),
1738
- ee > 400 && (I ? "Pause" : "Play")
1739
- ]
1740
- }
1741
- ),
1742
- m.stop && /* @__PURE__ */ e(
1743
- "button",
1744
- {
1745
- onClick: pe,
1746
- disabled: !i,
1747
- className: `${o ? "bg-gray-100 text-black hover:bg-gray-300" : "bg-gray-700 text-white hover:bg-gray-800"} px-3 py-3 rounded-full text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all`,
1748
- children: /* @__PURE__ */ e(Ue, { size: 16 })
1749
- }
1750
- ),
1751
- m.fullscreen && /* @__PURE__ */ r(
1752
- "button",
1753
- {
1754
- onClick: ze,
1755
- className: `${ee < 800 ? "px-3 py-3" : "px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${o ? "bg-gray-100 text-black hover:bg-gray-300" : "bg-gray-700 text-white hover:bg-gray-800"}`,
1756
- children: [
1757
- G ? /* @__PURE__ */ e(et, { size: 16 }) : /* @__PURE__ */ e(Ye, { size: 16 }),
1758
- /* @__PURE__ */ e("span", { style: { display: ee < 800 ? "none" : "block" }, children: G ? "Exit" : "Full" })
1759
- ]
1760
- }
1761
- ),
1762
- m.equalizer && /* @__PURE__ */ r(
1763
- "button",
1764
- {
1765
- onClick: () => R(!de),
1766
- disabled: !i,
1767
- className: `${ee < 700 ? "px-3 py-3" : "px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${de ? "text-white" : "bg-gray-100 text-gray-700 hover:bg-gray-300"} disabled:opacity-40 disabled:cursor-not-allowed`,
1768
- style: de ? { backgroundColor: T } : {},
1769
- children: [
1770
- /* @__PURE__ */ e(Ae, { size: 16 }),
1771
- /* @__PURE__ */ e("span", { style: { display: ee < 700 ? "none" : "block" }, children: "EQ" })
1772
- ]
1773
- }
1774
- ),
1775
- m.speed && /* @__PURE__ */ e("div", { className: "flex items-center", children: /* @__PURE__ */ r(
1776
- "select",
1777
- {
1778
- value: ie,
1779
- onChange: Me,
1780
- className: `rounded-full text-sm font-medium border-none outline-none cursor-pointer transition-all bg-transparent ${o ? "text-gray-200" : "text-gray-800"}`,
1781
- children: [
1782
- /* @__PURE__ */ e("option", { value: "0.5", className: o ? "bg-gray-800 text-gray-100" : "bg-gray-100 text-gray-800", children: "0.5x" }),
1783
- /* @__PURE__ */ e("option", { value: "0.75", className: o ? "bg-gray-800 text-gray-100" : "bg-gray-100 text-gray-800", children: "0.75x" }),
1784
- /* @__PURE__ */ e("option", { value: "1", className: o ? "bg-gray-800 text-gray-100" : "bg-gray-100 text-gray-800", children: "1x" }),
1785
- /* @__PURE__ */ e("option", { value: "1.25", className: o ? "bg-gray-800 text-gray-100" : "bg-gray-100 text-gray-800", children: "1.25x" }),
1786
- /* @__PURE__ */ e("option", { value: "1.5", className: o ? "bg-gray-800 text-gray-100" : "bg-gray-100 text-gray-800", children: "1.5x" }),
1787
- /* @__PURE__ */ e("option", { value: "2", className: o ? "bg-gray-800 text-gray-100" : "bg-gray-100 text-gray-800", children: "2x" })
1788
- ]
1789
- }
1790
- ) }),
1791
- m.volume && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 md:gap-3 ml-auto", children: [
1792
- /* @__PURE__ */ e(
1793
- "button",
1794
- {
1795
- onClick: je,
1796
- className: "p-2 rounded-lg hover:bg-gray-100 transition-all",
1797
- children: oe || N === 0 ? /* @__PURE__ */ e(De, { size: 20, className: o ? "text-gray-100" : "text-gray-600" }) : /* @__PURE__ */ e(He, { size: 20, className: o ? "text-gray-100" : "text-gray-600" })
1798
- }
1799
- ),
1800
- /* @__PURE__ */ e(
1801
- "input",
1802
- {
1803
- type: "range",
1804
- min: "0",
1805
- max: "100",
1806
- value: N,
1807
- onChange: Pe,
1808
- className: "hide-for-xs w-24 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer",
1809
- style: {
1810
- background: `linear-gradient(to right, ${T} ${N}%, #e5e7eb ${N}%)`,
1811
- display: ee < 460 ? "none" : "block"
1291
+ f.seekbar && /* @__PURE__ */ e("div", { className: `ecp-video-seekbar${ee ? " ecp-video-seekbar--fullscreen" : ""}`, children: /* @__PURE__ */ c("div", { className: "ecp-video-seekbar-row", children: [
1292
+ /* @__PURE__ */ e("span", { className: `ecp-video-time${h ? " ecp-video-time--dark" : " ecp-video-time--light"}`, children: Te(H) }),
1293
+ /* @__PURE__ */ e(
1294
+ "input",
1295
+ {
1296
+ type: "range",
1297
+ min: "0",
1298
+ max: "100",
1299
+ value: P > 0 ? H / P * 100 : 0,
1300
+ onChange: xe,
1301
+ onMouseDown: Ee,
1302
+ onMouseUp: Le,
1303
+ onTouchStart: Ee,
1304
+ onTouchEnd: Le,
1305
+ disabled: !s,
1306
+ className: "ecp-video-seek-input",
1307
+ style: {
1308
+ background: s && P > 0 ? `linear-gradient(to right, ${F} ${H / P * 100}%, #e5e7eb ${H / P * 100}%)` : "#e5e7eb",
1309
+ "--thumb-color": F
1310
+ }
1812
1311
  }
1813
- }
1814
- ),
1815
- /* @__PURE__ */ r("span", { style: { display: ee < 800 ? "none" : "block" }, className: `text-xs ${o ? "text-gray-100" : "text-gray-700"} font-mono w-10 text-right`, children: [
1816
- N,
1817
- "%"
1818
- ] })
1819
- ] })
1820
- ] }),
1821
- /* @__PURE__ */ e("style", { children: `
1822
- input[type="range"]::-webkit-slider-thumb {
1823
- -webkit-appearance: none;
1824
- appearance: none;
1825
- width: 16px;
1826
- height: 16px;
1827
- border-radius: 50%;
1828
- background: ${T};
1829
- cursor: pointer;
1830
- border: 2px solid white;
1831
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
1832
- }
1833
-
1834
- input[type="range"]::-moz-range-thumb {
1835
- width: 16px;
1836
- height: 16px;
1837
- border-radius: 50%;
1838
- background: ${T};
1839
- cursor: pointer;
1840
- border: 2px solid white;
1841
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
1842
- }
1843
- input[type="range"].eq-slider::-webkit-slider-thumb {
1844
- -webkit-appearance: none;
1845
- appearance: none;
1846
- width: 0;
1847
- height: 0;
1848
- background: transparent;
1849
- border: none;
1850
- box-shadow: none;
1851
- }
1852
- input[type="range"].eq-slider::-moz-range-thumb {
1853
- width: 0;
1854
- height: 0;
1855
- background: transparent;
1856
- border: none;
1857
- box-shadow: none;
1858
- }
1859
- .hide-for-xs {
1860
- display: flex;
1861
- }
1862
- @media (max-width: 480px) {
1863
- .hide-for-xs {
1864
- display: none;
1865
- }
1312
+ ),
1313
+ /* @__PURE__ */ e("span", { className: `ecp-video-time ecp-video-time--right${h ? " ecp-video-time--dark" : " ecp-video-time--light"}`, children: Te(P) })
1314
+ ] }) }),
1315
+ /* @__PURE__ */ c("div", { className: "ecp-video-controls", children: [
1316
+ f.play && /* @__PURE__ */ c(
1317
+ "button",
1318
+ {
1319
+ onClick: Ne,
1320
+ disabled: !s,
1321
+ className: `ecp-video-play-btn${te <= 400 ? " ecp-video-play-btn--compact" : ""}`,
1322
+ style: { backgroundColor: F },
1323
+ children: [
1324
+ /* @__PURE__ */ c("div", { className: "ecp-video-play-icon-wrap", children: [
1325
+ /* @__PURE__ */ e(Pe, { size: 16, style: { position: "absolute", transform: z ? void 0 : "scale(0) translateY(2.5rem)", transition: "all 150ms" } }),
1326
+ /* @__PURE__ */ e(Me, { size: 16, style: { position: "absolute", transform: z ? "scale(0) translateY(-2.5rem)" : void 0, transition: "all 150ms" } })
1327
+ ] }),
1328
+ te > 400 && (z ? "Pause" : "Play")
1329
+ ]
1330
+ }
1331
+ ),
1332
+ f.stop && /* @__PURE__ */ e("button", { onClick: ve, disabled: !s, className: `ecp-video-stop-btn${h ? " ecp-video-stop-btn--dark" : " ecp-video-stop-btn--light"}`, children: /* @__PURE__ */ e(Ge, { size: 16 }) }),
1333
+ f.fullscreen && /* @__PURE__ */ c(
1334
+ "button",
1335
+ {
1336
+ onClick: Se,
1337
+ className: `ecp-video-fullscreen-btn${h ? " ecp-video-fullscreen-btn--dark" : " ecp-video-fullscreen-btn--light"}${te >= 800 ? " ecp-video-fullscreen-btn--wide" : ""}`,
1338
+ children: [
1339
+ ee ? /* @__PURE__ */ e(at, { size: 16 }) : /* @__PURE__ */ e(rt, { size: 16 }),
1340
+ /* @__PURE__ */ e("span", { style: { display: te < 800 ? "none" : "block" }, children: ee ? "Exit" : "Full" })
1341
+ ]
1342
+ }
1343
+ ),
1344
+ f.equalizer && /* @__PURE__ */ c(
1345
+ "button",
1346
+ {
1347
+ onClick: () => R(!de),
1348
+ disabled: !s,
1349
+ className: `ecp-video-eq-toggle-btn${de ? " ecp-video-eq-toggle-btn--on" : " ecp-video-eq-toggle-btn--off"}${te >= 700 ? " ecp-video-eq-toggle-btn--wide" : ""}`,
1350
+ style: de ? { backgroundColor: F } : {},
1351
+ children: [
1352
+ /* @__PURE__ */ e(Fe, { size: 16 }),
1353
+ /* @__PURE__ */ e("span", { style: { display: te < 700 ? "none" : "block" }, children: "EQ" })
1354
+ ]
1355
+ }
1356
+ ),
1357
+ f.speed && /* @__PURE__ */ e("div", { className: "ecp-video-speed-wrap", children: /* @__PURE__ */ e("select", { value: oe, onChange: Re, className: `ecp-video-speed-select${h ? " ecp-video-speed-select--dark" : " ecp-video-speed-select--light"}`, children: ["0.5", "0.75", "1", "1.25", "1.5", "2"].map((n) => /* @__PURE__ */ c("option", { value: n, className: h ? "ecp-video-speed-option--dark" : "ecp-video-speed-option--light", children: [
1358
+ n,
1359
+ "x"
1360
+ ] }, n)) }) }),
1361
+ f.volume && /* @__PURE__ */ c("div", { className: "ecp-video-volume", children: [
1362
+ /* @__PURE__ */ e("button", { onClick: ze, className: "ecp-video-mute-btn", children: S || D === 0 ? /* @__PURE__ */ e(_e, { size: 20, className: h ? "ecp-video-mute-icon--dark" : "ecp-video-mute-icon--light" }) : /* @__PURE__ */ e(De, { size: 20, className: h ? "ecp-video-mute-icon--dark" : "ecp-video-mute-icon--light" }) }),
1363
+ /* @__PURE__ */ e(
1364
+ "input",
1365
+ {
1366
+ type: "range",
1367
+ min: "0",
1368
+ max: "100",
1369
+ value: D,
1370
+ onChange: Ae,
1371
+ className: "ecp-video-vol-slider",
1372
+ style: {
1373
+ background: `linear-gradient(to right, ${F} ${D}%, #e5e7eb ${D}%)`,
1374
+ "--thumb-color": F,
1375
+ display: te < 460 ? "none" : "block"
1866
1376
  }
1867
- ` })
1868
- ] })
1377
+ }
1378
+ ),
1379
+ /* @__PURE__ */ c(
1380
+ "span",
1381
+ {
1382
+ className: `ecp-video-vol-pct${h ? " ecp-video-vol-pct--dark" : " ecp-video-vol-pct--light"}`,
1383
+ style: { display: te < 800 ? "none" : "block" },
1384
+ children: [
1385
+ D,
1386
+ "%"
1387
+ ]
1388
+ }
1389
+ )
1390
+ ] })
1391
+ ] })
1392
+ ]
1393
+ }
1394
+ )
1869
1395
  }
1870
1396
  );
1871
1397
  }
1872
- function bt() {
1873
- const [i, c] = f(null), [g, p] = f("No track loaded"), [q, m] = f("purple"), [x, v] = f(!1), [P, T] = f(!1), [U, I] = f("light"), M = y(null);
1874
- return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center p-4 md:p-8", style: { backgroundColor: U === "dark" ? "#222" : "white" }, children: /* @__PURE__ */ r("div", { className: "w-full h-full md:h-auto md:max-w-4xl", children: [
1875
- x && /* @__PURE__ */ e(ut, { theme: q, setTheme: m, close: () => v(!1) }),
1876
- /* @__PURE__ */ r("div", { className: "container-glass rounded-xl p-8", children: [
1877
- /* @__PURE__ */ r("div", { className: "mb-6 flex justify-between items-start", children: [
1878
- /* @__PURE__ */ r("div", { children: [
1879
- /* @__PURE__ */ e("h1", { className: `text-2xl font-semibold ${U === "dark" ? "text-gray-200" : "text-gray-800"} mb-1`, children: "Audio Visualizer" }),
1880
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-500", children: "Professional frequency analyzer" })
1398
+ function Nt() {
1399
+ const [s, l] = m(null), [u, v] = m("No track loaded"), [C, f] = m("purple"), [y, O] = m(!1), [x, F] = m(!1), [I, z] = m("light"), E = b(null);
1400
+ return /* @__PURE__ */ e("div", { className: "ecp-page-wrapper", style: { backgroundColor: I === "dark" ? "#222" : "white" }, children: /* @__PURE__ */ c("div", { className: "ecp-demo-container", children: [
1401
+ y && /* @__PURE__ */ e(ht, { theme: C, setTheme: f, close: () => O(!1) }),
1402
+ /* @__PURE__ */ c("div", { className: "ecp-container-glass", children: [
1403
+ /* @__PURE__ */ c("div", { className: "ecp-demo-header", children: [
1404
+ /* @__PURE__ */ c("div", { children: [
1405
+ /* @__PURE__ */ e("h1", { className: `ecp-demo-title${I === "dark" ? " ecp-demo-title--dark" : ""}`, children: "Audio Visualizer" }),
1406
+ /* @__PURE__ */ e("p", { className: "ecp-demo-subtitle", children: "Professional frequency analyzer" })
1881
1407
  ] }),
1882
- /* @__PURE__ */ r(
1883
- "button",
1884
- {
1885
- onClick: () => v(!x),
1886
- className: "bg-white border border-gray-300 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",
1887
- children: [
1888
- /* @__PURE__ */ e("span", { children: "🎨" }),
1889
- " Themes"
1890
- ]
1891
- }
1892
- )
1408
+ /* @__PURE__ */ c("button", { onClick: () => O(!y), className: "ecp-theme-btn", children: [
1409
+ /* @__PURE__ */ e("span", { children: "🎨" }),
1410
+ " Themes"
1411
+ ] })
1893
1412
  ] }),
1894
1413
  /* @__PURE__ */ e(
1895
- gt,
1414
+ vt,
1896
1415
  {
1897
- audio: i || void 0,
1898
- name: g || void 0,
1416
+ audio: s || void 0,
1417
+ name: u || void 0,
1899
1418
  author: "K.Prabhasha",
1900
- theme: q,
1419
+ theme: C,
1901
1420
  autoPlay: !1,
1902
1421
  thumbnail: "https://cdn-icons-png.flaticon.com/512/3845/3845874.png",
1903
- mode: U,
1904
- transparent: P,
1422
+ mode: I,
1423
+ transparent: x,
1905
1424
  volume: 70,
1906
1425
  controls: {
1907
1426
  play: !0,
@@ -1914,69 +1433,58 @@ function bt() {
1914
1433
  }
1915
1434
  }
1916
1435
  ),
1917
- /* @__PURE__ */ e(ft, { audio: i || "", width: 400, thumbnail: "https://cdn-icons-png.flaticon.com/512/8316/8316619.png", autoPlay: !1, gradient: ["#26ce3aff", "#39eed9ff"], background: "#c0ffefff" }),
1918
- /* @__PURE__ */ e(mt, { audio: i || "", thumbnail: "https://cdn-icons-png.flaticon.com/512/17524/17524837.png", autoPlay: !1, gradient: ["#26ce3aff", "#39eed9ff"], background: "#c0ffefff" }),
1919
- /* @__PURE__ */ r("div", { className: "mt-6 flex flex-wrap items-center gap-3", children: [
1920
- /* @__PURE__ */ e(
1921
- "input",
1922
- {
1923
- type: "file",
1924
- ref: M,
1925
- onChange: (z) => {
1926
- var N;
1927
- const S = (N = z.target.files) == null ? void 0 : N[0];
1928
- if (S) {
1929
- const E = URL.createObjectURL(S);
1930
- c(E), p(S.name);
1931
- }
1932
- },
1933
- accept: "audio/*",
1934
- className: "hidden"
1935
- }
1936
- ),
1937
- /* @__PURE__ */ r(
1938
- "button",
1939
- {
1940
- onClick: () => {
1941
- var z;
1942
- (z = M.current) == null || z.click();
1943
- },
1944
- className: "bg-white border border-gray-300 text-gray-700 px-6 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",
1945
- children: [
1946
- /* @__PURE__ */ e(ct, { size: 16 }),
1947
- "Load Audio"
1948
- ]
1949
- }
1950
- ),
1951
- /* @__PURE__ */ e(
1952
- "button",
1953
- {
1954
- onClick: () => I(U === "dark" ? "light" : "dark"),
1955
- className: "bg-white border border-gray-300 text-gray-700 px-6 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",
1956
- children: U === "dark" ? "Light" : "Dark"
1957
- }
1958
- ),
1959
- /* @__PURE__ */ r(
1960
- "button",
1961
- {
1962
- onClick: () => T(!P),
1963
- className: "bg-white border border-gray-300 text-gray-700 px-6 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",
1964
- children: [
1965
- "Transparent: ",
1966
- String(P)
1967
- ]
1436
+ /* @__PURE__ */ e(
1437
+ bt,
1438
+ {
1439
+ audio: s || "",
1440
+ width: 400,
1441
+ thumbnail: "https://cdn-icons-png.flaticon.com/512/8316/8316619.png",
1442
+ autoPlay: !1,
1443
+ gradient: ["#26ce3aff", "#39eed9ff"],
1444
+ background: "#c0ffefff"
1445
+ }
1446
+ ),
1447
+ /* @__PURE__ */ e(
1448
+ gt,
1449
+ {
1450
+ audio: s || "",
1451
+ thumbnail: "https://cdn-icons-png.flaticon.com/512/17524/17524837.png",
1452
+ autoPlay: !1,
1453
+ gradient: ["#26ce3aff", "#39eed9ff"],
1454
+ background: "#c0ffefff"
1455
+ }
1456
+ ),
1457
+ /* @__PURE__ */ c("div", { className: "ecp-demo-actions", children: [
1458
+ /* @__PURE__ */ e("input", { type: "file", ref: E, onChange: (P) => {
1459
+ var D;
1460
+ const M = (D = P.target.files) == null ? void 0 : D[0];
1461
+ if (M) {
1462
+ const k = URL.createObjectURL(M);
1463
+ l(k), v(M.name);
1968
1464
  }
1969
- )
1465
+ }, accept: "audio/*", className: "ecp-file-input-hidden" }),
1466
+ /* @__PURE__ */ c("button", { onClick: () => {
1467
+ var P;
1468
+ return (P = E.current) == null ? void 0 : P.click();
1469
+ }, className: "ecp-action-btn", children: [
1470
+ /* @__PURE__ */ e(pt, { size: 16 }),
1471
+ "Load Audio"
1472
+ ] }),
1473
+ /* @__PURE__ */ e("button", { onClick: () => z(I === "dark" ? "light" : "dark"), className: "ecp-action-btn", children: I === "dark" ? "Light" : "Dark" }),
1474
+ /* @__PURE__ */ c("button", { onClick: () => F(!x), className: "ecp-action-btn", children: [
1475
+ "Transparent: ",
1476
+ String(x)
1477
+ ] })
1970
1478
  ] })
1971
1479
  ] })
1972
1480
  ] }) });
1973
1481
  }
1974
1482
  export {
1975
- bt as DemoVisualizePlayer,
1976
- mt as NanoAudioPlayer,
1977
- ut as ThemeSelector,
1978
- yt as VideoPlayer,
1979
- gt as VisualizePlayer,
1980
- ft as WaveAudioPlayer,
1981
- be as themes
1483
+ Nt as DemoVisualizePlayer,
1484
+ gt as NanoAudioPlayer,
1485
+ ht as ThemeSelector,
1486
+ wt as VideoPlayer,
1487
+ vt as VisualizePlayer,
1488
+ bt as WaveAudioPlayer,
1489
+ ge as themes
1982
1490
  };