1import{d as ye,u as xe,w as he,a0 as _e,af as we,A as pe,br as ke,h as Ce,y as L,aH as Se,r as c,c as A,a8 as $,aI as G,aB as Le,W as Te,av as Ve,aD as De,V as ze,P as Re,a9 as Ee,aC as je,bc as Ie,a4 as Ne,aE as Ue,aF as ee,_ as Fe,a as f,e as l,b as t,g as i,I as _,aQ as w,t as d,J as Be,a5 as Ae,n as b,F as Ge,p as Oe,f as p,E as te,s as T,ax as Pe,o as g}from"./index-DKueJ56C.js";import{U as He}from"./UiToggle-C2y38EVh.js";import{U as Me}from"./UiDropdown-BTMuH8wV.js";import{V as We,N as Ye,C as qe}from"./Videoable-Bjp0lhGA.js";import{S as Ke}from"./Share-BYEcZDwe.js";import{S as Je}from"./sliders-horizontal-BmAOFZFz.js";import{L as Qe}from"./loader-Cp4of_w2.js";import{R as Xe}from"./rotate-ccw-BsGAZL3l.js";import{C as Ze}from"./copy-Bs70Mwbo.js";import{L as $e}from"./link-dGdA9o4w.js";import{_ as et}from"./linkedin-Bh4MDjPd.js";import"./VideoCaptions-ZRzeBj-O.js";import"./ShareText-DSVE_bx0.js";import"./UiCheckbox-DuCOVXTG.js";import"./SelectColor-CvSZbrIH.js";import"./UiTextField-ROeT5wsN.js";import"./image-wvLpwYnP.js";import"./share-2-DCxk_HW5.js";import"./link-2-BUdBkJ_f.js";import"./gmail-CrIUpFgQ.js";import"./linkedin-Bo966_Xo.js";const tt=ye({__name:"ScreencastVideoView",setup(u,{expose:o}){o();const I=xe(),e=he(),{t:V}=_e(),v=we(),{upgradeWall:a}=Se(),x=pe(),O="https://d20lcwla9d9xwd.cloudfront.net";function P(s){try{const n=s.split("_");return`${O}/user_${n[0]}/${s}`}catch{return""}}const r=c(!1),H=c(!0),h=c([]),N=c(""),D=c(!1),k=c(0),C=c(!1),oe=c(!1),z=c(!1),R=c(!1),U=c("info"),M=c(!0),F=c(!1),W=c(null),Y=c(null),q=c(null);ke(Y,()=>Q());const se=A(()=>h.value.find(s=>s.id==r.value.event_id)),K=A(()=>x.settings),y=A(()=>Ue()?`${ee()}/video-${r.value.id}-${r.value.salt}`:`${ee()}/${K.value.link}/video-${r.value.id}-${r.value.salt}`);Ce(async()=>{await J(),B()});async function J(){const s=await L("GET","video/getEvents");s&&(h.value=s.data)}async function B(){const s=await L("GET","video/"+I.params.videoID);H.value=!1,s&&(r.value=s.data,setTimeout(()=>{M.value=!1},500))}async function ne(s){const n=s?1:0;r.value.show_booking=n;const m={show_booking:n};n==1&&!h.value.find(S=>S.id==r.value.event_id)&&h.value.length>0&&(m.event_id=h.value[0].id,m.event_type="event"),E(m)}async function ie(s){E({event_id:s,event_type:"event"})}function ae(){D.value=!0,N.value=r.value.name,$(()=>{var s;(s=W.value)==null||s.focus()})}async function Q(){if(!D.value)return!1;D.value=!1;const s=N.value.trim();s!=""&&(r.value.name=s,E({name:s}))}async function E(s){s.id=r.value.id;const n=await L("POST","video/update",s);n?(r.value=n.data,v.alert("Updated your settings")):(v.alert("Can not update your settings!","error"),B())}function re(s){try{const n=s.split("_"),m=n[1]=="m"?"mins":"hours";return n[0]+" "+m}catch{return""}}function le(){if(C.value)return!1;k.value=0}async function de(){if(C.value||k.value==0)return!1;const s=k.value;C.value=!0,await L("DELETE","video/delete",{ids:[s]})?(e.push("/screencast"),v.alert("Your video has been deleted!")):v.alert("Can not delete this video!","error"),C.value=!1,k.value=0}function ce(s){const n="-";if(s)try{const m=G.fromISO(s).toFormat("dd LLL");return G.now().toFormat("dd LLL")==m?V("text.today"):G.now().minus({days:1}).toFormat("dd LLL")==m?V("text.yesterday"):m}catch{return"-"}return n}function ge(){Le(y.value),v.alert("Copied link.")}async function me(){if(!await a("download-recorded-videos"))return!1;const n=document.createElement("a"),m=r.value.url;n.href=P(r.value.url),n.download=m,n.click()}function fe(s){return s=="facebook"?`https://www.facebook.com/dialog/share?app_id=624543526250248&display=popup"e=${r.value.name}&href=${y.value}`:s=="twitter"?`https://twitter.com/share?text=${r.value.name}&url=${y.value}`:s=="linkedin"?`https://www.linkedin.com/sharing/share-offsite/?url=${y.value}`:s=="gmail"?`https://mail.google.com/mail/?view=cm&fs=1&su=${r.value.name} [video]&body=${y.value}`:y.value}function ue(){z.value=!0,$(()=>{var j,S,Z;const s=document.getElementById("thumbnail-video-copy");if(!s){z.value=!1;return}const n=s.cloneNode(!0);n.style.backgroundColor="#fff",n.style.color="#000",document.body.appendChild(n);
1const m=document.createRange();m.selectNode(n),(j=window.getSelection())==null||j.removeAllRanges(),(S=window.getSelection())==null||S.addRange(m),document.execCommand("copy");try{document.execCommand("copy"),(Z=window.getSelection())==null||Z.removeAllRanges(),v.alert("Copied GIF thumbnail.")}catch{v.alert("Unable to copy!","error")}n.remove(),z.value=!1})}async function ve(){var n;if((n=q.value)==null||n.close(),R.value)return!1;R.value=!0,await L("POST","video/resetCounter",{id:r.value.id})&&(r.value.view=0,r.value.last_view=null),R.value=!1}function be(s){U.value=U.value==s?"":s,F.value=!0,setTimeout(()=>{F.value=!1},500)}const X={route:I,router:e,t:V,toast:v,upgradeWall:a,schedulingStore:x,CLOUDFRONT:O,getRecordingVideoURL:P,video:r,loading:H,events:h,new_name:N,is_editting:D,delete_id:k,deleting:C,openShare:oe,copyingGIF:z,reseting:R,tab:U,animation_page:M,animation_tab:F,textName:W,nameEditor:Y,ddResetCounter:q,selected_event:se,settings:K,link:y,getEvents:J,getVideo:B,toggleShowBooking:ne,selectEvent:ie,editName:ae,saveName:Q,updateEvent:E,convertDuration:re,cancelDelete:le,confirmDelete:de,getTime:ce,copyLink:ge,downloadVideo:me,getLink:fe,copyToEmail:ue,resetCounter:ve,toggleTab:be,UiToggle:He,UiDropdown:Me,Videoable:We,Share:Ke,get Eye(){return Ne},get LinkIcon(){return $e},get Copy(){return Ze},get Download(){return Ie},get Trash2(){return je},get RotateCcw(){return Xe},get ChartBar(){return qe},get Network(){return Ye},get Globe(){return Ee},get Check(){return Re},get Loader(){return Qe},get VideoIcon(){return ze},get SlidersHorizontal(){return Je},get SettingsIcon(){return De},get ChevronRight(){return Ve},get CalendarDays(){return Te}};return Object.defineProperty(X,"__isScriptSetup",{enumerable:!1,value:!0}),X}}),ot="/icons/gmail.png",st="/icons/twitter_x.png",nt="/icons/facebook.png",it={class:"flex-1 flex flex-col relative bg-gray-50 min-h-0"},at={key:0,class:"flex-1 flex items-center justify-center"},rt={key:1,class:"flex-1 flex items-center justify-center"},lt={key:2,class:"flex-1 overflow-y-auto p-5"},dt={ref:"nameEditor",class:"flex items-center mb-5 flex-wrap gap-1 text-sm"},ct={class:"font-semibold text-gray-900"},gt={class:"flex flex-col lg:flex-row gap-5 flex-1"},mt={class:"flex items-start justify-center"},ft={class:"flex-1 min-w-0"},ut={class:"bg-white rounded-xl border border-gray-200 p-5 flex flex-col h-full"},vt={class:"mb-5"},bt=["href"],yt={class:"mb-5"},xt={class:"mb-5"},ht={class:"w-full flex items-center justify-between rounded-lg border border-gray-200 bg-white px-4 py-3 text-sm font-medium text-gray-800"},_t={class:"flex-1 relative mb-5",style:{"min-height":"120px"}},wt={key:0,class:"absolute inset-0 overflow-y-auto pr-3"},pt={key:0,class:"text-sm text-red-500"},kt=["onClick"],Ct={class:"flex-1 min-w-0"},St={class:"font-medium text-sm mb-0 text-gray-900 truncate"},Lt={class:"mb-0 text-xs text-gray-500"},Tt={key:0,class:"w-5 h-5 rounded-full bg-blue-600 text-white flex items-center justify-center shrink-0"},Vt={key:1,class:"w-5 h-5 rounded-full border-2 border-gray-300 shrink-0"},Dt={id:"thumbnail-video-copy"},zt=["href"],Rt=["src"],Et={class:"mt-5"},jt={class:"bg-white rounded-xl border border-gray-200 p-5 flex flex-col h-full"},It={class:"mb-8"},Nt={class:"flex items-center mb-4 text-gray-900"},Ut={class:"flex justify-between"},Ft={class:"flex items-center mb-1.5"},Bt={class:"mb-0 text-sm text-gray-500"},At={class:"cursor-pointer"},Gt={class:"text-center p-3"},Ot={class:"flex items-center justify-center mt-5 gap-3"},Pt={class:"text-3xl font-bold text-gray-900 leading-none"},Ht={class:"text-sm text-gray-500 mb-1.5"},Mt={class:"font-semibold text-gray-900"},Wt={class:"text-sm text-gray-500 mb-1.5"},Yt={class:"font-semibold text-gray-900"},qt={class:"mb-8"},Kt={class:"flex items-center mb-4 text-gray-900"},Jt={class:"flex justify-between"},Qt=["href"],Xt=["href"],Zt=["href"],$t=["href"],eo={class:"mb-2.5"},to={class:"flex items-center mb-2.5 mt-8 text-gray-900"},oo={class:"mb-4 mt-4"},so=["src"],no={class:"bg-white rounded-xl border border-gray-200 p-5 flex flex-col h-full"},io={class:"mb-5"},ao={class:"mb-5"},ro={class:"flex flex-col gap-2 shrink-0"},lo={class:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 rounded-full bg-blue-600 text-white text-[10px] font-semibold flex items-center justify-center"},co={key:0,class:"fixed inset-0 z-50 flex items-center justify-center"},go={class:"relative bg-white rounded-xl shadow-xl w-full mx-4 max-w-lg p-6"},mo={class:"font-bold text-lg text-gray-900"},fo={class:"text-gray-600 mt-2"},uo={class:"flex justify-end mt-8 gap-2.5"};function vo(u,o,I,e,V,v){return g(),f("div",it,[e.loading?(g(),f("div",at,[l(e.Loader,{size:32,class:"animate-spin text-blue-600"})])):e.video?(g(),f("div",lt,[i(" Video title (breadcrumb + editable name) "),t("div",dt,[l(e.VideoIcon,{size:15,class:"text-gray-400 shrink-0 mr-0.5"}),t("button",{type:"button",class:"font-medium text-gray-500 hover:text-blue-600 hover:underline transition-colors",onClick:o[0]||(o[0]=a=>e.router.push("/screencast"))}," Screencast "),l(e.ChevronRight,{size:14,class:"text-gray-300 shrink-0"}),_(t("button",{type:"button",class:"group inline-flex items-center gap-1.5 rounded-md -mx-1 px-1.5 py-0.5 hover:bg-gray-100 transition-colors",title:"Rename video",onClick:e.editName},[t("span",ct,d(e.video.name),1)],512),[[w,!e.is_editting]]),_(t("input",{ref:"textName","onUpdate:modelValue":o[1]||(o[1]=a=>e.new_name=a),class:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm font-semibold text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-500",onKeyup:Ae(e.saveName,["enter"])},null,544),[[w,e.is_editting],[Be,e.new_name]])],512),t("div",gt,[i(" Video area "),t("div",{class:b(["flex-1 relative",{"animate-[fadeIn_.4s_ease]":e.animation_page}])},[t("div",mt,[l(e.Videoable,{video:e.video},null,8,["video"])])],2),i(" Info area "),t("div",{class:b(["w-full lg:w-[420px] flex gap-3",{"animate-[fadeIn_.4s_ease]":e.animation_page}])},[i(" Tab content "),_(t("div",ft,[i(" Video info "),_(t("div",ut,[o[15]||(o[15]=t("h6",{class:"font-semibold mb-6 text-gray-900"},"More about this video",-1)),i(" Preview video "),t("div",vt,[t("a",{href:e.link,target:"_blank",class:"w-full flex items-center justify-between rounded-lg border border-gray-200 bg-white hover:bg-gray-50 px-4 py-3 text-sm font-medium text-gray-800"},[o[11]||(o[11]=t("span",{class:"flex-1 text-left"},"Preview video",-1)),l(e.Eye,{size:18,class:"ml-2"})],8,bt)]),i(" Copy link to the video "),t("div",yt,[t("button",{class:"w-full flex items-center justify-between rounded-lg border border-gray-200 bg-white hover:bg-gray-50 px-4 py-3 text-sm font-medium text-gray-800",onClick:e.copyLink},[o[12]||(o[12]=t("span",{class:"flex-1 text-left"},"Copy link to the video",-1)),l(e.LinkIcon,{size:18,class:"ml-2"})])]),i(" Add meetings page "),t("div",xt,[t("div",ht,[o[13]||(o[13]=t("span",{class:"flex-1 text-left"},"Add meetings page",-1)),l(e.UiToggle,{"model-value":!!e.video.show_booking,"onUpdate:modelValue":o[2]||(o[2]=a=>e.toggleShowBooking(a)),class:"ml-2"},null,8,["model-value"])])]),t("div",_t,[e.video.show_booking?(g(),f("div",wt,[e.events.length==0?(g(),f("div",pt," â ï¸ You don't have any booking pages yet. ")):i("v-if",!0),(g(!0),f(Ge,null,Oe(e.events,a=>(g(),f("div",{key:a.id,class:b(["rounded-lg border px-3 py-2.5 cursor-pointer flex items-center gap-3 mb-2.5 transition-colors",e.selected_event&&e.selected_event.i
1d==a.id?"border-blue-500 bg-blue-50/50":"border-gray-200 hover:bg-gray-50"]),onClick:x=>e.selectEvent(a.id)},[t("div",{class:b(["w-8 h-8 rounded-lg flex items-center justify-center shrink-0",e.selected_event&&e.selected_event.id==a.id?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-400"])},[l(e.CalendarDays,{size:16})],2),t("div",Ct,[t("h6",St,d(a.name),1),t("p",Lt,d(e.convertDuration(a.duration)),1)]),e.selected_event&&e.selected_event.id==a.id?(g(),f("span",Tt,[l(e.Check,{size:12})])):(g(),f("span",Vt))],10,kt))),128))])):i("v-if",!0)]),i(" Share the video in an email "),o[16]||(o[16]=t("h6",{class:"text-gray-900 mb-2"},"Share the video in an email",-1)),t("div",Dt,[t("p",{class:b({hidden:!e.copyingGIF})},d(e.video.name),3),t("a",{href:e.link},[t("img",{src:e.getRecordingVideoURL(e.video.gif),alt:"",class:"rounded-lg",id:"gif-image"},null,8,Rt)],8,zt)]),t("div",Et,[t("button",{class:"w-full flex items-center justify-center rounded-lg border border-gray-200 bg-white hover:bg-gray-50 px-4 py-3 text-sm font-medium text-gray-800",onClick:e.copyToEmail},[o[14]||(o[14]=t("span",{class:"flex-1"},"Copy & Paste in Email",-1)),l(e.Copy,{size:18,class:"ml-2"})])])],512),[[w,e.tab=="info"]]),i(" Video statistics and share "),_(t("div",jt,[o[23]||(o[23]=t("h6",{class:"font-semibold mb-6 text-gray-900"},"Statistics & Share",-1)),i(" Stats "),t("div",It,[t("h6",Nt,[l(e.ChartBar,{size:18,class:"mr-1.5"}),p(d(u.$t("text.stats")),1)]),t("div",Ut,[t("div",null,[t("div",Ft,[t("p",Bt,d(u.$t("text.total_views")),1),i(" Reset total views "),l(e.UiDropdown,{ref:"ddResetCounter",position:"top-middle",width:"240px",class:"ml-1.5"},{toggle:te(()=>[t("span",At,[e.reseting?(g(),T(e.Loader,{key:0,size:16,class:"animate-spin"})):(g(),T(e.RotateCcw,{key:1,size:16,class:"text-gray-500 hover:text-blue-600"}))])]),default:te(()=>[t("div",Gt,[o[17]||(o[17]=t("p",{class:"text-sm text-gray-700"},[p(" Are you sure you want to reset"),t("br"),p(" the total view count? ")],-1)),t("div",Ot,[t("button",{class:"rounded-lg border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700",onClick:o[3]||(o[3]=a=>{var x;return(x=e.ddResetCounter)==null?void 0:x.close()})}," No, don't "),t("button",{class:"rounded-lg bg-red-50 px-4 py-2 text-sm font-medium text-red-600",onClick:e.resetCounter}," Yes, reset ")])])]),_:1},512)]),t("div",Pt,d(e.video.view),1)]),t("div",null,[t("p",Ht,d(u.$t("text.created")),1),t("h6",Mt,d(e.getTime(e.video.time_created)),1)]),t("div",null,[t("p",Wt,d(u.$t("text.latest_view")),1),t("h6",Yt,d(e.getTime(e.video.last_view)),1)])])]),i(" Share on social media "),t("div",qt,[t("h6",Kt,[l(e.Network,{size:18,class:"mr-1.5"}),p(d(u.$t("text.share_media")),1)]),t("div",Jt,[t("a",{href:e.getLink("gmail"),target:"_blank",class:"w-12 h-12 flex items-center justify-center rounded-lg border border-gray-200 hover:bg-gray-50"},[...o[18]||(o[18]=[t("img",{class:"social-icon",src:ot,alt:"",height:"22"},null,-1)])],8,Qt),t("a",{href:e.getLink("linkedin"),target:"_blank",class:"w-12 h-12 flex items-center justify-center rounded-lg border border-gray-200 hover:bg-gray-50"},[...o[19]||(o[19]=[t("img",{class:"social-icon",src:et,alt:"",height:"22"},null,-1)])],8,Xt),t("a",{href:e.getLink("twitter"),target:"_blank",class:"w-12 h-12 flex items-center justify-center rounded-lg border border-gray-200 hover:bg-gray-50"},[...o[20]||(o[20]=[t("img",{class:"social-icon",src:st,alt:"",height:"22"},null,-1)])],8,Zt),t("a",{href:e.getLink("facebook"),target:"_blank",class:"w-12 h-12 flex items-center justify-center rounded-lg border border-gray-200 hover:bg-gray-50"},[...o[21]||(o[21]=[t("img",{class:"social-icon",src:nt,alt:"",height:"22"},null,-1)])],8,$t)])]),i(" Add video on website "),t("div",eo,[t("h6",to,[l(e.Globe,{size:18,class:"mr-1.5"}),o[22]||(o[22]=p(" Add video on website ",-1))]),t("div",oo,[t("img",{src:e.getRecordingVideoURL(e.video.gif),alt:"",class:"rounded-lg"},null,8,so)]),t("button",{class:"w-full rounded-lg border border-gray-200 bg-white hover:bg-gray-50 px-4 py-3 text-sm font-medium text-gray-800",onClick:o[4]||(o[4]=a=>e.openShare=!0)}," Add to my website ")])],512),[[w,e.tab=="share"]]),i(" Video settings "),_(t("div",no,[o[26]||(o[26]=t("h6",{class:"font-semibold mb-6 text-gray-900"},"Options",-1)),i(" Download "),t("div",io,[t("button",{class:"w-full flex items-center justify-between rounded-lg border border-gray-200 bg-white hover:bg-gray-50 px-4 py-3 text-sm font-medium text-gray-800",onClick:e.downloadVideo},[o[24]||(o[24]=t("span",{class:"flex-1 text-left"},"Download",-1)),l(e.Download,{size:18,class:"ml-2"})])]),i(" Delete video "),t("div",ao,[t("button",{class:"w-full flex items-center justify-between rounded-lg border border-gray-200 bg-white hover:bg-red-50 px-4 py-3 text-sm font-medium text-red-600",onClick:o[5]||(o[5]=a=>e.delete_id=e.video.id)},[o[25]||(o[25]=t("span",{class:"flex-1 text-left"},"Delete video",-1)),l(e.Trash2,{size:18,class:"ml-2"}
1)])])],512),[[w,e.tab=="setting"]])],512),[[w,e.tab!=""]]),i(" Tab rail "),t("div",ro,[t("div",{class:b(["tab-rail-item",e.tab=="info"?"bg-white border-blue-600 text-blue-600":"bg-gray-100 border-transparent text-gray-500"]),onClick:o[6]||(o[6]=a=>e.toggleTab("info"))},[l(e.VideoIcon,{size:20})],2),t("div",{class:b(["tab-rail-item relative",e.tab=="share"?"bg-white border-blue-600 text-blue-600":"bg-gray-100 border-transparent text-gray-500"]),onClick:o[7]||(o[7]=a=>e.toggleTab("share"))},[l(e.SlidersHorizontal,{size:20}),t("span",lo,d(e.video.view),1)],2),t("div",{class:b(["tab-rail-item",e.tab=="setting"?"bg-white border-blue-600 text-blue-600":"bg-gray-100 border-transparent text-gray-500"]),onClick:o[8]||(o[8]=a=>e.toggleTab("setting"))},[l(e.SettingsIcon,{size:20})],2)])],2)])])):(g(),f("div",rt,[...o[10]||(o[10]=[t("h4",{class:"text-gray-400 italic"},"This video cannot be accessed.",-1)])])),i(" Delete "),(g(),T(Pe,{to:"body"},[e.delete_id!=0?(g(),f("div",co,[o[27]||(o[27]=t("div",{class:"absolute inset-0 bg-black/50"},null,-1)),t("div",go,[t("h5",mo,d(u.$t("text.would_you_like_to_delete_this_video"))+"?",1),t("p",fo,d(u.$t("text.once_deleted_video_no_access")),1),t("div",uo,[t("button",{class:"rounded-lg border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700",onClick:e.cancelDelete},d(u.$t("button.cancel")),1),t("button",{class:"rounded-lg bg-red-600 hover:bg-red-700 px-4 py-2 text-sm font-medium text-white flex items-center",onClick:e.confirmDelete},[p(d(u.$t("button.permanently_delete"))+" ",1),e.deleting?(g(),T(e.Loader,{key:0,size:16,class:"animate-spin ml-2"})):i("v-if",!0)])])])])):i("v-if",!0)])),i(" Share "),e.openShare?(g(),T(e.Share,{key:3,video:e.video,onClose:o[9]||(o[9]=a=>e.openShare=!1)},null,8,["video"])):i("v-if",!0)])}const Fo=Fe(tt,[["render",vo],["__scopeId","data-v-af56f6af"],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/views/screencast/ScreencastVideoView.vue"]]);export{Fo as default};
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.