@nice2dev/ui-video 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),ve=(l,m)=>m,xe=d.createContext(ve);function ge(){return{t:d.useContext(xe)}}d.createContext({dir:"ltr",isRTL:!1,flip:l=>l,value:l=>l.ltr});d.createContext(null);d.createContext(null);const je={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"};d.createContext({displayStyle:"default",variantConfig:je,setDisplayStyle:()=>{}});d.createContext({});d.createContext({direction:"ltr",isRTL:!1,flip:l=>l,flipStyle:(l,m)=>({[l]:m})});d.createContext({permissions:{},getAccessMode:()=>"full"});d.createContext(null);const we=process.env.NODE_ENV==="development";let de={enabled:we,slowRenderThreshold:16};const le=[],oe=new Map,fe=new Map;function Ne(){le.length=0,oe.clear(),fe.clear()}function ke(l){const m=de.slowRenderThreshold;return le.filter(f=>f.actualDuration>m)}function Y(l){return l<1?`${(l*1e3).toFixed(0)}μs`:l<1e3?`${l.toFixed(2)}ms`:`${(l/1e3).toFixed(2)}s`}function Ce(){const l=Array.from(oe.values()),m=ke(),f=l.reduce((H,u)=>H+u.renderCount,0),N=l.length>0?l.reduce((H,u)=>H+u.avgRenderTime,0)/l.length:0,S=Array.from(fe.values());return{stats:l,slowRenders:m,totalRenders:f,avgRenderTime:N,marks:S}}function Se(){const l=Ce();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${l.totalRenders}`),console.log(`Average render time: ${Y(l.avgRenderTime)}`),console.log(`Slow renders: ${l.slowRenders.length}`),console.group("Component Stats"),console.table(l.stats.sort((m,f)=>f.totalRenderTime-m.totalRenderTime).map(m=>({Name:m.componentName,Renders:m.renderCount,"Avg Time":Y(m.avgRenderTime),"Max Time":Y(m.maxRenderTime),"Total Time":Y(m.totalRenderTime),"Slow Renders":m.slowRenderCount}))),console.groupEnd(),l.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(l.slowRenders.slice(-10).map(m=>({Component:m.componentName,Phase:m.phase,Duration:Y(m.actualDuration),Time:new Date(m.timestamp).toLocaleTimeString()}))),console.groupEnd()),l.marks.length>0&&(console.group("Custom Marks"),console.table(l.marks.filter(m=>m.duration).map(m=>({Name:m.name,Duration:Y(m.duration)}))),console.groupEnd()),console.groupEnd()}const He=d.memo(({position:l="bottom-right",defaultCollapsed:m=!0})=>{const[f,N]=d.useState(m),[S,H]=d.useState([]),[u,s]=d.useState({used:0,total:0});if(d.useEffect(()=>{const b=()=>{const y=Array.from(oe.values());H(y.sort((k,$)=>$.totalRenderTime-k.totalRenderTime).slice(0,10));const j=window.performance;j.memory&&s({used:j.memory.usedJSHeapSize/1024/1024,total:j.memory.totalJSHeapSize/1024/1024})};b();const _=setInterval(b,2e3);return()=>clearInterval(_)},[]),!de.enabled)return null;const I={position:"fixed",zIndex:99999,...l.includes("top")?{top:8}:{bottom:8},...l.includes("left")?{left:8}:{right:8}};return e.jsxs("div",{style:{...I,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:f?"4px 8px":8,maxWidth:f?"auto":300,maxHeight:f?"auto":400,overflow:"auto"},children:[e.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>N(b=>!b),children:[e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),e.jsx("span",{children:"Profiler"}),u.used>0&&e.jsxs("span",{style:{color:u.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[u.used.toFixed(0),"MB"]}),e.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:f?"▼":"▲"})]}),!f&&e.jsxs("div",{style:{marginTop:8},children:[e.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:e.jsx("strong",{children:"Top Components"})}),S.map(b=>e.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:b.componentName}),e.jsx("span",{style:{color:b.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:Y(b.avgRenderTime)}),e.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",b.renderCount]})]},b.componentName)),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[e.jsx("button",{onClick:Se,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),e.jsx("button",{onClick:Ne,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});He.displayName="ProfilerOverlay";process.env.NODE_ENV;d.createContext(null);const Re=d.createContext({enabled:!0,active:!1,run:()=>{}});function Te(){return d.useContext(Re)}function Ie(l,m){if(!l)return null;if(l===!0)return m&&m.length>0?m:null;if(Array.isArray(l))return l.length>0?l:null;const f=l.steps??m;return f&&f.length>0?f:null}function Me(l,m){return l.map(f=>({target:f.target,title:f.titleKey?m(f.titleKey,f.title??""):f.title??"",content:f.contentKey?m(f.contentKey,f.content??""):f.content??"",placement:f.placement,highlightPadding:f.highlightPadding,showArrow:f.showArrow,scrollIntoView:f.scrollIntoView,disableInteraction:f.disableInteraction}))}const De=({steps:l,autoStart:m,label:f,size:N="md",className:S,style:H,"data-testid":u})=>{const{enabled:s,run:I}=Te(),{t:b}=ge();if(!s||!l||l.length===0)return null;const _=f??b("tutorial.startAria","Start tutorial");return e.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${N}`+(S?` ${S}`:""),style:H,"data-testid":u,"aria-label":_,title:_,onClick:()=>I(Me(l,b),{autoStart:m}),children:"?"})},ce="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(ce)){const l=document.createElement("style");l.id=ce,l.textContent=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),ve=(l,m)=>m,xe=d.createContext(ve);function ge(){return{t:d.useContext(xe)}}d.createContext({dir:"ltr",isRTL:!1,flip:l=>l,value:l=>l.ltr});d.createContext(null);d.createContext(null);const je={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"};d.createContext({displayStyle:"default",variantConfig:je,setDisplayStyle:()=>{}});d.createContext({});d.createContext({direction:"ltr",isRTL:!1,flip:l=>l,flipStyle:(l,m)=>({[l]:m})});d.createContext({permissions:{},getAccessMode:()=>"full"});d.createContext(null);const we=process.env.NODE_ENV==="development";let de={enabled:we,slowRenderThreshold:16};const le=[],oe=new Map,fe=new Map;function Ne(){le.length=0,oe.clear(),fe.clear()}function ke(l){const m=de.slowRenderThreshold;return le.filter(f=>f.actualDuration>m)}function X(l){return l<1?`${(l*1e3).toFixed(0)}μs`:l<1e3?`${l.toFixed(2)}ms`:`${(l/1e3).toFixed(2)}s`}function Ce(){const l=Array.from(oe.values()),m=ke(),f=l.reduce((H,u)=>H+u.renderCount,0),N=l.length>0?l.reduce((H,u)=>H+u.avgRenderTime,0)/l.length:0,S=Array.from(fe.values());return{stats:l,slowRenders:m,totalRenders:f,avgRenderTime:N,marks:S}}function Se(){const l=Ce();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${l.totalRenders}`),console.log(`Average render time: ${X(l.avgRenderTime)}`),console.log(`Slow renders: ${l.slowRenders.length}`),console.group("Component Stats"),console.table(l.stats.sort((m,f)=>f.totalRenderTime-m.totalRenderTime).map(m=>({Name:m.componentName,Renders:m.renderCount,"Avg Time":X(m.avgRenderTime),"Max Time":X(m.maxRenderTime),"Total Time":X(m.totalRenderTime),"Slow Renders":m.slowRenderCount}))),console.groupEnd(),l.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(l.slowRenders.slice(-10).map(m=>({Component:m.componentName,Phase:m.phase,Duration:X(m.actualDuration),Time:new Date(m.timestamp).toLocaleTimeString()}))),console.groupEnd()),l.marks.length>0&&(console.group("Custom Marks"),console.table(l.marks.filter(m=>m.duration).map(m=>({Name:m.name,Duration:X(m.duration)}))),console.groupEnd()),console.groupEnd()}const He=d.memo(({position:l="bottom-right",defaultCollapsed:m=!0})=>{const[f,N]=d.useState(m),[S,H]=d.useState([]),[u,s]=d.useState({used:0,total:0});if(d.useEffect(()=>{const b=()=>{const y=Array.from(oe.values());H(y.sort((k,$)=>$.totalRenderTime-k.totalRenderTime).slice(0,10));const j=window.performance;j.memory&&s({used:j.memory.usedJSHeapSize/1024/1024,total:j.memory.totalJSHeapSize/1024/1024})};b();const _=setInterval(b,2e3);return()=>clearInterval(_)},[]),!de.enabled)return null;const I={position:"fixed",zIndex:99999,...l.includes("top")?{top:8}:{bottom:8},...l.includes("left")?{left:8}:{right:8}};return e.jsxs("div",{style:{...I,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:f?"4px 8px":8,maxWidth:f?"auto":300,maxHeight:f?"auto":400,overflow:"auto"},children:[e.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>N(b=>!b),children:[e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),e.jsx("span",{children:"Profiler"}),u.used>0&&e.jsxs("span",{style:{color:u.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[u.used.toFixed(0),"MB"]}),e.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:f?"▼":"▲"})]}),!f&&e.jsxs("div",{style:{marginTop:8},children:[e.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:e.jsx("strong",{children:"Top Components"})}),S.map(b=>e.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:b.componentName}),e.jsx("span",{style:{color:b.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:X(b.avgRenderTime)}),e.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",b.renderCount]})]},b.componentName)),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[e.jsx("button",{onClick:Se,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),e.jsx("button",{onClick:Ne,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});He.displayName="ProfilerOverlay";process.env.NODE_ENV;d.createContext(null);const Re=d.createContext({enabled:!0,active:!1,run:()=>{}});function Te(){return d.useContext(Re)}function Ie(l,m){if(!l)return null;if(l===!0)return m&&m.length>0?m:null;if(Array.isArray(l))return l.length>0?l:null;const f=l.steps??m;return f&&f.length>0?f:null}function Me(l,m){return l.map(f=>({target:f.target,title:f.titleKey?m(f.titleKey,f.title??""):f.title??"",content:f.contentKey?m(f.contentKey,f.content??""):f.content??"",placement:f.placement,highlightPadding:f.highlightPadding,showArrow:f.showArrow,scrollIntoView:f.scrollIntoView,disableInteraction:f.disableInteraction}))}const De=({steps:l,autoStart:m,label:f,size:N="md",className:S,style:H,"data-testid":u})=>{const{enabled:s,run:I}=Te(),{t:b}=ge();if(!s||!l||l.length===0)return null;const _=f??b("tutorial.startAria","Start tutorial");return e.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${N}`+(S?` ${S}`:""),style:H,"data-testid":u,"aria-label":_,title:_,onClick:()=>I(Me(l,b),{autoStart:m}),children:"?"})},ce="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(ce)){const l=document.createElement("style");l.id=ce,l.textContent=`
2
2
  .nice-tutorial-button {
3
3
  display: inline-flex;
4
4
  align-items: center;
@@ -24,4 +24,4 @@
24
24
  }
25
25
  .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
26
26
  .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
27
- `,document.head.appendChild(l)}d.createContext(null);d.createContext(null);d.createContext(null);const me={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ue={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},pe={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},ye=l=>({color:l,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),_e={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},$e={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function c(l,m,f,N,S){return{name:l,darkMode:"light",colors:{...m,surface:m.surface??f.primary,surfaceHover:m.surfaceHover??f.secondary},backgrounds:{...f,elevated:f.elevated??f.primary,inset:f.inset??f.tertiary,canvas:f.canvas??f.primary},text:{...N,inverse:N.inverse??"#ffffff"},borders:ye(S),shadows:_e,spacing:me,typography:ue,transitions:pe}}function w(l,m,f,N,S){return{name:l,darkMode:"dark",colors:{...m,surface:m.surface??f.secondary,surfaceHover:m.surfaceHover??f.tertiary},backgrounds:{...f,elevated:f.elevated??f.secondary,inset:f.inset??f.primary,canvas:f.canvas??f.primary},text:{...N,inverse:N.inverse??"#0f172a"},borders:ye(S),shadows:$e,spacing:me,typography:ue,transitions:pe}}c("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1");c("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8");c("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1");c("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db");c("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8");c("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1");c("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db");c("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4");c("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af");c("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7");c("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d");c("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd");c("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4");c("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc");c("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9");c("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264");c("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4");c("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74");c("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9");c("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc");c("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af");c("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74");w("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b");w("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46");w("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266");w("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626");w("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252");w("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151");w("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87");w("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985");w("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040");w("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857");c("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac");c("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc");c("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047");c("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74");c("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4");c("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe");c("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5");c("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac");c("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd");c("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0");c("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4");c("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd");c("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0");c("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa");c("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe");c("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a");c("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0");c("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3");c("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1");c("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb");c("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1");c("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd");c("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd");c("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1");c("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0");c("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d");c("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9");w("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a");c("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5");w("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642");w("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32");w("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452");w("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866");c("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8");w("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300");c("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8");c("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4");w("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44");w("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333");w("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66");c("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0");w("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400");c("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af");c("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe");c("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d");c("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe");c("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8");c("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d");c("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0");c("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0");c("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb");c("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe");c("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5");c("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d");c("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac");c("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896");w("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff");c("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0");c("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c");c("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5");w("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e");w("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58");c("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8");c("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0");d.createContext(null);const Ae={id:crypto.randomUUID(),name:"Untitled Project",resolution:{width:1920,height:1080,label:"1080p"},frameRate:30,duration:0,tracks:[{id:"1",type:"video",name:"Video 1",items:[],muted:!1,locked:!1,visible:!0},{id:"2",type:"audio",name:"Audio 1",items:[],muted:!1,locked:!1,visible:!0}],assets:[],settings:{backgroundColor:"var(--nice-text, #000000)",audio:{sampleRate:48e3,channels:2,bitrate:320},video:{codec:"h264",bitrate:8e3,profile:"high"}}},Ee=[{type:"blur",name:"Blur",icon:"🔵"},{type:"brightness",name:"Brightness",icon:"☀️"},{type:"contrast",name:"Contrast",icon:"◐"},{type:"saturation",name:"Saturation",icon:"🎨"},{type:"grayscale",name:"Grayscale",icon:"⬛"},{type:"sepia",name:"Sepia",icon:"🟤"},{type:"chromaKey",name:"Chroma Key",icon:"🟢"},{type:"crop",name:"Crop",icon:"✂️"},{type:"zoom",name:"Zoom",icon:"🔍"}],ze=[{type:"fade",name:"Fade"},{type:"dissolve",name:"Dissolve"},{type:"wipe",name:"Wipe"},{type:"slide",name:"Slide"},{type:"zoom",name:"Zoom"},{type:"push",name:"Push"}],Pe=[{target:".nice-video-editor",titleKey:"tutorial.videoEditorPro.intro.title",title:"Video editor",contentKey:"tutorial.videoEditorPro.intro.content",content:"Add media to the timeline, arrange and trim clips, apply effects and transitions, then configure and run the export.",placement:"auto"}],Fe=({project:l,onProjectChange:m,onExport:f,onAssetUpload:N,className:S="",tutorial:H})=>{const[u,s]=d.useState(l||Ae),[I,b]=d.useState("timeline"),[_,y]=d.useState(null),[j,k]=d.useState(null),[$,R]=d.useState(0),[W,L]=d.useState(!1),[T,G]=d.useState(1),[V,A]=d.useState(!0),[E,F]=d.useState(null),ae=d.useRef(null),re=d.useRef(null),D=d.useRef(null);d.useEffect(()=>{l&&s(l)},[l]),d.useEffect(()=>()=>{D.current&&clearInterval(D.current)},[]);const x=d.useCallback(t=>{const i={...u,...t};s(i),m==null||m(i)},[u,m]),v=async t=>{const i=[];for(const a of Array.from(t)){const r=a.type.startsWith("video/")?"video":a.type.startsWith("audio/")?"audio":"image";let o;N?o=await N(a):o={id:crypto.randomUUID(),type:r,name:a.name,url:URL.createObjectURL(a),size:a.size},i.push(o)}x({assets:[...u.assets,...i]})},U=t=>{const i={id:crypto.randomUUID(),type:t,name:`${t.charAt(0).toUpperCase()+t.slice(1)} ${u.tracks.filter(a=>a.type===t).length+1}`,items:[],muted:!1,locked:!1,visible:!0};x({tracks:[...u.tracks,i]})},q=t=>{x({tracks:u.tracks.filter(i=>i.id!==t)}),_===t&&y(null)},O=t=>{x({tracks:u.tracks.map(i=>i.id===t?{...i,muted:!i.muted}:i)})},Q=t=>{x({tracks:u.tracks.map(i=>i.id===t?{...i,locked:!i.locked}:i)})},M=(t,i)=>{const a=u.tracks.find(h=>h.id===t);if(!a||a.locked)return;const r=a.items[a.items.length-1],o=r?r.startTime+r.duration:0,p={id:crypto.randomUUID(),assetId:i.id,type:i.type,startTime:o,duration:i.duration||5,offset:0,properties:{x:0,y:0,opacity:1,scale:1,volume:1},effects:[],transitions:[]};x({tracks:u.tracks.map(h=>h.id===t?{...h,items:[...h.items,p]}:h)})},Z=(t,i,a)=>{const r={id:crypto.randomUUID(),type:a,name:a.charAt(0).toUpperCase()+a.slice(1),parameters:se(a)};x({tracks:u.tracks.map(o=>o.id===t?{...o,items:o.items.map(p=>p.id===i?{...p,effects:[...p.effects,r]}:p)}:o)})},z=(t,i,a,r)=>{const o={id:crypto.randomUUID(),type:a,duration:.5,position:r};x({tracks:u.tracks.map(p=>p.id===t?{...p,items:p.items.map(h=>h.id===i?{...h,transitions:[...h.transitions,o]}:h)}:p)})},se=t=>{switch(t){case"blur":return{radius:5};case"brightness":return{value:100};case"contrast":return{value:100};case"saturation":return{value:100};case"grayscale":return{amount:100};case"sepia":return{amount:100};case"chromaKey":return{color:"var(--nice-success, #00ff00)",threshold:40};case"crop":return{top:0,right:0,bottom:0,left:0};case"zoom":return{scale:1,x:0,y:0};default:return{}}},te=()=>{W?(D.current&&clearInterval(D.current),L(!1)):(D.current=setInterval(()=>{R(t=>{const i=Math.max(...u.tracks.flatMap(a=>a.items.map(r=>r.startTime+r.duration)),0);return t>=i?(clearInterval(D.current),L(!1),0):t+1/u.frameRate})},1e3/u.frameRate),L(!0))},J=t=>{R(Math.max(0,t))},X=async()=>{if(f){F(0);try{const t=setInterval(()=>{F(i=>i!==null&&i<90?i+Math.random()*10:i)},500);await f(u,u.settings.video.codec),clearInterval(t),F(100),setTimeout(()=>F(null),2e3)}catch(t){F(null),console.error("Export failed:",t)}}},ee=t=>{const i=Math.floor(t/60),a=Math.floor(t%60),r=Math.floor(t%1*u.frameRate);return`${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},K=()=>{for(const t of u.tracks){const i=t.items.find(a=>a.id===j);if(i)return{track:t,item:i}}return null};return e.jsxs("div",{className:`nice-video-editor ${S}`,style:{position:"relative"},children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx(De,{steps:Ie(H,Pe)})}),e.jsxs("header",{className:"video-editor__header",children:[e.jsxs("div",{className:"header__project-info",children:[e.jsx("input",{type:"text",value:u.name,onChange:t=>x({name:t.target.value}),className:"project-name-input"}),e.jsxs("span",{className:"project-settings",children:[u.resolution.width,"x",u.resolution.height," • ",u.frameRate,"fps"]})]}),e.jsx("div",{className:"header__tabs",children:["timeline","effects","transitions","export"].map(t=>e.jsx("button",{className:`tab-button ${I===t?"tab-button--active":""}`,onClick:()=>b(t),children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsx("div",{className:"header__actions",children:e.jsx("button",{className:"action-button action-button--primary",onClick:X,disabled:E!==null,children:E!==null?`Exporting ${Math.round(E)}%`:"Export"})})]}),e.jsxs("div",{className:"video-editor__main",children:[V&&e.jsxs("aside",{className:"video-editor__asset-library",children:[e.jsxs("div",{className:"asset-library__header",children:[e.jsx("h3",{children:"Assets"}),e.jsx("button",{className:"close-button",onClick:()=>A(!1),children:"×"})]}),e.jsx("div",{className:"asset-library__upload",children:e.jsxs("label",{className:"upload-zone",children:[e.jsx("input",{type:"file",multiple:!0,accept:"video/*,audio/*,image/*",onChange:t=>t.target.files&&v(t.target.files),hidden:!0}),e.jsx("span",{className:"upload-icon",children:"+"}),e.jsx("span",{children:"Drop files or click to upload"})]})}),e.jsx("div",{className:"asset-library__list",children:u.assets.map(t=>e.jsxs("div",{className:"asset-item",draggable:!0,onDragStart:i=>i.dataTransfer.setData("assetId",t.id),children:[e.jsx("div",{className:"asset-thumbnail",children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):e.jsx("span",{className:"asset-type-icon",children:t.type==="video"?"🎬":t.type==="audio"?"🎵":"🖼️"})}),e.jsxs("div",{className:"asset-info",children:[e.jsx("span",{className:"asset-name",children:t.name}),e.jsxs("span",{className:"asset-meta",children:[(t.size/1024/1024).toFixed(1),"MB"]})]})]},t.id))})]}),e.jsxs("div",{className:"video-editor__preview-area",children:[e.jsxs("div",{className:"preview-container",children:[e.jsxs("div",{className:"preview-canvas",style:{aspectRatio:`${u.resolution.width}/${u.resolution.height}`},children:[e.jsx("video",{ref:re,className:"preview-video"}),e.jsx("div",{className:"preview-overlay",children:!V&&e.jsx("button",{className:"toggle-library-button",onClick:()=>A(!0),children:"📁"})})]}),e.jsxs("div",{className:"playback-controls",children:[e.jsx("button",{onClick:()=>J(0),children:"⏮️"}),e.jsx("button",{onClick:()=>J($-1/u.frameRate),children:"⏪"}),e.jsx("button",{onClick:te,className:"play-button",children:W?"⏸️":"▶️"}),e.jsx("button",{onClick:()=>J($+1/u.frameRate),children:"⏩"}),e.jsx("span",{className:"time-display",children:ee($)})]})]}),j&&I!=="export"&&e.jsx("div",{className:"item-inspector",children:(()=>{const t=K();if(!t)return null;const{track:i,item:a}=t;return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Item Properties"}),e.jsxs("div",{className:"inspector-section",children:[e.jsxs("label",{children:["Start Time",e.jsx("input",{type:"number",step:"0.1",value:a.startTime,onChange:r=>{const o=parseFloat(r.target.value);x({tracks:u.tracks.map(p=>p.id===i.id?{...p,items:p.items.map(h=>h.id===a.id?{...h,startTime:o}:h)}:p)})}})]}),e.jsxs("label",{children:["Duration",e.jsx("input",{type:"number",step:"0.1",value:a.duration,onChange:r=>{const o=parseFloat(r.target.value);x({tracks:u.tracks.map(p=>p.id===i.id?{...p,items:p.items.map(h=>h.id===a.id?{...h,duration:o}:h)}:p)})}})]}),e.jsxs("label",{children:["Opacity",e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:a.properties.opacity??1,onChange:r=>{const o=parseFloat(r.target.value);x({tracks:u.tracks.map(p=>p.id===i.id?{...p,items:p.items.map(h=>h.id===a.id?{...h,properties:{...h.properties,opacity:o}}:h)}:p)})}})]})]}),e.jsxs("h4",{children:["Effects (",a.effects.length,")"]}),e.jsx("div",{className:"effects-list",children:a.effects.map(r=>e.jsx("div",{className:"effect-badge",children:r.name},r.id))})]})})()})]})]}),e.jsxs("div",{className:"video-editor__panel",children:[I==="timeline"&&e.jsxs("div",{className:"timeline-panel",children:[e.jsxs("div",{className:"timeline-toolbar",children:[e.jsxs("div",{className:"track-buttons",children:[e.jsx("button",{onClick:()=>U("video"),children:"+ Video Track"}),e.jsx("button",{onClick:()=>U("audio"),children:"+ Audio Track"}),e.jsx("button",{onClick:()=>U("text"),children:"+ Text Track"})]}),e.jsxs("div",{className:"zoom-controls",children:[e.jsx("button",{onClick:()=>G(Math.max(.25,T-.25)),children:"-"}),e.jsxs("span",{children:[Math.round(T*100),"%"]}),e.jsx("button",{onClick:()=>G(Math.min(4,T+.25)),children:"+"})]})]}),e.jsxs("div",{className:"timeline-container",ref:ae,children:[e.jsx("div",{className:"timeline-ruler",children:Array.from({length:Math.ceil(30/T)}).map((t,i)=>e.jsx("div",{className:"ruler-mark",style:{left:`${i*50*T}px`},children:ee(i)},i))}),e.jsx("div",{className:"timeline-playhead",style:{left:`${$*50*T}px`}}),e.jsx("div",{className:"timeline-tracks",children:u.tracks.map(t=>e.jsxs("div",{className:`timeline-track ${_===t.id?"timeline-track--selected":""} ${t.locked?"timeline-track--locked":""}`,onClick:()=>y(t.id),onDrop:i=>{i.preventDefault();const a=i.dataTransfer.getData("assetId"),r=u.assets.find(o=>o.id===a);r&&M(t.id,r)},onDragOver:i=>i.preventDefault(),children:[e.jsxs("div",{className:"track-header",children:[e.jsx("span",{className:"track-name",children:t.name}),e.jsxs("div",{className:"track-controls",children:[e.jsx("button",{className:t.muted?"active":"",onClick:i=>{i.stopPropagation(),O(t.id)},children:t.muted?"🔇":"🔊"}),e.jsx("button",{className:t.locked?"active":"",onClick:i=>{i.stopPropagation(),Q(t.id)},children:t.locked?"🔒":"🔓"}),e.jsx("button",{onClick:i=>{i.stopPropagation(),q(t.id)},children:"🗑️"})]})]}),e.jsx("div",{className:"track-items",children:t.items.map(i=>{const a=u.assets.find(r=>r.id===i.assetId);return e.jsxs("div",{className:`track-item track-item--${i.type} ${j===i.id?"track-item--selected":""}`,style:{left:`${i.startTime*50*T}px`,width:`${i.duration*50*T}px`},onClick:r=>{r.stopPropagation(),k(i.id)},children:[e.jsx("span",{className:"item-name",children:(a==null?void 0:a.name)||"Untitled"}),i.transitions.length>0&&e.jsx("span",{className:"item-transitions",children:"✨"}),i.effects.length>0&&e.jsx("span",{className:"item-effects",children:"🎨"})]},i.id)})})]},t.id))})]})]}),I==="effects"&&e.jsxs("div",{className:"effects-panel",children:[e.jsx("h3",{children:"Video Effects"}),e.jsx("p",{className:"panel-hint",children:"Select a clip to apply effects"}),e.jsx("div",{className:"effects-grid",children:Ee.map(t=>e.jsxs("button",{className:"effect-preset",disabled:!j,onClick:()=>{const i=K();i&&Z(i.track.id,i.item.id,t.type)},children:[e.jsx("span",{className:"effect-icon",children:t.icon}),e.jsx("span",{className:"effect-name",children:t.name})]},t.type))})]}),I==="transitions"&&e.jsxs("div",{className:"transitions-panel",children:[e.jsx("h3",{children:"Transitions"}),e.jsx("p",{className:"panel-hint",children:"Select a clip and add transitions between clips"}),e.jsx("div",{className:"transitions-grid",children:ze.map(t=>e.jsxs("div",{className:"transition-preset",children:[e.jsx("span",{className:"transition-name",children:t.name}),e.jsxs("div",{className:"transition-buttons",children:[e.jsx("button",{disabled:!j,onClick:()=>{const i=K();i&&z(i.track.id,i.item.id,t.type,"start")},children:"In"}),e.jsx("button",{disabled:!j,onClick:()=>{const i=K();i&&z(i.track.id,i.item.id,t.type,"end")},children:"Out"})]})]},t.type))})]}),I==="export"&&e.jsxs("div",{className:"export-panel",children:[e.jsx("h3",{children:"Export Settings"}),e.jsxs("div",{className:"export-settings",children:[e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Resolution"}),e.jsxs("select",{value:`${u.resolution.width}x${u.resolution.height}`,onChange:t=>{const[i,a]=t.target.value.split("x").map(Number);x({resolution:{width:i,height:a}})},children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"}),e.jsx("option",{value:"3840x2160",children:"4K (3840x2160)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Frame Rate"}),e.jsxs("select",{value:u.frameRate,onChange:t=>x({frameRate:parseInt(t.target.value)}),children:[e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"}),e.jsx("option",{value:"120",children:"120 fps"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Video Codec"}),e.jsxs("select",{value:u.settings.video.codec,onChange:t=>x({settings:{...u.settings,video:{...u.settings.video,codec:t.target.value}}}),children:[e.jsx("option",{value:"h264",children:"H.264 (Best Compatibility)"}),e.jsx("option",{value:"h265",children:"H.265/HEVC (Smaller Size)"}),e.jsx("option",{value:"vp9",children:"VP9 (Web Optimized)"}),e.jsx("option",{value:"av1",children:"AV1 (Future Standard)"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Video Bitrate (Mbps)"}),e.jsx("input",{type:"number",value:u.settings.video.bitrate/1e3,onChange:t=>x({settings:{...u.settings,video:{...u.settings.video,bitrate:parseFloat(t.target.value)*1e3}}}),min:"1",max:"100"})]})]}),e.jsx("button",{className:"export-button",onClick:X,disabled:E!==null,children:E!==null?`Exporting... ${Math.round(E)}%`:"Export Video"}),E!==null&&e.jsx("div",{className:"export-progress",children:e.jsx("div",{className:"export-progress-bar",style:{width:`${E}%`}})})]})]})]})},Ue={video:{source:"screen",showCursor:!0,frameRate:30,resolution:{width:1920,height:1080}},audio:{enabled:!0,source:"both",echoCancellation:!0,noiseSuppression:!0},output:{format:"webm",quality:"high"}},Le=({options:l,onRecordingStart:m,onRecordingStop:f,onRecordingPause:N,onRecordingResume:S,onError:H,className:u=""})=>{var p,h;const[s,I]=d.useState({...Ue,...l}),[b,_]=d.useState(null),[y,j]=d.useState("idle"),[k,$]=d.useState([]),[R,W]=d.useState(null),[L,T]=d.useState(null),[G,V]=d.useState(!1),[A,E]=d.useState(!1),[F,ae]=d.useState("pen"),[re,D]=d.useState("var(--nice-danger, #ff0000)"),x=d.useRef(null),v=d.useRef([]),U=d.useRef(null),q=d.useRef(null),O=d.useRef(null),Q=d.useRef(0);d.useEffect(()=>()=>{R&&R.getTracks().forEach(n=>n.stop()),O.current&&clearInterval(O.current)},[R]);const M=n=>{I(g=>({...g,...n,video:{...g.video,...n.video},audio:{...g.audio,...n.audio},output:{...g.output,...n.output}}))},Z=async()=>{try{j("preparing");const n={video:{cursor:s.video.showCursor?"always":"never",frameRate:s.video.frameRate},audio:s.audio.source==="system"||s.audio.source==="both"},g=await navigator.mediaDevices.getDisplayMedia(n);if(s.audio.enabled&&(s.audio.source==="microphone"||s.audio.source==="both"))try{(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:s.audio.echoCancellation,noiseSuppression:s.audio.noiseSuppression}})).getAudioTracks().forEach(P=>g.addTrack(P))}catch(C){console.warn("Could not access microphone:",C)}W(g),U.current&&(U.current.srcObject=g,U.current.play()),j("idle")}catch(n){j("error"),H==null||H(n instanceof Error?n:new Error("Failed to start preview"))}},z=async()=>{R||await Z();for(let n=3;n>0;n--)T(n),await new Promise(g=>setTimeout(g,1e3));T(null);try{const n=R||await se();if(!n)throw new Error("No stream available");const g=t(s.output.format),C=new MediaRecorder(n,{mimeType:g,videoBitsPerSecond:i(s.output.quality)});v.current=[],C.ondataavailable=B=>{B.data.size>0&&v.current.push(B.data)},C.onstop=()=>{const B=new Blob(v.current,{type:g});b&&(f==null||f({...b,status:"stopped"},B))},x.current=C,C.start(1e3),Q.current=Date.now();const P={id:crypto.randomUUID(),status:"recording",startTime:new Date,duration:0,size:0,options:s,chunks:[]};_(P),j("recording"),m==null||m(P),O.current=setInterval(()=>{_(B=>B?{...B,duration:(Date.now()-Q.current)/1e3,size:v.current.reduce((he,be)=>he+be.size,0)}:null)},100)}catch(n){j("error"),H==null||H(n instanceof Error?n:new Error("Failed to start recording"))}},se=async()=>(await Z(),R),te=()=>{x.current&&y==="recording"&&(x.current.pause(),j("paused"),N==null||N())},J=()=>{x.current&&y==="paused"&&(x.current.resume(),j("recording"),S==null||S())},X=()=>{O.current&&clearInterval(O.current),x.current&&(y==="recording"||y==="paused")&&(x.current.stop(),j("stopped")),R&&(R.getTracks().forEach(n=>n.stop()),W(null))},ee=d.useCallback(n=>{if(y!=="recording")return;const g={id:crypto.randomUUID(),time:(b==null?void 0:b.duration)||0,label:n||`Marker ${k.length+1}`,color:a()};$(C=>[...C,g])},[y,b==null?void 0:b.duration,k.length]),K=n=>{$(g=>g.filter(C=>C.id!==n))},t=n=>{switch(n){case"mp4":return"video/mp4";case"mkv":return"video/x-matroska";default:return"video/webm;codecs=vp9"}},i=n=>{switch(n){case"low":return 25e5;case"medium":return 5e6;case"lossless":return 2e7;default:return 8e6}},a=()=>{const n=["var(--nice-danger, #ff4444)","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff"];return n[Math.floor(Math.random()*n.length)]},r=n=>{const g=Math.floor(n/3600),C=Math.floor(n%3600/60),P=Math.floor(n%60),B=Math.floor(n%1*100);return g>0?`${g}:${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}`:`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}.${B.toString().padStart(2,"0")}`},o=n=>n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`;return e.jsxs("div",{className:`nice-screen-recorder ${u}`,children:[e.jsxs("div",{className:"recorder__preview",children:[L!==null&&e.jsx("div",{className:"countdown-overlay",children:e.jsx("span",{className:"countdown-number",children:L})}),e.jsx("video",{ref:U,className:"preview-video",muted:!0,playsInline:!0}),A&&e.jsx("canvas",{ref:q,className:"annotation-canvas"}),!R&&y==="idle"&&e.jsx("div",{className:"preview-placeholder",children:e.jsxs("button",{className:"start-preview-button",onClick:Z,children:[e.jsx("span",{className:"icon",children:"🖥️"}),e.jsx("span",{children:"Select Screen to Record"})]})}),y==="recording"&&e.jsxs("div",{className:"recording-indicator",children:[e.jsx("span",{className:"recording-dot"}),e.jsx("span",{children:"REC"})]})]}),e.jsxs("div",{className:"recorder__controls",children:[e.jsxs("div",{className:"controls__main",children:[y==="idle"&&e.jsxs("button",{className:"control-button control-button--record",onClick:z,disabled:!!L,children:[e.jsx("span",{className:"icon",children:"⏺️"}),e.jsx("span",{children:"Start Recording"})]}),y==="recording"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"control-button control-button--pause",onClick:te,children:[e.jsx("span",{className:"icon",children:"⏸️"}),e.jsx("span",{children:"Pause"})]}),e.jsxs("button",{className:"control-button control-button--stop",onClick:X,children:[e.jsx("span",{className:"icon",children:"⏹️"}),e.jsx("span",{children:"Stop"})]})]}),y==="paused"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"control-button control-button--resume",onClick:J,children:[e.jsx("span",{className:"icon",children:"▶️"}),e.jsx("span",{children:"Resume"})]}),e.jsxs("button",{className:"control-button control-button--stop",onClick:X,children:[e.jsx("span",{className:"icon",children:"⏹️"}),e.jsx("span",{children:"Stop"})]})]}),y==="stopped"&&e.jsxs("button",{className:"control-button control-button--new",onClick:()=>{j("idle"),_(null),$([])},children:[e.jsx("span",{className:"icon",children:"🔄"}),e.jsx("span",{children:"New Recording"})]})]}),e.jsxs("div",{className:"controls__secondary",children:[(y==="recording"||y==="paused")&&e.jsxs("button",{className:"control-button control-button--marker",onClick:()=>ee(),children:[e.jsx("span",{className:"icon",children:"🚩"}),e.jsx("span",{children:"Add Marker"})]}),e.jsxs("button",{className:`control-button ${A?"control-button--active":""}`,onClick:()=>E(!A),disabled:y!=="recording",children:[e.jsx("span",{className:"icon",children:"✏️"}),e.jsx("span",{children:"Annotate"})]}),e.jsx("button",{className:"control-button control-button--settings",onClick:()=>V(!G),disabled:y==="recording",children:e.jsx("span",{className:"icon",children:"⚙️"})})]})]}),e.jsxs("div",{className:"recorder__status",children:[e.jsxs("div",{className:"status__info",children:[e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Duration:"})," ",r((b==null?void 0:b.duration)||0)]}),e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Size:"})," ",o((b==null?void 0:b.size)||0)]}),e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Markers:"})," ",k.length]})]}),e.jsxs("div",{className:"status__quality",children:[s.video.resolution&&e.jsxs("span",{children:[s.video.resolution.width,"x",s.video.resolution.height]}),e.jsxs("span",{children:[s.video.frameRate,"fps"]}),e.jsx("span",{className:s.audio.enabled?"audio-on":"audio-off",children:s.audio.enabled?"🔊":"🔇"})]})]}),A&&y==="recording"&&e.jsxs("div",{className:"recorder__annotation-tools",children:[e.jsx("div",{className:"tool-group",children:["pen","arrow","rectangle","text"].map(n=>e.jsxs("button",{className:`tool-button ${F===n?"tool-button--active":""}`,onClick:()=>ae(n),children:[n==="pen"&&"✏️",n==="arrow"&&"➡️",n==="rectangle"&&"⬜",n==="text"&&"T"]},n))}),e.jsx("div",{className:"color-group",children:["var(--nice-danger, #ff0000)","var(--nice-success, #00ff00)","var(--nice-primary, #0000ff)","var(--nice-warning, #ffff00)","var(--nice-bg, #fff)","var(--nice-text, #000000)"].map(n=>e.jsx("button",{className:`color-button ${re===n?"color-button--active":""}`,style:{backgroundColor:n},onClick:()=>D(n)},n))})]}),k.length>0&&e.jsxs("div",{className:"recorder__markers",children:[e.jsx("h4",{children:"Markers"}),e.jsx("div",{className:"markers-list",children:k.map(n=>e.jsxs("div",{className:"marker-item",style:{borderLeftColor:n.color},children:[e.jsx("span",{className:"marker-time",children:r(n.time)}),e.jsx("input",{type:"text",value:n.label,onChange:g=>{$(C=>C.map(P=>P.id===n.id?{...P,label:g.target.value}:P))},className:"marker-label"}),e.jsx("button",{className:"marker-remove",onClick:()=>K(n.id),children:"×"})]},n.id))})]}),G&&e.jsxs("div",{className:"recorder__settings",children:[e.jsxs("div",{className:"settings-header",children:[e.jsx("h3",{children:"Recording Settings"}),e.jsx("button",{className:"close-button",onClick:()=>V(!1),children:"×"})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Video"}),e.jsxs("label",{children:["Source",e.jsxs("select",{value:s.video.source,onChange:n=>M({video:{...s.video,source:n.target.value}}),children:[e.jsx("option",{value:"screen",children:"Entire Screen"}),e.jsx("option",{value:"window",children:"Application Window"}),e.jsx("option",{value:"tab",children:"Browser Tab"}),e.jsx("option",{value:"camera",children:"Camera"})]})]}),e.jsxs("label",{children:["Resolution",e.jsxs("select",{value:`${(p=s.video.resolution)==null?void 0:p.width}x${(h=s.video.resolution)==null?void 0:h.height}`,onChange:n=>{const[g,C]=n.target.value.split("x").map(Number);M({video:{...s.video,resolution:{width:g,height:C}}})},children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"}),e.jsx("option",{value:"3840x2160",children:"4K (3840x2160)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"})]})]}),e.jsxs("label",{children:["Frame Rate",e.jsxs("select",{value:s.video.frameRate,onChange:n=>M({video:{...s.video,frameRate:parseInt(n.target.value)}}),children:[e.jsx("option",{value:"15",children:"15 fps"}),e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"})]})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.video.showCursor,onChange:n=>M({video:{...s.video,showCursor:n.target.checked}})}),"Show Cursor"]})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Audio"}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.audio.enabled,onChange:n=>M({audio:{...s.audio,enabled:n.target.checked}})}),"Enable Audio"]}),s.audio.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Source",e.jsxs("select",{value:s.audio.source,onChange:n=>M({audio:{...s.audio,source:n.target.value}}),children:[e.jsx("option",{value:"system",children:"System Audio"}),e.jsx("option",{value:"microphone",children:"Microphone"}),e.jsx("option",{value:"both",children:"Both"})]})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.audio.echoCancellation,onChange:n=>M({audio:{...s.audio,echoCancellation:n.target.checked}})}),"Echo Cancellation"]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.audio.noiseSuppression,onChange:n=>M({audio:{...s.audio,noiseSuppression:n.target.checked}})}),"Noise Suppression"]})]})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Output"}),e.jsxs("label",{children:["Format",e.jsxs("select",{value:s.output.format,onChange:n=>M({output:{...s.output,format:n.target.value}}),children:[e.jsx("option",{value:"webm",children:"WebM (Best Web)"}),e.jsx("option",{value:"mp4",children:"MP4 (Most Compatible)"}),e.jsx("option",{value:"mkv",children:"MKV (Lossless)"})]})]}),e.jsxs("label",{children:["Quality",e.jsxs("select",{value:s.output.quality,onChange:n=>M({output:{...s.output,quality:n.target.value}}),children:[e.jsx("option",{value:"low",children:"Low (Smaller file)"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High (Recommended)"}),e.jsx("option",{value:"lossless",children:"Lossless (Largest file)"})]})]})]})]})]})},Ve={id:crypto.randomUUID(),name:"My Stream",protocol:"rtmp",destinations:[],sources:[],layout:{name:"Default",canvas:{width:1920,height:1080,backgroundColor:"var(--nice-text, #000000)"},layers:[]},settings:{video:{resolution:{width:1920,height:1080},frameRate:30,codec:"h264",bitrate:6e3,keyframe:2,profile:"high"},audio:{sampleRate:48e3,bitrate:160,channels:2,codec:"aac"}}},ne=[{platform:"youtube",name:"YouTube",icon:"📺",defaultUrl:"rtmp://a.rtmp.youtube.com/live2"},{platform:"twitch",name:"Twitch",icon:"🎮",defaultUrl:"rtmp://live.twitch.tv/app"},{platform:"facebook",name:"Facebook",icon:"📘",defaultUrl:"rtmps://live-api-s.facebook.com:443/rtmp"},{platform:"custom-rtmp",name:"Custom RTMP",icon:"🔗",defaultUrl:""},{platform:"custom-srt",name:"Custom SRT",icon:"🔒",defaultUrl:""}],ie=[{type:"camera",name:"Camera",icon:"📷"},{type:"screen",name:"Screen Capture",icon:"🖥️"},{type:"window",name:"Window Capture",icon:"🪟"},{type:"browser",name:"Browser Source",icon:"🌐"},{type:"image",name:"Image",icon:"🖼️"},{type:"video",name:"Video",icon:"🎬"},{type:"microphone",name:"Microphone",icon:"🎤"},{type:"system-audio",name:"System Audio",icon:"🔊"}],Oe=({config:l,onConfigChange:m,onStreamStart:f,onStreamStop:N,onStatsUpdate:S,onError:H,className:u=""})=>{const[s,I]=d.useState(l||Ve),[b,_]=d.useState("sources"),[y,j]=d.useState(!1),[k,$]=d.useState({duration:0,viewers:0,peakViewers:0,bitrate:0,fps:0,droppedFrames:0,cpuUsage:0,memoryUsage:0}),[R,W]=d.useState(null),[L,T]=d.useState(!1),[G,V]=d.useState(!1),[A,E]=d.useState([s.layout]),[F,ae]=d.useState(0),re=d.useRef(null),D=d.useRef(null),x=d.useRef(0);d.useEffect(()=>{l&&I(l)},[l]),d.useEffect(()=>()=>{D.current&&clearInterval(D.current)},[]);const v=d.useCallback(a=>{const r={...s,...a};I(r),m==null||m(r)},[s,m]),U=a=>{const r=ne.find(p=>p.platform===a),o={id:crypto.randomUUID(),name:(r==null?void 0:r.name)||"Custom",platform:a,url:(r==null?void 0:r.defaultUrl)||"",streamKey:"",enabled:!0,status:"idle"};v({destinations:[...s.destinations,o]}),V(!1)},q=(a,r)=>{v({destinations:s.destinations.map(o=>o.id===a?{...o,...r}:o)})},O=a=>{v({destinations:s.destinations.filter(r=>r.id!==a)})},Q=async a=>{const r=ie.find(h=>h.type===a),o={id:crypto.randomUUID(),type:a,name:`${(r==null?void 0:r.name)||a} ${s.sources.filter(h=>h.type===a).length+1}`,settings:{},volume:1,muted:!1};try{if(a==="camera"||a==="microphone"){const h=a==="camera"?{video:!0}:{audio:!0},g=(await navigator.mediaDevices.enumerateDevices()).filter(C=>a==="camera"?C.kind==="videoinput":C.kind==="audioinput");g.length>0&&(o.settings.deviceId=g[0].deviceId)}else(a==="screen"||a==="window")&&await navigator.mediaDevices.getDisplayMedia({video:!0})}catch(h){console.warn(`Could not access ${a}:`,h)}v({sources:[...s.sources,o]});const p={id:crypto.randomUUID(),sourceId:o.id,position:{x:0,y:0},size:{width:s.layout.canvas.width,height:s.layout.canvas.height},visible:!0,opacity:1,zIndex:s.layout.layers.length};v({layout:{...s.layout,layers:[...s.layout.layers,p]}}),T(!1)},M=(a,r)=>{v({sources:s.sources.map(o=>o.id===a?{...o,...r}:o)})},Z=a=>{v({sources:s.sources.filter(r=>r.id!==a),layout:{...s.layout,layers:s.layout.layers.filter(r=>r.sourceId!==a)}})},z=(a,r)=>{v({layout:{...s.layout,layers:s.layout.layers.map(o=>o.id===a?{...o,...r}:o)}})},se=a=>{const r=s.layout.layers.findIndex(o=>o.id===a);if(r<s.layout.layers.length-1){const o=[...s.layout.layers];[o[r],o[r+1]]=[o[r+1],o[r]],o.forEach((p,h)=>{p.zIndex=h}),v({layout:{...s.layout,layers:o}})}},te=a=>{const r=s.layout.layers.findIndex(o=>o.id===a);if(r>0){const o=[...s.layout.layers];[o[r],o[r-1]]=[o[r-1],o[r]],o.forEach((p,h)=>{p.zIndex=h}),v({layout:{...s.layout,layers:o}})}},J=()=>{const a={name:`Scene ${A.length+1}`,canvas:{...s.layout.canvas},layers:[]};E([...A,a])},X=a=>{const r=[...A];r[F]=s.layout,E(r),ae(a),v({layout:A[a]})},ee=async()=>{try{v({destinations:s.destinations.map(a=>a.enabled?{...a,status:"connecting"}:a)}),await new Promise(a=>setTimeout(a,2e3)),v({destinations:s.destinations.map(a=>a.enabled?{...a,status:"live"}:a)}),j(!0),x.current=Date.now(),f==null||f(),D.current=setInterval(()=>{const a={duration:(Date.now()-x.current)/1e3,viewers:Math.floor(Math.random()*100)+k.viewers,peakViewers:Math.max(k.peakViewers,k.viewers),bitrate:s.settings.video.bitrate+Math.floor(Math.random()*500-250),fps:s.settings.video.frameRate-Math.random()*2,droppedFrames:k.droppedFrames+(Math.random()>.95?1:0),cpuUsage:15+Math.random()*30,memoryUsage:40+Math.random()*20};$(a),S==null||S(a)},1e3)}catch(a){H==null||H(a instanceof Error?a:new Error("Failed to start stream")),v({destinations:s.destinations.map(r=>({...r,status:"error"}))})}},K=()=>{D.current&&clearInterval(D.current),v({destinations:s.destinations.map(a=>({...a,status:"idle"}))}),j(!1),N==null||N()},t=a=>{const r=Math.floor(a/3600),o=Math.floor(a%3600/60),p=Math.floor(a%60);return`${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`},i=a=>{switch(a){case"live":return"var(--nice-success, #00ff00)";case"connecting":return"var(--nice-warning, #ffff00)";case"error":return"var(--nice-danger, #ff0000)";default:return"var(--nice-text-secondary, #888888)"}};return e.jsxs("div",{className:`nice-live-streaming ${u}`,children:[e.jsxs("header",{className:"streaming__header",children:[e.jsxs("div",{className:"header__title",children:[e.jsx("input",{type:"text",value:s.name,onChange:a=>v({name:a.target.value}),className:"stream-name-input"}),y&&e.jsxs("span",{className:"live-badge",children:[e.jsx("span",{className:"live-dot"})," LIVE"]})]}),e.jsx("div",{className:"header__stats",children:y&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"stat-item",children:["⏱️ ",t(k.duration)]}),e.jsxs("span",{className:"stat-item",children:["👥 ",k.viewers]}),e.jsxs("span",{className:"stat-item",children:["📊 ",Math.round(k.bitrate)," kbps"]}),e.jsxs("span",{className:"stat-item",children:["🎬 ",k.fps.toFixed(1)," fps"]})]})}),e.jsx("div",{className:"header__actions",children:y?e.jsx("button",{className:"action-button action-button--stop",onClick:K,children:"End Stream"}):e.jsx("button",{className:"action-button action-button--go-live",onClick:ee,disabled:s.destinations.filter(a=>a.enabled).length===0,children:"Go Live"})})]}),e.jsxs("div",{className:"streaming__main",children:[e.jsxs("div",{className:"streaming__preview",children:[e.jsxs("div",{className:"scenes-bar",children:[A.map((a,r)=>e.jsx("button",{className:`scene-button ${F===r?"scene-button--active":""}`,onClick:()=>X(r),children:a.name},r)),e.jsx("button",{className:"scene-button scene-button--add",onClick:J,children:"+"})]}),e.jsx("div",{ref:re,className:"preview-canvas",style:{aspectRatio:`${s.layout.canvas.width}/${s.layout.canvas.height}`,backgroundColor:s.layout.canvas.backgroundColor},children:s.layout.layers.sort((a,r)=>a.zIndex-r.zIndex).map(a=>{var o;const r=s.sources.find(p=>p.id===a.sourceId);return!a.visible||!r?null:e.jsx("div",{className:`canvas-layer ${R===a.id?"canvas-layer--selected":""}`,style:{left:`${a.position.x/s.layout.canvas.width*100}%`,top:`${a.position.y/s.layout.canvas.height*100}%`,width:`${a.size.width/s.layout.canvas.width*100}%`,height:`${a.size.height/s.layout.canvas.height*100}%`,opacity:a.opacity,zIndex:a.zIndex},onClick:()=>W(a.id),children:e.jsxs("div",{className:"layer-content",children:[e.jsx("span",{className:"layer-icon",children:((o=ie.find(p=>p.type===r.type))==null?void 0:o.icon)||"📦"}),e.jsx("span",{className:"layer-name",children:r.name})]})},a.id)})})]}),e.jsxs("aside",{className:"streaming__panel",children:[e.jsx("div",{className:"panel-tabs",children:["sources","audio","destinations","settings"].map(a=>e.jsx("button",{className:`panel-tab ${b===a?"panel-tab--active":""}`,onClick:()=>_(a),children:a.charAt(0).toUpperCase()+a.slice(1)},a))}),e.jsxs("div",{className:"panel-content",children:[b==="sources"&&e.jsxs("div",{className:"sources-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Sources"}),e.jsx("button",{className:"add-button",onClick:()=>T(!0),disabled:y,children:"+ Add"})]}),e.jsx("div",{className:"sources-list",children:s.sources.filter(a=>a.type!=="microphone"&&a.type!=="system-audio").map(a=>{var o;const r=s.layout.layers.find(p=>p.sourceId===a.id);return e.jsxs("div",{className:`source-item ${R===(r==null?void 0:r.id)?"source-item--selected":""}`,onClick:()=>r&&W(r.id),children:[e.jsx("span",{className:"source-icon",children:(o=ie.find(p=>p.type===a.type))==null?void 0:o.icon}),e.jsx("span",{className:"source-name",children:a.name}),e.jsxs("div",{className:"source-controls",children:[e.jsx("button",{className:r!=null&&r.visible?"":"inactive",onClick:p=>{p.stopPropagation(),r&&z(r.id,{visible:!r.visible})},children:r!=null&&r.visible?"👁️":"👁️‍🗨️"}),e.jsx("button",{onClick:p=>{p.stopPropagation(),r&&se(r.id)},children:"⬆️"}),e.jsx("button",{onClick:p=>{p.stopPropagation(),r&&te(r.id)},children:"⬇️"}),e.jsx("button",{onClick:p=>{p.stopPropagation(),Z(a.id)},disabled:y,children:"🗑️"})]})]},a.id)})}),R&&e.jsxs("div",{className:"layer-properties",children:[e.jsx("h4",{children:"Properties"}),(()=>{const a=s.layout.layers.find(r=>r.id===R);return a?e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["X Position",e.jsx("input",{type:"number",value:a.position.x,onChange:r=>z(a.id,{position:{...a.position,x:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:["Y Position",e.jsx("input",{type:"number",value:a.position.y,onChange:r=>z(a.id,{position:{...a.position,y:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:["Width",e.jsx("input",{type:"number",value:a.size.width,onChange:r=>z(a.id,{size:{...a.size,width:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:["Height",e.jsx("input",{type:"number",value:a.size.height,onChange:r=>z(a.id,{size:{...a.size,height:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:["Opacity",e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:a.opacity,onChange:r=>z(a.id,{opacity:parseFloat(r.target.value)})})]})]}):null})()]})]}),b==="audio"&&e.jsxs("div",{className:"audio-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Audio Mixer"}),e.jsx("button",{className:"add-button",onClick:()=>{T(!0)},disabled:y,children:"+ Add"})]}),e.jsxs("div",{className:"audio-sources",children:[s.sources.filter(a=>a.type==="microphone"||a.type==="system-audio"||a.type==="video").map(a=>{var r;return e.jsxs("div",{className:"audio-source",children:[e.jsxs("div",{className:"audio-header",children:[e.jsx("span",{className:"audio-icon",children:(r=ie.find(o=>o.type===a.type))==null?void 0:r.icon}),e.jsx("span",{className:"audio-name",children:a.name}),e.jsx("button",{className:a.muted?"muted":"",onClick:()=>M(a.id,{muted:!a.muted}),children:a.muted?"🔇":"🔊"})]}),e.jsxs("div",{className:"audio-slider",children:[e.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:a.volume??1,onChange:o=>M(a.id,{volume:parseFloat(o.target.value)}),disabled:a.muted}),e.jsxs("span",{className:"volume-value",children:[Math.round((a.volume??1)*100),"%"]})]}),e.jsx("div",{className:"audio-meter",children:e.jsx("div",{className:"meter-fill",style:{width:`${(a.volume??1)*70+Math.random()*30}%`}})})]},a.id)}),s.sources.filter(a=>a.type==="microphone"||a.type==="system-audio").length===0&&e.jsx("p",{className:"empty-message",children:"No audio sources added"})]})]}),b==="destinations"&&e.jsxs("div",{className:"destinations-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Destinations"}),e.jsx("button",{className:"add-button",onClick:()=>V(!0),disabled:y,children:"+ Add"})]}),e.jsxs("div",{className:"destinations-list",children:[s.destinations.map(a=>{var r;return e.jsxs("div",{className:"destination-item",children:[e.jsxs("div",{className:"destination-header",children:[e.jsx("span",{className:"status-indicator",style:{backgroundColor:i(a.status)}}),e.jsx("span",{className:"destination-icon",children:(r=ne.find(o=>o.platform===a.platform))==null?void 0:r.icon}),e.jsx("span",{className:"destination-name",children:a.name}),e.jsxs("label",{className:"toggle",children:[e.jsx("input",{type:"checkbox",checked:a.enabled,onChange:o=>q(a.id,{enabled:o.target.checked}),disabled:y}),e.jsx("span",{className:"toggle-slider"})]})]}),e.jsxs("div",{className:"destination-config",children:[e.jsxs("label",{children:["Server URL",e.jsx("input",{type:"text",value:a.url,onChange:o=>q(a.id,{url:o.target.value}),placeholder:"rtmp://...",disabled:y})]}),e.jsxs("label",{children:["Stream Key",e.jsx("input",{type:"password",value:a.streamKey||"",onChange:o=>q(a.id,{streamKey:o.target.value}),placeholder:"Enter stream key",disabled:y})]})]}),e.jsx("button",{className:"remove-button",onClick:()=>O(a.id),disabled:y,children:"Remove"})]},a.id)}),s.destinations.length===0&&e.jsx("p",{className:"empty-message",children:"No destinations configured"})]})]}),b==="settings"&&e.jsxs("div",{className:"settings-panel",children:[e.jsxs("div",{className:"setting-section",children:[e.jsx("h4",{children:"Video"}),e.jsxs("label",{children:["Resolution",e.jsxs("select",{value:`${s.settings.video.resolution.width}x${s.settings.video.resolution.height}`,onChange:a=>{const[r,o]=a.target.value.split("x").map(Number);v({settings:{...s.settings,video:{...s.settings.video,resolution:{width:r,height:o}}},layout:{...s.layout,canvas:{...s.layout.canvas,width:r,height:o}}})},disabled:y,children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"})]})]}),e.jsxs("label",{children:["Frame Rate",e.jsxs("select",{value:s.settings.video.frameRate,onChange:a=>v({settings:{...s.settings,video:{...s.settings.video,frameRate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"})]})]}),e.jsxs("label",{children:["Bitrate (kbps)",e.jsx("input",{type:"number",value:s.settings.video.bitrate,onChange:a=>v({settings:{...s.settings,video:{...s.settings.video,bitrate:parseInt(a.target.value)||6e3}}}),min:"1000",max:"50000",disabled:y})]}),e.jsxs("label",{children:["Keyframe Interval (sec)",e.jsx("input",{type:"number",value:s.settings.video.keyframe,onChange:a=>v({settings:{...s.settings,video:{...s.settings.video,keyframe:parseInt(a.target.value)||2}}}),min:"1",max:"10",disabled:y})]})]}),e.jsxs("div",{className:"setting-section",children:[e.jsx("h4",{children:"Audio"}),e.jsxs("label",{children:["Sample Rate",e.jsxs("select",{value:s.settings.audio.sampleRate,onChange:a=>v({settings:{...s.settings,audio:{...s.settings.audio,sampleRate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"44100",children:"44.1 kHz"}),e.jsx("option",{value:"48000",children:"48 kHz"})]})]}),e.jsxs("label",{children:["Audio Bitrate (kbps)",e.jsxs("select",{value:s.settings.audio.bitrate,onChange:a=>v({settings:{...s.settings,audio:{...s.settings.audio,bitrate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"96",children:"96 kbps"}),e.jsx("option",{value:"128",children:"128 kbps"}),e.jsx("option",{value:"160",children:"160 kbps"}),e.jsx("option",{value:"320",children:"320 kbps"})]})]})]})]})]})]})]}),y&&e.jsx("footer",{className:"streaming__footer",children:e.jsxs("div",{className:"footer-stats",children:[e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"CPU"}),e.jsxs("span",{className:"value",children:[k.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Memory"}),e.jsxs("span",{className:"value",children:[k.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Dropped"}),e.jsx("span",{className:"value",children:k.droppedFrames})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Peak Viewers"}),e.jsx("span",{className:"value",children:k.peakViewers})]})]})}),L&&e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Add Source"}),e.jsx("button",{className:"close-button",onClick:()=>T(!1),children:"×"})]}),e.jsx("div",{className:"modal-content",children:e.jsx("div",{className:"source-type-grid",children:ie.map(a=>e.jsxs("button",{className:"source-type-button",onClick:()=>Q(a.type),children:[e.jsx("span",{className:"icon",children:a.icon}),e.jsx("span",{className:"name",children:a.name})]},a.type))})})]})}),G&&e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Add Destination"}),e.jsx("button",{className:"close-button",onClick:()=>V(!1),children:"×"})]}),e.jsx("div",{className:"modal-content",children:e.jsx("div",{className:"platform-grid",children:ne.map(a=>e.jsxs("button",{className:"platform-button",onClick:()=>U(a.platform),children:[e.jsx("span",{className:"icon",children:a.icon}),e.jsx("span",{className:"name",children:a.name})]},a.platform))})})]})})]})};exports.NiceLiveStreaming=Oe;exports.NiceScreenRecorder=Le;exports.NiceVideoEditor=Fe;
27
+ `,document.head.appendChild(l)}d.createContext(null);d.createContext(null);d.createContext(null);const me={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ue={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},pe={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},ye=l=>({color:l,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),_e={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},$e={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function c(l,m,f,N,S){return{name:l,darkMode:"light",colors:{...m,surface:m.surface??f.primary,surfaceHover:m.surfaceHover??f.secondary},backgrounds:{...f,elevated:f.elevated??f.primary,inset:f.inset??f.tertiary,canvas:f.canvas??f.primary},text:{...N,inverse:N.inverse??"#ffffff"},borders:ye(S),shadows:_e,spacing:me,typography:ue,transitions:pe}}function w(l,m,f,N,S){return{name:l,darkMode:"dark",colors:{...m,surface:m.surface??f.secondary,surfaceHover:m.surfaceHover??f.tertiary},backgrounds:{...f,elevated:f.elevated??f.secondary,inset:f.inset??f.primary,canvas:f.canvas??f.primary},text:{...N,inverse:N.inverse??"#0f172a"},borders:ye(S),shadows:$e,spacing:me,typography:ue,transitions:pe}}c("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1");c("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8");c("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1");c("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db");c("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8");c("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1");c("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db");c("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4");c("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af");c("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7");c("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d");c("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd");c("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4");c("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc");c("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9");c("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264");c("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4");c("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74");c("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9");c("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc");c("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af");c("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74");w("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b");w("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46");w("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266");w("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626");w("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252");w("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151");w("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87");w("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985");w("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040");w("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857");c("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac");c("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc");c("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047");c("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74");c("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4");c("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe");c("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5");c("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac");c("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd");c("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0");c("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4");c("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd");c("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0");c("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa");c("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe");c("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a");c("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0");c("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3");c("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1");c("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb");c("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1");c("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd");c("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd");c("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1");c("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0");c("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d");c("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9");w("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a");c("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5");w("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642");w("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32");w("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452");w("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866");c("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8");w("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300");c("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8");c("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4");w("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44");w("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333");w("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66");c("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0");w("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400");c("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af");c("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe");c("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d");c("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe");c("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8");c("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d");c("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0");c("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0");c("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb");c("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe");c("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5");c("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d");c("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac");c("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896");w("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff");c("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0");c("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c");c("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5");w("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e");w("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58");c("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8");c("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0");d.createContext(null);const Ee={id:crypto.randomUUID(),name:"Untitled Project",resolution:{width:1920,height:1080,label:"1080p"},frameRate:30,duration:0,tracks:[{id:"1",type:"video",name:"Video 1",items:[],muted:!1,locked:!1,visible:!0},{id:"2",type:"audio",name:"Audio 1",items:[],muted:!1,locked:!1,visible:!0}],assets:[],settings:{backgroundColor:"var(--nice-text, #000000)",audio:{sampleRate:48e3,channels:2,bitrate:320},video:{codec:"h264",bitrate:8e3,profile:"high"}}},Ae=[{type:"blur",name:"Blur",icon:"🔵"},{type:"brightness",name:"Brightness",icon:"☀️"},{type:"contrast",name:"Contrast",icon:"◐"},{type:"saturation",name:"Saturation",icon:"🎨"},{type:"grayscale",name:"Grayscale",icon:"⬛"},{type:"sepia",name:"Sepia",icon:"🟤"},{type:"chromaKey",name:"Chroma Key",icon:"🟢"},{type:"crop",name:"Crop",icon:"✂️"},{type:"zoom",name:"Zoom",icon:"🔍"}],ze=[{type:"fade",name:"Fade"},{type:"dissolve",name:"Dissolve"},{type:"wipe",name:"Wipe"},{type:"slide",name:"Slide"},{type:"zoom",name:"Zoom"},{type:"push",name:"Push"}],Pe=[{target:".nice-video-editor",titleKey:"tutorial.videoEditorPro.intro.title",title:"Video editor",contentKey:"tutorial.videoEditorPro.intro.content",content:"Add media to the timeline, arrange and trim clips, apply effects and transitions, then configure and run the export.",placement:"auto"}],Fe=({project:l,onProjectChange:m,onExport:f,onAssetUpload:N,className:S="",tutorial:H})=>{const[u,s]=d.useState(l||Ee),[I,b]=d.useState("timeline"),[_,y]=d.useState(null),[j,k]=d.useState(null),[$,R]=d.useState(0),[K,L]=d.useState(!1),[T,G]=d.useState(1),[V,E]=d.useState(!0),[A,F]=d.useState(null),ae=d.useRef(null),re=d.useRef(null),D=d.useRef(null);d.useEffect(()=>{l&&s(l)},[l]),d.useEffect(()=>()=>{D.current&&clearInterval(D.current)},[]);const x=d.useCallback(t=>{const i={...u,...t};s(i),m==null||m(i)},[u,m]),v=async t=>{const i=[];for(const a of Array.from(t)){const r=a.type.startsWith("video/")?"video":a.type.startsWith("audio/")?"audio":"image";let o;N?o=await N(a):o={id:crypto.randomUUID(),type:r,name:a.name,url:URL.createObjectURL(a),size:a.size},i.push(o)}x({assets:[...u.assets,...i]})},U=t=>{const i={id:crypto.randomUUID(),type:t,name:`${t.charAt(0).toUpperCase()+t.slice(1)} ${u.tracks.filter(a=>a.type===t).length+1}`,items:[],muted:!1,locked:!1,visible:!0};x({tracks:[...u.tracks,i]})},q=t=>{x({tracks:u.tracks.filter(i=>i.id!==t)}),_===t&&y(null)},O=t=>{x({tracks:u.tracks.map(i=>i.id===t?{...i,muted:!i.muted}:i)})},Q=t=>{x({tracks:u.tracks.map(i=>i.id===t?{...i,locked:!i.locked}:i)})},M=(t,i)=>{const a=u.tracks.find(h=>h.id===t);if(!a||a.locked)return;const r=a.items[a.items.length-1],o=r?r.startTime+r.duration:0,p={id:crypto.randomUUID(),assetId:i.id,type:i.type,startTime:o,duration:i.duration||5,offset:0,properties:{x:0,y:0,opacity:1,scale:1,volume:1},effects:[],transitions:[]};x({tracks:u.tracks.map(h=>h.id===t?{...h,items:[...h.items,p]}:h)})},Z=(t,i,a)=>{const r={id:crypto.randomUUID(),type:a,name:a.charAt(0).toUpperCase()+a.slice(1),parameters:se(a)};x({tracks:u.tracks.map(o=>o.id===t?{...o,items:o.items.map(p=>p.id===i?{...p,effects:[...p.effects,r]}:p)}:o)})},z=(t,i,a,r)=>{const o={id:crypto.randomUUID(),type:a,duration:.5,position:r};x({tracks:u.tracks.map(p=>p.id===t?{...p,items:p.items.map(h=>h.id===i?{...h,transitions:[...h.transitions,o]}:h)}:p)})},se=t=>{switch(t){case"blur":return{radius:5};case"brightness":return{value:100};case"contrast":return{value:100};case"saturation":return{value:100};case"grayscale":return{amount:100};case"sepia":return{amount:100};case"chromaKey":return{color:"var(--nice-success, #00ff00)",threshold:40};case"crop":return{top:0,right:0,bottom:0,left:0};case"zoom":return{scale:1,x:0,y:0};default:return{}}},te=()=>{K?(D.current&&clearInterval(D.current),L(!1)):(D.current=setInterval(()=>{R(t=>{const i=Math.max(...u.tracks.flatMap(a=>a.items.map(r=>r.startTime+r.duration)),0);return t>=i?(clearInterval(D.current),L(!1),0):t+1/u.frameRate})},1e3/u.frameRate),L(!0))},J=t=>{R(Math.max(0,t))},Y=async()=>{if(f){F(0);try{const t=setInterval(()=>{F(i=>i!==null&&i<90?i+Math.random()*10:i)},500);await f(u,u.settings.video.codec),clearInterval(t),F(100),setTimeout(()=>F(null),2e3)}catch(t){F(null),console.error("Export failed:",t)}}},ee=t=>{const i=Math.floor(t/60),a=Math.floor(t%60),r=Math.floor(t%1*u.frameRate);return`${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},W=()=>{for(const t of u.tracks){const i=t.items.find(a=>a.id===j);if(i)return{track:t,item:i}}return null};return e.jsxs("div",{className:`nice-video-editor ${S}`,style:{position:"relative"},children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx(De,{steps:Ie(H,Pe)})}),e.jsxs("header",{className:"video-editor__header",children:[e.jsxs("div",{className:"header__project-info",children:[e.jsx("input",{type:"text",value:u.name,onChange:t=>x({name:t.target.value}),className:"project-name-input"}),e.jsxs("span",{className:"project-settings",children:[u.resolution.width,"x",u.resolution.height," • ",u.frameRate,"fps"]})]}),e.jsx("div",{className:"header__tabs",children:["timeline","effects","transitions","export"].map(t=>e.jsx("button",{className:`tab-button ${I===t?"tab-button--active":""}`,onClick:()=>b(t),children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsx("div",{className:"header__actions",children:e.jsx("button",{className:"action-button action-button--primary",onClick:Y,disabled:A!==null,children:A!==null?`Exporting ${Math.round(A)}%`:"Export"})})]}),e.jsxs("div",{className:"video-editor__main",children:[V&&e.jsxs("aside",{className:"video-editor__asset-library",children:[e.jsxs("div",{className:"asset-library__header",children:[e.jsx("h3",{children:"Assets"}),e.jsx("button",{className:"close-button",onClick:()=>E(!1),children:"×"})]}),e.jsx("div",{className:"asset-library__upload",children:e.jsxs("label",{className:"upload-zone",children:[e.jsx("input",{type:"file",multiple:!0,accept:"video/*,audio/*,image/*",onChange:t=>t.target.files&&v(t.target.files),hidden:!0}),e.jsx("span",{className:"upload-icon",children:"+"}),e.jsx("span",{children:"Drop files or click to upload"})]})}),e.jsx("div",{className:"asset-library__list",children:u.assets.map(t=>e.jsxs("div",{className:"asset-item",draggable:!0,onDragStart:i=>i.dataTransfer.setData("assetId",t.id),children:[e.jsx("div",{className:"asset-thumbnail",children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):e.jsx("span",{className:"asset-type-icon",children:t.type==="video"?"🎬":t.type==="audio"?"🎵":"🖼️"})}),e.jsxs("div",{className:"asset-info",children:[e.jsx("span",{className:"asset-name",children:t.name}),e.jsxs("span",{className:"asset-meta",children:[(t.size/1024/1024).toFixed(1),"MB"]})]})]},t.id))})]}),e.jsxs("div",{className:"video-editor__preview-area",children:[e.jsxs("div",{className:"preview-container",children:[e.jsxs("div",{className:"preview-canvas",style:{aspectRatio:`${u.resolution.width}/${u.resolution.height}`},children:[e.jsx("video",{ref:re,className:"preview-video"}),e.jsx("div",{className:"preview-overlay",children:!V&&e.jsx("button",{className:"toggle-library-button",onClick:()=>E(!0),children:"📁"})})]}),e.jsxs("div",{className:"playback-controls",children:[e.jsx("button",{onClick:()=>J(0),children:"⏮️"}),e.jsx("button",{onClick:()=>J($-1/u.frameRate),children:"⏪"}),e.jsx("button",{onClick:te,className:"play-button",children:K?"⏸️":"▶️"}),e.jsx("button",{onClick:()=>J($+1/u.frameRate),children:"⏩"}),e.jsx("span",{className:"time-display",children:ee($)})]})]}),j&&I!=="export"&&e.jsx("div",{className:"item-inspector",children:(()=>{const t=W();if(!t)return null;const{track:i,item:a}=t;return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Item Properties"}),e.jsxs("div",{className:"inspector-section",children:[e.jsxs("label",{children:["Start Time",e.jsx("input",{type:"number",step:"0.1",value:a.startTime,onChange:r=>{const o=parseFloat(r.target.value);x({tracks:u.tracks.map(p=>p.id===i.id?{...p,items:p.items.map(h=>h.id===a.id?{...h,startTime:o}:h)}:p)})}})]}),e.jsxs("label",{children:["Duration",e.jsx("input",{type:"number",step:"0.1",value:a.duration,onChange:r=>{const o=parseFloat(r.target.value);x({tracks:u.tracks.map(p=>p.id===i.id?{...p,items:p.items.map(h=>h.id===a.id?{...h,duration:o}:h)}:p)})}})]}),e.jsxs("label",{children:["Opacity",e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:a.properties.opacity??1,onChange:r=>{const o=parseFloat(r.target.value);x({tracks:u.tracks.map(p=>p.id===i.id?{...p,items:p.items.map(h=>h.id===a.id?{...h,properties:{...h.properties,opacity:o}}:h)}:p)})}})]})]}),e.jsxs("h4",{children:["Effects (",a.effects.length,")"]}),e.jsx("div",{className:"effects-list",children:a.effects.map(r=>e.jsx("div",{className:"effect-badge",children:r.name},r.id))})]})})()})]})]}),e.jsxs("div",{className:"video-editor__panel",children:[I==="timeline"&&e.jsxs("div",{className:"timeline-panel",children:[e.jsxs("div",{className:"timeline-toolbar",children:[e.jsxs("div",{className:"track-buttons",children:[e.jsx("button",{onClick:()=>U("video"),children:"+ Video Track"}),e.jsx("button",{onClick:()=>U("audio"),children:"+ Audio Track"}),e.jsx("button",{onClick:()=>U("text"),children:"+ Text Track"})]}),e.jsxs("div",{className:"zoom-controls",children:[e.jsx("button",{onClick:()=>G(Math.max(.25,T-.25)),children:"-"}),e.jsxs("span",{children:[Math.round(T*100),"%"]}),e.jsx("button",{onClick:()=>G(Math.min(4,T+.25)),children:"+"})]})]}),e.jsxs("div",{className:"timeline-container",ref:ae,children:[e.jsx("div",{className:"timeline-ruler",children:Array.from({length:Math.ceil(30/T)}).map((t,i)=>e.jsx("div",{className:"ruler-mark",style:{left:`${i*50*T}px`},children:ee(i)},i))}),e.jsx("div",{className:"timeline-playhead",style:{left:`${$*50*T}px`}}),e.jsx("div",{className:"timeline-tracks",children:u.tracks.map(t=>e.jsxs("div",{className:`timeline-track ${_===t.id?"timeline-track--selected":""} ${t.locked?"timeline-track--locked":""}`,onClick:()=>y(t.id),onDrop:i=>{i.preventDefault();const a=i.dataTransfer.getData("assetId"),r=u.assets.find(o=>o.id===a);r&&M(t.id,r)},onDragOver:i=>i.preventDefault(),children:[e.jsxs("div",{className:"track-header",children:[e.jsx("span",{className:"track-name",children:t.name}),e.jsxs("div",{className:"track-controls",children:[e.jsx("button",{className:t.muted?"active":"",onClick:i=>{i.stopPropagation(),O(t.id)},children:t.muted?"🔇":"🔊"}),e.jsx("button",{className:t.locked?"active":"",onClick:i=>{i.stopPropagation(),Q(t.id)},children:t.locked?"🔒":"🔓"}),e.jsx("button",{onClick:i=>{i.stopPropagation(),q(t.id)},children:"🗑️"})]})]}),e.jsx("div",{className:"track-items",children:t.items.map(i=>{const a=u.assets.find(r=>r.id===i.assetId);return e.jsxs("div",{className:`track-item track-item--${i.type} ${j===i.id?"track-item--selected":""}`,style:{left:`${i.startTime*50*T}px`,width:`${i.duration*50*T}px`},onClick:r=>{r.stopPropagation(),k(i.id)},children:[e.jsx("span",{className:"item-name",children:(a==null?void 0:a.name)||"Untitled"}),i.transitions.length>0&&e.jsx("span",{className:"item-transitions",children:"✨"}),i.effects.length>0&&e.jsx("span",{className:"item-effects",children:"🎨"})]},i.id)})})]},t.id))})]})]}),I==="effects"&&e.jsxs("div",{className:"effects-panel",children:[e.jsx("h3",{children:"Video Effects"}),e.jsx("p",{className:"panel-hint",children:"Select a clip to apply effects"}),e.jsx("div",{className:"effects-grid",children:Ae.map(t=>e.jsxs("button",{className:"effect-preset",disabled:!j,onClick:()=>{const i=W();i&&Z(i.track.id,i.item.id,t.type)},children:[e.jsx("span",{className:"effect-icon",children:t.icon}),e.jsx("span",{className:"effect-name",children:t.name})]},t.type))})]}),I==="transitions"&&e.jsxs("div",{className:"transitions-panel",children:[e.jsx("h3",{children:"Transitions"}),e.jsx("p",{className:"panel-hint",children:"Select a clip and add transitions between clips"}),e.jsx("div",{className:"transitions-grid",children:ze.map(t=>e.jsxs("div",{className:"transition-preset",children:[e.jsx("span",{className:"transition-name",children:t.name}),e.jsxs("div",{className:"transition-buttons",children:[e.jsx("button",{disabled:!j,onClick:()=>{const i=W();i&&z(i.track.id,i.item.id,t.type,"start")},children:"In"}),e.jsx("button",{disabled:!j,onClick:()=>{const i=W();i&&z(i.track.id,i.item.id,t.type,"end")},children:"Out"})]})]},t.type))})]}),I==="export"&&e.jsxs("div",{className:"export-panel",children:[e.jsx("h3",{children:"Export Settings"}),e.jsxs("div",{className:"export-settings",children:[e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Resolution"}),e.jsxs("select",{value:`${u.resolution.width}x${u.resolution.height}`,onChange:t=>{const[i,a]=t.target.value.split("x").map(Number);x({resolution:{width:i,height:a}})},children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"}),e.jsx("option",{value:"3840x2160",children:"4K (3840x2160)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Frame Rate"}),e.jsxs("select",{value:u.frameRate,onChange:t=>x({frameRate:parseInt(t.target.value)}),children:[e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"}),e.jsx("option",{value:"120",children:"120 fps"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Video Codec"}),e.jsxs("select",{value:u.settings.video.codec,onChange:t=>x({settings:{...u.settings,video:{...u.settings.video,codec:t.target.value}}}),children:[e.jsx("option",{value:"h264",children:"H.264 (Best Compatibility)"}),e.jsx("option",{value:"h265",children:"H.265/HEVC (Smaller Size)"}),e.jsx("option",{value:"vp9",children:"VP9 (Web Optimized)"}),e.jsx("option",{value:"av1",children:"AV1 (Future Standard)"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Video Bitrate (Mbps)"}),e.jsx("input",{type:"number",value:u.settings.video.bitrate/1e3,onChange:t=>x({settings:{...u.settings,video:{...u.settings.video,bitrate:parseFloat(t.target.value)*1e3}}}),min:"1",max:"100"})]})]}),e.jsx("button",{className:"export-button",onClick:Y,disabled:A!==null,children:A!==null?`Exporting... ${Math.round(A)}%`:"Export Video"}),A!==null&&e.jsx("div",{className:"export-progress",children:e.jsx("div",{className:"export-progress-bar",style:{width:`${A}%`}})})]})]})]})},Ue={video:{source:"screen",showCursor:!0,frameRate:30,resolution:{width:1920,height:1080}},audio:{enabled:!0,source:"both",echoCancellation:!0,noiseSuppression:!0},output:{format:"webm",quality:"high"}},Le=({options:l,onRecordingStart:m,onRecordingStop:f,onRecordingPause:N,onRecordingResume:S,onError:H,className:u=""})=>{var p,h;const[s,I]=d.useState({...Ue,...l}),[b,_]=d.useState(null),[y,j]=d.useState("idle"),[k,$]=d.useState([]),[R,K]=d.useState(null),[L,T]=d.useState(null),[G,V]=d.useState(!1),[E,A]=d.useState(!1),[F,ae]=d.useState("pen"),[re,D]=d.useState("var(--nice-danger, #ff0000)"),x=d.useRef(null),v=d.useRef([]),U=d.useRef(null),q=d.useRef(null),O=d.useRef(null),Q=d.useRef(0);d.useEffect(()=>()=>{R&&R.getTracks().forEach(n=>n.stop()),O.current&&clearInterval(O.current)},[R]);const M=n=>{I(g=>({...g,...n,video:{...g.video,...n.video},audio:{...g.audio,...n.audio},output:{...g.output,...n.output}}))},Z=async()=>{try{j("preparing");const n={video:{cursor:s.video.showCursor?"always":"never",frameRate:s.video.frameRate},audio:s.audio.source==="system"||s.audio.source==="both"},g=await navigator.mediaDevices.getDisplayMedia(n);if(s.audio.enabled&&(s.audio.source==="microphone"||s.audio.source==="both"))try{(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:s.audio.echoCancellation,noiseSuppression:s.audio.noiseSuppression}})).getAudioTracks().forEach(P=>g.addTrack(P))}catch(C){console.warn("Could not access microphone:",C)}K(g),U.current&&(U.current.srcObject=g,U.current.play()),j("idle")}catch(n){j("error"),H==null||H(n instanceof Error?n:new Error("Failed to start preview"))}},z=async()=>{R||await Z();for(let n=3;n>0;n--)T(n),await new Promise(g=>setTimeout(g,1e3));T(null);try{const n=R||await se();if(!n)throw new Error("No stream available");const g=t(s.output.format),C=new MediaRecorder(n,{mimeType:g,videoBitsPerSecond:i(s.output.quality)});v.current=[],C.ondataavailable=B=>{B.data.size>0&&v.current.push(B.data)},C.onstop=()=>{const B=new Blob(v.current,{type:g});b&&(f==null||f({...b,status:"stopped"},B))},x.current=C,C.start(1e3),Q.current=Date.now();const P={id:crypto.randomUUID(),status:"recording",startTime:new Date,duration:0,size:0,options:s,chunks:[]};_(P),j("recording"),m==null||m(P),O.current=setInterval(()=>{_(B=>B?{...B,duration:(Date.now()-Q.current)/1e3,size:v.current.reduce((he,be)=>he+be.size,0)}:null)},100)}catch(n){j("error"),H==null||H(n instanceof Error?n:new Error("Failed to start recording"))}},se=async()=>(await Z(),R),te=()=>{x.current&&y==="recording"&&(x.current.pause(),j("paused"),N==null||N())},J=()=>{x.current&&y==="paused"&&(x.current.resume(),j("recording"),S==null||S())},Y=()=>{O.current&&clearInterval(O.current),x.current&&(y==="recording"||y==="paused")&&(x.current.stop(),j("stopped")),R&&(R.getTracks().forEach(n=>n.stop()),K(null))},ee=d.useCallback(n=>{if(y!=="recording")return;const g={id:crypto.randomUUID(),time:(b==null?void 0:b.duration)||0,label:n||`Marker ${k.length+1}`,color:a()};$(C=>[...C,g])},[y,b==null?void 0:b.duration,k.length]),W=n=>{$(g=>g.filter(C=>C.id!==n))},t=n=>{switch(n){case"mp4":return"video/mp4";case"mkv":return"video/x-matroska";default:return"video/webm;codecs=vp9"}},i=n=>{switch(n){case"low":return 25e5;case"medium":return 5e6;case"lossless":return 2e7;default:return 8e6}},a=()=>{const n=["var(--nice-danger, #ff4444)","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff"];return n[Math.floor(Math.random()*n.length)]},r=n=>{const g=Math.floor(n/3600),C=Math.floor(n%3600/60),P=Math.floor(n%60),B=Math.floor(n%1*100);return g>0?`${g}:${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}`:`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}.${B.toString().padStart(2,"0")}`},o=n=>n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`;return e.jsxs("div",{className:`nice-screen-recorder ${u}`,children:[e.jsxs("div",{className:"recorder__preview",children:[L!==null&&e.jsx("div",{className:"countdown-overlay",children:e.jsx("span",{className:"countdown-number",children:L})}),e.jsx("video",{ref:U,className:"preview-video",muted:!0,playsInline:!0}),E&&e.jsx("canvas",{ref:q,className:"annotation-canvas"}),!R&&y==="idle"&&e.jsx("div",{className:"preview-placeholder",children:e.jsxs("button",{className:"start-preview-button",onClick:Z,children:[e.jsx("span",{className:"icon",children:"🖥️"}),e.jsx("span",{children:"Select Screen to Record"})]})}),y==="recording"&&e.jsxs("div",{className:"recording-indicator",children:[e.jsx("span",{className:"recording-dot"}),e.jsx("span",{children:"REC"})]})]}),e.jsxs("div",{className:"recorder__controls",children:[e.jsxs("div",{className:"controls__main",children:[y==="idle"&&e.jsxs("button",{className:"control-button control-button--record",onClick:z,disabled:!!L,children:[e.jsx("span",{className:"icon",children:"⏺️"}),e.jsx("span",{children:"Start Recording"})]}),y==="recording"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"control-button control-button--pause",onClick:te,children:[e.jsx("span",{className:"icon",children:"⏸️"}),e.jsx("span",{children:"Pause"})]}),e.jsxs("button",{className:"control-button control-button--stop",onClick:Y,children:[e.jsx("span",{className:"icon",children:"⏹️"}),e.jsx("span",{children:"Stop"})]})]}),y==="paused"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"control-button control-button--resume",onClick:J,children:[e.jsx("span",{className:"icon",children:"▶️"}),e.jsx("span",{children:"Resume"})]}),e.jsxs("button",{className:"control-button control-button--stop",onClick:Y,children:[e.jsx("span",{className:"icon",children:"⏹️"}),e.jsx("span",{children:"Stop"})]})]}),y==="stopped"&&e.jsxs("button",{className:"control-button control-button--new",onClick:()=>{j("idle"),_(null),$([])},children:[e.jsx("span",{className:"icon",children:"🔄"}),e.jsx("span",{children:"New Recording"})]})]}),e.jsxs("div",{className:"controls__secondary",children:[(y==="recording"||y==="paused")&&e.jsxs("button",{className:"control-button control-button--marker",onClick:()=>ee(),children:[e.jsx("span",{className:"icon",children:"🚩"}),e.jsx("span",{children:"Add Marker"})]}),e.jsxs("button",{className:`control-button ${E?"control-button--active":""}`,onClick:()=>A(!E),disabled:y!=="recording",children:[e.jsx("span",{className:"icon",children:"✏️"}),e.jsx("span",{children:"Annotate"})]}),e.jsx("button",{className:"control-button control-button--settings",onClick:()=>V(!G),disabled:y==="recording",children:e.jsx("span",{className:"icon",children:"⚙️"})})]})]}),e.jsxs("div",{className:"recorder__status",children:[e.jsxs("div",{className:"status__info",children:[e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Duration:"})," ",r((b==null?void 0:b.duration)||0)]}),e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Size:"})," ",o((b==null?void 0:b.size)||0)]}),e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Markers:"})," ",k.length]})]}),e.jsxs("div",{className:"status__quality",children:[s.video.resolution&&e.jsxs("span",{children:[s.video.resolution.width,"x",s.video.resolution.height]}),e.jsxs("span",{children:[s.video.frameRate,"fps"]}),e.jsx("span",{className:s.audio.enabled?"audio-on":"audio-off",children:s.audio.enabled?"🔊":"🔇"})]})]}),E&&y==="recording"&&e.jsxs("div",{className:"recorder__annotation-tools",children:[e.jsx("div",{className:"tool-group",children:["pen","arrow","rectangle","text"].map(n=>e.jsxs("button",{className:`tool-button ${F===n?"tool-button--active":""}`,onClick:()=>ae(n),children:[n==="pen"&&"✏️",n==="arrow"&&"➡️",n==="rectangle"&&"⬜",n==="text"&&"T"]},n))}),e.jsx("div",{className:"color-group",children:["var(--nice-danger, #ff0000)","var(--nice-success, #00ff00)","var(--nice-primary, #0000ff)","var(--nice-warning, #ffff00)","var(--nice-bg, #fff)","var(--nice-text, #000000)"].map(n=>e.jsx("button",{className:`color-button ${re===n?"color-button--active":""}`,style:{backgroundColor:n},onClick:()=>D(n)},n))})]}),k.length>0&&e.jsxs("div",{className:"recorder__markers",children:[e.jsx("h4",{children:"Markers"}),e.jsx("div",{className:"markers-list",children:k.map(n=>e.jsxs("div",{className:"marker-item",style:{borderLeftColor:n.color},children:[e.jsx("span",{className:"marker-time",children:r(n.time)}),e.jsx("input",{type:"text",value:n.label,onChange:g=>{$(C=>C.map(P=>P.id===n.id?{...P,label:g.target.value}:P))},className:"marker-label"}),e.jsx("button",{className:"marker-remove",onClick:()=>W(n.id),children:"×"})]},n.id))})]}),G&&e.jsxs("div",{className:"recorder__settings",children:[e.jsxs("div",{className:"settings-header",children:[e.jsx("h3",{children:"Recording Settings"}),e.jsx("button",{className:"close-button",onClick:()=>V(!1),children:"×"})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Video"}),e.jsxs("label",{children:["Source",e.jsxs("select",{value:s.video.source,onChange:n=>M({video:{...s.video,source:n.target.value}}),children:[e.jsx("option",{value:"screen",children:"Entire Screen"}),e.jsx("option",{value:"window",children:"Application Window"}),e.jsx("option",{value:"tab",children:"Browser Tab"}),e.jsx("option",{value:"camera",children:"Camera"})]})]}),e.jsxs("label",{children:["Resolution",e.jsxs("select",{value:`${(p=s.video.resolution)==null?void 0:p.width}x${(h=s.video.resolution)==null?void 0:h.height}`,onChange:n=>{const[g,C]=n.target.value.split("x").map(Number);M({video:{...s.video,resolution:{width:g,height:C}}})},children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"}),e.jsx("option",{value:"3840x2160",children:"4K (3840x2160)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"})]})]}),e.jsxs("label",{children:["Frame Rate",e.jsxs("select",{value:s.video.frameRate,onChange:n=>M({video:{...s.video,frameRate:parseInt(n.target.value)}}),children:[e.jsx("option",{value:"15",children:"15 fps"}),e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"})]})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.video.showCursor,onChange:n=>M({video:{...s.video,showCursor:n.target.checked}})}),"Show Cursor"]})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Audio"}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.audio.enabled,onChange:n=>M({audio:{...s.audio,enabled:n.target.checked}})}),"Enable Audio"]}),s.audio.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Source",e.jsxs("select",{value:s.audio.source,onChange:n=>M({audio:{...s.audio,source:n.target.value}}),children:[e.jsx("option",{value:"system",children:"System Audio"}),e.jsx("option",{value:"microphone",children:"Microphone"}),e.jsx("option",{value:"both",children:"Both"})]})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.audio.echoCancellation,onChange:n=>M({audio:{...s.audio,echoCancellation:n.target.checked}})}),"Echo Cancellation"]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:s.audio.noiseSuppression,onChange:n=>M({audio:{...s.audio,noiseSuppression:n.target.checked}})}),"Noise Suppression"]})]})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Output"}),e.jsxs("label",{children:["Format",e.jsxs("select",{value:s.output.format,onChange:n=>M({output:{...s.output,format:n.target.value}}),children:[e.jsx("option",{value:"webm",children:"WebM (Best Web)"}),e.jsx("option",{value:"mp4",children:"MP4 (Most Compatible)"}),e.jsx("option",{value:"mkv",children:"MKV (Lossless)"})]})]}),e.jsxs("label",{children:["Quality",e.jsxs("select",{value:s.output.quality,onChange:n=>M({output:{...s.output,quality:n.target.value}}),children:[e.jsx("option",{value:"low",children:"Low (Smaller file)"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High (Recommended)"}),e.jsx("option",{value:"lossless",children:"Lossless (Largest file)"})]})]})]})]})]})},Ve={id:crypto.randomUUID(),name:"My Stream",protocol:"rtmp",destinations:[],sources:[],layout:{name:"Default",canvas:{width:1920,height:1080,backgroundColor:"var(--nice-text, #000000)"},layers:[]},settings:{video:{resolution:{width:1920,height:1080},frameRate:30,codec:"h264",bitrate:6e3,keyframe:2,profile:"high"},audio:{sampleRate:48e3,bitrate:160,channels:2,codec:"aac"}}},ne=[{platform:"youtube",name:"YouTube",icon:"📺",defaultUrl:"rtmp://a.rtmp.youtube.com/live2"},{platform:"twitch",name:"Twitch",icon:"🎮",defaultUrl:"rtmp://live.twitch.tv/app"},{platform:"facebook",name:"Facebook",icon:"📘",defaultUrl:"rtmps://live-api-s.facebook.com:443/rtmp"},{platform:"custom-rtmp",name:"Custom RTMP",icon:"🔗",defaultUrl:""},{platform:"custom-srt",name:"Custom SRT",icon:"🔒",defaultUrl:""}],ie=[{type:"camera",name:"Camera",icon:"📷"},{type:"screen",name:"Screen Capture",icon:"🖥️"},{type:"window",name:"Window Capture",icon:"🪟"},{type:"browser",name:"Browser Source",icon:"🌐"},{type:"image",name:"Image",icon:"🖼️"},{type:"video",name:"Video",icon:"🎬"},{type:"microphone",name:"Microphone",icon:"🎤"},{type:"system-audio",name:"System Audio",icon:"🔊"}],Oe=({config:l,onConfigChange:m,onStreamStart:f,onStreamStop:N,onStatsUpdate:S,onError:H,className:u=""})=>{const[s,I]=d.useState(l||Ve),[b,_]=d.useState("sources"),[y,j]=d.useState(!1),[k,$]=d.useState({duration:0,viewers:0,peakViewers:0,bitrate:0,fps:0,droppedFrames:0,cpuUsage:0,memoryUsage:0}),[R,K]=d.useState(null),[L,T]=d.useState(!1),[G,V]=d.useState(!1),[E,A]=d.useState([s.layout]),[F,ae]=d.useState(0),re=d.useRef(null),D=d.useRef(null),x=d.useRef(0);d.useEffect(()=>{l&&I(l)},[l]),d.useEffect(()=>()=>{D.current&&clearInterval(D.current)},[]);const v=d.useCallback(a=>{const r={...s,...a};I(r),m==null||m(r)},[s,m]),U=a=>{const r=ne.find(p=>p.platform===a),o={id:crypto.randomUUID(),name:(r==null?void 0:r.name)||"Custom",platform:a,url:(r==null?void 0:r.defaultUrl)||"",streamKey:"",enabled:!0,status:"idle"};v({destinations:[...s.destinations,o]}),V(!1)},q=(a,r)=>{v({destinations:s.destinations.map(o=>o.id===a?{...o,...r}:o)})},O=a=>{v({destinations:s.destinations.filter(r=>r.id!==a)})},Q=async a=>{const r=ie.find(h=>h.type===a),o={id:crypto.randomUUID(),type:a,name:`${(r==null?void 0:r.name)||a} ${s.sources.filter(h=>h.type===a).length+1}`,settings:{},volume:1,muted:!1};try{if(a==="camera"||a==="microphone"){const h=a==="camera"?{video:!0}:{audio:!0},g=(await navigator.mediaDevices.enumerateDevices()).filter(C=>a==="camera"?C.kind==="videoinput":C.kind==="audioinput");g.length>0&&(o.settings.deviceId=g[0].deviceId)}else(a==="screen"||a==="window")&&await navigator.mediaDevices.getDisplayMedia({video:!0})}catch(h){console.warn(`Could not access ${a}:`,h)}v({sources:[...s.sources,o]});const p={id:crypto.randomUUID(),sourceId:o.id,position:{x:0,y:0},size:{width:s.layout.canvas.width,height:s.layout.canvas.height},visible:!0,opacity:1,zIndex:s.layout.layers.length};v({layout:{...s.layout,layers:[...s.layout.layers,p]}}),T(!1)},M=(a,r)=>{v({sources:s.sources.map(o=>o.id===a?{...o,...r}:o)})},Z=a=>{v({sources:s.sources.filter(r=>r.id!==a),layout:{...s.layout,layers:s.layout.layers.filter(r=>r.sourceId!==a)}})},z=(a,r)=>{v({layout:{...s.layout,layers:s.layout.layers.map(o=>o.id===a?{...o,...r}:o)}})},se=a=>{const r=s.layout.layers.findIndex(o=>o.id===a);if(r<s.layout.layers.length-1){const o=[...s.layout.layers];[o[r],o[r+1]]=[o[r+1],o[r]],o.forEach((p,h)=>{p.zIndex=h}),v({layout:{...s.layout,layers:o}})}},te=a=>{const r=s.layout.layers.findIndex(o=>o.id===a);if(r>0){const o=[...s.layout.layers];[o[r],o[r-1]]=[o[r-1],o[r]],o.forEach((p,h)=>{p.zIndex=h}),v({layout:{...s.layout,layers:o}})}},J=()=>{const a={name:`Scene ${E.length+1}`,canvas:{...s.layout.canvas},layers:[]};A([...E,a])},Y=a=>{const r=[...E];r[F]=s.layout,A(r),ae(a),v({layout:E[a]})},ee=async()=>{try{v({destinations:s.destinations.map(a=>a.enabled?{...a,status:"connecting"}:a)}),await new Promise(a=>setTimeout(a,2e3)),v({destinations:s.destinations.map(a=>a.enabled?{...a,status:"live"}:a)}),j(!0),x.current=Date.now(),f==null||f(),D.current=setInterval(()=>{const a={duration:(Date.now()-x.current)/1e3,viewers:Math.floor(Math.random()*100)+k.viewers,peakViewers:Math.max(k.peakViewers,k.viewers),bitrate:s.settings.video.bitrate+Math.floor(Math.random()*500-250),fps:s.settings.video.frameRate-Math.random()*2,droppedFrames:k.droppedFrames+(Math.random()>.95?1:0),cpuUsage:15+Math.random()*30,memoryUsage:40+Math.random()*20};$(a),S==null||S(a)},1e3)}catch(a){H==null||H(a instanceof Error?a:new Error("Failed to start stream")),v({destinations:s.destinations.map(r=>({...r,status:"error"}))})}},W=()=>{D.current&&clearInterval(D.current),v({destinations:s.destinations.map(a=>({...a,status:"idle"}))}),j(!1),N==null||N()},t=a=>{const r=Math.floor(a/3600),o=Math.floor(a%3600/60),p=Math.floor(a%60);return`${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`},i=a=>{switch(a){case"live":return"var(--nice-success, #00ff00)";case"connecting":return"var(--nice-warning, #ffff00)";case"error":return"var(--nice-danger, #ff0000)";default:return"var(--nice-text-secondary, #888888)"}};return e.jsxs("div",{className:`nice-live-streaming ${u}`,children:[e.jsxs("header",{className:"streaming__header",children:[e.jsxs("div",{className:"header__title",children:[e.jsx("input",{type:"text",value:s.name,onChange:a=>v({name:a.target.value}),className:"stream-name-input"}),y&&e.jsxs("span",{className:"live-badge",children:[e.jsx("span",{className:"live-dot"})," LIVE"]})]}),e.jsx("div",{className:"header__stats",children:y&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"stat-item",children:["⏱️ ",t(k.duration)]}),e.jsxs("span",{className:"stat-item",children:["👥 ",k.viewers]}),e.jsxs("span",{className:"stat-item",children:["📊 ",Math.round(k.bitrate)," kbps"]}),e.jsxs("span",{className:"stat-item",children:["🎬 ",k.fps.toFixed(1)," fps"]})]})}),e.jsx("div",{className:"header__actions",children:y?e.jsx("button",{className:"action-button action-button--stop",onClick:W,children:"End Stream"}):e.jsx("button",{className:"action-button action-button--go-live",onClick:ee,disabled:s.destinations.filter(a=>a.enabled).length===0,children:"Go Live"})})]}),e.jsxs("div",{className:"streaming__main",children:[e.jsxs("div",{className:"streaming__preview",children:[e.jsxs("div",{className:"scenes-bar",children:[E.map((a,r)=>e.jsx("button",{className:`scene-button ${F===r?"scene-button--active":""}`,onClick:()=>Y(r),children:a.name},r)),e.jsx("button",{className:"scene-button scene-button--add",onClick:J,children:"+"})]}),e.jsx("div",{ref:re,className:"preview-canvas",style:{aspectRatio:`${s.layout.canvas.width}/${s.layout.canvas.height}`,backgroundColor:s.layout.canvas.backgroundColor},children:s.layout.layers.sort((a,r)=>a.zIndex-r.zIndex).map(a=>{var o;const r=s.sources.find(p=>p.id===a.sourceId);return!a.visible||!r?null:e.jsx("div",{className:`canvas-layer ${R===a.id?"canvas-layer--selected":""}`,style:{left:`${a.position.x/s.layout.canvas.width*100}%`,top:`${a.position.y/s.layout.canvas.height*100}%`,width:`${a.size.width/s.layout.canvas.width*100}%`,height:`${a.size.height/s.layout.canvas.height*100}%`,opacity:a.opacity,zIndex:a.zIndex},onClick:()=>K(a.id),children:e.jsxs("div",{className:"layer-content",children:[e.jsx("span",{className:"layer-icon",children:((o=ie.find(p=>p.type===r.type))==null?void 0:o.icon)||"📦"}),e.jsx("span",{className:"layer-name",children:r.name})]})},a.id)})})]}),e.jsxs("aside",{className:"streaming__panel",children:[e.jsx("div",{className:"panel-tabs",children:["sources","audio","destinations","settings"].map(a=>e.jsx("button",{className:`panel-tab ${b===a?"panel-tab--active":""}`,onClick:()=>_(a),children:a.charAt(0).toUpperCase()+a.slice(1)},a))}),e.jsxs("div",{className:"panel-content",children:[b==="sources"&&e.jsxs("div",{className:"sources-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Sources"}),e.jsx("button",{className:"add-button",onClick:()=>T(!0),disabled:y,children:"+ Add"})]}),e.jsx("div",{className:"sources-list",children:s.sources.filter(a=>a.type!=="microphone"&&a.type!=="system-audio").map(a=>{var o;const r=s.layout.layers.find(p=>p.sourceId===a.id);return e.jsxs("div",{className:`source-item ${R===(r==null?void 0:r.id)?"source-item--selected":""}`,onClick:()=>r&&K(r.id),children:[e.jsx("span",{className:"source-icon",children:(o=ie.find(p=>p.type===a.type))==null?void 0:o.icon}),e.jsx("span",{className:"source-name",children:a.name}),e.jsxs("div",{className:"source-controls",children:[e.jsx("button",{className:r!=null&&r.visible?"":"inactive",onClick:p=>{p.stopPropagation(),r&&z(r.id,{visible:!r.visible})},children:r!=null&&r.visible?"👁️":"👁️‍🗨️"}),e.jsx("button",{onClick:p=>{p.stopPropagation(),r&&se(r.id)},children:"⬆️"}),e.jsx("button",{onClick:p=>{p.stopPropagation(),r&&te(r.id)},children:"⬇️"}),e.jsx("button",{onClick:p=>{p.stopPropagation(),Z(a.id)},disabled:y,children:"🗑️"})]})]},a.id)})}),R&&e.jsxs("div",{className:"layer-properties",children:[e.jsx("h4",{children:"Properties"}),(()=>{const a=s.layout.layers.find(r=>r.id===R);return a?e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["X Position",e.jsx("input",{type:"number",value:a.position.x,onChange:r=>z(a.id,{position:{...a.position,x:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:["Y Position",e.jsx("input",{type:"number",value:a.position.y,onChange:r=>z(a.id,{position:{...a.position,y:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:["Width",e.jsx("input",{type:"number",value:a.size.width,onChange:r=>z(a.id,{size:{...a.size,width:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:["Height",e.jsx("input",{type:"number",value:a.size.height,onChange:r=>z(a.id,{size:{...a.size,height:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:["Opacity",e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:a.opacity,onChange:r=>z(a.id,{opacity:parseFloat(r.target.value)})})]})]}):null})()]})]}),b==="audio"&&e.jsxs("div",{className:"audio-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Audio Mixer"}),e.jsx("button",{className:"add-button",onClick:()=>{T(!0)},disabled:y,children:"+ Add"})]}),e.jsxs("div",{className:"audio-sources",children:[s.sources.filter(a=>a.type==="microphone"||a.type==="system-audio"||a.type==="video").map(a=>{var r;return e.jsxs("div",{className:"audio-source",children:[e.jsxs("div",{className:"audio-header",children:[e.jsx("span",{className:"audio-icon",children:(r=ie.find(o=>o.type===a.type))==null?void 0:r.icon}),e.jsx("span",{className:"audio-name",children:a.name}),e.jsx("button",{className:a.muted?"muted":"",onClick:()=>M(a.id,{muted:!a.muted}),children:a.muted?"🔇":"🔊"})]}),e.jsxs("div",{className:"audio-slider",children:[e.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:a.volume??1,onChange:o=>M(a.id,{volume:parseFloat(o.target.value)}),disabled:a.muted}),e.jsxs("span",{className:"volume-value",children:[Math.round((a.volume??1)*100),"%"]})]}),e.jsx("div",{className:"audio-meter",children:e.jsx("div",{className:"meter-fill",style:{width:`${(a.volume??1)*70+Math.random()*30}%`}})})]},a.id)}),s.sources.filter(a=>a.type==="microphone"||a.type==="system-audio").length===0&&e.jsx("p",{className:"empty-message",children:"No audio sources added"})]})]}),b==="destinations"&&e.jsxs("div",{className:"destinations-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Destinations"}),e.jsx("button",{className:"add-button",onClick:()=>V(!0),disabled:y,children:"+ Add"})]}),e.jsxs("div",{className:"destinations-list",children:[s.destinations.map(a=>{var r;return e.jsxs("div",{className:"destination-item",children:[e.jsxs("div",{className:"destination-header",children:[e.jsx("span",{className:"status-indicator",style:{backgroundColor:i(a.status)}}),e.jsx("span",{className:"destination-icon",children:(r=ne.find(o=>o.platform===a.platform))==null?void 0:r.icon}),e.jsx("span",{className:"destination-name",children:a.name}),e.jsxs("label",{className:"toggle",children:[e.jsx("input",{type:"checkbox",checked:a.enabled,onChange:o=>q(a.id,{enabled:o.target.checked}),disabled:y}),e.jsx("span",{className:"toggle-slider"})]})]}),e.jsxs("div",{className:"destination-config",children:[e.jsxs("label",{children:["Server URL",e.jsx("input",{type:"text",value:a.url,onChange:o=>q(a.id,{url:o.target.value}),placeholder:"rtmp://...",disabled:y})]}),e.jsxs("label",{children:["Stream Key",e.jsx("input",{type:"password",value:a.streamKey||"",onChange:o=>q(a.id,{streamKey:o.target.value}),placeholder:"Enter stream key",disabled:y})]})]}),e.jsx("button",{className:"remove-button",onClick:()=>O(a.id),disabled:y,children:"Remove"})]},a.id)}),s.destinations.length===0&&e.jsx("p",{className:"empty-message",children:"No destinations configured"})]})]}),b==="settings"&&e.jsxs("div",{className:"settings-panel",children:[e.jsxs("div",{className:"setting-section",children:[e.jsx("h4",{children:"Video"}),e.jsxs("label",{children:["Resolution",e.jsxs("select",{value:`${s.settings.video.resolution.width}x${s.settings.video.resolution.height}`,onChange:a=>{const[r,o]=a.target.value.split("x").map(Number);v({settings:{...s.settings,video:{...s.settings.video,resolution:{width:r,height:o}}},layout:{...s.layout,canvas:{...s.layout.canvas,width:r,height:o}}})},disabled:y,children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"})]})]}),e.jsxs("label",{children:["Frame Rate",e.jsxs("select",{value:s.settings.video.frameRate,onChange:a=>v({settings:{...s.settings,video:{...s.settings.video,frameRate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"})]})]}),e.jsxs("label",{children:["Bitrate (kbps)",e.jsx("input",{type:"number",value:s.settings.video.bitrate,onChange:a=>v({settings:{...s.settings,video:{...s.settings.video,bitrate:parseInt(a.target.value)||6e3}}}),min:"1000",max:"50000",disabled:y})]}),e.jsxs("label",{children:["Keyframe Interval (sec)",e.jsx("input",{type:"number",value:s.settings.video.keyframe,onChange:a=>v({settings:{...s.settings,video:{...s.settings.video,keyframe:parseInt(a.target.value)||2}}}),min:"1",max:"10",disabled:y})]})]}),e.jsxs("div",{className:"setting-section",children:[e.jsx("h4",{children:"Audio"}),e.jsxs("label",{children:["Sample Rate",e.jsxs("select",{value:s.settings.audio.sampleRate,onChange:a=>v({settings:{...s.settings,audio:{...s.settings.audio,sampleRate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"44100",children:"44.1 kHz"}),e.jsx("option",{value:"48000",children:"48 kHz"})]})]}),e.jsxs("label",{children:["Audio Bitrate (kbps)",e.jsxs("select",{value:s.settings.audio.bitrate,onChange:a=>v({settings:{...s.settings,audio:{...s.settings.audio,bitrate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"96",children:"96 kbps"}),e.jsx("option",{value:"128",children:"128 kbps"}),e.jsx("option",{value:"160",children:"160 kbps"}),e.jsx("option",{value:"320",children:"320 kbps"})]})]})]})]})]})]})]}),y&&e.jsx("footer",{className:"streaming__footer",children:e.jsxs("div",{className:"footer-stats",children:[e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"CPU"}),e.jsxs("span",{className:"value",children:[k.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Memory"}),e.jsxs("span",{className:"value",children:[k.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Dropped"}),e.jsx("span",{className:"value",children:k.droppedFrames})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Peak Viewers"}),e.jsx("span",{className:"value",children:k.peakViewers})]})]})}),L&&e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Add Source"}),e.jsx("button",{className:"close-button",onClick:()=>T(!1),children:"×"})]}),e.jsx("div",{className:"modal-content",children:e.jsx("div",{className:"source-type-grid",children:ie.map(a=>e.jsxs("button",{className:"source-type-button",onClick:()=>Q(a.type),children:[e.jsx("span",{className:"icon",children:a.icon}),e.jsx("span",{className:"name",children:a.name})]},a.type))})})]})}),G&&e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Add Destination"}),e.jsx("button",{className:"close-button",onClick:()=>V(!1),children:"×"})]}),e.jsx("div",{className:"modal-content",children:e.jsx("div",{className:"platform-grid",children:ne.map(a=>e.jsxs("button",{className:"platform-button",onClick:()=>U(a.platform),children:[e.jsx("span",{className:"icon",children:a.icon}),e.jsx("span",{className:"name",children:a.name})]},a.platform))})})]})})]})};exports.NiceLiveStreaming=Oe;exports.NiceScreenRecorder=Le;exports.NiceVideoEditor=Fe;
package/dist/index.mjs CHANGED
@@ -1790,7 +1790,7 @@ const Be = {
1790
1790
  audio: { sampleRate: 48e3, channels: 2, bitrate: 320 },
1791
1791
  video: { codec: "h264", bitrate: 8e3, profile: "high" }
1792
1792
  }
1793
- }, We = [
1793
+ }, Ke = [
1794
1794
  { type: "blur", name: "Blur", icon: "🔵" },
1795
1795
  { type: "brightness", name: "Brightness", icon: "☀️" },
1796
1796
  { type: "contrast", name: "Contrast", icon: "◐" },
@@ -1800,7 +1800,7 @@ const Be = {
1800
1800
  { type: "chromaKey", name: "Chroma Key", icon: "🟢" },
1801
1801
  { type: "crop", name: "Crop", icon: "✂️" },
1802
1802
  { type: "zoom", name: "Zoom", icon: "🔍" }
1803
- ], Ke = [
1803
+ ], We = [
1804
1804
  { type: "fade", name: "Fade" },
1805
1805
  { type: "dissolve", name: "Dissolve" },
1806
1806
  { type: "wipe", name: "Wipe" },
@@ -1816,7 +1816,7 @@ const Be = {
1816
1816
  content: "Add media to the timeline, arrange and trim clips, apply effects and transitions, then configure and run the export.",
1817
1817
  placement: "auto"
1818
1818
  }
1819
- ], Xe = ({
1819
+ ], Ye = ({
1820
1820
  project: l,
1821
1821
  onProjectChange: m,
1822
1822
  onExport: f,
@@ -1826,7 +1826,7 @@ const Be = {
1826
1826
  }) => {
1827
1827
  const [p, i] = v(l || Be), [D, b] = v(
1828
1828
  "timeline"
1829
- ), [E, y] = v(null), [k, S] = v(null), [z, R] = v(0), [Z, W] = v(!1), [M, J] = v(1), [K, P] = v(!0), [U, O] = v(null), oe = F(null), se = F(null), A = F(null);
1829
+ ), [E, y] = v(null), [k, S] = v(null), [z, R] = v(0), [q, K] = v(!1), [M, J] = v(1), [W, P] = v(!0), [U, O] = v(null), oe = F(null), se = F(null), A = F(null);
1830
1830
  ne(() => {
1831
1831
  l && i(l);
1832
1832
  }, [l]), ne(() => () => {
@@ -1863,7 +1863,7 @@ const Be = {
1863
1863
  visible: !0
1864
1864
  };
1865
1865
  w({ tracks: [...p.tracks, o] });
1866
- }, X = (n) => {
1866
+ }, Y = (n) => {
1867
1867
  w({ tracks: p.tracks.filter((o) => o.id !== n) }), E === n && y(null);
1868
1868
  }, G = (n) => {
1869
1869
  w({
@@ -1899,7 +1899,7 @@ const Be = {
1899
1899
  (h) => h.id === n ? { ...h, items: [...h.items, u] } : h
1900
1900
  )
1901
1901
  });
1902
- }, Y = (n, o, a) => {
1902
+ }, X = (n, o, a) => {
1903
1903
  const t = {
1904
1904
  id: crypto.randomUUID(),
1905
1905
  type: a,
@@ -1957,15 +1957,15 @@ const Be = {
1957
1957
  return {};
1958
1958
  }
1959
1959
  }, de = () => {
1960
- Z ? (A.current && clearInterval(A.current), W(!1)) : (A.current = setInterval(() => {
1960
+ q ? (A.current && clearInterval(A.current), K(!1)) : (A.current = setInterval(() => {
1961
1961
  R((n) => {
1962
1962
  const o = Math.max(
1963
1963
  ...p.tracks.flatMap((a) => a.items.map((t) => t.startTime + t.duration)),
1964
1964
  0
1965
1965
  );
1966
- return n >= o ? (clearInterval(A.current), W(!1), 0) : n + 1 / p.frameRate;
1966
+ return n >= o ? (clearInterval(A.current), K(!1), 0) : n + 1 / p.frameRate;
1967
1967
  });
1968
- }, 1e3 / p.frameRate), W(!0));
1968
+ }, 1e3 / p.frameRate), K(!0));
1969
1969
  }, Q = (n) => {
1970
1970
  R(Math.max(0, n));
1971
1971
  }, ee = async () => {
@@ -1983,7 +1983,7 @@ const Be = {
1983
1983
  }, te = (n) => {
1984
1984
  const o = Math.floor(n / 60), a = Math.floor(n % 60), t = Math.floor(n % 1 * p.frameRate);
1985
1985
  return `${o.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}:${t.toString().padStart(2, "0")}`;
1986
- }, q = () => {
1986
+ }, Z = () => {
1987
1987
  for (const n of p.tracks) {
1988
1988
  const o = n.items.find((a) => a.id === k);
1989
1989
  if (o)
@@ -2033,7 +2033,7 @@ const Be = {
2033
2033
  ) })
2034
2034
  ] }),
2035
2035
  /* @__PURE__ */ r("div", { className: "video-editor__main", children: [
2036
- K && /* @__PURE__ */ r("aside", { className: "video-editor__asset-library", children: [
2036
+ W && /* @__PURE__ */ r("aside", { className: "video-editor__asset-library", children: [
2037
2037
  /* @__PURE__ */ r("div", { className: "asset-library__header", children: [
2038
2038
  /* @__PURE__ */ e("h3", { children: "Assets" }),
2039
2039
  /* @__PURE__ */ e("button", { className: "close-button", onClick: () => P(!1), children: "×" })
@@ -2081,7 +2081,7 @@ const Be = {
2081
2081
  style: { aspectRatio: `${p.resolution.width}/${p.resolution.height}` },
2082
2082
  children: [
2083
2083
  /* @__PURE__ */ e("video", { ref: se, className: "preview-video" }),
2084
- /* @__PURE__ */ e("div", { className: "preview-overlay", children: !K && /* @__PURE__ */ e(
2084
+ /* @__PURE__ */ e("div", { className: "preview-overlay", children: !W && /* @__PURE__ */ e(
2085
2085
  "button",
2086
2086
  {
2087
2087
  className: "toggle-library-button",
@@ -2095,13 +2095,13 @@ const Be = {
2095
2095
  /* @__PURE__ */ r("div", { className: "playback-controls", children: [
2096
2096
  /* @__PURE__ */ e("button", { onClick: () => Q(0), children: "⏮️" }),
2097
2097
  /* @__PURE__ */ e("button", { onClick: () => Q(z - 1 / p.frameRate), children: "⏪" }),
2098
- /* @__PURE__ */ e("button", { onClick: de, className: "play-button", children: Z ? "⏸️" : "▶️" }),
2098
+ /* @__PURE__ */ e("button", { onClick: de, className: "play-button", children: q ? "⏸️" : "▶️" }),
2099
2099
  /* @__PURE__ */ e("button", { onClick: () => Q(z + 1 / p.frameRate), children: "⏩" }),
2100
2100
  /* @__PURE__ */ e("span", { className: "time-display", children: te(z) })
2101
2101
  ] })
2102
2102
  ] }),
2103
2103
  k && D !== "export" && /* @__PURE__ */ e("div", { className: "item-inspector", children: (() => {
2104
- const n = q();
2104
+ const n = Z();
2105
2105
  if (!n)
2106
2106
  return null;
2107
2107
  const { track: o, item: a } = n;
@@ -2255,7 +2255,7 @@ const Be = {
2255
2255
  "button",
2256
2256
  {
2257
2257
  onClick: (o) => {
2258
- o.stopPropagation(), X(n.id);
2258
+ o.stopPropagation(), Y(n.id);
2259
2259
  },
2260
2260
  children: "🗑️"
2261
2261
  }
@@ -2293,14 +2293,14 @@ const Be = {
2293
2293
  D === "effects" && /* @__PURE__ */ r("div", { className: "effects-panel", children: [
2294
2294
  /* @__PURE__ */ e("h3", { children: "Video Effects" }),
2295
2295
  /* @__PURE__ */ e("p", { className: "panel-hint", children: "Select a clip to apply effects" }),
2296
- /* @__PURE__ */ e("div", { className: "effects-grid", children: We.map((n) => /* @__PURE__ */ r(
2296
+ /* @__PURE__ */ e("div", { className: "effects-grid", children: Ke.map((n) => /* @__PURE__ */ r(
2297
2297
  "button",
2298
2298
  {
2299
2299
  className: "effect-preset",
2300
2300
  disabled: !k,
2301
2301
  onClick: () => {
2302
- const o = q();
2303
- o && Y(o.track.id, o.item.id, n.type);
2302
+ const o = Z();
2303
+ o && X(o.track.id, o.item.id, n.type);
2304
2304
  },
2305
2305
  children: [
2306
2306
  /* @__PURE__ */ e("span", { className: "effect-icon", children: n.icon }),
@@ -2313,7 +2313,7 @@ const Be = {
2313
2313
  D === "transitions" && /* @__PURE__ */ r("div", { className: "transitions-panel", children: [
2314
2314
  /* @__PURE__ */ e("h3", { children: "Transitions" }),
2315
2315
  /* @__PURE__ */ e("p", { className: "panel-hint", children: "Select a clip and add transitions between clips" }),
2316
- /* @__PURE__ */ e("div", { className: "transitions-grid", children: Ke.map((n) => /* @__PURE__ */ r("div", { className: "transition-preset", children: [
2316
+ /* @__PURE__ */ e("div", { className: "transitions-grid", children: We.map((n) => /* @__PURE__ */ r("div", { className: "transition-preset", children: [
2317
2317
  /* @__PURE__ */ e("span", { className: "transition-name", children: n.name }),
2318
2318
  /* @__PURE__ */ r("div", { className: "transition-buttons", children: [
2319
2319
  /* @__PURE__ */ e(
@@ -2321,7 +2321,7 @@ const Be = {
2321
2321
  {
2322
2322
  disabled: !k,
2323
2323
  onClick: () => {
2324
- const o = q();
2324
+ const o = Z();
2325
2325
  o && L(
2326
2326
  o.track.id,
2327
2327
  o.item.id,
@@ -2337,7 +2337,7 @@ const Be = {
2337
2337
  {
2338
2338
  disabled: !k,
2339
2339
  onClick: () => {
2340
- const o = q();
2340
+ const o = Z();
2341
2341
  o && L(o.track.id, o.item.id, n.type, "end");
2342
2342
  },
2343
2343
  children: "Out"
@@ -2460,7 +2460,7 @@ const Be = {
2460
2460
  format: "webm",
2461
2461
  quality: "high"
2462
2462
  }
2463
- }, Ye = ({
2463
+ }, Xe = ({
2464
2464
  options: l,
2465
2465
  onRecordingStart: m,
2466
2466
  onRecordingStop: f,
@@ -2473,9 +2473,9 @@ const Be = {
2473
2473
  const [i, D] = v({
2474
2474
  ...je,
2475
2475
  ...l
2476
- }), [b, E] = v(null), [y, k] = v("idle"), [S, z] = v([]), [R, Z] = v(null), [W, M] = v(null), [J, K] = v(!1), [P, U] = v(!1), [O, oe] = v(
2476
+ }), [b, E] = v(null), [y, k] = v("idle"), [S, z] = v([]), [R, q] = v(null), [K, M] = v(null), [J, W] = v(!1), [P, U] = v(!1), [O, oe] = v(
2477
2477
  "pen"
2478
- ), [se, A] = v("var(--nice-danger, #ff0000)"), w = F(null), g = F([]), B = F(null), X = F(null), G = F(null), re = F(0);
2478
+ ), [se, A] = v("var(--nice-danger, #ff0000)"), w = F(null), g = F([]), B = F(null), Y = F(null), G = F(null), re = F(0);
2479
2479
  ne(() => () => {
2480
2480
  R && R.getTracks().forEach((s) => s.stop()), G.current && clearInterval(G.current);
2481
2481
  }, [R]);
@@ -2487,7 +2487,7 @@ const Be = {
2487
2487
  audio: { ...N.audio, ...s.audio },
2488
2488
  output: { ...N.output, ...s.output }
2489
2489
  }));
2490
- }, Y = async () => {
2490
+ }, X = async () => {
2491
2491
  try {
2492
2492
  k("preparing");
2493
2493
  const s = {
@@ -2508,12 +2508,12 @@ const Be = {
2508
2508
  } catch (H) {
2509
2509
  console.warn("Could not access microphone:", H);
2510
2510
  }
2511
- Z(N), B.current && (B.current.srcObject = N, B.current.play()), k("idle");
2511
+ q(N), B.current && (B.current.srcObject = N, B.current.play()), k("idle");
2512
2512
  } catch (s) {
2513
2513
  k("error"), I == null || I(s instanceof Error ? s : new Error("Failed to start preview"));
2514
2514
  }
2515
2515
  }, L = async () => {
2516
- R || await Y();
2516
+ R || await X();
2517
2517
  for (let s = 3; s > 0; s--)
2518
2518
  M(s), await new Promise((N) => setTimeout(N, 1e3));
2519
2519
  M(null);
@@ -2552,12 +2552,12 @@ const Be = {
2552
2552
  } catch (s) {
2553
2553
  k("error"), I == null || I(s instanceof Error ? s : new Error("Failed to start recording"));
2554
2554
  }
2555
- }, ce = async () => (await Y(), R), de = () => {
2555
+ }, ce = async () => (await X(), R), de = () => {
2556
2556
  w.current && y === "recording" && (w.current.pause(), k("paused"), C == null || C());
2557
2557
  }, Q = () => {
2558
2558
  w.current && y === "paused" && (w.current.resume(), k("recording"), T == null || T());
2559
2559
  }, ee = () => {
2560
- G.current && clearInterval(G.current), w.current && (y === "recording" || y === "paused") && (w.current.stop(), k("stopped")), R && (R.getTracks().forEach((s) => s.stop()), Z(null));
2560
+ G.current && clearInterval(G.current), w.current && (y === "recording" || y === "paused") && (w.current.stop(), k("stopped")), R && (R.getTracks().forEach((s) => s.stop()), q(null));
2561
2561
  }, te = me(
2562
2562
  (s) => {
2563
2563
  if (y !== "recording")
@@ -2571,7 +2571,7 @@ const Be = {
2571
2571
  z((H) => [...H, N]);
2572
2572
  },
2573
2573
  [y, b == null ? void 0 : b.duration, S.length]
2574
- ), q = (s) => {
2574
+ ), Z = (s) => {
2575
2575
  z((N) => N.filter((H) => H.id !== s));
2576
2576
  }, n = (s) => {
2577
2577
  switch (s) {
@@ -2602,10 +2602,10 @@ const Be = {
2602
2602
  }, c = (s) => s < 1024 ? `${s} B` : s < 1024 * 1024 ? `${(s / 1024).toFixed(1)} KB` : `${(s / 1024 / 1024).toFixed(1)} MB`;
2603
2603
  return /* @__PURE__ */ r("div", { className: `nice-screen-recorder ${p}`, children: [
2604
2604
  /* @__PURE__ */ r("div", { className: "recorder__preview", children: [
2605
- W !== null && /* @__PURE__ */ e("div", { className: "countdown-overlay", children: /* @__PURE__ */ e("span", { className: "countdown-number", children: W }) }),
2605
+ K !== null && /* @__PURE__ */ e("div", { className: "countdown-overlay", children: /* @__PURE__ */ e("span", { className: "countdown-number", children: K }) }),
2606
2606
  /* @__PURE__ */ e("video", { ref: B, className: "preview-video", muted: !0, playsInline: !0 }),
2607
- P && /* @__PURE__ */ e("canvas", { ref: X, className: "annotation-canvas" }),
2608
- !R && y === "idle" && /* @__PURE__ */ e("div", { className: "preview-placeholder", children: /* @__PURE__ */ r("button", { className: "start-preview-button", onClick: Y, children: [
2607
+ P && /* @__PURE__ */ e("canvas", { ref: Y, className: "annotation-canvas" }),
2608
+ !R && y === "idle" && /* @__PURE__ */ e("div", { className: "preview-placeholder", children: /* @__PURE__ */ r("button", { className: "start-preview-button", onClick: X, children: [
2609
2609
  /* @__PURE__ */ e("span", { className: "icon", children: "🖥️" }),
2610
2610
  /* @__PURE__ */ e("span", { children: "Select Screen to Record" })
2611
2611
  ] }) }),
@@ -2621,7 +2621,7 @@ const Be = {
2621
2621
  {
2622
2622
  className: "control-button control-button--record",
2623
2623
  onClick: L,
2624
- disabled: !!W,
2624
+ disabled: !!K,
2625
2625
  children: [
2626
2626
  /* @__PURE__ */ e("span", { className: "icon", children: "⏺️" }),
2627
2627
  /* @__PURE__ */ e("span", { children: "Start Recording" })
@@ -2683,7 +2683,7 @@ const Be = {
2683
2683
  "button",
2684
2684
  {
2685
2685
  className: "control-button control-button--settings",
2686
- onClick: () => K(!J),
2686
+ onClick: () => W(!J),
2687
2687
  disabled: y === "recording",
2688
2688
  children: /* @__PURE__ */ e("span", { className: "icon", children: "⚙️" })
2689
2689
  }
@@ -2768,7 +2768,7 @@ const Be = {
2768
2768
  className: "marker-label"
2769
2769
  }
2770
2770
  ),
2771
- /* @__PURE__ */ e("button", { className: "marker-remove", onClick: () => q(s.id), children: "×" })
2771
+ /* @__PURE__ */ e("button", { className: "marker-remove", onClick: () => Z(s.id), children: "×" })
2772
2772
  ]
2773
2773
  },
2774
2774
  s.id
@@ -2777,7 +2777,7 @@ const Be = {
2777
2777
  J && /* @__PURE__ */ r("div", { className: "recorder__settings", children: [
2778
2778
  /* @__PURE__ */ r("div", { className: "settings-header", children: [
2779
2779
  /* @__PURE__ */ e("h3", { children: "Recording Settings" }),
2780
- /* @__PURE__ */ e("button", { className: "close-button", onClick: () => K(!1), children: "×" })
2780
+ /* @__PURE__ */ e("button", { className: "close-button", onClick: () => W(!1), children: "×" })
2781
2781
  ] }),
2782
2782
  /* @__PURE__ */ r("div", { className: "settings-section", children: [
2783
2783
  /* @__PURE__ */ e("h4", { children: "Video" }),
@@ -2962,7 +2962,7 @@ const Be = {
2962
2962
  ] })
2963
2963
  ] })
2964
2964
  ] });
2965
- }, Ze = {
2965
+ }, qe = {
2966
2966
  id: crypto.randomUUID(),
2967
2967
  name: "My Stream",
2968
2968
  protocol: "rtmp",
@@ -3023,7 +3023,7 @@ const Be = {
3023
3023
  onError: I,
3024
3024
  className: p = ""
3025
3025
  }) => {
3026
- const [i, D] = v(l || Ze), [b, E] = v(
3026
+ const [i, D] = v(l || qe), [b, E] = v(
3027
3027
  "sources"
3028
3028
  ), [y, k] = v(!1), [S, z] = v({
3029
3029
  duration: 0,
@@ -3034,7 +3034,7 @@ const Be = {
3034
3034
  droppedFrames: 0,
3035
3035
  cpuUsage: 0,
3036
3036
  memoryUsage: 0
3037
- }), [R, Z] = v(null), [W, M] = v(!1), [J, K] = v(!1), [P, U] = v([i.layout]), [O, oe] = v(0), se = F(null), A = F(null), w = F(0);
3037
+ }), [R, q] = v(null), [K, M] = v(!1), [J, W] = v(!1), [P, U] = v([i.layout]), [O, oe] = v(0), se = F(null), A = F(null), w = F(0);
3038
3038
  ne(() => {
3039
3039
  l && D(l);
3040
3040
  }, [l]), ne(() => () => {
@@ -3056,8 +3056,8 @@ const Be = {
3056
3056
  enabled: !0,
3057
3057
  status: "idle"
3058
3058
  };
3059
- g({ destinations: [...i.destinations, c] }), K(!1);
3060
- }, X = (a, t) => {
3059
+ g({ destinations: [...i.destinations, c] }), W(!1);
3060
+ }, Y = (a, t) => {
3061
3061
  g({
3062
3062
  destinations: i.destinations.map((c) => c.id === a ? { ...c, ...t } : c)
3063
3063
  });
@@ -3102,7 +3102,7 @@ const Be = {
3102
3102
  g({
3103
3103
  sources: i.sources.map((c) => c.id === a ? { ...c, ...t } : c)
3104
3104
  });
3105
- }, Y = (a) => {
3105
+ }, X = (a) => {
3106
3106
  g({
3107
3107
  sources: i.sources.filter((t) => t.id !== a),
3108
3108
  layout: {
@@ -3174,7 +3174,7 @@ const Be = {
3174
3174
  }))
3175
3175
  });
3176
3176
  }
3177
- }, q = () => {
3177
+ }, Z = () => {
3178
3178
  A.current && clearInterval(A.current), g({
3179
3179
  destinations: i.destinations.map((a) => ({ ...a, status: "idle" }))
3180
3180
  }), k(!1), C == null || C();
@@ -3230,7 +3230,7 @@ const Be = {
3230
3230
  " fps"
3231
3231
  ] })
3232
3232
  ] }) }),
3233
- /* @__PURE__ */ e("div", { className: "header__actions", children: y ? /* @__PURE__ */ e("button", { className: "action-button action-button--stop", onClick: q, children: "End Stream" }) : /* @__PURE__ */ e(
3233
+ /* @__PURE__ */ e("div", { className: "header__actions", children: y ? /* @__PURE__ */ e("button", { className: "action-button action-button--stop", onClick: Z, children: "End Stream" }) : /* @__PURE__ */ e(
3234
3234
  "button",
3235
3235
  {
3236
3236
  className: "action-button action-button--go-live",
@@ -3278,7 +3278,7 @@ const Be = {
3278
3278
  opacity: a.opacity,
3279
3279
  zIndex: a.zIndex
3280
3280
  },
3281
- onClick: () => Z(a.id),
3281
+ onClick: () => q(a.id),
3282
3282
  children: /* @__PURE__ */ r("div", { className: "layer-content", children: [
3283
3283
  /* @__PURE__ */ e("span", { className: "layer-icon", children: ((c = le.find((u) => u.type === t.type)) == null ? void 0 : c.icon) || "📦" }),
3284
3284
  /* @__PURE__ */ e("span", { className: "layer-name", children: t.name })
@@ -3321,7 +3321,7 @@ const Be = {
3321
3321
  "div",
3322
3322
  {
3323
3323
  className: `source-item ${R === (t == null ? void 0 : t.id) ? "source-item--selected" : ""}`,
3324
- onClick: () => t && Z(t.id),
3324
+ onClick: () => t && q(t.id),
3325
3325
  children: [
3326
3326
  /* @__PURE__ */ e("span", { className: "source-icon", children: (c = le.find((u) => u.type === a.type)) == null ? void 0 : c.icon }),
3327
3327
  /* @__PURE__ */ e("span", { className: "source-name", children: a.name }),
@@ -3358,7 +3358,7 @@ const Be = {
3358
3358
  "button",
3359
3359
  {
3360
3360
  onClick: (u) => {
3361
- u.stopPropagation(), Y(a.id);
3361
+ u.stopPropagation(), X(a.id);
3362
3362
  },
3363
3363
  disabled: y,
3364
3364
  children: "🗑️"
@@ -3519,7 +3519,7 @@ const Be = {
3519
3519
  "button",
3520
3520
  {
3521
3521
  className: "add-button",
3522
- onClick: () => K(!0),
3522
+ onClick: () => W(!0),
3523
3523
  disabled: y,
3524
3524
  children: "+ Add"
3525
3525
  }
@@ -3545,7 +3545,7 @@ const Be = {
3545
3545
  {
3546
3546
  type: "checkbox",
3547
3547
  checked: a.enabled,
3548
- onChange: (c) => X(a.id, { enabled: c.target.checked }),
3548
+ onChange: (c) => Y(a.id, { enabled: c.target.checked }),
3549
3549
  disabled: y
3550
3550
  }
3551
3551
  ),
@@ -3560,7 +3560,7 @@ const Be = {
3560
3560
  {
3561
3561
  type: "text",
3562
3562
  value: a.url,
3563
- onChange: (c) => X(a.id, { url: c.target.value }),
3563
+ onChange: (c) => Y(a.id, { url: c.target.value }),
3564
3564
  placeholder: "rtmp://...",
3565
3565
  disabled: y
3566
3566
  }
@@ -3573,7 +3573,7 @@ const Be = {
3573
3573
  {
3574
3574
  type: "password",
3575
3575
  value: a.streamKey || "",
3576
- onChange: (c) => X(a.id, { streamKey: c.target.value }),
3576
+ onChange: (c) => Y(a.id, { streamKey: c.target.value }),
3577
3577
  placeholder: "Enter stream key",
3578
3578
  disabled: y
3579
3579
  }
@@ -3770,7 +3770,7 @@ const Be = {
3770
3770
  /* @__PURE__ */ e("span", { className: "value", children: S.peakViewers })
3771
3771
  ] })
3772
3772
  ] }) }),
3773
- W && /* @__PURE__ */ e("div", { className: "modal-overlay", children: /* @__PURE__ */ r("div", { className: "modal", children: [
3773
+ K && /* @__PURE__ */ e("div", { className: "modal-overlay", children: /* @__PURE__ */ r("div", { className: "modal", children: [
3774
3774
  /* @__PURE__ */ r("div", { className: "modal-header", children: [
3775
3775
  /* @__PURE__ */ e("h3", { children: "Add Source" }),
3776
3776
  /* @__PURE__ */ e("button", { className: "close-button", onClick: () => M(!1), children: "×" })
@@ -3791,7 +3791,7 @@ const Be = {
3791
3791
  J && /* @__PURE__ */ e("div", { className: "modal-overlay", children: /* @__PURE__ */ r("div", { className: "modal", children: [
3792
3792
  /* @__PURE__ */ r("div", { className: "modal-header", children: [
3793
3793
  /* @__PURE__ */ e("h3", { children: "Add Destination" }),
3794
- /* @__PURE__ */ e("button", { className: "close-button", onClick: () => K(!1), children: "×" })
3794
+ /* @__PURE__ */ e("button", { className: "close-button", onClick: () => W(!1), children: "×" })
3795
3795
  ] }),
3796
3796
  /* @__PURE__ */ e("div", { className: "modal-content", children: /* @__PURE__ */ e("div", { className: "platform-grid", children: fe.map((a) => /* @__PURE__ */ r(
3797
3797
  "button",
@@ -3810,6 +3810,6 @@ const Be = {
3810
3810
  };
3811
3811
  export {
3812
3812
  Qe as NiceLiveStreaming,
3813
- Ye as NiceScreenRecorder,
3814
- Xe as NiceVideoEditor
3813
+ Xe as NiceScreenRecorder,
3814
+ Ye as NiceVideoEditor
3815
3815
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/ui-video",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "Nice2Dev Video Components - Video editor, screen recorder, and live streaming",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -31,12 +31,12 @@
31
31
  },
32
32
  "dependencies": {},
33
33
  "peerDependencies": {
34
- "@nice2dev/ui-core": "^1.0.24",
34
+ "@nice2dev/ui-core": "^1.0.26",
35
35
  "react": ">=17.0.0",
36
36
  "react-dom": ">=17.0.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@nice2dev/ui-core": "^1.0.24",
39
+ "@nice2dev/ui-core": "^1.0.26",
40
40
  "@testing-library/react": "^14.1.0",
41
41
  "@types/react": "^18.2.0",
42
42
  "@types/react-dom": "^18.2.0",