1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3651],{91237:function(e,t,i){"use strict";var n=i(54235),s=i(85893);t.Z=(0,n.Z)((0,s.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft")},78046:function(e,t,i){"use strict";var n=i(54235),s=i(85893);t.Z=(0,n.Z)((0,s.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight")},41131:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/home",function(){return i(22243)}])},22243:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return S}});var n=i(85893),s=i(67294),r=i(9008),o=i.n(r),a=i(36336),l=i(79072),d=i(61953),c=i(53082),h=i(87556),u=i(53763),x=i(96287),m=i(49837),p=i(29630),g=i(62097),v=i(43768),j=i(15505),f=(0,i(54235).Z)((0,n.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Z=i(11163);var b=()=>{const e=(0,g.Z)(),[t,i]=(0,s.useState)(0),r=(0,Z.useRouter)(),{data:o,isLoading:a}=v.S.clip.list.useQuery({page:t,sortBy:"newest"}),l=(null===o||void 0===o?void 0:o.clips)||[],c=(null===o||void 0===o?void 0:o.streamUrls)||{},h=(null===o||void 0===o?void 0:o.backgroundStreamUrls)||{},u=(null===o||void 0===o?void 0:o.totalCount)||0,x=Math.ceil(u/9);return(0,n.jsx)(m.Z,{children:(0,n.jsxs)(d.Z,{children:[(0,n.jsxs)(d.Z,{p:3,pb:0,children:[(0,n.jsx)(p.Z,{variant:"h5",children:"Newest Clips For You"}),(0,n.jsx)(d.Z,{children:(0,n.jsx)(p.Z,{variant:"subtitle2",sx:{color:e.palette.grey[600],fontWeight:400},children:"The newest clips from your video library."})})]}),(0,n.jsx)(d.Z,{mt:2,width:"100%",sx:{background:e.palette.grey[200]},children:(0,n.jsx)(j.Z,{containerId:"recommended",clips:l,streamUrls:c,backgroundStreamUrls:h,totalPages:x,onAddPageCount:()=>{i(t+1)},onDecreasePageCount:()=>{i(t-1)},similarClips:[],isLoading:a,fts:{},selectedVideoTags:[],filterParams:{},videos:[]})}),(0,n.jsx)(d.Z,{px:2,height:48,display:"flex",alignItems:"center",justifyContent:"flex-end",children:(0,n.jsxs)(d.Z,{display:"flex",alignItems:"center",sx:{cursor:"pointer"},onClick:()=>{r.push("/dashboard/clips")},children:[(0,n.jsx)(p.Z,{variant:"subtitle2",children:"View all recommended clips"}),(0,n.jsx)(f,{sx:{ml:1,fontSize:18}})]})})]})})},y=i(54225);var w=()=>{const e=(0,g.Z)(),[t,i]=(0,s.useState)(0),{data:r,isLoading:o}=((0,Z.useRouter)(),v.S.clip.recentlyEdited.useQuery()),a=(null===r||void 0===r?void 0:r.clips)||[],l=(null===r||void 0===r?void 0:r.streamUrls)||{},c=(null===r||void 0===r?void 0:r.backgroundStreamUrls)||{},h=a.map((e=>e.video));return(0,n.jsx)(m.Z,{children:(0,n.jsxs)(d.Z,{children:[(0,n.jsxs)(d.Z,{p:3,pb:0,children:[(0,n.jsx)(p.Z,{variant:"h5",children:"Recent Activity"}),(0,n.jsx)(d.Z,{children:(0,n.jsx)(p.Z,{variant:"subtitle2",sx:{color:e.palette.grey[600],fontWeight:400},children:"Pick up where you left off with the most recent clips you've worked on."})})]}),(0,n.jsx)(d.Z,{mt:2,width:"100%",sx:{background:e.palette.grey[200]},children:(0,n.jsx)(j.Z,{containerId:"recent",clips:a,streamUrls:l,backgroundStreamUrls:c,totalPages:1,onAddPageCount:()=>{i(t+1)},onDecreasePageCount:()=>{i(t-1)},similarClips:[],isLoading:o,fts:{},selectedVideoTags:[],filterParams:{},videos:h,emptyStateText:"No recent activity.",cta:(0,n.jsx)(y.Z,{href:"/dashboard/clips",sx:{mt:1},variant:"contained",color:"inherit",children:"Edit Clips"})})})]})})},C=i(21368);function S(){const{themeStretch:e}=(0,c.K$)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsx)("title",{children:"Generate Clips"})}),(0,n.jsxs)(a.Z,{sx:{mt:-4},maxWidth:!e&&"xl",children:[(0,n.jsxs)(l.ZP,{container:!0,spacing:2,children:[(0,n.jsx)(l.ZP,{item:!0,xs:12,sm:12,children:(0,n.jsx)(x.Z,{title:"Upload your content",subheader:"Upload a video or .mp3 to start getting insights and suggested clips."})}),(0,n.jsx)(l.ZP,{item:!0,xs:12,sm:6,children:(0,n.jsx)(u.Z,{})}),(0,n.jsx)(l.ZP,{item:!0,xs:12,sm:6,children:(0,n.jsx)(C.Z,{})}),(0,n.jsx)(l.ZP,{item:!0,xs:12,children:(0,n.jsx)(b,{})}),(0,n.jsx)(l.ZP,{item:!0,xs:12,children:(0,n.jsx)(w,{})})]}),(0,n.jsx)(d.Z,{my:6})]})]})}S.getLayout=e=>(0,n.jsx)(h.Z,{children:e})},15505:function(e,t,i){"use strict";i.d(t,{Z:function(){return Y}});var n=i(85893),s=i(67294),r=i(61953),o=i(9144),a=i(29630),l=i(54225),d=i(49837),c=i(91655),h=i(61117),u=i(62097),x=i(53082),m=i(68346),p=i(79072),g=i(72389),v=i(68697),j=i(43768),f=i(71674),Z=i(54491),b=i(85945),y=i(11163),w=i(52610),C=i(91811),S=i(46743),I=i(55678),k=i(13424),P=i(61565),T=i(36111),E=i(46907),U=i(83949),N=i(91117),A=i(43949),L=i(17668),z=i(98185),R=i(62961);function F(e){let{videoTags:t=[],videoStartTime:i,videoEndTime:c,clipName:u,clipText:x,clipScore:F,clipId:V,videoId:_,streamUrl:H,backgroundStreamUrl:D,buffer:W,thumbnailImage:Q,favorited:M,clip:Y,videoName:B,size:q,hitCount:K,totalQueryParams:O,showExportPreview:X,isPublic:$=!1,isMobile:G=!1,video:J,isHighlight:ee}=e;const{user:te,originalUser:ie}=(0,z.E)(),ne=ie?(null===ie||void 0===ie?void 0:ie.id)||"":(null===te||void 0===te?void 0:te.id)||"",se=(0,s.useRef)(null),re=(0,b.NL)(),oe=(0,h.Y)(se),ae=(0,y.useRouter)(),[le,de]=(0,s.use
1State)(!1),[ce,he]=(0,s.useState)(!1),[ue,xe]=(0,s.useState)(0),[me,pe]=(0,s.useState)(!1),[ge,ve]=(0,s.useState)(M||!1),[je,fe]=(0,s.useState)(u||""),[Ze,be]=(0,s.useState)(!1),[ye,we]=(0,s.useState)(!1),[Ce,Se]=(0,s.useState)(!1),[Ie,ke]=(0,s.useState)(!!X),[Pe,Te]=(0,s.useState)(!1),Ee=(0,s.useRef)(null),Ue=((0,s.useRef)(null),(0,v.Z)(V)),{data:Ne}=j.S.tag.list.useQuery({entityType:"clip",entityId:V},{enabled:!!V&&Ue}),{mutate:Ae,isLoading:Le}=j.S.clip.delete.useMutation({onSuccess:()=>{I.Am.info("Clip deleted"),re.refetchQueries(),de(!1)},onError:e=>{I.Am.error("Error deleting clip: ".concat(e.message))}});s.useEffect((()=>{var e;Ee&&(null===Ee||void 0===Ee||null===(e=Ee.current)||void 0===e||e.seekTo(i-W))}),[Ee,oe]);s.useEffect((()=>{oe&&Te(!0)}),[Pe]);null===x||void 0===x||x.length,null===Ne||void 0===Ne||Ne.filter((e=>"person"===e.type)),null===Ne||void 0===Ne||Ne.filter((e=>"person"!==e.type));const ze=!1===(null===Y||void 0===Y?void 0:Y.isClip);return Ie&&(null===Y||void 0===Y?void 0:Y.id)&&_?(0,n.jsx)(A.L,{clipId:null===Y||void 0===Y?void 0:Y.id,videoId:_,children:(0,n.jsx)(L.Z,{clipId:V,videoId:_,startTime:i,endTime:c,open:Ie,onClose:()=>{ke(!1)}})}):(0,n.jsxs)("div",{ref:se,children:[(0,n.jsxs)(d.Z,{sx:{textAlign:"center",minWidth:320,width:320},children:[(0,n.jsx)(r.Z,{position:"relative",display:"flex",justifyContent:"center",maxHeight:"170px",children:(0,n.jsx)(r.Z,{sx:{background:"black"},height:"170px",width:"100%",alignItems:"center",justifyContent:"center",display:"flex",children:H&&oe&&(0,n.jsx)(w.E,{video:J,onReady:()=>{Se(!0)},onPlay:()=>{0===ue&&xe(Ee.current.getDuration()),he(!0)},isPlaying:ce,setIsPlaying:he,playerRef:Ee,className:"react-player mw-100 w-100",id:"myPlayer",url:"".concat(H,"#t=").concat(i-Number(W)),backgroundStreamUrl:D,thumbnailImage:Q,progressInterval:100,isReady:Ce,onProgress:e=>{e.playedSeconds>=Number(c)-Number(W)&&(he(!1),Ee.current.seekTo(i-W))}},H)})}),(0,n.jsxs)(r.Z,{p:G?2:3,py:2,display:"flex",flexDirection:"column",justifyContent:"space-between",height:"100%",textAlign:"left",children:[(0,n.jsxs)(r.Z,{textAlign:"left",children:[ze&&(0,n.jsx)(r.Z,{children:(0,n.jsx)(o.Z,{alignItems:"center",direction:"row",justifyContent:"space-between",children:(0,n.jsx)(a.Z,{variant:"subtitle1",children:"Suggested Clip"})})}),!ze&&(0,n.jsx)(n.Fragment,{children:$?(0,n.jsx)(a.Z,{variant:"subtitle1",children:je}):(0,n.jsx)(k.Z,{editing:Ze,setEditing:be,text:je,onTextChange:fe,textVariant:"subtitle1",onConfirm:async()=>{we(!0);try{const e=await S.U.patch("/api/v1/video/".concat(_,"/clip/").concat(V),{name:je});if(be(!1),e.data.error)return void I.Am.error("Error updating name:",e.data.error);I.Am.success("Clip name updated"),we(!1)}catch(e){I.Am.error("Error updating name:",e),we(!1)}},fullWidth:!0,updating:ye})}),K&&(0,n.jsx)(a.Z,{sx:{fontSize:11},variant:"overline",children:"Matching ".concat(K," / ").concat(O," query parameters")}),(B||(null===J||void 0===J?void 0:J.name))&&(0,n.jsxs)(r.Z,{mt:1,mb:.5,sx:{lineHeight:1},children:[(0,n.jsx)(m.Z,{color:"inherit",underline:"hover",target:"_blank",href:$?"/".concat(ae.query.slug,"/videos/").concat(_):"/dashboard/videos/".concat(_),children:(0,n.jsxs)(a.Z,{sx:{fontSize:11},variant:"overline",children:[(0,n.jsx)(P.Z,{sx:{fontSize:12,mr:.5,opacity:.6,transform:"translateY(2px)"}}),(null===J||void 0===J?void 0:J.name)||B]})}),ee&&(0,n.jsx)(R.Z,{sx:{padding:1.2,mb:1,ml:1,cursor:"default",background:"#FF3030",fontWeight:200,color:"#FFF",opacity:.9,"& .mode":{display:"none"},"&:hover":{opacity:1,"& .mode":{display:"flex"}}},variant:"filled",children:"Highlight"})]}),!G&&(0,n.jsxs)(p.ZP,{sx:{mt:2},container:!0,children:[(0,n.jsxs)(p.ZP,{item:!0,xs:4,children:[(0,n.jsx)(a.Z,{variant:"caption",sx:{mb:.25,color:"text.disabled"},children:"Duration"}),(0,n.jsxs)(a.Z,{variant:"subtitle1",children:[(0,f.v1)(Number(c)-Number(i)),"s"]})]}),!$&&(0,n.jsxs)(p.ZP,{item:!0,xs:4,sx:{mt:1},children:[(0,n.jsxs)(a.Z,{variant:"caption",sx:{color:"text.disabled",display:"flex"},children:["Score",(0,n.jsx)(g.Z,{placement:"top",title:"An AI-calculated score on a clip's engagement potential, scored from 0 to 100.",children:(0,n.jsx)(r.Z,{children:(0,n.jsx)(N.sz,{sx:{cursor:"pointer",fontSize:13,mt:-.25,ml:.5,mb:.5}})})},V)]}),(0,n.jsx)(a.Z,{variant:"subtitle1",children:F})]}),(0,n.jsx)(p.ZP,{item:!0,xs:4,children:(0,n.jsxs)(r.Z,{onClick:()=>ae.push("videos/".concat(_,"?clipStartTime=").concat(i,"&clipEndTime=").concat(c)),sx:{cursor:"pointer","&:hover":{color:"red"}},children:[(0,n.jsx)(a.Z,{variant:"caption",sx:{mb:.25,color:"text.disabled"},children:"Timestamp"}),(0,n.jsx)(a.Z,{variant:"subtitle1",children:(0,Z.qt)(Number(i))})]})})]})]}),!$&&(0,n.jsxs)(r.Z,{sx:{mt:2,mb:1},display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(l.Z,{sx:{height:32,px:1.7},variant:"contained",onClick:async()=>{ae.push("/dashboard/videos/".concat(_,"/clips/").concat(V||"segment","?videoStartTime=").concat(i,"&videoEndTime=").concat(c,"&back=").concat(encodeURIComponent(null===ae||void 0===ae?void 0:ae.asPath)))},children:"View ".concat(ee?"Highlight":"Clip")}),(0,n.jsxs)(o.Z,{direction:"row",spacing:0,children:[!ze&&(0,n.jsx)(l.Z,{onClick:()=>
1de(!0),sx:{width:36,minWidth:0,ml:1,height:32},children:(0,n.jsx)(E.Z,{sx:{fontSize:28}})}),!ze&&(0,n.jsx)(l.Z,{onClick:async()=>{try{const e=await S.U.patch("/api/v1/video/".concat(_,"/clip/").concat(V),{favorited:!ge});if(e.data.error)return void I.Am.error("Error updating name:",e.data.error);ve(!ge),ge?I.Am.success("Clip removed from favorites"):I.Am.success("Clip added to favorites")}catch(e){I.Am.error("Error adding to favorites:",e)}},sx:{width:36,minWidth:0,height:32},children:ge?(0,n.jsx)(T.Z,{sx:{fontSize:25}}):(0,n.jsx)(C.Z,{sx:{fontSize:25}})})]})]})]})]}),(0,n.jsx)(U.Z,{open:le,onClose:()=>de(!1),title:"Delete",content:(0,n.jsx)(n.Fragment,{children:"Are you sure want to delete this clip?"}),action:(0,n.jsx)(l.Z,{variant:"contained",color:"error",onClick:()=>{(async()=>{Ae({id:V,userId:ne})})()},children:Le?"Deleting...":"Delete"})})]})}var V=i(81832),_=i(91237),H=i(78046),D=i(96486),W=i(67820);const Q=e=>{let{setIsEndInView:t}=e;const i=(0,s.useRef)(null),r=(0,h.Y)(i);return(0,s.useEffect)((()=>{t&&t(r)}),[r]),(0,n.jsx)("div",{style:{width:16},ref:i})},M=e=>{let{setIsStartInView:t}=e;const i=(0,s.useRef)(null),r=(0,h.Y)(i);return(0,s.useEffect)((()=>{t&&t(r)}),[r]),(0,n.jsx)("div",{style:{width:0,height:"100%"},ref:i})};var Y=e=>{let{streamUrls:t,backgroundStreamUrls:i,videos:d,isLoading:c,selectedVideoTags:h,clips:m,filterParams:p,emptyStateText:g,cta:v,containerId:j,isHighlight:f}=e;(0,u.Z)();const{themeLayout:Z}=(0,x.K$)(),b=(0,V.Z)("down","sm"),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!0);return(0,n.jsxs)(r.Z,{display:"grid",position:"relative",children:[(0,n.jsxs)(r.Z,{id:j||"scrollContainer",sx:{overflow:"scroll",width:"100%",position:"relative",scrollBehavior:"smooth"},display:"flex",children:[(0,n.jsx)(M,{setIsStartInView:S}),(0,n.jsxs)(o.Z,{direction:"row",spacing:1,p:2.5,children:[(c||!m.length)&&(0,n.jsx)(o.Z,{direction:"row",spacing:1,children:Array(5).fill(0).map(((e,t)=>(0,n.jsx)(K,{animation:!!c&&"wave"},t)))}),!c&&m.map(((e,s)=>(0,n.jsx)(B,{clip:e,selectedVideoTags:h,filterParams:p,streamUrls:t,backgroundStreamUrls:i,video:(0,D.find)(d,{id:e.videoId}),isHighlight:f},e.id)))]}),(0,n.jsx)(Q,{setIsEndInView:w}),!c&&!m.length&&(0,n.jsxs)(r.Z,{top:"50%",left:"50%",sx:{transform:"translate(-50%, -50%)",background:"rgba(255,255,255,0.5)"},position:"absolute",borderRadius:1,p:4,display:"flex",alignItems:"center",flexDirection:"column",children:[(0,n.jsx)(a.Z,{variant:"h6",children:g||"You have no clips."}),v||(0,n.jsx)(l.Z,{href:"/dashboard/upload",sx:{mt:1},variant:"contained",color:"inherit",children:"Upload a Video"})]})]}),!b&&!C&&!!m.length&&(0,n.jsx)(r.Z,{position:"absolute",left:0,top:0,height:"100%",width:"64px",zIndex:1,sx:{background:"linear-gradient(90deg, #F4F6F8, rgba(0,0,0,0))"},display:"flex",alignItems:"center",justifyContent:"center",children:(0,n.jsx)(r.Z,{onClick:()=>{const e=document.getElementById(j||"scrollContainer");e&&(e.scrollLeft-=840)},sx:{width:54,height:54,background:"black",color:"white",borderRadius:"50%",cursor:"pointer",":hover":{background:"#1C1C1C",color:"white"}},display:"flex",alignItems:"center",justifyContent:"center",children:(0,n.jsx)(_.Z,{sx:{fontSize:40}})})}),!b&&!y&&!!m.length&&(0,n.jsx)(r.Z,{position:"absolute",right:0,top:0,height:"100%",width:"64px",zIndex:1,sx:{background:"linear-gradient(270deg, #F4F6F8, rgba(0,0,0,0))"},display:"flex",alignItems:"center",justifyContent:"center",children:(0,n.jsx)(r.Z,{onClick:()=>{const e=document.getElementById(j||"scrollContainer");e&&(e.scrollLeft+=840)},sx:{width:54,height:54,background:"black",color:"white",borderRadius:"50%",cursor:"pointer",":hover":{background:"#1C1C1C",color:"white"}},display:"flex",alignItems:"center",justifyContent:"center",children:(0,n.jsx)(H.Z,{sx:{fontSize:40}})})})]})};const B=e=>{let{clip:t,selectedVideoTags:i,filterParams:s,streamUrls:r,backgroundStreamUrls:o,video:a,isHighlight:l}=e;var d;const c=(0,u.Z)(),h=(q(c),(0,W.WQ)(t)),x=-1===h?0:540*h;return(0,n.jsx)(F,{videoTags:i,videoName:"".concat(null===t||void 0===t?void 0:t.videoName),hitCount:null===t||void 0===t?void 0:t.hitCount,totalQueryParams:(0,D.size)(null===s||void 0===s?void 0:s.tagIds),clip:t,clipScore:"".concat(t.score||"N/A"),clipId:"".concat(t.id),thumbnailImage:(null===(d=t.thumbnailUrl)||void 0===d?void 0:d.split("?")[0])||"",clipName:t.name?"".concat(t.name):"Suggested Clip",clipText:"".concat(t.text),videoStartTime:Number(t.videoStartTime),videoEndTime:Number(t.videoEndTime),videoId:"".concat(t.videoId),buffer:x,streamUrl:(0,W.Lr)(t,r),backgroundStreamUrl:(0,W.Lr)(t,o),favorited:!!(null===t||void 0===t?void 0:t.favorited),video:a,isHighlight:l})},q=e=>({tableRow:{cursor:"pointer","&:hover":{backgroundColor:e.palette.action.hover}}}),K=e=>{let{animation:t="wave"}=e;return(0,n.jsx)(d.Z,{sx:{width:320,p:0},children:(0,n.jsxs)(r.Z,{children:[(0,n.jsx)(c.Z,{animation:t,variant:"rectangular",width:"100%",height:170,sx:{p:0,maxHeight:170}}),(0,n.jsxs)(r.Z,{p:2.5,children:[(0,n.jsx)(c.Z,{animation:t,width:"100%",height:26}),(0,n.jsx)(c.Z,{animation:t,width:"100%",height:26}),(0,n.jsx)(r.Z,{mt:1,children:(0,n.jsx)(c.Z,{animation:t,width:"100%",height:18})}),(0,n.jsxs)(o.Z,{direction:"row",spacing:1,sx:{mt:1},children:[(0,n.jsx)(c.Z,{animation:t,width:"100%",height:48}),(0,n.jsx)(c.Z,{animation:t,width:"100%",height:48}),(0,n.jsx)(c.Z,{animation:t,width:"100%",height:48})]}),(0,n.jsxs)(o.Z,{direction:"row",spacing:1,children:[(0,n.jsx)(c.Z,{animation:t,width:"100%",height:60}),(0,n.jsx)(c.Z,{animation:t,width:"100%",height:60})]})]})]})})}}},function(e){e.O(0,[5831,4885,9072,3930,5996,2077,6344,1001,2512,9199,6672,6750,4860,3803,2004,5604,4791,3377,2567,1136,2238,6636,7556,6691,7009,1437,5302,2451,9774,2888,179],(function(){return t=41131,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.