@nice2dev/ui-video 1.2.2 → 1.3.0
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 +1 -1
- package/dist/index.mjs +37 -27
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),oe=require("@nice2dev/ui"),l=require("@nice2dev/ui-core"),u=require("react"),le={id:l.createId(),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:"#000000",audio:{sampleRate:48e3,channels:2,bitrate:320},video:{codec:"h264",bitrate:8e3,profile:"high"}}},de=[{type:"blur",name:"Blur",icon:"droplet"},{type:"brightness",name:"Brightness",icon:"sun"},{type:"contrast",name:"Contrast",icon:"moon"},{type:"saturation",name:"Saturation",icon:"palette"},{type:"grayscale",name:"Grayscale",icon:"square"},{type:"sepia",name:"Sepia",icon:"image"},{type:"chromaKey",name:"Chroma Key",icon:"layers"},{type:"crop",name:"Crop",icon:"crop"},{type:"zoom",name:"Zoom",icon:"search"}],ue=[{type:"fade",name:"Fade"},{type:"dissolve",name:"Dissolve"},{type:"wipe",name:"Wipe"},{type:"slide",name:"Slide"},{type:"zoom",name:"Zoom"},{type:"push",name:"Push"}],me=[{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"}],ve=({project:z,onProjectChange:w,onExport:$,onAssetUpload:A,className:F="",tutorial:R})=>{const{t:m}=l.useNiceTranslation(),[s,a]=u.useState(z||le),[E,j]=u.useState("timeline"),[B,h]=u.useState(null),[b,f]=u.useState(null),[T,N]=u.useState(0),[L,V]=u.useState(!1),[y,q]=u.useState(1),[U,C]=u.useState(!0),[I,D]=u.useState(null),Q=u.useRef(null),X=u.useRef(null),S=u.useRef(null);u.useEffect(()=>{z&&a(z)},[z]),u.useEffect(()=>()=>{S.current&&clearInterval(S.current)},[]);const g=u.useCallback(n=>{const c={...s,...n};a(c),w==null||w(c)},[s,w]),_=async n=>{const c=[];for(const t of Array.from(n)){const d=t.type.startsWith("video/")?"video":t.type.startsWith("audio/")?"audio":"image";let v;A?v=await A(t):v={id:l.createId(),type:d,name:t.name,url:URL.createObjectURL(t),size:t.size},c.push(v)}g({assets:[...s.assets,...c]})},P=n=>{const c={id:l.createId(),type:n,name:`${n.charAt(0).toUpperCase()+n.slice(1)} ${s.tracks.filter(t=>t.type===n).length+1}`,items:[],muted:!1,locked:!1,visible:!0};g({tracks:[...s.tracks,c]})},W=n=>{g({tracks:s.tracks.filter(c=>c.id!==n)}),B===n&&h(null)},O=n=>{g({tracks:s.tracks.map(c=>c.id===n?{...c,muted:!c.muted}:c)})},Z=n=>{g({tracks:s.tracks.map(c=>c.id===n?{...c,locked:!c.locked}:c)})},k=(n,c)=>{const t=s.tracks.find(x=>x.id===n);if(!t||t.locked)return;const d=t.items[t.items.length-1],v=d?d.startTime+d.duration:0,p={id:l.createId(),assetId:c.id,type:c.type,startTime:v,duration:c.duration||5,offset:0,properties:{x:0,y:0,opacity:1,scale:1,volume:1},effects:[],transitions:[]};g({tracks:s.tracks.map(x=>x.id===n?{...x,items:[...x.items,p]}:x)})},H=(n,c,t)=>{const d={id:l.createId(),type:t,name:t.charAt(0).toUpperCase()+t.slice(1),parameters:ee(t)};g({tracks:s.tracks.map(v=>v.id===n?{...v,items:v.items.map(p=>p.id===c?{...p,effects:[...p.effects,d]}:p)}:v)})},M=(n,c,t,d)=>{const v={id:l.createId(),type:t,duration:.5,position:d};g({tracks:s.tracks.map(p=>p.id===n?{...p,items:p.items.map(x=>x.id===c?{...x,transitions:[...x.transitions,v]}:x)}:p)})},ee=n=>{switch(n){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{}}},ie=()=>{L?(S.current&&clearInterval(S.current),V(!1)):(S.current=setInterval(()=>{N(n=>{const c=Math.max(...s.tracks.flatMap(t=>t.items.map(d=>d.startTime+d.duration)),0);return n>=c?(clearInterval(S.current),V(!1),0):n+1/s.frameRate})},1e3/s.frameRate),V(!0))},G=n=>{N(Math.max(0,n))},Y=async()=>{if($){D(0);try{const n=setInterval(()=>{D(c=>c!==null&&c<90?c+Math.random()*10:c)},500);await $(s,s.settings.video.codec),clearInterval(n),D(100),setTimeout(()=>D(null),2e3)}catch(n){D(null),console.error("Export failed:",n)}}},J=n=>{const c=Math.floor(n/60),t=Math.floor(n%60),d=Math.floor(n%1*s.frameRate);return`${c.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}`},K=()=>{for(const n of s.tracks){const c=n.items.find(t=>t.id===b);if(c)return{track:n,item:c}}return null},se=e.jsxs("header",{className:"nice-video-studio__header",children:[e.jsxs("div",{className:"nice-video-studio__header-project-info",children:[e.jsx("input",{type:"text",value:s.name,onChange:n=>g({name:n.target.value}),className:"nice-video-studio__project-name-input"}),e.jsxs("span",{className:"nice-video-studio__project-settings",children:[s.resolution.width,"x",s.resolution.height," • ",s.frameRate,"fps"]})]}),e.jsx("div",{className:"nice-video-studio__header-tabs",children:["timeline","effects","transitions","export"].map(n=>e.jsx("button",{className:`nice-video-studio__tab-button ${E===n?"nice-video-studio__tab-button--active":""}`,onClick:()=>j(n),children:n.charAt(0).toUpperCase()+n.slice(1)},n))}),e.jsx("div",{className:"nice-video-studio__header-actions",children:e.jsx("button",{className:"nice-video-studio__action-button nice-video-studio__action-button--primary",onClick:Y,disabled:I!==null,children:I!==null?m("videoEditor.exporting","Exporting {exportProgress}%").replace("{exportProgress}",String(Math.round(I))):m("videoEditor.export","Export")})})]}),te=b&&E!=="export"?(()=>{const n=K();if(!n)return null;const{track:c,item:t}=n;return e.jsxs("div",{className:"nice-video-studio__item-inspector",children:[e.jsx("h4",{children:m("videoEditor.itemProperties","Item Properties")}),e.jsxs("div",{className:"nice-video-studio__inspector-section",children:[e.jsxs("label",{children:[m("videoEditor.startTime","Start Time"),e.jsx("input",{type:"number",step:"0.1",value:t.startTime,onChange:d=>{const v=parseFloat(d.target.value);g({tracks:s.tracks.map(p=>p.id===c.id?{...p,items:p.items.map(x=>x.id===t.id?{...x,startTime:v}:x)}:p)})}})]}),e.jsxs("label",{children:[m("videoEditor.duration","Duration"),e.jsx("input",{type:"number",step:"0.1",value:t.duration,onChange:d=>{const v=parseFloat(d.target.value);g({tracks:s.tracks.map(p=>p.id===c.id?{...p,items:p.items.map(x=>x.id===t.id?{...x,duration:v}:x)}:p)})}})]}),e.jsxs("label",{children:[m("videoEditor.opacity","Opacity"),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:t.properties.opacity??1,onChange:d=>{const v=parseFloat(d.target.value);g({tracks:s.tracks.map(p=>p.id===c.id?{...p,items:p.items.map(x=>x.id===t.id?{...x,properties:{...x.properties,opacity:v}}:x)}:p)})}})]})]}),e.jsx("h4",{children:m("videoEditor.effects","Effects ({effects})").replace("{effects}",String(t.effects.length))}),e.jsx("div",{className:"nice-video-studio__effects-list",children:t.effects.map(d=>e.jsx("div",{className:"nice-video-studio__effect-badge",children:d.name},d.id))})]})})():null,i=U?e.jsxs("aside",{className:"nice-video-studio__asset-library",children:[e.jsxs("div",{className:"nice-video-studio__asset-library-header",children:[e.jsx("h3",{children:m("videoEditor.assets","Assets")}),e.jsx("button",{"aria-label":m("videoEditor.close","Close"),className:"nice-video-studio__close-button",onClick:()=>C(!1),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]}),e.jsx("div",{className:"nice-video-studio__asset-library-upload",children:e.jsxs("label",{className:"nice-video-studio__upload-zone",children:[e.jsx("input",{type:"file",multiple:!0,accept:"video/*,audio/*,image/*",onChange:n=>n.target.files&&_(n.target.files),hidden:!0}),e.jsx("span",{className:"nice-video-studio__upload-icon",children:"+"}),e.jsx("span",{children:m("videoEditor.dropFilesOrClickTo","Drop files or click to upload")})]})}),e.jsx("div",{className:"nice-video-studio__asset-library-list",children:s.assets.map(n=>e.jsxs("div",{className:"nice-video-studio__asset-item",draggable:!0,onDragStart:c=>c.dataTransfer.setData("assetId",n.id),children:[e.jsx("div",{className:"nice-video-studio__asset-thumbnail",children:n.thumbnail?e.jsx("img",{src:n.thumbnail,alt:n.name}):e.jsx("span",{className:"nice-video-studio__asset-type-icon",children:e.jsx(l.NiceIcon,{name:n.type==="video"?"video":n.type==="audio"?"music":"image",size:24})})}),e.jsxs("div",{className:"nice-video-studio__asset-info",children:[e.jsx("span",{className:"nice-video-studio__asset-name",children:n.name}),e.jsxs("span",{className:"nice-video-studio__asset-meta",children:[(n.size/1024/1024).toFixed(1),"MB"]})]})]},n.id))})]}):void 0,r=e.jsx("div",{className:"nice-video-studio__preview-area",children:e.jsxs("div",{className:"nice-video-studio__preview-container",children:[e.jsxs("div",{className:"nice-video-studio__preview-canvas",style:{aspectRatio:`${s.resolution.width}/${s.resolution.height}`},children:[e.jsx("video",{ref:X,className:"nice-video-studio__preview-video"}),e.jsx("div",{className:"nice-video-studio__preview-overlay",children:!U&&e.jsx("button",{className:"nice-video-studio__toggle-library-button",onClick:()=>C(!0),"aria-label":m("videoEditor.showAssetLibrary","Show asset library"),children:e.jsx(l.NiceIcon,{name:"folder",size:16})})})]}),e.jsxs("div",{className:"nice-video-studio__playback-controls",children:[e.jsx("button",{onClick:()=>G(0),"aria-label":m("videoEditor.goToStart","Go to start"),children:e.jsx(l.NiceIcon,{name:"skip-back",size:16})}),e.jsx("button",{onClick:()=>G(T-1/s.frameRate),"aria-label":m("videoEditor.previousFrame","Previous frame"),children:e.jsx(l.NiceIcon,{name:"chevron-left",size:16})}),e.jsx("button",{onClick:ie,className:"nice-video-studio__play-button","aria-label":L?m("videoEditor.pause","Pause"):m("videoEditor.play","Play"),children:e.jsx(l.NiceIcon,{name:L?"pause":"play",size:18})}),e.jsx("button",{onClick:()=>G(T+1/s.frameRate),"aria-label":m("videoEditor.nextFrame","Next frame"),children:e.jsx(l.NiceIcon,{name:"chevron-right",size:16})}),e.jsx("span",{className:"nice-video-studio__time-display",children:J(T)})]})]})}),o=e.jsxs("div",{className:"nice-video-studio__panel",children:[E==="timeline"&&e.jsxs("div",{className:"nice-video-studio__timeline-panel",children:[e.jsxs("div",{className:"nice-video-studio__timeline-toolbar",children:[e.jsxs("div",{className:"nice-video-studio__track-buttons",children:[e.jsx("button",{onClick:()=>P("video"),children:m("videoEditor.videoTrack","+ Video Track")}),e.jsx("button",{onClick:()=>P("audio"),children:m("videoEditor.audioTrack","+ Audio Track")}),e.jsx("button",{onClick:()=>P("text"),children:m("videoEditor.textTrack","+ Text Track")})]}),e.jsxs("div",{className:"nice-video-studio__zoom-controls",children:[e.jsx("button",{onClick:()=>q(Math.max(.25,y-.25)),children:"-"}),e.jsxs("span",{children:[Math.round(y*100),"%"]}),e.jsx("button",{onClick:()=>q(Math.min(4,y+.25)),children:"+"})]})]}),e.jsxs("div",{className:"nice-video-studio__timeline-container",ref:Q,children:[e.jsx("div",{className:"nice-video-studio__timeline-ruler",children:Array.from({length:Math.ceil(30/y)}).map((n,c)=>e.jsx("div",{className:"nice-video-studio__ruler-mark",style:{left:`${c*50*y}px`},children:J(c)},c))}),e.jsx("div",{className:"nice-video-studio__timeline-playhead",style:{left:`${T*50*y}px`}}),e.jsx("div",{className:"nice-video-studio__timeline-tracks",children:s.tracks.map(n=>e.jsxs("div",{className:`nice-video-studio__timeline-track ${B===n.id?"nice-video-studio__timeline-track--selected":""} ${n.locked?"nice-video-studio__timeline-track--locked":""}`,onClick:()=>h(n.id),onDrop:c=>{c.preventDefault();const t=c.dataTransfer.getData("assetId"),d=s.assets.find(v=>v.id===t);d&&k(n.id,d)},onDragOver:c=>c.preventDefault(),children:[e.jsxs("div",{className:"nice-video-studio__track-header",children:[e.jsx("span",{className:"nice-video-studio__track-name",children:n.name}),e.jsxs("div",{className:"nice-video-studio__track-controls",children:[e.jsx("button",{className:`nice-video-studio__track-toggle ${n.muted?"nice-video-studio__track-toggle--active":""}`,onClick:c=>{c.stopPropagation(),O(n.id)},children:e.jsx(l.NiceIcon,{name:n.muted?"volume-off":"volume",size:14})}),e.jsx("button",{className:`nice-video-studio__track-toggle ${n.locked?"nice-video-studio__track-toggle--active":""}`,onClick:c=>{c.stopPropagation(),Z(n.id)},children:e.jsx(l.NiceIcon,{name:n.locked?"lock":"unlock",size:14})}),e.jsx("button",{onClick:c=>{c.stopPropagation(),W(n.id)},"aria-label":m("videoEditor.removeTrack","Remove track"),children:e.jsx(l.NiceIcon,{name:"trash",size:14})})]})]}),e.jsx("div",{className:"nice-video-studio__track-items",children:n.items.map(c=>{const t=s.assets.find(d=>d.id===c.assetId);return e.jsxs("div",{className:`nice-video-studio__track-item nice-video-studio__track-item--${c.type} ${b===c.id?"nice-video-studio__track-item--selected":""}`,style:{left:`${c.startTime*50*y}px`,width:`${c.duration*50*y}px`},onClick:d=>{d.stopPropagation(),f(c.id)},children:[e.jsx("span",{className:"nice-video-studio__item-name",children:(t==null?void 0:t.name)||m("videoEditor.untitled","Untitled")}),c.transitions.length>0&&e.jsx("span",{className:"nice-video-studio__item-transitions",children:e.jsx(l.NiceIcon,{name:"wand",size:12})}),c.effects.length>0&&e.jsx("span",{className:"nice-video-studio__item-effects",children:e.jsx(l.NiceIcon,{name:"palette",size:12})})]},c.id)})})]},n.id))})]})]}),E==="effects"&&e.jsxs("div",{className:"nice-video-studio__effects-panel",children:[e.jsx("h3",{children:m("videoEditor.videoEffects","Video Effects")}),e.jsx("p",{className:"nice-video-studio__panel-hint",children:m("videoEditor.selectAClipToApply","Select a clip to apply effects")}),e.jsx("div",{className:"nice-video-studio__effects-grid",children:de.map(n=>e.jsxs("button",{className:"nice-video-studio__effect-preset",disabled:!b,onClick:()=>{const c=K();c&&H(c.track.id,c.item.id,n.type)},children:[e.jsx("span",{className:"nice-video-studio__effect-icon",children:e.jsx(l.NiceIcon,{name:n.icon,size:16})}),e.jsx("span",{className:"nice-video-studio__effect-name",children:n.name})]},n.type))})]}),E==="transitions"&&e.jsxs("div",{className:"nice-video-studio__transitions-panel",children:[e.jsx("h3",{children:m("videoEditor.transitions","Transitions")}),e.jsx("p",{className:"nice-video-studio__panel-hint",children:m("videoEditor.selectAClipAndAdd","Select a clip and add transitions between clips")}),e.jsx("div",{className:"nice-video-studio__transitions-grid",children:ue.map(n=>e.jsxs("div",{className:"nice-video-studio__transition-preset",children:[e.jsx("span",{className:"nice-video-studio__transition-name",children:n.name}),e.jsxs("div",{className:"nice-video-studio__transition-buttons",children:[e.jsx("button",{disabled:!b,onClick:()=>{const c=K();c&&M(c.track.id,c.item.id,n.type,"start")},children:m("videoEditor.in","In")}),e.jsx("button",{disabled:!b,onClick:()=>{const c=K();c&&M(c.track.id,c.item.id,n.type,"end")},children:m("videoEditor.out","Out")})]})]},n.type))})]}),E==="export"&&e.jsxs("div",{className:"nice-video-studio__export-panel",children:[e.jsx("h3",{children:m("videoEditor.exportSettings","Export Settings")}),e.jsxs("div",{className:"nice-video-studio__export-settings",children:[e.jsxs("div",{className:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.resolution","Resolution")}),e.jsxs("select",{value:`${s.resolution.width}x${s.resolution.height}`,onChange:n=>{const[c,t]=n.target.value.split("x").map(Number);g({resolution:{width:c,height:t}})},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:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.frameRate","Frame Rate")}),e.jsxs("select",{value:s.frameRate,onChange:n=>g({frameRate:parseInt(n.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:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.videoCodec","Video Codec")}),e.jsxs("select",{value:s.settings.video.codec,onChange:n=>g({settings:{...s.settings,video:{...s.settings.video,codec:n.target.value}}}),children:[e.jsx("option",{value:"h264",children:m("videoEditor.h264BestCompatibility","H.264 (Best Compatibility)")}),e.jsx("option",{value:"h265",children:m("videoEditor.h265HevcSmallerSize","H.265/HEVC (Smaller Size)")}),e.jsx("option",{value:"vp9",children:m("videoEditor.vp9WebOptimized","VP9 (Web Optimized)")}),e.jsx("option",{value:"av1",children:m("videoEditor.av1FutureStandard","AV1 (Future Standard)")})]})]}),e.jsxs("div",{className:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.videoBitrateMbps","Video Bitrate (Mbps)")}),e.jsx("input",{type:"number",value:s.settings.video.bitrate/1e3,onChange:n=>g({settings:{...s.settings,video:{...s.settings.video,bitrate:parseFloat(n.target.value)*1e3}}}),min:"1",max:"100"})]})]}),e.jsx("button",{className:"nice-video-studio__export-button",onClick:Y,disabled:I!==null,children:I!==null?m("videoEditor.exporting2","Exporting... {exportProgress}%").replace("{exportProgress}",String(Math.round(I))):m("videoEditor.exportVideo","Export Video")}),I!==null&&e.jsx("div",{className:"nice-video-studio__export-progress",children:e.jsx("div",{className:"nice-video-studio__export-progress-bar",style:{width:`${I}%`}})})]})]});return e.jsxs(oe.NiceAppShell,{flush:!0,className:`nice-video-editor nice-video-studio ${F}`,height:"100%",style:{position:"relative",minHeight:600},toolbar:se,sidebar:i,rightSidebar:te??void 0,bottomPanel:o,children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx(l.NiceTutorialButton,{steps:l.resolveTutorial(R,me)})}),r]})},he={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"}},pe=({options:z,onRecordingStart:w,onRecordingStop:$,onRecordingPause:A,onRecordingResume:F,onError:R,className:m=""})=>{var n,c;const{t:s}=l.useNiceTranslation(),[a,E]=u.useState({...he,...z}),[j,B]=u.useState(null),[h,b]=u.useState("idle"),[f,T]=u.useState([]),[N,L]=u.useState(null),[V,y]=u.useState(null),[q,U]=u.useState(!1),[C,I]=u.useState(!1),[D,Q]=u.useState("pen"),[X,S]=u.useState("var(--nice-danger, #ff0000)"),g=u.useRef(null),_=u.useRef([]),P=u.useRef(null),W=u.useRef(null),O=u.useRef(null),Z=u.useRef(0);u.useEffect(()=>()=>{N&&N.getTracks().forEach(t=>t.stop()),O.current&&clearInterval(O.current)},[N]);const k=t=>{E(d=>({...d,...t,video:{...d.video,...t.video},audio:{...d.audio,...t.audio},output:{...d.output,...t.output}}))},H=async()=>{try{b("preparing");const t={video:{cursor:a.video.showCursor?"always":"never",frameRate:a.video.frameRate},audio:a.audio.source==="system"||a.audio.source==="both"},d=await navigator.mediaDevices.getDisplayMedia(t);if(a.audio.enabled&&(a.audio.source==="microphone"||a.audio.source==="both"))try{(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:a.audio.echoCancellation,noiseSuppression:a.audio.noiseSuppression}})).getAudioTracks().forEach(p=>d.addTrack(p))}catch(v){console.warn("Could not access microphone:",v)}L(d),P.current&&(P.current.srcObject=d,P.current.play()),b("idle")}catch(t){b("error"),R==null||R(t instanceof Error?t:new Error("Failed to start preview"))}},M=async()=>{N||await H();for(let t=3;t>0;t--)y(t),await new Promise(d=>setTimeout(d,1e3));y(null);try{const t=N||await ee();if(!t)throw new Error("No stream available");const d=se(a.output.format),v=new MediaRecorder(t,{mimeType:d,videoBitsPerSecond:te(a.output.quality)});_.current=[],v.ondataavailable=x=>{x.data.size>0&&_.current.push(x.data)},v.onstop=()=>{const x=new Blob(_.current,{type:d});j&&($==null||$({...j,status:"stopped"},x))},g.current=v,v.start(1e3),Z.current=Date.now();const p={id:l.createId(),status:"recording",startTime:new Date,duration:0,size:0,options:a,chunks:[]};B(p),b("recording"),w==null||w(p),O.current=setInterval(()=>{B(x=>x?{...x,duration:(Date.now()-Z.current)/1e3,size:_.current.reduce((re,ce)=>re+ce.size,0)}:null)},100)}catch(t){b("error"),R==null||R(t instanceof Error?t:new Error("Failed to start recording"))}},ee=async()=>(await H(),N),ie=()=>{g.current&&h==="recording"&&(g.current.pause(),b("paused"),A==null||A())},G=()=>{g.current&&h==="paused"&&(g.current.resume(),b("recording"),F==null||F())},Y=()=>{O.current&&clearInterval(O.current),g.current&&(h==="recording"||h==="paused")&&(g.current.stop(),b("stopped")),N&&(N.getTracks().forEach(t=>t.stop()),L(null))},J=u.useCallback(t=>{if(h!=="recording")return;const d={id:l.createId(),time:(j==null?void 0:j.duration)||0,label:t||s("screenRecorder.marker","Marker {markers}").replace("{markers}",String(f.length+1)),color:i()};T(v=>[...v,d])},[h,j==null?void 0:j.duration,f.length,s]),K=t=>{T(d=>d.filter(v=>v.id!==t))},se=t=>{switch(t){case"mp4":return"video/mp4";case"mkv":return"video/x-matroska";default:return"video/webm;codecs=vp9"}},te=t=>{switch(t){case"low":return 25e5;case"medium":return 5e6;case"lossless":return 2e7;default:return 8e6}},i=()=>{const t=["var(--nice-danger, #ff4444)","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff"];return t[Math.floor(Math.random()*t.length)]},r=t=>{const d=Math.floor(t/3600),v=Math.floor(t%3600/60),p=Math.floor(t%60),x=Math.floor(t%1*100);return d>0?`${d}:${v.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`:`${v.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}.${x.toString().padStart(2,"0")}`},o=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`;return e.jsxs("div",{className:`nice-screen-recorder ${m}`,children:[e.jsxs("div",{className:"nice-screen-recorder__preview",children:[V!==null&&e.jsx("div",{className:"nice-screen-recorder__countdown-overlay",children:e.jsx("span",{className:"nice-screen-recorder__countdown-number",children:V})}),e.jsx("video",{ref:P,className:"nice-screen-recorder__preview-video",muted:!0,playsInline:!0}),C&&e.jsx("canvas",{ref:W,className:"nice-screen-recorder__annotation-canvas"}),!N&&h==="idle"&&e.jsx("div",{className:"nice-screen-recorder__preview-placeholder",children:e.jsxs("button",{className:"nice-screen-recorder__start-preview-button",onClick:H,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"monitor",size:18})}),e.jsx("span",{children:s("screenRecorder.selectScreenToRecord","Select Screen to Record")})]})}),h==="recording"&&e.jsxs("div",{className:"nice-screen-recorder__recording-indicator",children:[e.jsx("span",{className:"nice-screen-recorder__recording-dot"}),e.jsx("span",{children:s("screenRecorder.rec","REC")})]})]}),e.jsxs("div",{className:"nice-screen-recorder__controls",children:[e.jsxs("div",{className:"nice-screen-recorder__controls-main",children:[h==="idle"&&e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--record",onClick:M,disabled:!!V,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"circle",size:18})}),e.jsx("span",{children:s("screenRecorder.startRecording","Start Recording")})]}),h==="recording"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--pause",onClick:ie,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"pause",size:18})}),e.jsx("span",{children:s("screenRecorder.pause","Pause")})]}),e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--stop",onClick:Y,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"stop",size:18})}),e.jsx("span",{children:s("screenRecorder.stop","Stop")})]})]}),h==="paused"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--resume",onClick:G,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"play",size:18})}),e.jsx("span",{children:s("screenRecorder.resume","Resume")})]}),e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--stop",onClick:Y,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"stop",size:18})}),e.jsx("span",{children:s("screenRecorder.stop","Stop")})]})]}),h==="stopped"&&e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--new",onClick:()=>{b("idle"),B(null),T([])},children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"refresh",size:18})}),e.jsx("span",{children:s("screenRecorder.newRecording","New Recording")})]})]}),e.jsxs("div",{className:"nice-screen-recorder__controls-secondary",children:[(h==="recording"||h==="paused")&&e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--marker",onClick:()=>J(),children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"tag",size:18})}),e.jsx("span",{children:s("screenRecorder.addMarker","Add Marker")})]}),e.jsxs("button",{className:`nice-screen-recorder__control-button ${C?"nice-screen-recorder__control-button--active":""}`,onClick:()=>I(!C),disabled:h!=="recording",children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"pen",size:18})}),e.jsx("span",{children:s("screenRecorder.annotate","Annotate")})]}),e.jsx("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--settings",onClick:()=>U(!q),disabled:h==="recording","aria-label":s("screenRecorder.settings","Settings"),children:e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(l.NiceIcon,{name:"settings",size:18})})})]})]}),e.jsxs("div",{className:"nice-screen-recorder__status",children:[e.jsxs("div",{className:"nice-screen-recorder__status-info",children:[e.jsxs("span",{className:"nice-screen-recorder__status-item",children:[e.jsx("strong",{children:s("screenRecorder.duration","Duration:")})," ",r((j==null?void 0:j.duration)||0)]}),e.jsxs("span",{className:"nice-screen-recorder__status-item",children:[e.jsx("strong",{children:s("screenRecorder.size","Size:")})," ",o((j==null?void 0:j.size)||0)]}),e.jsxs("span",{className:"nice-screen-recorder__status-item",children:[e.jsx("strong",{children:s("screenRecorder.markers2","Markers:")})," ",f.length]})]}),e.jsxs("div",{className:"nice-screen-recorder__status-quality",children:[a.video.resolution&&e.jsxs("span",{children:[a.video.resolution.width,"x",a.video.resolution.height]}),e.jsxs("span",{children:[a.video.frameRate,"fps"]}),e.jsx("span",{className:`nice-screen-recorder__audio-status nice-screen-recorder__audio-status--${a.audio.enabled?"on":"off"}`,children:e.jsx(l.NiceIcon,{name:a.audio.enabled?"volume":"volume-off",size:14})})]})]}),C&&h==="recording"&&e.jsxs("div",{className:"nice-screen-recorder__annotation-tools",children:[e.jsx("div",{className:"nice-screen-recorder__tool-group",children:["pen","arrow","rectangle","text"].map(t=>e.jsx("button",{className:`nice-screen-recorder__tool-button ${D===t?"nice-screen-recorder__tool-button--active":""}`,onClick:()=>Q(t),"aria-label":t,children:e.jsx(l.NiceIcon,{name:t==="pen"?"pen":t==="arrow"?"arrow-right":t==="rectangle"?"square":"type",size:16})},t))}),e.jsx("div",{className:"nice-screen-recorder__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(t=>e.jsx("button",{className:`nice-screen-recorder__color-button ${X===t?"nice-screen-recorder__color-button--active":""}`,style:{backgroundColor:t},onClick:()=>S(t)},t))})]}),f.length>0&&e.jsxs("div",{className:"nice-screen-recorder__markers",children:[e.jsx("h4",{children:s("screenRecorder.markers","Markers")}),e.jsx("div",{className:"nice-screen-recorder__markers-list",children:f.map(t=>e.jsxs("div",{className:"nice-screen-recorder__marker-item",style:{borderLeftColor:t.color},children:[e.jsx("span",{className:"nice-screen-recorder__marker-time",children:r(t.time)}),e.jsx("input",{type:"text",value:t.label,onChange:d=>{T(v=>v.map(p=>p.id===t.id?{...p,label:d.target.value}:p))},className:"nice-screen-recorder__marker-label"}),e.jsx("button",{"aria-label":s("screenRecorder.close","Close"),className:"nice-screen-recorder__marker-remove",onClick:()=>K(t.id),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]},t.id))})]}),q&&e.jsxs("div",{className:"nice-screen-recorder__settings",children:[e.jsxs("div",{className:"nice-screen-recorder__settings-header",children:[e.jsx("h3",{children:s("screenRecorder.recordingSettings","Recording Settings")}),e.jsx("button",{"aria-label":s("screenRecorder.close","Close"),className:"nice-screen-recorder__close-button",onClick:()=>U(!1),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]}),e.jsxs("div",{className:"nice-screen-recorder__settings-section",children:[e.jsx("h4",{children:s("screenRecorder.video","Video")}),e.jsxs("label",{children:[s("screenRecorder.source","Source"),e.jsxs("select",{value:a.video.source,onChange:t=>k({video:{...a.video,source:t.target.value}}),children:[e.jsx("option",{value:"screen",children:s("screenRecorder.entireScreen","Entire Screen")}),e.jsx("option",{value:"window",children:s("screenRecorder.applicationWindow","Application Window")}),e.jsx("option",{value:"tab",children:s("screenRecorder.browserTab","Browser Tab")}),e.jsx("option",{value:"camera",children:s("screenRecorder.camera","Camera")})]})]}),e.jsxs("label",{children:[s("screenRecorder.resolution","Resolution"),e.jsxs("select",{value:`${(n=a.video.resolution)==null?void 0:n.width}x${(c=a.video.resolution)==null?void 0:c.height}`,onChange:t=>{const[d,v]=t.target.value.split("x").map(Number);k({video:{...a.video,resolution:{width:d,height:v}}})},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:[s("screenRecorder.frameRate","Frame Rate"),e.jsxs("select",{value:a.video.frameRate,onChange:t=>k({video:{...a.video,frameRate:parseInt(t.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:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.video.showCursor,onChange:t=>k({video:{...a.video,showCursor:t.target.checked}})}),s("screenRecorder.showCursor","Show Cursor")]})]}),e.jsxs("div",{className:"nice-screen-recorder__settings-section",children:[e.jsx("h4",{children:s("screenRecorder.audio","Audio")}),e.jsxs("label",{className:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.audio.enabled,onChange:t=>k({audio:{...a.audio,enabled:t.target.checked}})}),s("screenRecorder.enableAudio","Enable Audio")]}),a.audio.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:[s("screenRecorder.source","Source"),e.jsxs("select",{value:a.audio.source,onChange:t=>k({audio:{...a.audio,source:t.target.value}}),children:[e.jsx("option",{value:"system",children:s("screenRecorder.systemAudio","System Audio")}),e.jsx("option",{value:"microphone",children:s("screenRecorder.microphone","Microphone")}),e.jsx("option",{value:"both",children:s("screenRecorder.both","Both")})]})]}),e.jsxs("label",{className:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.audio.echoCancellation,onChange:t=>k({audio:{...a.audio,echoCancellation:t.target.checked}})}),s("screenRecorder.echoCancellation","Echo Cancellation")]}),e.jsxs("label",{className:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.audio.noiseSuppression,onChange:t=>k({audio:{...a.audio,noiseSuppression:t.target.checked}})}),s("screenRecorder.noiseSuppression","Noise Suppression")]})]})]}),e.jsxs("div",{className:"nice-screen-recorder__settings-section",children:[e.jsx("h4",{children:s("screenRecorder.output","Output")}),e.jsxs("label",{children:[s("screenRecorder.format","Format"),e.jsxs("select",{value:a.output.format,onChange:t=>k({output:{...a.output,format:t.target.value}}),children:[e.jsx("option",{value:"webm",children:s("screenRecorder.webmBestWeb","WebM (Best Web)")}),e.jsx("option",{value:"mp4",children:s("screenRecorder.mp4MostCompatible","MP4 (Most Compatible)")}),e.jsx("option",{value:"mkv",children:s("screenRecorder.mkvLossless","MKV (Lossless)")})]})]}),e.jsxs("label",{children:[s("screenRecorder.quality","Quality"),e.jsxs("select",{value:a.output.quality,onChange:t=>k({output:{...a.output,quality:t.target.value}}),children:[e.jsx("option",{value:"low",children:s("screenRecorder.lowSmallerFile","Low (Smaller file)")}),e.jsx("option",{value:"medium",children:s("screenRecorder.medium","Medium")}),e.jsx("option",{value:"high",children:s("screenRecorder.highRecommended","High (Recommended)")}),e.jsx("option",{value:"lossless",children:s("screenRecorder.losslessLargestFile","Lossless (Largest file)")})]})]})]})]})]})},xe={id:l.createId(),name:"My Stream",protocol:"rtmp",destinations:[],sources:[],layout:{name:"Default",canvas:{width:1920,height:1080,backgroundColor:"#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"}}},ae=[{platform:"youtube",name:"YouTube",icon:"video",defaultUrl:"rtmp://a.rtmp.youtube.com/live2"},{platform:"twitch",name:"Twitch",icon:"gamepad",defaultUrl:"rtmp://live.twitch.tv/app"},{platform:"facebook",name:"Facebook",icon:"users",defaultUrl:"rtmps://live-api-s.facebook.com:443/rtmp"},{platform:"custom-rtmp",name:"Custom RTMP",icon:"link",defaultUrl:""},{platform:"custom-srt",name:"Custom SRT",icon:"lock",defaultUrl:""}],ne=[{type:"camera",name:"Camera",icon:"camera"},{type:"screen",name:"Screen Capture",icon:"monitor"},{type:"window",name:"Window Capture",icon:"window"},{type:"browser",name:"Browser Source",icon:"globe"},{type:"image",name:"Image",icon:"image"},{type:"video",name:"Video",icon:"video"},{type:"microphone",name:"Microphone",icon:"mic"},{type:"system-audio",name:"System Audio",icon:"volume"}],_e=({config:z,onConfigChange:w,onStreamStart:$,onStreamStop:A,onStatsUpdate:F,onError:R,className:m=""})=>{const{t:s}=l.useNiceTranslation(),[a,E]=u.useState(z||xe),[j,B]=u.useState("sources"),[h,b]=u.useState(!1),[f,T]=u.useState({duration:0,viewers:0,peakViewers:0,bitrate:0,fps:0,droppedFrames:0,cpuUsage:0,memoryUsage:0}),[N,L]=u.useState(null),[V,y]=u.useState(!1),[q,U]=u.useState(!1),[C,I]=u.useState([a.layout]),[D,Q]=u.useState(0),X=u.useRef(null),S=u.useRef(null),g=u.useRef(0);u.useEffect(()=>{z&&E(z)},[z]),u.useEffect(()=>()=>{S.current&&clearInterval(S.current)},[]);const _=u.useCallback(i=>{const r={...a,...i};E(r),w==null||w(r)},[a,w]),P=i=>{const r=ae.find(n=>n.platform===i),o={id:l.createId(),name:(r==null?void 0:r.name)||"Custom",platform:i,url:(r==null?void 0:r.defaultUrl)||"",streamKey:"",enabled:!0,status:"idle"};_({destinations:[...a.destinations,o]}),U(!1)},W=(i,r)=>{_({destinations:a.destinations.map(o=>o.id===i?{...o,...r}:o)})},O=i=>{_({destinations:a.destinations.filter(r=>r.id!==i)})},Z=async i=>{const r=ne.find(c=>c.type===i),o={id:l.createId(),type:i,name:`${(r==null?void 0:r.name)||i} ${a.sources.filter(c=>c.type===i).length+1}`,settings:{},volume:1,muted:!1};try{if(i==="camera"||i==="microphone"){const c=i==="camera"?{video:!0}:{audio:!0},d=(await navigator.mediaDevices.enumerateDevices()).filter(v=>i==="camera"?v.kind==="videoinput":v.kind==="audioinput");d.length>0&&(o.settings.deviceId=d[0].deviceId)}else(i==="screen"||i==="window")&&await navigator.mediaDevices.getDisplayMedia({video:!0})}catch(c){console.warn(`Could not access ${i}:`,c)}_({sources:[...a.sources,o]});const n={id:l.createId(),sourceId:o.id,position:{x:0,y:0},size:{width:a.layout.canvas.width,height:a.layout.canvas.height},visible:!0,opacity:1,zIndex:a.layout.layers.length};_({layout:{...a.layout,layers:[...a.layout.layers,n]}}),y(!1)},k=(i,r)=>{_({sources:a.sources.map(o=>o.id===i?{...o,...r}:o)})},H=i=>{_({sources:a.sources.filter(r=>r.id!==i),layout:{...a.layout,layers:a.layout.layers.filter(r=>r.sourceId!==i)}})},M=(i,r)=>{_({layout:{...a.layout,layers:a.layout.layers.map(o=>o.id===i?{...o,...r}:o)}})},ee=i=>{const r=a.layout.layers.findIndex(o=>o.id===i);if(r<a.layout.layers.length-1){const o=[...a.layout.layers];[o[r],o[r+1]]=[o[r+1],o[r]],o.forEach((n,c)=>{n.zIndex=c}),_({layout:{...a.layout,layers:o}})}},ie=i=>{const r=a.layout.layers.findIndex(o=>o.id===i);if(r>0){const o=[...a.layout.layers];[o[r],o[r-1]]=[o[r-1],o[r]],o.forEach((n,c)=>{n.zIndex=c}),_({layout:{...a.layout,layers:o}})}},G=()=>{const i={name:`Scene ${C.length+1}`,canvas:{...a.layout.canvas},layers:[]};I([...C,i])},Y=i=>{const r=[...C];r[D]=a.layout,I(r),Q(i),_({layout:C[i]})},J=async()=>{try{_({destinations:a.destinations.map(i=>i.enabled?{...i,status:"connecting"}:i)}),await new Promise(i=>setTimeout(i,2e3)),_({destinations:a.destinations.map(i=>i.enabled?{...i,status:"live"}:i)}),b(!0),g.current=Date.now(),$==null||$(),S.current=setInterval(()=>{const i={duration:(Date.now()-g.current)/1e3,viewers:Math.floor(Math.random()*100)+f.viewers,peakViewers:Math.max(f.peakViewers,f.viewers),bitrate:a.settings.video.bitrate+Math.floor(Math.random()*500-250),fps:a.settings.video.frameRate-Math.random()*2,droppedFrames:f.droppedFrames+(Math.random()>.95?1:0),cpuUsage:15+Math.random()*30,memoryUsage:40+Math.random()*20};T(i),F==null||F(i)},1e3)}catch(i){R==null||R(i instanceof Error?i:new Error("Failed to start stream")),_({destinations:a.destinations.map(r=>({...r,status:"error"}))})}},K=()=>{S.current&&clearInterval(S.current),_({destinations:a.destinations.map(i=>({...i,status:"idle"}))}),b(!1),A==null||A()},se=i=>{const r=Math.floor(i/3600),o=Math.floor(i%3600/60),n=Math.floor(i%60);return`${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},te=i=>{switch(i){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 ${m}`,children:[e.jsxs("header",{className:"nice-live-streaming__header",children:[e.jsxs("div",{className:"nice-live-streaming__header-title",children:[e.jsx("input",{type:"text",value:a.name,onChange:i=>_({name:i.target.value}),className:"nice-live-streaming__stream-name-input"}),h&&e.jsxs("span",{className:"nice-live-streaming__live-badge",children:[e.jsx("span",{className:"nice-live-streaming__live-dot"})," ",s("liveStreaming.live","LIVE")]})]}),e.jsx("div",{className:"nice-live-streaming__header-stats",children:h&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(l.NiceIcon,{name:"clock",size:14})," ",se(f.duration)]}),e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(l.NiceIcon,{name:"users",size:14})," ",f.viewers]}),e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(l.NiceIcon,{name:"bar-chart",size:14})," ",s("liveStreaming.kbps","{bitrate} kbps").replace("{bitrate}",String(Math.round(f.bitrate)))]}),e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(l.NiceIcon,{name:"video",size:14})," ",f.fps.toFixed(1)," fps"]})]})}),e.jsx("div",{className:"nice-live-streaming__header-actions",children:h?e.jsx("button",{className:"nice-live-streaming__action-button nice-live-streaming__action-button--stop",onClick:K,children:s("liveStreaming.endStream","End Stream")}):e.jsx("button",{className:"nice-live-streaming__action-button nice-live-streaming__action-button--go-live",onClick:J,disabled:a.destinations.filter(i=>i.enabled).length===0,children:s("liveStreaming.goLive","Go Live")})})]}),e.jsxs("div",{className:"nice-live-streaming__main",children:[e.jsxs("div",{className:"nice-live-streaming__preview",children:[e.jsxs("div",{className:"nice-live-streaming__scenes-bar",children:[C.map((i,r)=>e.jsx("button",{className:`nice-live-streaming__scene-button ${D===r?"nice-live-streaming__scene-button--active":""}`,onClick:()=>Y(r),children:i.name},r)),e.jsx("button",{className:"nice-live-streaming__scene-button nice-live-streaming__scene-button--add",onClick:G,children:"+"})]}),e.jsx("div",{ref:X,className:"nice-live-streaming__preview-canvas",style:{aspectRatio:`${a.layout.canvas.width}/${a.layout.canvas.height}`,backgroundColor:a.layout.canvas.backgroundColor},children:a.layout.layers.sort((i,r)=>i.zIndex-r.zIndex).map(i=>{var o;const r=a.sources.find(n=>n.id===i.sourceId);return!i.visible||!r?null:e.jsx("div",{className:`nice-live-streaming__canvas-layer ${N===i.id?"nice-live-streaming__canvas-layer--selected":""}`,style:{left:`${i.position.x/a.layout.canvas.width*100}%`,top:`${i.position.y/a.layout.canvas.height*100}%`,width:`${i.size.width/a.layout.canvas.width*100}%`,height:`${i.size.height/a.layout.canvas.height*100}%`,opacity:i.opacity,zIndex:i.zIndex},onClick:()=>L(i.id),children:e.jsxs("div",{className:"nice-live-streaming__layer-content",children:[e.jsx("span",{className:"nice-live-streaming__layer-icon",children:e.jsx(l.NiceIcon,{name:((o=ne.find(n=>n.type===r.type))==null?void 0:o.icon)??"box",size:16})}),e.jsx("span",{className:"nice-live-streaming__layer-name",children:r.name})]})},i.id)})})]}),e.jsxs("aside",{className:"nice-live-streaming__panel",children:[e.jsx("div",{className:"nice-live-streaming__panel-tabs",children:["sources","audio","destinations","settings"].map(i=>e.jsx("button",{className:`nice-live-streaming__panel-tab ${j===i?"nice-live-streaming__panel-tab--active":""}`,onClick:()=>B(i),children:i.charAt(0).toUpperCase()+i.slice(1)},i))}),e.jsxs("div",{className:"nice-live-streaming__panel-content",children:[j==="sources"&&e.jsxs("div",{className:"nice-live-streaming__sources-panel",children:[e.jsxs("div",{className:"nice-live-streaming__panel-header",children:[e.jsx("h3",{children:s("liveStreaming.sources","Sources")}),e.jsx("button",{className:"nice-live-streaming__add-button",onClick:()=>y(!0),disabled:h,children:s("liveStreaming.add","+ Add")})]}),e.jsx("div",{className:"nice-live-streaming__sources-list",children:a.sources.filter(i=>i.type!=="microphone"&&i.type!=="system-audio").map(i=>{var o;const r=a.layout.layers.find(n=>n.sourceId===i.id);return e.jsxs("div",{className:`nice-live-streaming__source-item ${N===(r==null?void 0:r.id)?"nice-live-streaming__source-item--selected":""}`,onClick:()=>r&&L(r.id),children:[e.jsx("span",{className:"nice-live-streaming__source-icon",children:e.jsx(l.NiceIcon,{name:((o=ne.find(n=>n.type===i.type))==null?void 0:o.icon)??"box",size:16})}),e.jsx("span",{className:"nice-live-streaming__source-name",children:i.name}),e.jsxs("div",{className:"nice-live-streaming__source-controls",children:[e.jsx("button",{className:`nice-live-streaming__visibility-toggle ${r!=null&&r.visible?"":"nice-live-streaming__visibility-toggle--hidden"}`,onClick:n=>{n.stopPropagation(),r&&M(r.id,{visible:!r.visible})},children:e.jsx(l.NiceIcon,{name:r!=null&&r.visible?"eye":"eye-off",size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),r&&ee(r.id)},children:e.jsx(l.NiceIcon,{name:"arrow-up",size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),r&&ie(r.id)},children:e.jsx(l.NiceIcon,{name:"arrow-down",size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),H(i.id)},disabled:h,children:e.jsx(l.NiceIcon,{name:"trash",size:14})})]})]},i.id)})}),N&&e.jsxs("div",{className:"nice-live-streaming__layer-properties",children:[e.jsx("h4",{children:s("liveStreaming.properties","Properties")}),(()=>{const i=a.layout.layers.find(r=>r.id===N);return i?e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:[s("liveStreaming.xPosition","X Position"),e.jsx("input",{type:"number",value:i.position.x,onChange:r=>M(i.id,{position:{...i.position,x:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:[s("liveStreaming.yPosition","Y Position"),e.jsx("input",{type:"number",value:i.position.y,onChange:r=>M(i.id,{position:{...i.position,y:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:[s("liveStreaming.width","Width"),e.jsx("input",{type:"number",value:i.size.width,onChange:r=>M(i.id,{size:{...i.size,width:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:[s("liveStreaming.height","Height"),e.jsx("input",{type:"number",value:i.size.height,onChange:r=>M(i.id,{size:{...i.size,height:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:[s("liveStreaming.opacity","Opacity"),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:i.opacity,onChange:r=>M(i.id,{opacity:parseFloat(r.target.value)})})]})]}):null})()]})]}),j==="audio"&&e.jsxs("div",{className:"nice-live-streaming__audio-panel",children:[e.jsxs("div",{className:"nice-live-streaming__panel-header",children:[e.jsx("h3",{children:s("liveStreaming.audioMixer","Audio Mixer")}),e.jsx("button",{className:"nice-live-streaming__add-button",onClick:()=>{y(!0)},disabled:h,children:s("liveStreaming.add","+ Add")})]}),e.jsxs("div",{className:"nice-live-streaming__audio-sources",children:[a.sources.filter(i=>i.type==="microphone"||i.type==="system-audio"||i.type==="video").map(i=>{var r;return e.jsxs("div",{className:"nice-live-streaming__audio-source",children:[e.jsxs("div",{className:"nice-live-streaming__audio-header",children:[e.jsx("span",{className:"nice-live-streaming__audio-icon",children:e.jsx(l.NiceIcon,{name:((r=ne.find(o=>o.type===i.type))==null?void 0:r.icon)??"box",size:16})}),e.jsx("span",{className:"nice-live-streaming__audio-name",children:i.name}),e.jsx("button",{className:`nice-live-streaming__mute-toggle ${i.muted?"nice-live-streaming__mute-toggle--muted":""}`,onClick:()=>k(i.id,{muted:!i.muted}),children:e.jsx(l.NiceIcon,{name:i.muted?"volume-off":"volume",size:14})})]}),e.jsxs("div",{className:"nice-live-streaming__audio-slider",children:[e.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:i.volume??1,onChange:o=>k(i.id,{volume:parseFloat(o.target.value)}),disabled:i.muted}),e.jsxs("span",{className:"nice-live-streaming__volume-value",children:[Math.round((i.volume??1)*100),"%"]})]}),e.jsx("div",{className:"nice-live-streaming__audio-meter",children:e.jsx("div",{className:"nice-live-streaming__meter-fill",style:{width:`${(i.volume??1)*70+Math.random()*30}%`}})})]},i.id)}),a.sources.filter(i=>i.type==="microphone"||i.type==="system-audio").length===0&&e.jsx("p",{className:"nice-live-streaming__empty-message",children:s("liveStreaming.noAudioSourcesAdded","No audio sources added")})]})]}),j==="destinations"&&e.jsxs("div",{className:"nice-live-streaming__destinations-panel",children:[e.jsxs("div",{className:"nice-live-streaming__panel-header",children:[e.jsx("h3",{children:s("liveStreaming.destinations","Destinations")}),e.jsx("button",{className:"nice-live-streaming__add-button",onClick:()=>U(!0),disabled:h,children:s("liveStreaming.add","+ Add")})]}),e.jsxs("div",{className:"nice-live-streaming__destinations-list",children:[a.destinations.map(i=>{var r;return e.jsxs("div",{className:"nice-live-streaming__destination-item",children:[e.jsxs("div",{className:"nice-live-streaming__destination-header",children:[e.jsx("span",{className:"nice-live-streaming__status-indicator",style:{backgroundColor:te(i.status)}}),e.jsx("span",{className:"nice-live-streaming__destination-icon",children:e.jsx(l.NiceIcon,{name:((r=ae.find(o=>o.platform===i.platform))==null?void 0:r.icon)??"link",size:16})}),e.jsx("span",{className:"nice-live-streaming__destination-name",children:i.name}),e.jsxs("label",{className:"nice-live-streaming__toggle",children:[e.jsx("input",{type:"checkbox",checked:i.enabled,onChange:o=>W(i.id,{enabled:o.target.checked}),disabled:h}),e.jsx("span",{className:"nice-live-streaming__toggle-slider"})]})]}),e.jsxs("div",{className:"nice-live-streaming__destination-config",children:[e.jsxs("label",{children:[s("liveStreaming.serverUrl","Server URL"),e.jsx("input",{type:"text",value:i.url,onChange:o=>W(i.id,{url:o.target.value}),placeholder:s("liveStreaming.rtmp","rtmp://..."),disabled:h})]}),e.jsxs("label",{children:[s("liveStreaming.streamKey","Stream Key"),e.jsx("input",{type:"password",value:i.streamKey||"",onChange:o=>W(i.id,{streamKey:o.target.value}),placeholder:s("liveStreaming.enterStreamKey","Enter stream key"),disabled:h})]})]}),e.jsx("button",{className:"nice-live-streaming__remove-button",onClick:()=>O(i.id),disabled:h,children:s("liveStreaming.remove","Remove")})]},i.id)}),a.destinations.length===0&&e.jsx("p",{className:"nice-live-streaming__empty-message",children:s("liveStreaming.noDestinationsConfigured","No destinations configured")})]})]}),j==="settings"&&e.jsxs("div",{className:"nice-live-streaming__settings-panel",children:[e.jsxs("div",{className:"nice-live-streaming__setting-section",children:[e.jsx("h4",{children:s("liveStreaming.video","Video")}),e.jsxs("label",{children:[s("liveStreaming.resolution","Resolution"),e.jsxs("select",{value:`${a.settings.video.resolution.width}x${a.settings.video.resolution.height}`,onChange:i=>{const[r,o]=i.target.value.split("x").map(Number);_({settings:{...a.settings,video:{...a.settings.video,resolution:{width:r,height:o}}},layout:{...a.layout,canvas:{...a.layout.canvas,width:r,height:o}}})},disabled:h,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:[s("liveStreaming.frameRate","Frame Rate"),e.jsxs("select",{value:a.settings.video.frameRate,onChange:i=>_({settings:{...a.settings,video:{...a.settings.video,frameRate:parseInt(i.target.value)}}}),disabled:h,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:[s("liveStreaming.bitrateKbps","Bitrate (kbps)"),e.jsx("input",{type:"number",value:a.settings.video.bitrate,onChange:i=>_({settings:{...a.settings,video:{...a.settings.video,bitrate:parseInt(i.target.value)||6e3}}}),min:"1000",max:"50000",disabled:h})]}),e.jsxs("label",{children:[s("liveStreaming.keyframeIntervalSec","Keyframe Interval (sec)"),e.jsx("input",{type:"number",value:a.settings.video.keyframe,onChange:i=>_({settings:{...a.settings,video:{...a.settings.video,keyframe:parseInt(i.target.value)||2}}}),min:"1",max:"10",disabled:h})]})]}),e.jsxs("div",{className:"nice-live-streaming__setting-section",children:[e.jsx("h4",{children:s("liveStreaming.audio","Audio")}),e.jsxs("label",{children:[s("liveStreaming.sampleRate","Sample Rate"),e.jsxs("select",{value:a.settings.audio.sampleRate,onChange:i=>_({settings:{...a.settings,audio:{...a.settings.audio,sampleRate:parseInt(i.target.value)}}}),disabled:h,children:[e.jsx("option",{value:"44100",children:"44.1 kHz"}),e.jsx("option",{value:"48000",children:"48 kHz"})]})]}),e.jsxs("label",{children:[s("liveStreaming.audioBitrateKbps","Audio Bitrate (kbps)"),e.jsxs("select",{value:a.settings.audio.bitrate,onChange:i=>_({settings:{...a.settings,audio:{...a.settings.audio,bitrate:parseInt(i.target.value)}}}),disabled:h,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"})]})]})]})]})]})]})]}),h&&e.jsx("footer",{className:"nice-live-streaming__footer",children:e.jsxs("div",{className:"nice-live-streaming__footer-stats",children:[e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:"CPU"}),e.jsxs("span",{className:"nice-live-streaming__value",children:[f.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:s("liveStreaming.memory","Memory")}),e.jsxs("span",{className:"nice-live-streaming__value",children:[f.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:s("liveStreaming.dropped","Dropped")}),e.jsx("span",{className:"nice-live-streaming__value",children:f.droppedFrames})]}),e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:s("liveStreaming.peakViewers","Peak Viewers")}),e.jsx("span",{className:"nice-live-streaming__value",children:f.peakViewers})]})]})}),V&&e.jsx("div",{className:"nice-live-streaming__modal-overlay",children:e.jsxs("div",{className:"nice-live-streaming__modal",children:[e.jsxs("div",{className:"nice-live-streaming__modal-header",children:[e.jsx("h3",{children:s("liveStreaming.addSource","Add Source")}),e.jsx("button",{"aria-label":s("liveStreaming.close","Close"),className:"nice-live-streaming__close-button",onClick:()=>y(!1),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]}),e.jsx("div",{className:"nice-live-streaming__modal-content",children:e.jsx("div",{className:"nice-live-streaming__source-type-grid",children:ne.map(i=>e.jsxs("button",{className:"nice-live-streaming__source-type-button",onClick:()=>Z(i.type),children:[e.jsx("span",{className:"nice-live-streaming__icon",children:e.jsx(l.NiceIcon,{name:i.icon,size:24})}),e.jsx("span",{className:"nice-live-streaming__name",children:i.name})]},i.type))})})]})}),q&&e.jsx("div",{className:"nice-live-streaming__modal-overlay",children:e.jsxs("div",{className:"nice-live-streaming__modal",children:[e.jsxs("div",{className:"nice-live-streaming__modal-header",children:[e.jsx("h3",{children:s("liveStreaming.addDestination","Add Destination")}),e.jsx("button",{"aria-label":s("liveStreaming.close","Close"),className:"nice-live-streaming__close-button",onClick:()=>U(!1),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]}),e.jsx("div",{className:"nice-live-streaming__modal-content",children:e.jsx("div",{className:"nice-live-streaming__platform-grid",children:ae.map(i=>e.jsxs("button",{className:"nice-live-streaming__platform-button",onClick:()=>P(i.platform),children:[e.jsx("span",{className:"nice-live-streaming__icon",children:e.jsx(l.NiceIcon,{name:i.icon,size:24})}),e.jsx("span",{className:"nice-live-streaming__name",children:i.name})]},i.platform))})})]})})]})};exports.NiceLiveStreaming=_e;exports.NiceScreenRecorder=pe;exports.NiceVideoEditor=ve;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),oe=require("@nice2dev/ui"),o=require("@nice2dev/ui-core"),u=require("react"),le={id:o.createId(),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:"#000000",audio:{sampleRate:48e3,channels:2,bitrate:320},video:{codec:"h264",bitrate:8e3,profile:"high"}}},de=[{type:"blur",name:"Blur",icon:"droplet"},{type:"brightness",name:"Brightness",icon:"sun"},{type:"contrast",name:"Contrast",icon:"moon"},{type:"saturation",name:"Saturation",icon:"palette"},{type:"grayscale",name:"Grayscale",icon:"square"},{type:"sepia",name:"Sepia",icon:"image"},{type:"chromaKey",name:"Chroma Key",icon:"layers"},{type:"crop",name:"Crop",icon:"crop"},{type:"zoom",name:"Zoom",icon:"search"}],ue=[{type:"fade",name:"Fade"},{type:"dissolve",name:"Dissolve"},{type:"wipe",name:"Wipe"},{type:"slide",name:"Slide"},{type:"zoom",name:"Zoom"},{type:"push",name:"Push"}],me=[{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"}],ve=({project:z,onProjectChange:w,onExport:$,onAssetUpload:A,className:F="",tutorial:R})=>{const{t:m}=o.useNiceTranslation(),[s,a]=u.useState(z||le),[E,j]=u.useState("timeline"),[K,h]=u.useState(null),[b,f]=u.useState(null),[T,N]=u.useState(0),[L,O]=u.useState(!1),[y,q]=u.useState(1),[V,C]=u.useState(!0),[I,D]=u.useState(null),Q=u.useRef(null),X=u.useRef(null),S=u.useRef(null);u.useEffect(()=>{z&&a(z)},[z]),u.useEffect(()=>()=>{S.current&&clearInterval(S.current)},[]);const g=u.useCallback(n=>{const c={...s,...n};a(c),w==null||w(c)},[s,w]),_=async n=>{const c=[];for(const t of Array.from(n)){const d=t.type.startsWith("video/")?"video":t.type.startsWith("audio/")?"audio":"image";let v;A?v=await A(t):v={id:o.createId(),type:d,name:t.name,url:URL.createObjectURL(t),size:t.size},c.push(v)}g({assets:[...s.assets,...c]})},P=n=>{const c={id:o.createId(),type:n,name:`${n.charAt(0).toUpperCase()+n.slice(1)} ${s.tracks.filter(t=>t.type===n).length+1}`,items:[],muted:!1,locked:!1,visible:!0};g({tracks:[...s.tracks,c]})},W=n=>{g({tracks:s.tracks.filter(c=>c.id!==n)}),K===n&&h(null)},U=n=>{g({tracks:s.tracks.map(c=>c.id===n?{...c,muted:!c.muted}:c)})},Z=n=>{g({tracks:s.tracks.map(c=>c.id===n?{...c,locked:!c.locked}:c)})},k=(n,c)=>{const t=s.tracks.find(x=>x.id===n);if(!t||t.locked)return;const d=t.items[t.items.length-1],v=d?d.startTime+d.duration:0,p={id:o.createId(),assetId:c.id,type:c.type,startTime:v,duration:c.duration||5,offset:0,properties:{x:0,y:0,opacity:1,scale:1,volume:1},effects:[],transitions:[]};g({tracks:s.tracks.map(x=>x.id===n?{...x,items:[...x.items,p]}:x)})},H=(n,c,t)=>{const d={id:o.createId(),type:t,name:t.charAt(0).toUpperCase()+t.slice(1),parameters:ee(t)};g({tracks:s.tracks.map(v=>v.id===n?{...v,items:v.items.map(p=>p.id===c?{...p,effects:[...p.effects,d]}:p)}:v)})},M=(n,c,t,d)=>{const v={id:o.createId(),type:t,duration:.5,position:d};g({tracks:s.tracks.map(p=>p.id===n?{...p,items:p.items.map(x=>x.id===c?{...x,transitions:[...x.transitions,v]}:x)}:p)})},ee=n=>{switch(n){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{}}},ie=()=>{L?(S.current&&clearInterval(S.current),O(!1)):(S.current=setInterval(()=>{N(n=>{const c=Math.max(...s.tracks.flatMap(t=>t.items.map(d=>d.startTime+d.duration)),0);return n>=c?(clearInterval(S.current),O(!1),0):n+1/s.frameRate})},1e3/s.frameRate),O(!0))},G=n=>{N(Math.max(0,n))},Y=async()=>{if($){D(0);try{const n=setInterval(()=>{D(c=>c!==null&&c<90?c+Math.random()*10:c)},500);await $(s,s.settings.video.codec),clearInterval(n),D(100),setTimeout(()=>D(null),2e3)}catch(n){D(null),console.error("Export failed:",n)}}},J=n=>{const c=Math.floor(n/60),t=Math.floor(n%60),d=Math.floor(n%1*s.frameRate);return`${c.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}`},B=()=>{for(const n of s.tracks){const c=n.items.find(t=>t.id===b);if(c)return{track:n,item:c}}return null},se=e.jsxs("header",{className:"nice-video-studio__header",children:[e.jsxs("div",{className:"nice-video-studio__header-project-info",children:[e.jsx("input",{type:"text",value:s.name,onChange:n=>g({name:n.target.value}),className:"nice-video-studio__project-name-input"}),e.jsxs("span",{className:"nice-video-studio__project-settings",children:[s.resolution.width,"x",s.resolution.height," • ",s.frameRate,"fps"]})]}),e.jsx("div",{className:"nice-video-studio__header-tabs",children:["timeline","effects","transitions","export"].map(n=>e.jsx("button",{className:`nice-video-studio__tab-button ${E===n?"nice-video-studio__tab-button--active":""}`,onClick:()=>j(n),children:n.charAt(0).toUpperCase()+n.slice(1)},n))}),e.jsx("div",{className:"nice-video-studio__header-actions",children:e.jsx("button",{className:"nice-video-studio__action-button nice-video-studio__action-button--primary",onClick:Y,disabled:I!==null,children:I!==null?m("videoEditor.exporting","Exporting {exportProgress}%").replace("{exportProgress}",String(Math.round(I))):m("videoEditor.export","Export")})})]}),te=b&&E!=="export"?(()=>{const n=B();if(!n)return null;const{track:c,item:t}=n;return e.jsxs("div",{className:"nice-video-studio__item-inspector",children:[e.jsx("h4",{children:m("videoEditor.itemProperties","Item Properties")}),e.jsxs("div",{className:"nice-video-studio__inspector-section",children:[e.jsxs("label",{children:[m("videoEditor.startTime","Start Time"),e.jsx("input",{type:"number",step:"0.1",value:t.startTime,onChange:d=>{const v=parseFloat(d.target.value);g({tracks:s.tracks.map(p=>p.id===c.id?{...p,items:p.items.map(x=>x.id===t.id?{...x,startTime:v}:x)}:p)})}})]}),e.jsxs("label",{children:[m("videoEditor.duration","Duration"),e.jsx("input",{type:"number",step:"0.1",value:t.duration,onChange:d=>{const v=parseFloat(d.target.value);g({tracks:s.tracks.map(p=>p.id===c.id?{...p,items:p.items.map(x=>x.id===t.id?{...x,duration:v}:x)}:p)})}})]}),e.jsxs("label",{children:[m("videoEditor.opacity","Opacity"),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:t.properties.opacity??1,onChange:d=>{const v=parseFloat(d.target.value);g({tracks:s.tracks.map(p=>p.id===c.id?{...p,items:p.items.map(x=>x.id===t.id?{...x,properties:{...x.properties,opacity:v}}:x)}:p)})}})]})]}),e.jsx("h4",{children:m("videoEditor.effects","Effects ({effects})").replace("{effects}",String(t.effects.length))}),e.jsx("div",{className:"nice-video-studio__effects-list",children:t.effects.map(d=>e.jsx("div",{className:"nice-video-studio__effect-badge",children:d.name},d.id))})]})})():null,i=V?e.jsxs("aside",{className:"nice-video-studio__asset-library",children:[e.jsxs("div",{className:"nice-video-studio__asset-library-header",children:[e.jsx("h3",{children:m("videoEditor.assets","Assets")}),e.jsx("button",{"aria-label":m("videoEditor.close","Close"),className:"nice-video-studio__close-button",onClick:()=>C(!1),children:e.jsx(o.NiceIcon,{name:"close",size:16})})]}),e.jsx("div",{className:"nice-video-studio__asset-library-upload",children:e.jsxs("label",{className:"nice-video-studio__upload-zone",children:[e.jsx("input",{type:"file",multiple:!0,accept:"video/*,audio/*,image/*",onChange:n=>n.target.files&&_(n.target.files),hidden:!0}),e.jsx("span",{className:"nice-video-studio__upload-icon",children:"+"}),e.jsx("span",{children:m("videoEditor.dropFilesOrClickTo","Drop files or click to upload")})]})}),e.jsx("div",{className:"nice-video-studio__asset-library-list",children:s.assets.map(n=>e.jsxs("div",{className:"nice-video-studio__asset-item",draggable:!0,onDragStart:c=>c.dataTransfer.setData("assetId",n.id),children:[e.jsx("div",{className:"nice-video-studio__asset-thumbnail",children:n.thumbnail?e.jsx("img",{src:n.thumbnail,alt:n.name}):e.jsx("span",{className:"nice-video-studio__asset-type-icon",children:e.jsx(o.NiceIcon,{name:n.type==="video"?"video":n.type==="audio"?"music":"image",size:24})})}),e.jsxs("div",{className:"nice-video-studio__asset-info",children:[e.jsx("span",{className:"nice-video-studio__asset-name",children:n.name}),e.jsxs("span",{className:"nice-video-studio__asset-meta",children:[(n.size/1024/1024).toFixed(1),"MB"]})]})]},n.id))})]}):void 0,r=e.jsx("div",{className:"nice-video-studio__preview-area",children:e.jsxs("div",{className:"nice-video-studio__preview-container",children:[e.jsxs("div",{className:"nice-video-studio__preview-canvas",style:{aspectRatio:`${s.resolution.width}/${s.resolution.height}`},children:[e.jsx("video",{ref:X,className:"nice-video-studio__preview-video"}),e.jsx("div",{className:"nice-video-studio__preview-overlay",children:!V&&e.jsx("button",{className:"nice-video-studio__toggle-library-button",onClick:()=>C(!0),"aria-label":m("videoEditor.showAssetLibrary","Show asset library"),children:e.jsx(o.NiceIcon,{name:"folder",size:16})})})]}),e.jsxs("div",{className:"nice-video-studio__playback-controls",children:[e.jsx("button",{onClick:()=>G(0),"aria-label":m("videoEditor.goToStart","Go to start"),children:e.jsx(o.NiceIcon,{name:"skip-back",size:16})}),e.jsx("button",{onClick:()=>G(T-1/s.frameRate),"aria-label":m("videoEditor.previousFrame","Previous frame"),children:e.jsx(o.NiceIcon,{name:"chevron-left",size:16})}),e.jsx("button",{onClick:ie,className:"nice-video-studio__play-button","aria-label":L?m("videoEditor.pause","Pause"):m("videoEditor.play","Play"),children:e.jsx(o.NiceIcon,{name:L?"pause":"play",size:18})}),e.jsx("button",{onClick:()=>G(T+1/s.frameRate),"aria-label":m("videoEditor.nextFrame","Next frame"),children:e.jsx(o.NiceIcon,{name:"chevron-right",size:16})}),e.jsx("span",{className:"nice-video-studio__time-display",children:J(T)})]})]})}),l=e.jsxs("div",{className:"nice-video-studio__panel",children:[E==="timeline"&&e.jsxs("div",{className:"nice-video-studio__timeline-panel",children:[e.jsxs("div",{className:"nice-video-studio__timeline-toolbar",children:[e.jsxs("div",{className:"nice-video-studio__track-buttons",children:[e.jsx("button",{onClick:()=>P("video"),children:m("videoEditor.videoTrack","+ Video Track")}),e.jsx("button",{onClick:()=>P("audio"),children:m("videoEditor.audioTrack","+ Audio Track")}),e.jsx("button",{onClick:()=>P("text"),children:m("videoEditor.textTrack","+ Text Track")})]}),e.jsxs("div",{className:"nice-video-studio__zoom-controls",children:[e.jsx("button",{onClick:()=>q(Math.max(.25,y-.25)),children:"-"}),e.jsxs("span",{children:[Math.round(y*100),"%"]}),e.jsx("button",{onClick:()=>q(Math.min(4,y+.25)),children:"+"})]})]}),e.jsxs("div",{className:"nice-video-studio__timeline-container",ref:Q,children:[e.jsx("div",{className:"nice-video-studio__timeline-ruler",children:Array.from({length:Math.ceil(30/y)}).map((n,c)=>e.jsx("div",{className:"nice-video-studio__ruler-mark",style:{left:`${c*50*y}px`},children:J(c)},c))}),e.jsx("div",{className:"nice-video-studio__timeline-playhead",style:{left:`${T*50*y}px`}}),e.jsx("div",{className:"nice-video-studio__timeline-tracks",children:s.tracks.map(n=>e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:o.clickOnActivationKey,className:`nice-video-studio__timeline-track ${K===n.id?"nice-video-studio__timeline-track--selected":""} ${n.locked?"nice-video-studio__timeline-track--locked":""}`,onClick:()=>h(n.id),onDrop:c=>{c.preventDefault();const t=c.dataTransfer.getData("assetId"),d=s.assets.find(v=>v.id===t);d&&k(n.id,d)},onDragOver:c=>c.preventDefault(),children:[e.jsxs("div",{className:"nice-video-studio__track-header",children:[e.jsx("span",{className:"nice-video-studio__track-name",children:n.name}),e.jsxs("div",{className:"nice-video-studio__track-controls",children:[e.jsx("button",{className:`nice-video-studio__track-toggle ${n.muted?"nice-video-studio__track-toggle--active":""}`,onClick:c=>{c.stopPropagation(),U(n.id)},children:e.jsx(o.NiceIcon,{name:n.muted?"volume-off":"volume",size:14})}),e.jsx("button",{className:`nice-video-studio__track-toggle ${n.locked?"nice-video-studio__track-toggle--active":""}`,onClick:c=>{c.stopPropagation(),Z(n.id)},children:e.jsx(o.NiceIcon,{name:n.locked?"lock":"unlock",size:14})}),e.jsx("button",{onClick:c=>{c.stopPropagation(),W(n.id)},"aria-label":m("videoEditor.removeTrack","Remove track"),children:e.jsx(o.NiceIcon,{name:"trash",size:14})})]})]}),e.jsx("div",{className:"nice-video-studio__track-items",children:n.items.map(c=>{const t=s.assets.find(d=>d.id===c.assetId);return e.jsxs("div",{role:"button",tabIndex:0,onKeyDown:o.clickOnActivationKey,className:`nice-video-studio__track-item nice-video-studio__track-item--${c.type} ${b===c.id?"nice-video-studio__track-item--selected":""}`,style:{left:`${c.startTime*50*y}px`,width:`${c.duration*50*y}px`},onClick:d=>{d.stopPropagation(),f(c.id)},children:[e.jsx("span",{className:"nice-video-studio__item-name",children:(t==null?void 0:t.name)||m("videoEditor.untitled","Untitled")}),c.transitions.length>0&&e.jsx("span",{className:"nice-video-studio__item-transitions",children:e.jsx(o.NiceIcon,{name:"wand",size:12})}),c.effects.length>0&&e.jsx("span",{className:"nice-video-studio__item-effects",children:e.jsx(o.NiceIcon,{name:"palette",size:12})})]},c.id)})})]},n.id))})]})]}),E==="effects"&&e.jsxs("div",{className:"nice-video-studio__effects-panel",children:[e.jsx("h3",{children:m("videoEditor.videoEffects","Video Effects")}),e.jsx("p",{className:"nice-video-studio__panel-hint",children:m("videoEditor.selectAClipToApply","Select a clip to apply effects")}),e.jsx("div",{className:"nice-video-studio__effects-grid",children:de.map(n=>e.jsxs("button",{className:"nice-video-studio__effect-preset",disabled:!b,onClick:()=>{const c=B();c&&H(c.track.id,c.item.id,n.type)},children:[e.jsx("span",{className:"nice-video-studio__effect-icon",children:e.jsx(o.NiceIcon,{name:n.icon,size:16})}),e.jsx("span",{className:"nice-video-studio__effect-name",children:n.name})]},n.type))})]}),E==="transitions"&&e.jsxs("div",{className:"nice-video-studio__transitions-panel",children:[e.jsx("h3",{children:m("videoEditor.transitions","Transitions")}),e.jsx("p",{className:"nice-video-studio__panel-hint",children:m("videoEditor.selectAClipAndAdd","Select a clip and add transitions between clips")}),e.jsx("div",{className:"nice-video-studio__transitions-grid",children:ue.map(n=>e.jsxs("div",{className:"nice-video-studio__transition-preset",children:[e.jsx("span",{className:"nice-video-studio__transition-name",children:n.name}),e.jsxs("div",{className:"nice-video-studio__transition-buttons",children:[e.jsx("button",{disabled:!b,onClick:()=>{const c=B();c&&M(c.track.id,c.item.id,n.type,"start")},children:m("videoEditor.in","In")}),e.jsx("button",{disabled:!b,onClick:()=>{const c=B();c&&M(c.track.id,c.item.id,n.type,"end")},children:m("videoEditor.out","Out")})]})]},n.type))})]}),E==="export"&&e.jsxs("div",{className:"nice-video-studio__export-panel",children:[e.jsx("h3",{children:m("videoEditor.exportSettings","Export Settings")}),e.jsxs("div",{className:"nice-video-studio__export-settings",children:[e.jsxs("div",{className:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.resolution","Resolution")}),e.jsxs("select",{value:`${s.resolution.width}x${s.resolution.height}`,onChange:n=>{const[c,t]=n.target.value.split("x").map(Number);g({resolution:{width:c,height:t}})},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:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.frameRate","Frame Rate")}),e.jsxs("select",{value:s.frameRate,onChange:n=>g({frameRate:parseInt(n.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:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.videoCodec","Video Codec")}),e.jsxs("select",{value:s.settings.video.codec,onChange:n=>g({settings:{...s.settings,video:{...s.settings.video,codec:n.target.value}}}),children:[e.jsx("option",{value:"h264",children:m("videoEditor.h264BestCompatibility","H.264 (Best Compatibility)")}),e.jsx("option",{value:"h265",children:m("videoEditor.h265HevcSmallerSize","H.265/HEVC (Smaller Size)")}),e.jsx("option",{value:"vp9",children:m("videoEditor.vp9WebOptimized","VP9 (Web Optimized)")}),e.jsx("option",{value:"av1",children:m("videoEditor.av1FutureStandard","AV1 (Future Standard)")})]})]}),e.jsxs("div",{className:"nice-video-studio__setting-group",children:[e.jsx("label",{children:m("videoEditor.videoBitrateMbps","Video Bitrate (Mbps)")}),e.jsx("input",{type:"number",value:s.settings.video.bitrate/1e3,onChange:n=>g({settings:{...s.settings,video:{...s.settings.video,bitrate:parseFloat(n.target.value)*1e3}}}),min:"1",max:"100"})]})]}),e.jsx("button",{className:"nice-video-studio__export-button",onClick:Y,disabled:I!==null,children:I!==null?m("videoEditor.exporting2","Exporting... {exportProgress}%").replace("{exportProgress}",String(Math.round(I))):m("videoEditor.exportVideo","Export Video")}),I!==null&&e.jsx("div",{className:"nice-video-studio__export-progress",children:e.jsx("div",{className:"nice-video-studio__export-progress-bar",style:{width:`${I}%`}})})]})]});return e.jsxs(oe.NiceAppShell,{flush:!0,className:`nice-video-editor nice-video-studio ${F}`,height:"100%",style:{position:"relative",minHeight:600},toolbar:se,sidebar:i,rightSidebar:te??void 0,bottomPanel:l,children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx(o.NiceTutorialButton,{steps:o.resolveTutorial(R,me)})}),r]})},he={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"}},pe=({options:z,onRecordingStart:w,onRecordingStop:$,onRecordingPause:A,onRecordingResume:F,onError:R,className:m=""})=>{var n,c;const{t:s}=o.useNiceTranslation(),[a,E]=u.useState({...he,...z}),[j,K]=u.useState(null),[h,b]=u.useState("idle"),[f,T]=u.useState([]),[N,L]=u.useState(null),[O,y]=u.useState(null),[q,V]=u.useState(!1),[C,I]=u.useState(!1),[D,Q]=u.useState("pen"),[X,S]=u.useState("var(--nice-danger, #ff0000)"),g=u.useRef(null),_=u.useRef([]),P=u.useRef(null),W=u.useRef(null),U=u.useRef(null),Z=u.useRef(0);u.useEffect(()=>()=>{N&&N.getTracks().forEach(t=>t.stop()),U.current&&clearInterval(U.current)},[N]);const k=t=>{E(d=>({...d,...t,video:{...d.video,...t.video},audio:{...d.audio,...t.audio},output:{...d.output,...t.output}}))},H=async()=>{try{b("preparing");const t={video:{cursor:a.video.showCursor?"always":"never",frameRate:a.video.frameRate},audio:a.audio.source==="system"||a.audio.source==="both"},d=await navigator.mediaDevices.getDisplayMedia(t);if(a.audio.enabled&&(a.audio.source==="microphone"||a.audio.source==="both"))try{(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:a.audio.echoCancellation,noiseSuppression:a.audio.noiseSuppression}})).getAudioTracks().forEach(p=>d.addTrack(p))}catch(v){console.warn("Could not access microphone:",v)}L(d),P.current&&(P.current.srcObject=d,P.current.play()),b("idle")}catch(t){b("error"),R==null||R(t instanceof Error?t:new Error("Failed to start preview"))}},M=async()=>{N||await H();for(let t=3;t>0;t--)y(t),await new Promise(d=>setTimeout(d,1e3));y(null);try{const t=N||await ee();if(!t)throw new Error("No stream available");const d=se(a.output.format),v=new MediaRecorder(t,{mimeType:d,videoBitsPerSecond:te(a.output.quality)});_.current=[],v.ondataavailable=x=>{x.data.size>0&&_.current.push(x.data)},v.onstop=()=>{const x=new Blob(_.current,{type:d});j&&($==null||$({...j,status:"stopped"},x))},g.current=v,v.start(1e3),Z.current=Date.now();const p={id:o.createId(),status:"recording",startTime:new Date,duration:0,size:0,options:a,chunks:[]};K(p),b("recording"),w==null||w(p),U.current=setInterval(()=>{K(x=>x?{...x,duration:(Date.now()-Z.current)/1e3,size:_.current.reduce((re,ce)=>re+ce.size,0)}:null)},100)}catch(t){b("error"),R==null||R(t instanceof Error?t:new Error("Failed to start recording"))}},ee=async()=>(await H(),N),ie=()=>{g.current&&h==="recording"&&(g.current.pause(),b("paused"),A==null||A())},G=()=>{g.current&&h==="paused"&&(g.current.resume(),b("recording"),F==null||F())},Y=()=>{U.current&&clearInterval(U.current),g.current&&(h==="recording"||h==="paused")&&(g.current.stop(),b("stopped")),N&&(N.getTracks().forEach(t=>t.stop()),L(null))},J=u.useCallback(t=>{if(h!=="recording")return;const d={id:o.createId(),time:(j==null?void 0:j.duration)||0,label:t||s("screenRecorder.marker","Marker {markers}").replace("{markers}",String(f.length+1)),color:i()};T(v=>[...v,d])},[h,j==null?void 0:j.duration,f.length,s]),B=t=>{T(d=>d.filter(v=>v.id!==t))},se=t=>{switch(t){case"mp4":return"video/mp4";case"mkv":return"video/x-matroska";default:return"video/webm;codecs=vp9"}},te=t=>{switch(t){case"low":return 25e5;case"medium":return 5e6;case"lossless":return 2e7;default:return 8e6}},i=()=>{const t=["var(--nice-danger, #ff4444)","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff"];return t[Math.floor(Math.random()*t.length)]},r=t=>{const d=Math.floor(t/3600),v=Math.floor(t%3600/60),p=Math.floor(t%60),x=Math.floor(t%1*100);return d>0?`${d}:${v.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`:`${v.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}.${x.toString().padStart(2,"0")}`},l=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`;return e.jsxs("div",{className:`nice-screen-recorder ${m}`,children:[e.jsxs("div",{className:"nice-screen-recorder__preview",children:[O!==null&&e.jsx("div",{className:"nice-screen-recorder__countdown-overlay",children:e.jsx("span",{className:"nice-screen-recorder__countdown-number",children:O})}),e.jsx("video",{ref:P,className:"nice-screen-recorder__preview-video",muted:!0,playsInline:!0}),C&&e.jsx("canvas",{ref:W,className:"nice-screen-recorder__annotation-canvas"}),!N&&h==="idle"&&e.jsx("div",{className:"nice-screen-recorder__preview-placeholder",children:e.jsxs("button",{className:"nice-screen-recorder__start-preview-button",onClick:H,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"monitor",size:18})}),e.jsx("span",{children:s("screenRecorder.selectScreenToRecord","Select Screen to Record")})]})}),h==="recording"&&e.jsxs("div",{className:"nice-screen-recorder__recording-indicator",children:[e.jsx("span",{className:"nice-screen-recorder__recording-dot"}),e.jsx("span",{children:s("screenRecorder.rec","REC")})]})]}),e.jsxs("div",{className:"nice-screen-recorder__controls",children:[e.jsxs("div",{className:"nice-screen-recorder__controls-main",children:[h==="idle"&&e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--record",onClick:M,disabled:!!O,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"circle",size:18})}),e.jsx("span",{children:s("screenRecorder.startRecording","Start Recording")})]}),h==="recording"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--pause",onClick:ie,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"pause",size:18})}),e.jsx("span",{children:s("screenRecorder.pause","Pause")})]}),e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--stop",onClick:Y,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"stop",size:18})}),e.jsx("span",{children:s("screenRecorder.stop","Stop")})]})]}),h==="paused"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--resume",onClick:G,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"play",size:18})}),e.jsx("span",{children:s("screenRecorder.resume","Resume")})]}),e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--stop",onClick:Y,children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"stop",size:18})}),e.jsx("span",{children:s("screenRecorder.stop","Stop")})]})]}),h==="stopped"&&e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--new",onClick:()=>{b("idle"),K(null),T([])},children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"refresh",size:18})}),e.jsx("span",{children:s("screenRecorder.newRecording","New Recording")})]})]}),e.jsxs("div",{className:"nice-screen-recorder__controls-secondary",children:[(h==="recording"||h==="paused")&&e.jsxs("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--marker",onClick:()=>J(),children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"tag",size:18})}),e.jsx("span",{children:s("screenRecorder.addMarker","Add Marker")})]}),e.jsxs("button",{className:`nice-screen-recorder__control-button ${C?"nice-screen-recorder__control-button--active":""}`,onClick:()=>I(!C),disabled:h!=="recording",children:[e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"pen",size:18})}),e.jsx("span",{children:s("screenRecorder.annotate","Annotate")})]}),e.jsx("button",{className:"nice-screen-recorder__control-button nice-screen-recorder__control-button--settings",onClick:()=>V(!q),disabled:h==="recording","aria-label":s("screenRecorder.settings","Settings"),children:e.jsx("span",{className:"nice-screen-recorder__icon",children:e.jsx(o.NiceIcon,{name:"settings",size:18})})})]})]}),e.jsxs("div",{className:"nice-screen-recorder__status",children:[e.jsxs("div",{className:"nice-screen-recorder__status-info",children:[e.jsxs("span",{className:"nice-screen-recorder__status-item",children:[e.jsx("strong",{children:s("screenRecorder.duration","Duration:")})," ",r((j==null?void 0:j.duration)||0)]}),e.jsxs("span",{className:"nice-screen-recorder__status-item",children:[e.jsx("strong",{children:s("screenRecorder.size","Size:")})," ",l((j==null?void 0:j.size)||0)]}),e.jsxs("span",{className:"nice-screen-recorder__status-item",children:[e.jsx("strong",{children:s("screenRecorder.markers2","Markers:")})," ",f.length]})]}),e.jsxs("div",{className:"nice-screen-recorder__status-quality",children:[a.video.resolution&&e.jsxs("span",{children:[a.video.resolution.width,"x",a.video.resolution.height]}),e.jsxs("span",{children:[a.video.frameRate,"fps"]}),e.jsx("span",{className:`nice-screen-recorder__audio-status nice-screen-recorder__audio-status--${a.audio.enabled?"on":"off"}`,children:e.jsx(o.NiceIcon,{name:a.audio.enabled?"volume":"volume-off",size:14})})]})]}),C&&h==="recording"&&e.jsxs("div",{className:"nice-screen-recorder__annotation-tools",children:[e.jsx("div",{className:"nice-screen-recorder__tool-group",children:["pen","arrow","rectangle","text"].map(t=>e.jsx("button",{className:`nice-screen-recorder__tool-button ${D===t?"nice-screen-recorder__tool-button--active":""}`,onClick:()=>Q(t),"aria-label":t,children:e.jsx(o.NiceIcon,{name:t==="pen"?"pen":t==="arrow"?"arrow-right":t==="rectangle"?"square":"type",size:16})},t))}),e.jsx("div",{className:"nice-screen-recorder__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(t=>e.jsx("button",{className:`nice-screen-recorder__color-button ${X===t?"nice-screen-recorder__color-button--active":""}`,style:{backgroundColor:t},onClick:()=>S(t)},t))})]}),f.length>0&&e.jsxs("div",{className:"nice-screen-recorder__markers",children:[e.jsx("h4",{children:s("screenRecorder.markers","Markers")}),e.jsx("div",{className:"nice-screen-recorder__markers-list",children:f.map(t=>e.jsxs("div",{className:"nice-screen-recorder__marker-item",style:{borderLeftColor:t.color},children:[e.jsx("span",{className:"nice-screen-recorder__marker-time",children:r(t.time)}),e.jsx("input",{type:"text",value:t.label,onChange:d=>{T(v=>v.map(p=>p.id===t.id?{...p,label:d.target.value}:p))},className:"nice-screen-recorder__marker-label"}),e.jsx("button",{"aria-label":s("screenRecorder.close","Close"),className:"nice-screen-recorder__marker-remove",onClick:()=>B(t.id),children:e.jsx(o.NiceIcon,{name:"close",size:16})})]},t.id))})]}),q&&e.jsxs("div",{className:"nice-screen-recorder__settings",children:[e.jsxs("div",{className:"nice-screen-recorder__settings-header",children:[e.jsx("h3",{children:s("screenRecorder.recordingSettings","Recording Settings")}),e.jsx("button",{"aria-label":s("screenRecorder.close","Close"),className:"nice-screen-recorder__close-button",onClick:()=>V(!1),children:e.jsx(o.NiceIcon,{name:"close",size:16})})]}),e.jsxs("div",{className:"nice-screen-recorder__settings-section",children:[e.jsx("h4",{children:s("screenRecorder.video","Video")}),e.jsxs("label",{children:[s("screenRecorder.source","Source"),e.jsxs("select",{value:a.video.source,onChange:t=>k({video:{...a.video,source:t.target.value}}),children:[e.jsx("option",{value:"screen",children:s("screenRecorder.entireScreen","Entire Screen")}),e.jsx("option",{value:"window",children:s("screenRecorder.applicationWindow","Application Window")}),e.jsx("option",{value:"tab",children:s("screenRecorder.browserTab","Browser Tab")}),e.jsx("option",{value:"camera",children:s("screenRecorder.camera","Camera")})]})]}),e.jsxs("label",{children:[s("screenRecorder.resolution","Resolution"),e.jsxs("select",{value:`${(n=a.video.resolution)==null?void 0:n.width}x${(c=a.video.resolution)==null?void 0:c.height}`,onChange:t=>{const[d,v]=t.target.value.split("x").map(Number);k({video:{...a.video,resolution:{width:d,height:v}}})},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:[s("screenRecorder.frameRate","Frame Rate"),e.jsxs("select",{value:a.video.frameRate,onChange:t=>k({video:{...a.video,frameRate:parseInt(t.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:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.video.showCursor,onChange:t=>k({video:{...a.video,showCursor:t.target.checked}})}),s("screenRecorder.showCursor","Show Cursor")]})]}),e.jsxs("div",{className:"nice-screen-recorder__settings-section",children:[e.jsx("h4",{children:s("screenRecorder.audio","Audio")}),e.jsxs("label",{className:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.audio.enabled,onChange:t=>k({audio:{...a.audio,enabled:t.target.checked}})}),s("screenRecorder.enableAudio","Enable Audio")]}),a.audio.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:[s("screenRecorder.source","Source"),e.jsxs("select",{value:a.audio.source,onChange:t=>k({audio:{...a.audio,source:t.target.value}}),children:[e.jsx("option",{value:"system",children:s("screenRecorder.systemAudio","System Audio")}),e.jsx("option",{value:"microphone",children:s("screenRecorder.microphone","Microphone")}),e.jsx("option",{value:"both",children:s("screenRecorder.both","Both")})]})]}),e.jsxs("label",{className:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.audio.echoCancellation,onChange:t=>k({audio:{...a.audio,echoCancellation:t.target.checked}})}),s("screenRecorder.echoCancellation","Echo Cancellation")]}),e.jsxs("label",{className:"nice-screen-recorder__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:a.audio.noiseSuppression,onChange:t=>k({audio:{...a.audio,noiseSuppression:t.target.checked}})}),s("screenRecorder.noiseSuppression","Noise Suppression")]})]})]}),e.jsxs("div",{className:"nice-screen-recorder__settings-section",children:[e.jsx("h4",{children:s("screenRecorder.output","Output")}),e.jsxs("label",{children:[s("screenRecorder.format","Format"),e.jsxs("select",{value:a.output.format,onChange:t=>k({output:{...a.output,format:t.target.value}}),children:[e.jsx("option",{value:"webm",children:s("screenRecorder.webmBestWeb","WebM (Best Web)")}),e.jsx("option",{value:"mp4",children:s("screenRecorder.mp4MostCompatible","MP4 (Most Compatible)")}),e.jsx("option",{value:"mkv",children:s("screenRecorder.mkvLossless","MKV (Lossless)")})]})]}),e.jsxs("label",{children:[s("screenRecorder.quality","Quality"),e.jsxs("select",{value:a.output.quality,onChange:t=>k({output:{...a.output,quality:t.target.value}}),children:[e.jsx("option",{value:"low",children:s("screenRecorder.lowSmallerFile","Low (Smaller file)")}),e.jsx("option",{value:"medium",children:s("screenRecorder.medium","Medium")}),e.jsx("option",{value:"high",children:s("screenRecorder.highRecommended","High (Recommended)")}),e.jsx("option",{value:"lossless",children:s("screenRecorder.losslessLargestFile","Lossless (Largest file)")})]})]})]})]})]})},xe={id:o.createId(),name:"My Stream",protocol:"rtmp",destinations:[],sources:[],layout:{name:"Default",canvas:{width:1920,height:1080,backgroundColor:"#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"}}},ae=[{platform:"youtube",name:"YouTube",icon:"video",defaultUrl:"rtmp://a.rtmp.youtube.com/live2"},{platform:"twitch",name:"Twitch",icon:"gamepad",defaultUrl:"rtmp://live.twitch.tv/app"},{platform:"facebook",name:"Facebook",icon:"users",defaultUrl:"rtmps://live-api-s.facebook.com:443/rtmp"},{platform:"custom-rtmp",name:"Custom RTMP",icon:"link",defaultUrl:""},{platform:"custom-srt",name:"Custom SRT",icon:"lock",defaultUrl:""}],ne=[{type:"camera",name:"Camera",icon:"camera"},{type:"screen",name:"Screen Capture",icon:"monitor"},{type:"window",name:"Window Capture",icon:"window"},{type:"browser",name:"Browser Source",icon:"globe"},{type:"image",name:"Image",icon:"image"},{type:"video",name:"Video",icon:"video"},{type:"microphone",name:"Microphone",icon:"mic"},{type:"system-audio",name:"System Audio",icon:"volume"}],_e=({config:z,onConfigChange:w,onStreamStart:$,onStreamStop:A,onStatsUpdate:F,onError:R,className:m=""})=>{const{t:s}=o.useNiceTranslation(),[a,E]=u.useState(z||xe),[j,K]=u.useState("sources"),[h,b]=u.useState(!1),[f,T]=u.useState({duration:0,viewers:0,peakViewers:0,bitrate:0,fps:0,droppedFrames:0,cpuUsage:0,memoryUsage:0}),[N,L]=u.useState(null),[O,y]=u.useState(!1),[q,V]=u.useState(!1),[C,I]=u.useState([a.layout]),[D,Q]=u.useState(0),X=u.useRef(null),S=u.useRef(null),g=u.useRef(0);u.useEffect(()=>{z&&E(z)},[z]),u.useEffect(()=>()=>{S.current&&clearInterval(S.current)},[]);const _=u.useCallback(i=>{const r={...a,...i};E(r),w==null||w(r)},[a,w]),P=i=>{const r=ae.find(n=>n.platform===i),l={id:o.createId(),name:(r==null?void 0:r.name)||"Custom",platform:i,url:(r==null?void 0:r.defaultUrl)||"",streamKey:"",enabled:!0,status:"idle"};_({destinations:[...a.destinations,l]}),V(!1)},W=(i,r)=>{_({destinations:a.destinations.map(l=>l.id===i?{...l,...r}:l)})},U=i=>{_({destinations:a.destinations.filter(r=>r.id!==i)})},Z=async i=>{const r=ne.find(c=>c.type===i),l={id:o.createId(),type:i,name:`${(r==null?void 0:r.name)||i} ${a.sources.filter(c=>c.type===i).length+1}`,settings:{},volume:1,muted:!1};try{if(i==="camera"||i==="microphone"){const c=i==="camera"?{video:!0}:{audio:!0},d=(await navigator.mediaDevices.enumerateDevices()).filter(v=>i==="camera"?v.kind==="videoinput":v.kind==="audioinput");d.length>0&&(l.settings.deviceId=d[0].deviceId)}else(i==="screen"||i==="window")&&await navigator.mediaDevices.getDisplayMedia({video:!0})}catch(c){console.warn(`Could not access ${i}:`,c)}_({sources:[...a.sources,l]});const n={id:o.createId(),sourceId:l.id,position:{x:0,y:0},size:{width:a.layout.canvas.width,height:a.layout.canvas.height},visible:!0,opacity:1,zIndex:a.layout.layers.length};_({layout:{...a.layout,layers:[...a.layout.layers,n]}}),y(!1)},k=(i,r)=>{_({sources:a.sources.map(l=>l.id===i?{...l,...r}:l)})},H=i=>{_({sources:a.sources.filter(r=>r.id!==i),layout:{...a.layout,layers:a.layout.layers.filter(r=>r.sourceId!==i)}})},M=(i,r)=>{_({layout:{...a.layout,layers:a.layout.layers.map(l=>l.id===i?{...l,...r}:l)}})},ee=i=>{const r=a.layout.layers.findIndex(l=>l.id===i);if(r<a.layout.layers.length-1){const l=[...a.layout.layers];[l[r],l[r+1]]=[l[r+1],l[r]],l.forEach((n,c)=>{n.zIndex=c}),_({layout:{...a.layout,layers:l}})}},ie=i=>{const r=a.layout.layers.findIndex(l=>l.id===i);if(r>0){const l=[...a.layout.layers];[l[r],l[r-1]]=[l[r-1],l[r]],l.forEach((n,c)=>{n.zIndex=c}),_({layout:{...a.layout,layers:l}})}},G=()=>{const i={name:`Scene ${C.length+1}`,canvas:{...a.layout.canvas},layers:[]};I([...C,i])},Y=i=>{const r=[...C];r[D]=a.layout,I(r),Q(i),_({layout:C[i]})},J=async()=>{try{_({destinations:a.destinations.map(i=>i.enabled?{...i,status:"connecting"}:i)}),await new Promise(i=>setTimeout(i,2e3)),_({destinations:a.destinations.map(i=>i.enabled?{...i,status:"live"}:i)}),b(!0),g.current=Date.now(),$==null||$(),S.current=setInterval(()=>{const i={duration:(Date.now()-g.current)/1e3,viewers:Math.floor(Math.random()*100)+f.viewers,peakViewers:Math.max(f.peakViewers,f.viewers),bitrate:a.settings.video.bitrate+Math.floor(Math.random()*500-250),fps:a.settings.video.frameRate-Math.random()*2,droppedFrames:f.droppedFrames+(Math.random()>.95?1:0),cpuUsage:15+Math.random()*30,memoryUsage:40+Math.random()*20};T(i),F==null||F(i)},1e3)}catch(i){R==null||R(i instanceof Error?i:new Error("Failed to start stream")),_({destinations:a.destinations.map(r=>({...r,status:"error"}))})}},B=()=>{S.current&&clearInterval(S.current),_({destinations:a.destinations.map(i=>({...i,status:"idle"}))}),b(!1),A==null||A()},se=i=>{const r=Math.floor(i/3600),l=Math.floor(i%3600/60),n=Math.floor(i%60);return`${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},te=i=>{switch(i){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 ${m}`,children:[e.jsxs("header",{className:"nice-live-streaming__header",children:[e.jsxs("div",{className:"nice-live-streaming__header-title",children:[e.jsx("input",{type:"text",value:a.name,onChange:i=>_({name:i.target.value}),className:"nice-live-streaming__stream-name-input"}),h&&e.jsxs("span",{className:"nice-live-streaming__live-badge",children:[e.jsx("span",{className:"nice-live-streaming__live-dot"})," ",s("liveStreaming.live","LIVE")]})]}),e.jsx("div",{className:"nice-live-streaming__header-stats",children:h&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(o.NiceIcon,{name:"clock",size:14})," ",se(f.duration)]}),e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(o.NiceIcon,{name:"users",size:14})," ",f.viewers]}),e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(o.NiceIcon,{name:"bar-chart",size:14})," ",s("liveStreaming.kbps","{bitrate} kbps").replace("{bitrate}",String(Math.round(f.bitrate)))]}),e.jsxs("span",{className:"nice-live-streaming__stat-item",children:[e.jsx(o.NiceIcon,{name:"video",size:14})," ",f.fps.toFixed(1)," fps"]})]})}),e.jsx("div",{className:"nice-live-streaming__header-actions",children:h?e.jsx("button",{className:"nice-live-streaming__action-button nice-live-streaming__action-button--stop",onClick:B,children:s("liveStreaming.endStream","End Stream")}):e.jsx("button",{className:"nice-live-streaming__action-button nice-live-streaming__action-button--go-live",onClick:J,disabled:a.destinations.filter(i=>i.enabled).length===0,children:s("liveStreaming.goLive","Go Live")})})]}),e.jsxs("div",{className:"nice-live-streaming__main",children:[e.jsxs("div",{className:"nice-live-streaming__preview",children:[e.jsxs("div",{className:"nice-live-streaming__scenes-bar",children:[C.map((i,r)=>e.jsx("button",{className:`nice-live-streaming__scene-button ${D===r?"nice-live-streaming__scene-button--active":""}`,onClick:()=>Y(r),children:i.name},r)),e.jsx("button",{className:"nice-live-streaming__scene-button nice-live-streaming__scene-button--add",onClick:G,children:"+"})]}),e.jsx("div",{ref:X,className:"nice-live-streaming__preview-canvas",style:{aspectRatio:`${a.layout.canvas.width}/${a.layout.canvas.height}`,backgroundColor:a.layout.canvas.backgroundColor},children:a.layout.layers.sort((i,r)=>i.zIndex-r.zIndex).map(i=>{var l;const r=a.sources.find(n=>n.id===i.sourceId);return!i.visible||!r?null:e.jsx("div",{role:"presentation",className:`nice-live-streaming__canvas-layer ${N===i.id?"nice-live-streaming__canvas-layer--selected":""}`,style:{left:`${i.position.x/a.layout.canvas.width*100}%`,top:`${i.position.y/a.layout.canvas.height*100}%`,width:`${i.size.width/a.layout.canvas.width*100}%`,height:`${i.size.height/a.layout.canvas.height*100}%`,opacity:i.opacity,zIndex:i.zIndex},onClick:()=>L(i.id),children:e.jsxs("div",{className:"nice-live-streaming__layer-content",children:[e.jsx("span",{className:"nice-live-streaming__layer-icon",children:e.jsx(o.NiceIcon,{name:((l=ne.find(n=>n.type===r.type))==null?void 0:l.icon)??"box",size:16})}),e.jsx("span",{className:"nice-live-streaming__layer-name",children:r.name})]})},i.id)})})]}),e.jsxs("aside",{className:"nice-live-streaming__panel",children:[e.jsx("div",{className:"nice-live-streaming__panel-tabs",children:["sources","audio","destinations","settings"].map(i=>e.jsx("button",{className:`nice-live-streaming__panel-tab ${j===i?"nice-live-streaming__panel-tab--active":""}`,onClick:()=>K(i),children:i.charAt(0).toUpperCase()+i.slice(1)},i))}),e.jsxs("div",{className:"nice-live-streaming__panel-content",children:[j==="sources"&&e.jsxs("div",{className:"nice-live-streaming__sources-panel",children:[e.jsxs("div",{className:"nice-live-streaming__panel-header",children:[e.jsx("h3",{children:s("liveStreaming.sources","Sources")}),e.jsx("button",{className:"nice-live-streaming__add-button",onClick:()=>y(!0),disabled:h,children:s("liveStreaming.add","+ Add")})]}),e.jsx("div",{className:"nice-live-streaming__sources-list",children:a.sources.filter(i=>i.type!=="microphone"&&i.type!=="system-audio").map(i=>{var l;const r=a.layout.layers.find(n=>n.sourceId===i.id);return e.jsxs("div",{role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:r?o.clickOnActivationKey:void 0,className:`nice-live-streaming__source-item ${N===(r==null?void 0:r.id)?"nice-live-streaming__source-item--selected":""}`,onClick:()=>r&&L(r.id),children:[e.jsx("span",{className:"nice-live-streaming__source-icon",children:e.jsx(o.NiceIcon,{name:((l=ne.find(n=>n.type===i.type))==null?void 0:l.icon)??"box",size:16})}),e.jsx("span",{className:"nice-live-streaming__source-name",children:i.name}),e.jsxs("div",{className:"nice-live-streaming__source-controls",children:[e.jsx("button",{className:`nice-live-streaming__visibility-toggle ${r!=null&&r.visible?"":"nice-live-streaming__visibility-toggle--hidden"}`,onClick:n=>{n.stopPropagation(),r&&M(r.id,{visible:!r.visible})},children:e.jsx(o.NiceIcon,{name:r!=null&&r.visible?"eye":"eye-off",size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),r&&ee(r.id)},children:e.jsx(o.NiceIcon,{name:"arrow-up",size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),r&&ie(r.id)},children:e.jsx(o.NiceIcon,{name:"arrow-down",size:14})}),e.jsx("button",{onClick:n=>{n.stopPropagation(),H(i.id)},disabled:h,children:e.jsx(o.NiceIcon,{name:"trash",size:14})})]})]},i.id)})}),N&&e.jsxs("div",{className:"nice-live-streaming__layer-properties",children:[e.jsx("h4",{children:s("liveStreaming.properties","Properties")}),(()=>{const i=a.layout.layers.find(r=>r.id===N);return i?e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:[s("liveStreaming.xPosition","X Position"),e.jsx("input",{type:"number",value:i.position.x,onChange:r=>M(i.id,{position:{...i.position,x:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:[s("liveStreaming.yPosition","Y Position"),e.jsx("input",{type:"number",value:i.position.y,onChange:r=>M(i.id,{position:{...i.position,y:parseInt(r.target.value)||0}})})]}),e.jsxs("label",{children:[s("liveStreaming.width","Width"),e.jsx("input",{type:"number",value:i.size.width,onChange:r=>M(i.id,{size:{...i.size,width:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:[s("liveStreaming.height","Height"),e.jsx("input",{type:"number",value:i.size.height,onChange:r=>M(i.id,{size:{...i.size,height:parseInt(r.target.value)||100}})})]}),e.jsxs("label",{children:[s("liveStreaming.opacity","Opacity"),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:i.opacity,onChange:r=>M(i.id,{opacity:parseFloat(r.target.value)})})]})]}):null})()]})]}),j==="audio"&&e.jsxs("div",{className:"nice-live-streaming__audio-panel",children:[e.jsxs("div",{className:"nice-live-streaming__panel-header",children:[e.jsx("h3",{children:s("liveStreaming.audioMixer","Audio Mixer")}),e.jsx("button",{className:"nice-live-streaming__add-button",onClick:()=>{y(!0)},disabled:h,children:s("liveStreaming.add","+ Add")})]}),e.jsxs("div",{className:"nice-live-streaming__audio-sources",children:[a.sources.filter(i=>i.type==="microphone"||i.type==="system-audio"||i.type==="video").map(i=>{var r;return e.jsxs("div",{className:"nice-live-streaming__audio-source",children:[e.jsxs("div",{className:"nice-live-streaming__audio-header",children:[e.jsx("span",{className:"nice-live-streaming__audio-icon",children:e.jsx(o.NiceIcon,{name:((r=ne.find(l=>l.type===i.type))==null?void 0:r.icon)??"box",size:16})}),e.jsx("span",{className:"nice-live-streaming__audio-name",children:i.name}),e.jsx("button",{className:`nice-live-streaming__mute-toggle ${i.muted?"nice-live-streaming__mute-toggle--muted":""}`,onClick:()=>k(i.id,{muted:!i.muted}),children:e.jsx(o.NiceIcon,{name:i.muted?"volume-off":"volume",size:14})})]}),e.jsxs("div",{className:"nice-live-streaming__audio-slider",children:[e.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:i.volume??1,onChange:l=>k(i.id,{volume:parseFloat(l.target.value)}),disabled:i.muted}),e.jsxs("span",{className:"nice-live-streaming__volume-value",children:[Math.round((i.volume??1)*100),"%"]})]}),e.jsx("div",{className:"nice-live-streaming__audio-meter",children:e.jsx("div",{className:"nice-live-streaming__meter-fill",style:{width:`${(i.volume??1)*70+Math.random()*30}%`}})})]},i.id)}),a.sources.filter(i=>i.type==="microphone"||i.type==="system-audio").length===0&&e.jsx("p",{className:"nice-live-streaming__empty-message",children:s("liveStreaming.noAudioSourcesAdded","No audio sources added")})]})]}),j==="destinations"&&e.jsxs("div",{className:"nice-live-streaming__destinations-panel",children:[e.jsxs("div",{className:"nice-live-streaming__panel-header",children:[e.jsx("h3",{children:s("liveStreaming.destinations","Destinations")}),e.jsx("button",{className:"nice-live-streaming__add-button",onClick:()=>V(!0),disabled:h,children:s("liveStreaming.add","+ Add")})]}),e.jsxs("div",{className:"nice-live-streaming__destinations-list",children:[a.destinations.map(i=>{var r;return e.jsxs("div",{className:"nice-live-streaming__destination-item",children:[e.jsxs("div",{className:"nice-live-streaming__destination-header",children:[e.jsx("span",{className:"nice-live-streaming__status-indicator",style:{backgroundColor:te(i.status)}}),e.jsx("span",{className:"nice-live-streaming__destination-icon",children:e.jsx(o.NiceIcon,{name:((r=ae.find(l=>l.platform===i.platform))==null?void 0:r.icon)??"link",size:16})}),e.jsx("span",{className:"nice-live-streaming__destination-name",children:i.name}),e.jsxs("label",{className:"nice-live-streaming__toggle",children:[e.jsx("input",{type:"checkbox",checked:i.enabled,onChange:l=>W(i.id,{enabled:l.target.checked}),disabled:h}),e.jsx("span",{className:"nice-live-streaming__toggle-slider"})]})]}),e.jsxs("div",{className:"nice-live-streaming__destination-config",children:[e.jsxs("label",{children:[s("liveStreaming.serverUrl","Server URL"),e.jsx("input",{type:"text",value:i.url,onChange:l=>W(i.id,{url:l.target.value}),placeholder:s("liveStreaming.rtmp","rtmp://..."),disabled:h})]}),e.jsxs("label",{children:[s("liveStreaming.streamKey","Stream Key"),e.jsx("input",{type:"password",value:i.streamKey||"",onChange:l=>W(i.id,{streamKey:l.target.value}),placeholder:s("liveStreaming.enterStreamKey","Enter stream key"),disabled:h})]})]}),e.jsx("button",{className:"nice-live-streaming__remove-button",onClick:()=>U(i.id),disabled:h,children:s("liveStreaming.remove","Remove")})]},i.id)}),a.destinations.length===0&&e.jsx("p",{className:"nice-live-streaming__empty-message",children:s("liveStreaming.noDestinationsConfigured","No destinations configured")})]})]}),j==="settings"&&e.jsxs("div",{className:"nice-live-streaming__settings-panel",children:[e.jsxs("div",{className:"nice-live-streaming__setting-section",children:[e.jsx("h4",{children:s("liveStreaming.video","Video")}),e.jsxs("label",{children:[s("liveStreaming.resolution","Resolution"),e.jsxs("select",{value:`${a.settings.video.resolution.width}x${a.settings.video.resolution.height}`,onChange:i=>{const[r,l]=i.target.value.split("x").map(Number);_({settings:{...a.settings,video:{...a.settings.video,resolution:{width:r,height:l}}},layout:{...a.layout,canvas:{...a.layout.canvas,width:r,height:l}}})},disabled:h,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:[s("liveStreaming.frameRate","Frame Rate"),e.jsxs("select",{value:a.settings.video.frameRate,onChange:i=>_({settings:{...a.settings,video:{...a.settings.video,frameRate:parseInt(i.target.value)}}}),disabled:h,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:[s("liveStreaming.bitrateKbps","Bitrate (kbps)"),e.jsx("input",{type:"number",value:a.settings.video.bitrate,onChange:i=>_({settings:{...a.settings,video:{...a.settings.video,bitrate:parseInt(i.target.value)||6e3}}}),min:"1000",max:"50000",disabled:h})]}),e.jsxs("label",{children:[s("liveStreaming.keyframeIntervalSec","Keyframe Interval (sec)"),e.jsx("input",{type:"number",value:a.settings.video.keyframe,onChange:i=>_({settings:{...a.settings,video:{...a.settings.video,keyframe:parseInt(i.target.value)||2}}}),min:"1",max:"10",disabled:h})]})]}),e.jsxs("div",{className:"nice-live-streaming__setting-section",children:[e.jsx("h4",{children:s("liveStreaming.audio","Audio")}),e.jsxs("label",{children:[s("liveStreaming.sampleRate","Sample Rate"),e.jsxs("select",{value:a.settings.audio.sampleRate,onChange:i=>_({settings:{...a.settings,audio:{...a.settings.audio,sampleRate:parseInt(i.target.value)}}}),disabled:h,children:[e.jsx("option",{value:"44100",children:"44.1 kHz"}),e.jsx("option",{value:"48000",children:"48 kHz"})]})]}),e.jsxs("label",{children:[s("liveStreaming.audioBitrateKbps","Audio Bitrate (kbps)"),e.jsxs("select",{value:a.settings.audio.bitrate,onChange:i=>_({settings:{...a.settings,audio:{...a.settings.audio,bitrate:parseInt(i.target.value)}}}),disabled:h,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"})]})]})]})]})]})]})]}),h&&e.jsx("footer",{className:"nice-live-streaming__footer",children:e.jsxs("div",{className:"nice-live-streaming__footer-stats",children:[e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:"CPU"}),e.jsxs("span",{className:"nice-live-streaming__value",children:[f.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:s("liveStreaming.memory","Memory")}),e.jsxs("span",{className:"nice-live-streaming__value",children:[f.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:s("liveStreaming.dropped","Dropped")}),e.jsx("span",{className:"nice-live-streaming__value",children:f.droppedFrames})]}),e.jsxs("span",{className:"nice-live-streaming__stat",children:[e.jsx("label",{children:s("liveStreaming.peakViewers","Peak Viewers")}),e.jsx("span",{className:"nice-live-streaming__value",children:f.peakViewers})]})]})}),O&&e.jsx("div",{className:"nice-live-streaming__modal-overlay",children:e.jsxs("div",{className:"nice-live-streaming__modal",children:[e.jsxs("div",{className:"nice-live-streaming__modal-header",children:[e.jsx("h3",{children:s("liveStreaming.addSource","Add Source")}),e.jsx("button",{"aria-label":s("liveStreaming.close","Close"),className:"nice-live-streaming__close-button",onClick:()=>y(!1),children:e.jsx(o.NiceIcon,{name:"close",size:16})})]}),e.jsx("div",{className:"nice-live-streaming__modal-content",children:e.jsx("div",{className:"nice-live-streaming__source-type-grid",children:ne.map(i=>e.jsxs("button",{className:"nice-live-streaming__source-type-button",onClick:()=>Z(i.type),children:[e.jsx("span",{className:"nice-live-streaming__icon",children:e.jsx(o.NiceIcon,{name:i.icon,size:24})}),e.jsx("span",{className:"nice-live-streaming__name",children:i.name})]},i.type))})})]})}),q&&e.jsx("div",{className:"nice-live-streaming__modal-overlay",children:e.jsxs("div",{className:"nice-live-streaming__modal",children:[e.jsxs("div",{className:"nice-live-streaming__modal-header",children:[e.jsx("h3",{children:s("liveStreaming.addDestination","Add Destination")}),e.jsx("button",{"aria-label":s("liveStreaming.close","Close"),className:"nice-live-streaming__close-button",onClick:()=>V(!1),children:e.jsx(o.NiceIcon,{name:"close",size:16})})]}),e.jsx("div",{className:"nice-live-streaming__modal-content",children:e.jsx("div",{className:"nice-live-streaming__platform-grid",children:ae.map(i=>e.jsxs("button",{className:"nice-live-streaming__platform-button",onClick:()=>P(i.platform),children:[e.jsx("span",{className:"nice-live-streaming__icon",children:e.jsx(o.NiceIcon,{name:i.icon,size:24})}),e.jsx("span",{className:"nice-live-streaming__name",children:i.name})]},i.platform))})})]})})]})};exports.NiceLiveStreaming=_e;exports.NiceScreenRecorder=pe;exports.NiceVideoEditor=ve;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { NiceAppShell as
|
|
3
|
-
import { useNiceTranslation as
|
|
4
|
-
import { useState as f, useRef as I, useEffect as le, useCallback as
|
|
5
|
-
const
|
|
2
|
+
import { NiceAppShell as _e } from "@nice2dev/ui";
|
|
3
|
+
import { useNiceTranslation as ue, NiceIcon as m, clickOnActivationKey as me, NiceTutorialButton as ge, resolveTutorial as fe, createId as M } from "@nice2dev/ui-core";
|
|
4
|
+
import { useState as f, useRef as I, useEffect as le, useCallback as ve } from "react";
|
|
5
|
+
const be = {
|
|
6
6
|
id: M(),
|
|
7
7
|
name: "Untitled Project",
|
|
8
8
|
resolution: { width: 1920, height: 1080, label: "1080p" },
|
|
@@ -35,7 +35,7 @@ const fe = {
|
|
|
35
35
|
audio: { sampleRate: 48e3, channels: 2, bitrate: 320 },
|
|
36
36
|
video: { codec: "h264", bitrate: 8e3, profile: "high" }
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, ye = [
|
|
39
39
|
{ type: "blur", name: "Blur", icon: "droplet" },
|
|
40
40
|
{ type: "brightness", name: "Brightness", icon: "sun" },
|
|
41
41
|
{ type: "contrast", name: "Contrast", icon: "moon" },
|
|
@@ -45,14 +45,14 @@ const fe = {
|
|
|
45
45
|
{ type: "chromaKey", name: "Chroma Key", icon: "layers" },
|
|
46
46
|
{ type: "crop", name: "Crop", icon: "crop" },
|
|
47
47
|
{ type: "zoom", name: "Zoom", icon: "search" }
|
|
48
|
-
],
|
|
48
|
+
], Ne = [
|
|
49
49
|
{ type: "fade", name: "Fade" },
|
|
50
50
|
{ type: "dissolve", name: "Dissolve" },
|
|
51
51
|
{ type: "wipe", name: "Wipe" },
|
|
52
52
|
{ type: "slide", name: "Slide" },
|
|
53
53
|
{ type: "zoom", name: "Zoom" },
|
|
54
54
|
{ type: "push", name: "Push" }
|
|
55
|
-
],
|
|
55
|
+
], ke = [
|
|
56
56
|
{
|
|
57
57
|
target: ".nice-video-editor",
|
|
58
58
|
titleKey: "tutorial.videoEditorPro.intro.title",
|
|
@@ -61,7 +61,7 @@ const fe = {
|
|
|
61
61
|
content: "Add media to the timeline, arrange and trim clips, apply effects and transitions, then configure and run the export.",
|
|
62
62
|
placement: "auto"
|
|
63
63
|
}
|
|
64
|
-
],
|
|
64
|
+
], Ee = ({
|
|
65
65
|
project: $,
|
|
66
66
|
onProjectChange: R,
|
|
67
67
|
onExport: F,
|
|
@@ -69,7 +69,7 @@ const fe = {
|
|
|
69
69
|
className: O = "",
|
|
70
70
|
tutorial: T
|
|
71
71
|
}) => {
|
|
72
|
-
const { t: u } =
|
|
72
|
+
const { t: u } = ue(), [n, s] = f($ || be), [A, y] = f(
|
|
73
73
|
"timeline"
|
|
74
74
|
), [q, h] = f(null), [k, N] = f(null), [D, w] = f(0), [B, K] = f(!1), [S, G] = f(1), [W, z] = f(!0), [E, U] = f(null), ie = I(null), te = I(null), x = I(null);
|
|
75
75
|
le(() => {
|
|
@@ -77,7 +77,7 @@ const fe = {
|
|
|
77
77
|
}, [$]), le(() => () => {
|
|
78
78
|
x.current && clearInterval(x.current);
|
|
79
79
|
}, []);
|
|
80
|
-
const b =
|
|
80
|
+
const b = ve(
|
|
81
81
|
(r) => {
|
|
82
82
|
const c = { ...n, ...r };
|
|
83
83
|
s(c), R == null || R(c);
|
|
@@ -513,6 +513,9 @@ const fe = {
|
|
|
513
513
|
/* @__PURE__ */ e("div", { className: "nice-video-studio__timeline-tracks", children: n.tracks.map((r) => /* @__PURE__ */ t(
|
|
514
514
|
"div",
|
|
515
515
|
{
|
|
516
|
+
role: "button",
|
|
517
|
+
tabIndex: 0,
|
|
518
|
+
onKeyDown: me,
|
|
516
519
|
className: `nice-video-studio__timeline-track ${q === r.id ? "nice-video-studio__timeline-track--selected" : ""} ${r.locked ? "nice-video-studio__timeline-track--locked" : ""}`,
|
|
517
520
|
onClick: () => h(r.id),
|
|
518
521
|
onDrop: (c) => {
|
|
@@ -562,6 +565,9 @@ const fe = {
|
|
|
562
565
|
return /* @__PURE__ */ t(
|
|
563
566
|
"div",
|
|
564
567
|
{
|
|
568
|
+
role: "button",
|
|
569
|
+
tabIndex: 0,
|
|
570
|
+
onKeyDown: me,
|
|
565
571
|
className: `nice-video-studio__track-item nice-video-studio__track-item--${c.type} ${k === c.id ? "nice-video-studio__track-item--selected" : ""}`,
|
|
566
572
|
style: {
|
|
567
573
|
left: `${c.startTime * 50 * S}px`,
|
|
@@ -588,7 +594,7 @@ const fe = {
|
|
|
588
594
|
A === "effects" && /* @__PURE__ */ t("div", { className: "nice-video-studio__effects-panel", children: [
|
|
589
595
|
/* @__PURE__ */ e("h3", { children: u("videoEditor.videoEffects", "Video Effects") }),
|
|
590
596
|
/* @__PURE__ */ e("p", { className: "nice-video-studio__panel-hint", children: u("videoEditor.selectAClipToApply", "Select a clip to apply effects") }),
|
|
591
|
-
/* @__PURE__ */ e("div", { className: "nice-video-studio__effects-grid", children:
|
|
597
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__effects-grid", children: ye.map((r) => /* @__PURE__ */ t(
|
|
592
598
|
"button",
|
|
593
599
|
{
|
|
594
600
|
className: "nice-video-studio__effect-preset",
|
|
@@ -608,7 +614,7 @@ const fe = {
|
|
|
608
614
|
A === "transitions" && /* @__PURE__ */ t("div", { className: "nice-video-studio__transitions-panel", children: [
|
|
609
615
|
/* @__PURE__ */ e("h3", { children: u("videoEditor.transitions", "Transitions") }),
|
|
610
616
|
/* @__PURE__ */ e("p", { className: "nice-video-studio__panel-hint", children: u("videoEditor.selectAClipAndAdd", "Select a clip and add transitions between clips") }),
|
|
611
|
-
/* @__PURE__ */ e("div", { className: "nice-video-studio__transitions-grid", children:
|
|
617
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__transitions-grid", children: Ne.map((r) => /* @__PURE__ */ t("div", { className: "nice-video-studio__transition-preset", children: [
|
|
612
618
|
/* @__PURE__ */ e("span", { className: "nice-video-studio__transition-name", children: r.name }),
|
|
613
619
|
/* @__PURE__ */ t("div", { className: "nice-video-studio__transition-buttons", children: [
|
|
614
620
|
/* @__PURE__ */ e(
|
|
@@ -742,7 +748,7 @@ const fe = {
|
|
|
742
748
|
] })
|
|
743
749
|
] });
|
|
744
750
|
return /* @__PURE__ */ t(
|
|
745
|
-
|
|
751
|
+
_e,
|
|
746
752
|
{
|
|
747
753
|
flush: !0,
|
|
748
754
|
className: `nice-video-editor nice-video-studio ${O}`,
|
|
@@ -753,12 +759,12 @@ const fe = {
|
|
|
753
759
|
rightSidebar: se ?? void 0,
|
|
754
760
|
bottomPanel: l,
|
|
755
761
|
children: [
|
|
756
|
-
/* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(
|
|
762
|
+
/* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(ge, { steps: fe(T, ke) }) }),
|
|
757
763
|
o
|
|
758
764
|
]
|
|
759
765
|
}
|
|
760
766
|
);
|
|
761
|
-
},
|
|
767
|
+
}, we = {
|
|
762
768
|
video: {
|
|
763
769
|
source: "screen",
|
|
764
770
|
showCursor: !0,
|
|
@@ -775,7 +781,7 @@ const fe = {
|
|
|
775
781
|
format: "webm",
|
|
776
782
|
quality: "high"
|
|
777
783
|
}
|
|
778
|
-
},
|
|
784
|
+
}, Te = ({
|
|
779
785
|
options: $,
|
|
780
786
|
onRecordingStart: R,
|
|
781
787
|
onRecordingStop: F,
|
|
@@ -785,8 +791,8 @@ const fe = {
|
|
|
785
791
|
className: u = ""
|
|
786
792
|
}) => {
|
|
787
793
|
var r, c;
|
|
788
|
-
const { t: n } =
|
|
789
|
-
...
|
|
794
|
+
const { t: n } = ue(), [s, A] = f({
|
|
795
|
+
...we,
|
|
790
796
|
...$
|
|
791
797
|
}), [y, q] = f(null), [h, k] = f("idle"), [N, D] = f([]), [w, B] = f(null), [K, S] = f(null), [G, W] = f(!1), [z, E] = f(!1), [U, ie] = f(
|
|
792
798
|
"pen"
|
|
@@ -860,7 +866,7 @@ const fe = {
|
|
|
860
866
|
(_) => _ ? {
|
|
861
867
|
..._,
|
|
862
868
|
duration: (Date.now() - X.current) / 1e3,
|
|
863
|
-
size: g.current.reduce((
|
|
869
|
+
size: g.current.reduce((he, pe) => he + pe.size, 0)
|
|
864
870
|
} : null
|
|
865
871
|
);
|
|
866
872
|
}, 100);
|
|
@@ -873,7 +879,7 @@ const fe = {
|
|
|
873
879
|
b.current && h === "paused" && (b.current.resume(), k("recording"), O == null || O());
|
|
874
880
|
}, Q = () => {
|
|
875
881
|
H.current && clearInterval(H.current), b.current && (h === "recording" || h === "paused") && (b.current.stop(), k("stopped")), w && (w.getTracks().forEach((a) => a.stop()), B(null));
|
|
876
|
-
}, ee =
|
|
882
|
+
}, ee = ve(
|
|
877
883
|
(a) => {
|
|
878
884
|
if (h !== "recording")
|
|
879
885
|
return;
|
|
@@ -1363,7 +1369,7 @@ const fe = {
|
|
|
1363
1369
|
] })
|
|
1364
1370
|
] })
|
|
1365
1371
|
] });
|
|
1366
|
-
},
|
|
1372
|
+
}, Se = {
|
|
1367
1373
|
id: M(),
|
|
1368
1374
|
name: "My Stream",
|
|
1369
1375
|
protocol: "rtmp",
|
|
@@ -1416,7 +1422,7 @@ const fe = {
|
|
|
1416
1422
|
{ type: "video", name: "Video", icon: "video" },
|
|
1417
1423
|
{ type: "microphone", name: "Microphone", icon: "mic" },
|
|
1418
1424
|
{ type: "system-audio", name: "System Audio", icon: "volume" }
|
|
1419
|
-
],
|
|
1425
|
+
], Ie = ({
|
|
1420
1426
|
config: $,
|
|
1421
1427
|
onConfigChange: R,
|
|
1422
1428
|
onStreamStart: F,
|
|
@@ -1425,7 +1431,7 @@ const fe = {
|
|
|
1425
1431
|
onError: T,
|
|
1426
1432
|
className: u = ""
|
|
1427
1433
|
}) => {
|
|
1428
|
-
const { t: n } =
|
|
1434
|
+
const { t: n } = ue(), [s, A] = f($ || Se), [y, q] = f(
|
|
1429
1435
|
"sources"
|
|
1430
1436
|
), [h, k] = f(!1), [N, D] = f({
|
|
1431
1437
|
duration: 0,
|
|
@@ -1442,7 +1448,7 @@ const fe = {
|
|
|
1442
1448
|
}, [$]), le(() => () => {
|
|
1443
1449
|
x.current && clearInterval(x.current);
|
|
1444
1450
|
}, []);
|
|
1445
|
-
const g =
|
|
1451
|
+
const g = ve(
|
|
1446
1452
|
(i) => {
|
|
1447
1453
|
const o = { ...s, ...i };
|
|
1448
1454
|
A(o), R == null || R(o);
|
|
@@ -1692,6 +1698,7 @@ const fe = {
|
|
|
1692
1698
|
return !i.visible || !o ? null : /* @__PURE__ */ e(
|
|
1693
1699
|
"div",
|
|
1694
1700
|
{
|
|
1701
|
+
role: "presentation",
|
|
1695
1702
|
className: `nice-live-streaming__canvas-layer ${w === i.id ? "nice-live-streaming__canvas-layer--selected" : ""}`,
|
|
1696
1703
|
style: {
|
|
1697
1704
|
left: `${i.position.x / s.layout.canvas.width * 100}%`,
|
|
@@ -1749,6 +1756,9 @@ const fe = {
|
|
|
1749
1756
|
return /* @__PURE__ */ t(
|
|
1750
1757
|
"div",
|
|
1751
1758
|
{
|
|
1759
|
+
role: o ? "button" : void 0,
|
|
1760
|
+
tabIndex: o ? 0 : void 0,
|
|
1761
|
+
onKeyDown: o ? me : void 0,
|
|
1752
1762
|
className: `nice-live-streaming__source-item ${w === (o == null ? void 0 : o.id) ? "nice-live-streaming__source-item--selected" : ""}`,
|
|
1753
1763
|
onClick: () => o && B(o.id),
|
|
1754
1764
|
children: [
|
|
@@ -2272,7 +2282,7 @@ const fe = {
|
|
|
2272
2282
|
] });
|
|
2273
2283
|
};
|
|
2274
2284
|
export {
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2285
|
+
Ie as NiceLiveStreaming,
|
|
2286
|
+
Te as NiceScreenRecorder,
|
|
2287
|
+
Ee as NiceVideoEditor
|
|
2278
2288
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/ui-video",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Nice2Dev Video Components - Video editor, screen recorder, and live streaming",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"dependencies": {},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@nice2dev/ui": "^1.2.0",
|
|
36
|
-
"@nice2dev/ui-core": "^1.
|
|
36
|
+
"@nice2dev/ui-core": "^1.3.0",
|
|
37
37
|
"react": ">=17.0.0",
|
|
38
38
|
"react-dom": ">=17.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@nice2dev/ui": "^1.
|
|
42
|
-
"@nice2dev/ui-core": "^1.
|
|
41
|
+
"@nice2dev/ui": "^1.3.0",
|
|
42
|
+
"@nice2dev/ui-core": "^1.3.0",
|
|
43
43
|
"@testing-library/react": "^16.3.3",
|
|
44
44
|
"@types/react": "^19.2.18",
|
|
45
45
|
"@types/react-dom": "^19.2.7",
|