1import{r as t,H as T,p as H,s as te,q as re,Y as ge,d as Ne,j as e,T as na,cI as Se,v as ee,ac as ae,ae as ba,V as ia,X as ra,o as pe,a4 as se,dY as sa,G as ka,cM as va,fM as xa,l3 as he,g as oa,dg as Ca,dh as Sa,hg as je,ff as ye,Z as G,$ as Q,l as Fe,aj as K,al as la,u as ja,A as ya,av as Ma,ak as Na,az as Ia,aA as Aa,aC as Ta,U as Va,I as Pa,aW as wa,L as Fa,c as Le}from"./index-B-8CDiEL.js";import{C as De}from"./ContentWide-index-CoEdL4Bc.js";import{L as me,g as da}from"./LanguageWrapper-index-BDEw7DGx.js";import{s as La}from"./sectionMessages-C1cVYuzC.js";import{c as Da,d as za,e as ze,f as $e,P as Ee,g as Be,h as $a,i as Ea,B as ca,S as Oe,j as Ba,k as ie,O as fe,l as be,m as ke,n as ve,o as Oa,q as _a,r as qa,s as _e,t as Ua,u as qe,v as Ha,w as Ra,x as Ue,y as Wa,z as Ga,V as Qa,D as Ya,E as Ja,F as Ka,A as Xa,T as Za,G as et,H as at,C as tt,J as nt,K as it,N as rt,Q as He,R as st,b as ot,M as Me,a as ua,L as lt,U as dt,W as ct,I as ut,X as mt,Y as gt,Z as Re,$ as de,a0 as ce,a1 as pt,a2 as We,a3 as ht,a4 as ft,a5 as bt,a6 as kt}from"./LoadingDropzone-qMrcu8x6.js";import{m as u}from"./PublisherDropzone-intl-CFITanVw.js";import{v as vt}from"./validateExternalVideoUrl-ZFkDiTOK.js";import{q as xt}from"./queryExternalVideoData-BiMw8-7K.js";import{e as Ge}from"./errors-DaTWixw_.js";import{S as xe}from"./SwitchButton-index-C0ZSGXuh.js";import{u as ma,_ as Ct,S as St,C as jt,b as yt,L as Mt,c as Nt,d as It,R as At,e as Qe,P as Tt,f as Vt,g as Ye,h as Je,I as Pt,H as Ke,T as Xe,i as Ze,j as wt}from"./UpdateVideo-8oYeTty_.js";import{B as Ft}from"./BuyCreditsButton-index-D9KQVUQd.js";import{I as Lt}from"./IconWarning-CJZdmaH8.js";import{P as Dt}from"./PersistentHeightLoadingSpinner-index-BUM_cYPr.js";import{M as zt}from"./UpdateTrack-DU9qFpjq.js";import{u as $t}from"./useMount-index-S3pExgBf.js";import{d as Et}from"./ArticleCardContent-BVliUN3a.js";import{m as Bt}from"./DownloadAndPublishModalSections-intl-_tAqcRmb.js";import{P as Ot,m as _t}from"./ProjectExplorer-C6sYztfo.js";import{C as qt}from"./CheckBox-LHAdxNvk.js";import{m as Ut}from"./connect-BJograE-.js";import{U as Ht}from"./UnverifiedHint-index-ng669igd.js";import"./LanguageSelection-index-Dn3Syu0G.js";import"./Tag-index-DuZlojVC.js";import"./useDebounce-index-Dv7f12rR.js";import"./FormLabel-index-DGVYL3SH.js";import"./Poster-CxQBZl2p.js";import"./LoadingCircle-BR4quEBf.js";import"./react-files-dist-index-ph2b3pah.js";import"./TextArea-index-bubeXjOX.js";import"./Alugha2GoVideoMeta-styled-L1aH5MC1.js";import"./alugha2Go_Background_Banner-BkzPCBlP.js";import"./normalizeHeight-ig0K_vT0.js";import"./Divider-index-C2Y8vWzi.js";import"./SegmentSelector-styled-BVsd4jMM.js";import"./AddMedia-styled-Chfdmd1j.js";import"./loadable-DdNr4yeD.js";import"./Error-BjakEj1u.js";import"./VideoPageQuery-DhRteSV-.js";import"./molecules-intl-DY7dCEho.js";import"./DiscountBanner-styled-BsNxmtkJ.js";var Rt=function(a){t.useEffect(a,[])},Wt=function(a){Rt(function(){a()})};T.div.withConfig({componentId:"sc-374f263c-0"})(["background:",";padding:2.5rem;font-size:0.75rem;text-align:center;justify-content:center;flex-direction:column;"],({theme:a})=>a.colors.textDark);const Gt=T.div.withConfig({componentId:"sc-374f263c-1"})(["margin-top:1.5rem;text-align:start;"]),Qt=T.div.withConfig({componentId:"sc-374f263c-2"})(["margin-top:2rem;padding:0 0.75rem;@media (min-width:","){padding:0 0.75rem 0 0;}"],({theme:a})=>`${a.newScreenBreakpoints.large}px`),Yt=T.div.withConfig({componentId:"sc-374f263c-3"})(["display:inline-block;margin:1.5rem auto 0;"]),Jt=T.form.withConfig({componentId:"sc-374f263c-4"})(["text-align:center;"]),Kt=`mutation createArticle( 2 $title: String! 3 $langCode: String! 4 $langName: String! 5) { 6 createArticle(title: $title, langCode: $langCode, langName: $langName) { 7 id 8 } 9} 10`,Xt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createArticle"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"title"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}
10,{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"langCode"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"langName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createArticle"},arguments:[{kind:"Argument",name:{kind:"Name",value:"title"},value:{kind:"Variable",name:{kind:"Name",value:"title"}}},{kind:"Argument",name:{kind:"Name",value:"langCode"},value:{kind:"Variable",name:{kind:"Name",value:"langCode"}}},{kind:"Argument",name:{kind:"Name",value:"langName"},value:{kind:"Variable",name:{kind:"Name",value:"langName"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:214,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Kt}}},Zt=({closeModal:a})=>{const{formatMessage:s}=H(),{graphqlError:r}=te(),h=re(),n=ge(),[i,b]=t.useState(null),[d,l]=t.useState(""),m=t.useCallback(p=>{b(p)},[]),o=t.useCallback(p=>{a(),n.push(h.toEditArticle(p.createArticle.id))},[a,n,h]),[v]=Ne(Xt,{onError:p=>r(p),onCompleted:o}),k=t.useCallback(p=>{p.preventDefault();const c=i?.code,g=i?.name;d&&c&&g&&v({variables:{title:d,langCode:c,langName:g}})},[v,i,d]);return e.jsxs(Jt,{onSubmit:k,children:[e.jsx(Gt,{children:e.jsx(me,{selectedLanguage:i,setLanguage:m,noMinWidth:!0})}),e.jsx(Qt,{children:e.jsx(na,{placeholder:s(Se.Title),value:d,onChange:p=>l(p.target.value),required:!0})}),e.jsxs(Yt,{children:[e.jsx(ee,{color:"negative",variant:"outlined",onClick:a,children:s(ae.cancel)}),e.jsx(ee,{type:"submit",color:"primary",variant:"outlined",disabled:!i?.code||!i?.name||!d,children:s(ae.ready)})]})]})};T.div.withConfig({componentId:"sc-2c61f207-0"})(["background:",";padding:2.5rem;font-size:0.75rem;text-align:center;justify-content:center;flex-direction:column;"],({theme:a})=>a.colors.textDark);const en=T.div.withConfig({componentId:"sc-2c61f207-1"})(["margin:1.5rem auto 0;text-align:center;"]),ea=T.div.withConfig({componentId:"sc-2c61f207-2"})(["display:flex;flex-direction:row;align-items:center;margin:2rem 0;"]),aa=T.label.withConfig({componentId:"sc-2c61f207-3"})(["display:none;",";@media (min-width:","){display:flex;flex:5rem;}@media (max-width:","){margin-bottom:1rem;}"],ba("4rem"),({theme:a})=>`${a.newScreenBreakpoints.small}px`,({theme:a})=>`${a.newScreenBreakpoints.medium-1}px`),ta=T.div.withConfig({componentId:"sc-2c61f207-4"})(["margin:2rem 0;width:100%;height:1px;background-color:",";"],({theme:a})=>a.colors.borderAccent),an=T(na).withConfig({componentId:"sc-2c61f207-5"})(["display:inline-block;border-color:",";flex:100%;"],({theme:a})=>a.colors.borderAccent),tn=T.div.withConfig({componentId:"sc-2c61f207-6"})(["display:inline-block;flex:100%;"]),nn=`mutation publisher_createMagazine( 11 $magazineTitles: [MagazineTitleInput!]! 12 $sections: [MagazineSectionInput!] 13) { 14 createMagazine(magazineTitles: $magazineTitles, sections: $sections) { 15 id 16 } 17} 18`,rn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"publisher_createMagazine"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"magazineTitles"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MagazineTitleInput"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sections"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MagazineSectionInput"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createMagazine"},arguments:[{kind:"Argument",name:{kind:"Name",value:"magazineTitles"},value:{kind:"Variable",name:{kind:"Name",value:"magazineTitles"}}},{kind:"Argument",name:{kind:"Name",value:"sections"},value:{kind:"Variable",name:{kind:"Name",value:"sections"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:242,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:nn}}},sn=()=>{const{formatMessage:a}=H(),{graphqlError:s,success:r}=te(),h=ia(ra),[n,i]=Ne(rn,{update:d=>{h&&d.modify({id:d.identify({__typename:"User",id:h}),fields:{magazineCount(l){return typeof l=="number"?l+1:l}}})},onCompleted:()=>{r(a(La.createMagazineSectionSuccess))},onError:d=>s(d)}),b=t.useCallback(d=>n({variables:{magazineTitles:[d],sections:[]}}),[n]);return t.useMemo(()=>[b,i],[i,b])},ue=pe({errorCreateMagazine:{id:"dubbr.PublisherMagazineMeta.errorCreateMagazine",defaultMessage:"Error while creating Magazine"},selectMagazineLang:{id:"dubbr.PublisherMagazineMeta.selectMagazineLang",defaultMessage:"Select the magazine language"},selectMagazineTitle:{id:"dubbr.PublisherMagazineMeta.selectMagazineTitle",defaultMessage:"Select the magazine title"}}),on=({closeModal:a})=>{const s=se(),r=ge(),h=re(),{formatMessage:n}=H(),{error:i}=te(),[b,{loading:d}]=sn(),[l,m]=t.useState(""),[o,v]=t.useState(null),k=t.useCallback(async g=>{if(g.preventDefault(),!(d||!o))try{const{data:x,error:f}=await b({langCode:o.code===""?`c-${da(o.name||"").toLowerCase()}`:o.code,langName:o.name,value:l});if(f||!x){i(n(ue.errorCreateMagazine));return}const{id:E}=x.createMagazine;s.current&&(r.push(h.toEditMagazine(E)),a())}catch{i(n(ue.errorCreateMagazine))}},[a,b,i,n,r,s,h,d,l,o]),p=t.useCallback(g=>{v(g)},[]),c=!o?.code?.trim()||!o?.name?.trim()||!l.trim();return e.jsxs("form",{...sa("publisher-create-magazine-modal"),onSubmit:k,children:[e.jsx(ta,{}),e.jsxs(ea,{children:[e.jsx(aa,{children:n(ka.language)}),e.jsx(tn,{children:e.jsx(me,{selectedLanguage:o,setLanguage:p,noMinWidth:!0,noPadding:!0})})]}),e.jsxs(ea,{children:[e.jsx(aa,{children:n(Se.Title)}
18),e.jsx(an,{placeholder:n(Se.Title),value:l,onChange:g=>m(g.target.value),required:!0})]}),e.jsx(ta,{}),e.jsxs(en,{children:[e.jsx(ee,{color:"negative",variant:"outlined",onClick:a,children:n(ae.cancel)}),e.jsx(ee,{type:"submit",color:"primary",variant:"outlined",disabled:c,title:o?.name?.trim()?l.trim()?"":n(ue.selectMagazineTitle):n(ue.selectMagazineLang),children:n(ae.create)})]})]})},ln=a=>a.find(s=>typeof s=="string")||void 0,dn=({availableCredits:a,requiredCredits:s})=>{const{formatMessage:r,formatNumber:h}=H(),{insufficiency:n,isInsufficient:i}=ma(s,a);let b=0n,d=0n;try{a&&(b=BigInt(a)),s&&(d=BigInt(s))}catch{}return e.jsxs(e.Fragment,{children:[e.jsx(Da,{children:r(u.creditHeader)}),e.jsxs(za,{children:[e.jsxs(ze,{children:[e.jsx($e,{isNeededCredits:!0,children:r(u.totalNeededCredits)}),e.jsxs(Ee,{isNeededCredits:!0,children:[h(d),e.jsxs(Be,{children:[" ",r(u.totalCredits)]})]})]}),e.jsxs(ze,{children:[e.jsx($e,{children:r(u.remainCredits)}),e.jsxs(Ee,{hasError:i,children:[i&&e.jsx(Lt,{}),h(b-d),e.jsxs(Be,{children:[" ",r(u.credits)]})]})]}),i&&e.jsxs($a,{children:[e.jsx(Ea,{children:r(va.InsufficientCredits)}),e.jsx(Ft,{variant:"contained",color:"primary",minCredits:n})]})]})]})},cn=`mutation createVideo( 19 $platform: String! 20 $platformInfo: platformInfoInput! 21 $platformId: String 22 $alughaVideo: FileMeta 23 $isAudioOnly: Boolean 24 $sttSelected: Boolean 25 $textCompletionSelected: Boolean 26 $withSubtitlesFile: Boolean 27 $folderId: ID 28 $hasAiContent: Boolean 29) { 30 createVideo( 31 platform: $platform 32 platformInfo: $platformInfo 33 platformId: $platformId 34 alughaVideo: $alughaVideo 35 isAudioOnly: $isAudioOnly 36 sttSelected: $sttSelected 37 textCompletionSelected: $textCompletionSelected 38 withSubtitlesFile: $withSubtitlesFile 39 folderId: $folderId 40 hasAiContent: $hasAiContent 41 ) { 42 id 43 assetId 44 thumbnailAssetId 45 defaultTrackId 46 } 47} 48`,un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"platform"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"platformInfo"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"platformInfoInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"platformId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"alughaVideo"}},type:{kind:"NamedType",name:{kind:"Name",value:"FileMeta"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"isAudioOnly"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sttSelected"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"textCompletionSelected"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"withSubtitlesFile"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"folderId"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"hasAiContent"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"platform"},value:{kind:"Variable",name:{kind:"Name",value:"platform"}}},{kind:"Argument",name:{kind:"Name",value:"platformInfo"},value:{kind:"Variable",name:{kind:"Name",value:"platformInfo"}}},{kind:"Argument",name:{kind:"Name",value:"platformId"},value:{kind:"Variable",name:{kind:"Name",value:"platformId"}}},{kind:"Argument",name:{kind:"Name",value:"alughaVideo"},value:{kind:"Variable",name:{kind:"Name",value:"alughaVideo"}}},{kind:"Argument",name:{kind:"Name",value:"isAudioOnly"},value:{kind:"Variable",name:{kind:"Name",value:"isAudioOnly"}}},{kind:"Argument",name:{kind:"Name",value:"sttSelected"},value:{kind:"Variable",name:{kind:"Name",value:"sttSelected"}}},{kind:"Argument",name:{kind:"Name",value:"textCompletionSelected"},value:{kind:"Variable",name:{kind:"Name",value:"textCompletionSelected"}}},{kind:"Argument",name:{kind:"Name",value:"withSubtitlesFile"},value:{kind:"Variable",name:{kind:"Name",value:"withSubtitlesFile"}}},{kind:"Argument",name:{kind:"Name",value:"folderId"},value:{kind:"Variable",name:{kind:"Name",value:"folderId"}}},{kind:"Argument",name:{kind:"Name",value:"hasAiContent"},value:{kind:"Variable",name:{kind:"Name",value:"hasAiContent"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"assetId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnailAssetId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultTrackId"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:732,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:cn}}},mn=()=>{const{graphqlError:a}=te(),[s,r]=Ne(un,{onError:a}),h=t.useCallback((n,i,b,d,l,m,o,v,k,p)=>s({variables:{platform:n,platformInfo:i,platformId:b,alughaVideo:d,isAudioOnly:l,sttSelected:m,textCompletionSelected:o,withSubtitlesFile:v,folderId:k,hasAiContent:p}}),[s]);return t.useMemo(()=>[h,r],[r,h])},Ce=pe({editFile:{id:"dubbr.PublisherVideoMeta.editFile",defaultMessage:"Edit file information"},errorDubbrVideo:{id:"dubbr.PublisherVideoMeta.errorDubbrVideo",defaultMessage:"Error while creating Dubbr video"},errorYouthProtection:{id:"dubbr.PublisherVideoMeta.errorYouthProtection",defaultMessage:"Illegal option value for video youth protection: {youthProtection}"},errorMarketplaceVideo:{id:"dubbr.PublisherVideoMeta.errorMarketplaceVideo",defaultMessage:"Error while creating Marketplace"},createDubbrProject:{id:"dubbr.PublisherVideoMeta.createDubbrProject",defaultMessage:"Create Dubbr Project"},createMarketplaceVideo:{id:"dubbr.PublisherVideoMeta.createMarketplaceVideo",defaultMessage:"Create Marketplace Video"},marketplaceHead:{id:"dubbr.PublisherVideoMeta.marketplaceHead",defaultMessage:"Marketplace"},marketplaceText:{id:"dubbr.PublisherVideoMeta.marketplaceText",defaultMessage:"Sell in marketplace"}}),gn=T.div.withConfig({componentId:"sc-897caf9d-0"}
48)(["height:100%;background-color:",";border-radius:",";"],({theme:a})=>a.colors.accentPrimary,({completed:a})=>a?"0.25rem":" 0.25rem 0 0 0.25rem;"),pn=T.div.withConfig({componentId:"sc-897caf9d-1"})(["width:15rem;border-radius:0.25rem;height:0.75rem;background-color:#3d4d5c;"]),hn=T.div.withConfig({componentId:"sc-897caf9d-2"})(["margin-left:1rem;font-size:1rem;color:",";padding:0.5rem;"],({theme:a})=>a.colors.accentPrimary),fn=T.div.withConfig({componentId:"sc-897caf9d-3"})(["display:flex;justify-content:center;align-items:center;flex-wrap:wrap-reverse;"]),bn=T.p.withConfig({componentId:"sc-897caf9d-4"})(["color:",";font-weight:bold;font-size:0.875rem;"],({theme:a})=>a.colors.accentPrimary),kn=({data:{id:a,status:s,size:r,created:h},videoId:n,sttSelected:i,metaDataSelected:b})=>{const d=ge(),l=re(),m=ia(ra),{formatMessage:o,formatNumber:v}=H(),k=se(),p=xa(a),c=t.useMemo(()=>p||{id:a,userId:m||"",heartbeat:0,value:s===he.Complete?r:0,max:r,percentage:s===he.Complete?1:0,created:new Date},[p,a,m,s,r]),g=Math.round(c.value/c.max*100),x=t.useCallback(f=>{if(f.value===f.max&&m)return o(u.successfulUpload,{code:"â"});const E=new Date(h),j=f.value,V=(new Date().getTime()-E.getTime())/1e3,_=j/V,F=f.max-j,L=Math.round(F/_),$=Math.floor(L/60),A=L%60;return V>2?o(u.timeLeft,{minutes:v($),seconds:v(A)}):o(u.calculating)},[m,h,o,v]);return t.useEffect(()=>{if(c.value===c.max){const f=setTimeout(()=>{k.current&&(i||b?d.push(l.toDubbrTimeline(n,!1)):d.push(l.toDubbrVideoInfo(n,!1)))},2e3);return()=>{clearTimeout(f)}}},[c,n,k,l,d,i,b]),e.jsxs("div",{style:{margin:"2rem auto"},children:[e.jsxs(fn,{children:[e.jsx(pn,{children:e.jsx(gn,{style:{width:`${g}%`},completed:s===he.Complete})}),e.jsx(hn,{children:`${g}%`})]}),e.jsxs(bn,{children:[" ",x(c)," "]})]})},vn=oa("alugha:publisher"),xn=({fields:a,platform:s,platformId:r,thumbnailHref:h,alughaVideo:n,isAudioOnly:i,resetVideo:b,createDubbrProjectButtonDisabled:d,encodingCreditPrice:l,sttCredit:m,metaDataCredit:o,sttSelected:v,withSubtitlesFile:k,metaDataSelected:p,hasAiContent:c,setUploading:g})=>{const{error:x}=te(),{formatMessage:f}=H(),[E,j]=t.useState(""),[V,_]=t.useState(""),F=ge(),L=re(),$=se(),[A,{loading:q}]=mn(),B=Ca(),D=Sa().find(M=>M.assetId===E),C=t.useCallback(M=>{M.stopPropagation(),M.preventDefault(),!q&&(async()=>{try{const{data:P,error:X}=await A(n?"alugha":s,{videoInput:{categories:null,youthProtection:ye.UNLOCKED,license:je.DEFAULT_ALUGHA,sublicense:null,state:0},trackInput:{title:a.title,langCode:a.langCode==="c-"?`c-${da(a.langName)}`:a.langCode,name:a.langName,description:"",tags:[],thumbnailFromUrl:h},encodingConstraints:a.maxResolution?{maxVideoResolution:a.maxResolution}:null},r,{name:n?.name},i,!!v,!!p,!!k,a.projectIdentifier?.folderId,!!c);if(X||!$.current)return;if(!P){x(f(Ce.errorDubbrVideo));return}const{id:R,assetId:Y}=P.createVideo;if(Y){if(n){if(await B.startUpload(Y,n),!$.current)return;j(Y),_(R);return}v||p?F.push(L.toDubbrTimeline(R,!1)):F.push(L.toDubbrVideoInfo(R,!1))}}catch(P){vn.error("couldn't create dubbr video: %o",P),$.current&&x(f(Ce.errorDubbrVideo))}})()},[q,A,n,s,a,f,B,x,i,r,h,$,L,F,v,p,k,c]),z=t.useMemo(()=>{const M=v?m:0,P=p?o:0;return(l?.requiredCredits?Number(l.requiredCredits):0)+M+P},[l,v,p,m,o]),{isInsufficient:y}=ma(`${z}`,l?.availableCredits);return t.useEffect(()=>{D&&g(!0)},[D,g]),D?e.jsx(kn,{data:D,videoId:V,sttSelected:v,metaDataSelected:p}):e.jsxs(e.Fragment,{children:[e.jsx(dn,{requiredCredits:`${z}`,availableCredits:l?.availableCredits}),e.jsxs(ca,{children:[e.jsx(Oe,{color:"negative",variant:"outlined",onClick:M=>{b(M),window.scrollTo(0,0)},children:f(ae.cancel)}),e.jsx(Dt,{loading:q,children:e.jsx(Oe,{color:"primary",variant:"outlined",disabled:d||q||y,onClick:C,children:f(Ce.createDubbrProject)})})]})]})},Cn=`query GenerateMetadataCredits($minutes: Float!) { 49 viewer { 50 id 51 creditsAvailable 52 TCRequiredCredits: creditsRequired( 53 type: TextCompletion 54 unit: Minute 55 quantity: $minutes 56 ) 57 } 58} 59`,Sn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GenerateMetadataCredits"}
59,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"minutes"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"creditsAvailable"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"TCRequiredCredits"},name:{kind:"Name",value:"creditsRequired"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"EnumValue",value:"TextCompletion"}},{kind:"Argument",name:{kind:"Name",value:"unit"},value:{kind:"EnumValue",value:"Minute"}},{kind:"Argument",name:{kind:"Name",value:"quantity"},value:{kind:"Variable",name:{kind:"Name",value:"minutes"}}}],directives:[]}]}}]}}],loc:{start:0,end:250,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Cn}}},jn=({fields:a,platform:s,platformId:r,thumbnailHref:h,alughaVideo:n,isAudioOnly:i,withSubtitlesFile:b,resetVideo:d,createDubbrProjectButtonDisabled:l,platformVideo:m,meta:o,encodingCreditPrice:v,uploading:k,setUploading:p})=>{const{graphqlError:c}=te(),{formatMessage:g,formatNumber:x}=H(),[f,E]=t.useState(!0),[j,V]=t.useState(!0),[_,F]=t.useState(!0),[L,$]=t.useState(0),[A,q]=t.useState(0),B=t.useRef(null),U=G(Q.FreeAiOnUpload),[D,{error:C,data:z}]=Fe(Ct),[y,{error:M,data:P}]=Fe(Sn);t.useEffect(()=>{C&&c(C)},[C,c]),t.useEffect(()=>{z&&z.viewer&&$(Number(z.viewer.sttRequiredCredits))},[z]),t.useEffect(()=>{M&&c(M)},[M,c]),t.useEffect(()=>{P&&P.viewer&&q(Number(P.viewer.TCRequiredCredits))},[P]);const X=t.useCallback(N=>{E(N.target.checked);const J=N.target.checked?j:!1;V(J),N.target.checked?F(!0):J||F(!1),U||D({variables:{sttMinuteAmount:o?o.duration/60:m?.duration?m.duration/60:0}})},[j,U,D,o,m?.duration]),R=t.useCallback(N=>{const J=o?o.duration/60:m?.duration?m.duration/60:0;V(N.target.checked),E(N.target.checked?!0:f),N.target.checked&&F(!0),U||(N.target.checked&&!f&&D({variables:{sttMinuteAmount:J}}),y({variables:{minutes:J}}))},[o,m?.duration,f,U,y,D]),Y=t.useCallback(N=>{!f&&!j&&F(N.target.checked)},[f,j]),ne=t.useCallback(()=>{const N=B?.current;N&&N.scrollIntoView({behavior:"smooth",block:"nearest"})},[B]);return $t(()=>{if(!U){const N=o?o.duration/60:m?.duration?m.duration/60:0;f&&D({variables:{sttMinuteAmount:N}}),j&&y({variables:{minutes:N}})}}),t.useEffect(()=>{ne()},[B,ne]),e.jsxs(e.Fragment,{children:[e.jsxs(Ba,{disabled:k,ref:B,children:[e.jsx(ie,{}),e.jsxs(fe,{children:[e.jsx(be,{children:g(u.speechToTextSetting)}),e.jsx(ke,{children:g(u.sttOptionInfo)}),e.jsxs(ve,{children:[e.jsx(xe,{checked:f,onChange:X,leftLabel:g(u.generateStt)}),j&&e.jsxs(Oa,{children:[e.jsx(_a,{}),e.jsx(qa,{children:g(u.sttRequired)})]})]}),e.jsxs(_e,{active:f,children:[g(u.neededCredits)," ",x(f?L:0)]})]}),e.jsx(ie,{}),e.jsxs(fe,{children:[e.jsx(be,{children:g(u.videoMetaData)}),e.jsx(ke,{children:g(u.metaDataOptionInfo)}),e.jsx(ve,{children:e.jsx(xe,{checked:j,onChange:R,leftLabel:g(u.generateMetaData)})}),e.jsxs(_e,{active:j,children:[g(u.neededCredits)," ",x(j?A:0)]})]}),e.jsx(ie,{}),e.jsxs(fe,{children:[e.jsx(be,{children:g(u.aiContentDisclosure)}),e.jsx(ke,{children:g(u.aiContentDisclosureText)}),e.jsx(ve,{children:e.jsx(xe,{checked:_,onChange:Y,disabled:f||j,leftLabel:g(u.aiContentLabel)})})]})]}),e.jsx(ie,{}),e.jsx(xn,{fields:a,platform:s,platformId:r,thumbnailHref:h,alughaVideo:n,isAudioOnly:i,resetVideo:d,createDubbrProjectButtonDisabled:l,encodingCreditPrice:v,sttCredit:L,metaDataCredit:A,sttSelected:f,withSubtitlesFile:b,metaDataSelected:j,setUploading:p,hasAiContent:_})]})},yn=({isMobile:a,selectedLanguage:s,handleLanguage:r})=>{const{formatMessage:h}=H();return e.jsx(Ua,{children:a?e.jsx(qe,{children:e.jsxs(Wa,{children:[e.jsx(Ga,{children:h(Bt.originalLang)}),e.jsx(me,{selectedLanguage:s,setLanguage:r,noMinWidth:!0,noPadding:!0}),e.jsx(Ue,{children:h(u.selectLangSubtext)})]})}):e.jsxs(qe,{children:[e.jsx(Ha,{children:h(u.selectLang)}),e.jsx(Ra,{children:e.jsx(me,{selectedLanguage:s,setLanguage:r,noMinWidth:!0})}),e.jsx(Ue,{children:h(u.selectLangSubtext)})]})})},Mn=`query CreditViewerQuery { 60 viewer { 61 id 62 plan { 63 id 64 name 65 maxVideoResolution 66 } 67 creditsAvailable 68 } 69} 70`,Nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CreditViewerQuery"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"plan"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"maxVideoResolution"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"creditsAvailable"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:171,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Mn}}},In=({handleFolderModal:a,handleCloseModal:s})=>{const{formatMessage:r}=H(),[h,n]=t.useState(null),[i,b]=t.useState(null),[d,l]=t.useState(null),m=t.useCallback(c=>{n(c)},[n]),o=t.useCallback(c=>{b(c)},[b]),v=t.useCallback(c=>{l(g=>K(g,{$set:{folderId:g?.folderId||"",folderName:c}})),i?.length?d?.folderName?i[i.length-1]=c:b([...i,c]):b([c]),n([])},[d,i,l,b]),k=t.useCallback(c=>{l(g=>K(g,{$set:{folderName:"",folderId:c}}))},[l]),p=t.useCallback(()=>a(d,i?i[i.length-1]:""),[d,i,a]);return e.jsxs(e.Fragment,{children:[e.jsx(Ot,{selectedFolderId:d?.folderId||null,selectedFolder:i,currentFolders:h,handleSetProjectIdentifier:v,handleSetSelectedFolder:o,handleSetCurrentFolders:m,setProjectFolderId:k,transparentBg:!0,withAddNewFolder:!0}),e.jsxs(ca,{children:[e.jsx(ee,{variant:"outlined",color:"primary",onClick:p,children:r(i?.length?u.selectFolder:u.removeFolder)}),e.jsx(ee,{variant:"outlined",color:"negative",onClick:s,children:r(ae.cancel)})]})]})},An=({alughaVideo:a,platformVideo:s,fields:r,isMobile:h,selectedLanguage:n,meta:i,stopEvents:b,setSelectedLanguage:d,encodingCreditPrice:l,setFields:m,setEncodingCreditPrice:o,setMeta:v,withSubtitlesFile:k,setWithSubtitlesFile:p})=>{const{formatMessage:c}=H(),{openModal:g,closeModal:x}=t.useContext(la),f=t.useRef(0),[E,j]=t.useState(null),{data:V,loading:_}=ja(Nn),F=t.useCallback(C=>{d(C),m({...r,langName:C?.name||"",langCode:C?.code.toLowerCase()||""})},[r,d,m]);t.useEffect(()=>{V?.viewer&&s&&o({availableCredits:V.viewer.creditsAvailable,requiredCredits:"0"})},[V,s,r.uploadOnlyAudio,o]);const L=se();Wt(()=>{a&&(async()=>{const C=await ua(a);L.current&&v(C)})()});const $=t.useMemo(()=>a?URL.createObjectURL(a):"",[a]),A=t.useCallback(()=>{f.current&&(x(f.current),f.current=0)},[x]),q=t.useCallback((C,z)=>{A(),m(y=>K(y,{projectIdentifier:{$set:{folderId:C?.folderId,folderName:C?.folderName||""}}}
70)),j(z)},[A,m]),B=t.useMemo(()=>({header:c(u.selectFolder),variant:"flatRounded",size:"medium",overflow:"auto",onCloseCallback:A,modalContent:e.jsx(In,{handleFolderModal:q,handleCloseModal:A})}),[c,A,q]),U=t.useCallback(()=>{f.current=g(B)},[B,g]),D=t.useCallback(()=>{m(C=>K(C,{projectIdentifier:{$set:void 0}})),j(null)},[m]);return e.jsxs(Qa,{noResSection:!a||!i?.height,children:[e.jsx(ie,{}),e.jsxs(Ya,{children:[e.jsxs(Ja,{children:[a?e.jsx(Ka,{children:e.jsx(ya,{children:e.jsx(Xa,{asset:{__typename:"Asset",id:"123"},fallbackSrc:$})})}):e.jsx(Za,{src:s?s.thumbnailHref:Et}),e.jsxs(et,{onClick:C=>b(C),children:[e.jsx(at,{title:r.title,children:r.title}),e.jsx(yn,{handleLanguage:F,isMobile:h,selectedLanguage:n})]})]}),s&&n&&e.jsx(tt,{children:e.jsx(qt,{id:"upload.subtitles.fromURL",checked:!!k,handleChange:()=>p(C=>!C),labelText:c(u.includeSubtitles,{language:n.code.toLocaleUpperCase()})})})]}),e.jsxs(nt,{noMarginBottom:!0,children:[e.jsx(it,{children:c(_t.projectFolders)}),e.jsxs(rt,{children:[e.jsxs(He,{onClick:U,size:"fit",children:[e.jsx(st,{}),E||c(u.selectFolder)]}),E&&e.jsx(He,{onClick:D,size:"fit",color:"negative",children:e.jsx(Ma,{})})]})]}),e.jsx(ot,{meta:i,uploadOnlyAudio:r.uploadOnlyAudio,alughaVideo:a,setUploadOnlyAudio:C=>i?.mediaType!==Me.Audio&&m(z=>K(z,{uploadOnlyAudio:{$set:C}})),encodingCreditPrice:l,setEncodingCreditPrice:o,loading:_,viewerPlan:V?.viewer?.plan,setMaxRes:C=>m(z=>({...z,maxResolution:C,uploadOnlyAudio:!1})),maxRes:r.maxResolution})]})},Tn=oa("alugha:shared:Dropzone"),Vn=({hasVideoId:a,showProjectDetails:s,setShowProjectDetails:r})=>{const h=Na(),{formatMessage:n,formatList:i}=H(),b=t.useRef(!1),d=G(Q.VideoImportUI),l=G(Q.PodcastSupport),m=G(Q.VideoCreation),o=G(Q.ImportExternalVideos)&&m,v=t.useMemo(()=>{const I=[];return m&&I.push(n(u.mediaTypeVideo)),l&&I.push(n(u.mediaTypeAudio)),i(I,{type:"conjunction"})},[m,l,i,n]),[k,p]=t.useState(null),[c,g]=t.useState(""),[x,f]=t.useState(null),[E,j]=t.useState(!1),[V,_]=t.useState(!1),[F,L]=t.useState(!1),[$,A]=t.useState(null),[q,B]=t.useState(!1),[U,D]=t.useState(null),[C,z]=t.useState(!1),[y,M]=t.useState({title:"",description:"",license:je.DEFAULT_ALUGHA,sublicense:null,tags:[],youthProtection:ye.UNLOCKED,langCode:"",langName:"",uploadOnlyAudio:!1}),[P,X]=t.useState(null),[R,Y]=t.useState(null),[ne,N]=t.useState(!1),[J,ga]=t.useState(!1),pa=Ia(),Ie=Aa(`(max-width: ${pa.newScreenBreakpoints.medium-1}px)`),Z=se(),Ae=t.useMemo(()=>{const I=x&&!x.code.toLowerCase().startsWith("c-"),S=x&&x?.name,w=x&&!x?.code&&x?.name?.length>=3;return!(I||S||w)},[x]),Te=t.useCallback(async I=>{const S=await xt(h,I);if(!Z.current)return;if(!S){_(!0);return}r(!0),p({platform:S.platform,platformId:S.platformId,title:S.title,description:S.description,tags:S.tags,thumbnailAssetId:null,thumbnailHref:S.thumbnailUrl,channelName:S.channelName,duration:S.duration});const w=S.langCode?Ta[S.langCode]:void 0;w&&f(w),M({...y,title:S.title,description:S.description,tags:S.tags,langCode:w?.code||"",langName:w?.name||""})},[h,y,Z,r]),ha=t.useCallback(I=>{const[S,w]=vt(I.currentTarget.value);g(S),_(!w),L(!1),A(null),w&&(async()=>{try{await Te(S)}catch(W){if(Tn.error(W),!Z.current||!(W instanceof Error))return;W.message==="NotAllowed"?L(!0):A(W.message||W.toString())}})()},[Te,Z]),oe=t.useCallback(()=>{g(""),p(null),D(null),M({...y,title:"",description:"",license:je.DEFAULT_ALUGHA,sublicense:null,tags:[],youthProtection:ye.UNLOCKED,langCode:"",langName:"",uploadOnlyAudio:!1}),r(!1),f(null),j(!1),L(!1),_(!1),A(null),X(null),Y(null)},[y,r]),Ve=t.useCallback(()=>{oe()},[oe]),Pe=t.useCallback(I=>{I.stopPropagation(),I.preventDefault()},[]),fa=t.useCallback(async I=>{if(oe(),!I?.length)return;const S=I[0];B(!0);const w=await ua(S);if(!Z.current)return;const W=w.mediaType===Me.Audio,we=w.mediaType===Me.Video;we&&m||W&&l?(D(S),M(K(y,{title:{$set:S.name}})),r(!0),z(W),W&&M(le=>K(le,{uploadOnlyAudio:{$set:!le.uploadOnlyAudio}})),we&&M(le=>K(le,{maxResolution:{$set:w.height<w.width?w.height:w.width}}))):j(!0),B(!1)},[y,Z,l,oe,r,m]);return e.jsxs(e.Fragment,{children:[q?e.jsx(lt,{}
70):e.jsx(e.Fragment,{children:!s&&e.jsxs(dt,{disabled:q,onChange:fa,clickable:!0,hasVideo:c!==""||y.title!=="",multiple:!1,externalImport:o,showProjectDetails:s,children:[e.jsx(ct,{src:ut}),e.jsxs(mt,{children:[e.jsx(gt,{children:n(u.headline)}),e.jsx(Re,{children:n(Ie?u.browse:u.dropOrClick)}),e.jsx(Re,{mediaType:!0,children:n(u.supportedMedia,{types:v})})]})]})}),s&&e.jsxs(zt,{countBubbleData:[n(u.videoSettings),n(u.aiSettings)],handleCloseModal:()=>Ve(),nextButtonColor:"primary",isContinueDisabled:Ae||!P&&!!U||!R,isGoBackDisabled:ne,titleForDisabling:y.langCode?P?"":n(u.metaDataMissing):n(Ut.selectVideoLang),children:[e.jsx(An,{alughaVideo:U,platformVideo:k,fields:y,isMobile:Ie,selectedLanguage:x,meta:P,setSelectedLanguage:f,stopEvents:Pe,setFields:M,setEncodingCreditPrice:Y,encodingCreditPrice:R,setMeta:X,withSubtitlesFile:J,setWithSubtitlesFile:ga}),e.jsx(jn,{fields:y,platform:k?.platform||"alugha",platformId:k?.platformId||"",thumbnailHref:k?.thumbnailHref,isAudioOnly:C||y.uploadOnlyAudio,alughaVideo:U,haveConfirmedYouTubeChannel:b.current,resetVideo:Ve,createDubbrProjectButtonDisabled:Ae,platformVideo:k,meta:P,encodingCreditPrice:R,uploading:ne,setUploading:N,withSubtitlesFile:J})]}),E&&e.jsxs(de,{children:[e.jsx(ce,{children:"!"}),e.jsx(Va,{id:"app.PublisherDropzone.errorVideoFileFormat",defaultMessage:"The selected file is not a valid media file or uses an unsupported format"})]}),!s&&o&&e.jsxs(pt,{children:[e.jsx(We,{centered:!0,children:n(u.or)}),e.jsxs(We,{centered:!0,children:[n(u.importVideo),e.jsx(ht,{children:n(u.videoPlatforms)})]}),e.jsxs(ft,{children:[d?e.jsx(bt,{placeholder:n(u.videoUrl),value:c,onChange:ha,onClick:Pe,disabled:!!(c&&!V&&!F&&!$)}):e.jsx("div",{children:"Importing external videos is temporily disabled while we investigate an ongoing issue with fetching metadata for external videos"}),c&&!V&&e.jsx(kt,{children:e.jsx(Pa,{})})]})]}),a&&V&&e.jsxs(de,{children:[e.jsx(ce,{children:"!"}),n(Ge.invalidVideoUrl)]}),a&&F&&e.jsxs(de,{children:[e.jsx(ce,{children:"!"}),n(Ge.channelNotAllowed,{a:I=>e.jsx("a",{href:ln(I),target:"_blank",rel:"noreferrer",children:I})})]}),a&&$&&e.jsxs(de,{children:[e.jsx(ce,{children:"!"}),$]})]})},Pn=""+__alugha__.clientFilesBaseUrl+"assets/publish_article-Br3yaC0m.png",O=pe({pageTitle:{id:"shared.PublisherPage.pageTitle",defaultMessage:"New project"},pageSubTitle:{id:"shared.PublisherPage.pageSubTitle",defaultMessage:"The first step to become multilingual! Here you can upload your media or create a new article."},articleHeadline:{id:"shared.PublisherPage.articleHeadline",defaultMessage:"Write a new article"},articleSubHeadline:{id:"shared.PublisherPage.articleSubHeadline",defaultMessage:"Publish articles in multiple languages to reach a global audience"},magazineHeadline:{id:"shared.PublisherPage.magazineHeadline",defaultMessage:"Create a magazine"},magazineSubHeadline:{id:"shared.PublisherPage.magazineSubHeadline",defaultMessage:"Create a magazine and show everyone your interests to reach a global audience"},start:{id:"shared.PublisherPage.start",defaultMessage:"Start"},titleArticleModal:{id:"shared.PublisherPage.titleArtcleModal",defaultMessage:"Publish article"},titleMagazineModal:{id:"shared.PublisherPage.titleMagazineModal",defaultMessage:"Create a new magazine page"},loginIndication:{id:"shared.PublisherPage.loginIndication",defaultMessage:"You must log in to create and upload your content and enjoy all the features that alugha offers."},loginToAccount:{id:"shared.PublisherPage.loginToAccount",defaultMessage:"Log in to your account"},registerAccount:{id:"shared.PublisherPage.registerAccount",defaultMessage:"Register on alugha"}}),wn=pe({tagsSelectionMatchOr:{id:"app.TagsSelection.tagsSelectionMatchOr",defaultMessage:"or"},tagsSelectionMatchAnd:{id:"app.TagsSelection.tagsSelectionMatchAnd",defaultMessage:"and"}}),Fn=""+__alugha__.clientFilesBaseUrl+"assets/login_notification-DIOJJJYX.png",Ci=()=>{const{formatMessage:a}=H(),{viewer:s,loading:r}=wa(),h=re(),n=G(Q.PublishContent),i=G(Q.MagazineSupport),b=G(Q.VideoCreation),d=G(Q.ImportExternalVideos)&&b,[l,m]=t.useState(!1),{openModal:o,closeModal:v}=t.useContext(la),k=t.useRef(0),p=t.useCallback(()=>{k.current&&(v(k.current),k.current=0)},[v]),c=t.useCallback(()=>{const x={header:a(O.titleArticleModal),variant:"flatRounded",onCloseCallback:p,modalContent:e.jsx(Zt,{closeModal:p})};k.current=o(x)},[a,p,o]),g=t.useCallback(()=>{const x={header:a(O.titleMagazineModal),variant:"flatRounded",onCloseCallback:p,modalContent:e.jsx(on,{closeModal:p})};k.current=o(x)},[a,p,o]);return r?e.jsx(De,{children:e.jsx(Fa,{})}):e.jsxs(De,{children:[n===!1&&s&&e.jsx(Ht,{}),e.jsxs(St,{children:[e.jsx(jt,{children:a(O.pageTitle)}),e.jsx(yt,{children:a(l?u.headline:O.pageSubTitle)})]}),s?e.jsxs(Tt,{singleColumn:l,withMagazine:!!i,children:[e.jsx(Vt,{showProjectDetails:l,children:e.jsx(Vn,{hasVideoId:!0,showProjectDetails:l,setShowProjectDetails:m})}),l?null:e.jsx(Ye,{children:e.jsxs(Je,{externalImport:!!d,children:[e.jsx(Pt,{src:Pn}),e.jsx(Ke,{children:a(O.articleHeadline)}),e.jsx(Xe,{children:a(O.articleSubHeadline)}),e.jsx(Ze,{color:"primary",variant:"outlined",onClick:c,children:a(O.start)})]})}),i&&!l&&e.jsx(Ye,{children:e.jsxs(Je,{externalImport:!!d,children:[e.jsx(wt,{}),e.jsx(Ke,{children:a(O.magazineHeadline)}),e.jsx(Xe,{children:a(O.magazineSubHeadline)}),e.jsx(Ze,{color:"primary",variant:"outlined",onClick:g,...sa("publisher-create-magazine-button"),children:a(O.start)})]})})]}):e.jsxs(Mt,{children:[e.jsx(Nt,{src:Fn}),e.jsx(It,{children:a(O.loginIndication)}),e.jsxs(At,{children:[e.jsx(Qe,{as:Le,to:h.toLogin({redirectPath:"publisher"}),children:a(O.loginToAccount)})," ",a(wn.tagsSelectionMatchOr)," ",e.jsx(Qe,{as:Le,to:h.toRegister(),children:a(O.registerAccount)})]})]})]})};export{Ci 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.