PageSourceSearch

https://static.alugha.com/assets/ProducerPage-w-zEhD-r.js

js alugha.com collected 2026-10-02 11:22:22 UTC 370,076 bytes, 1,006 lines download raw bytes

1import{q as de,r as h,aY as Bi,j as e,aN as fs,ap as gs,aB as O,H as k,c as Ie,z as ae,x as p,o as ve,c0 as St,y as wt,ae as Rt,S as hs,iJ as qr,v as L,p as T,a4 as me,u as ue,g as ps,t as fe,aG as dt,eq as Ui,aM as li,dO as ct,aI as Tn,m as Bt,n as ie,F as wi,af as Wi,aC as ks,jU as Lr,ao as vs,cU as Er,jg as Or,a5 as bs,G as F,cI as tt,e7 as zr,i as Se,ar as di,w as kn,gR as _r,A as Br,ff as Re,ay as Ur,en as In,E as ys,W as Xt,J as Dn,K as An,N as Vn,O as ye,iU as Wr,du as Hr,au as vn,eg as Ss,az as ge,s as Z,ag as Ki,d as W,aA as le,aj as ci,cO as Be,ac as I,ah as Qr,jV as Gr,jW as Yr,jX as Xn,jY as Kr,f9 as $n,iK as ws,jZ as Zr,j_ as Xr,V as Ue,X as We,iL as Jr,iT as Jn,al as Rn,jc as Zi,Z as De,$ as je,gp as eo,aP as to,dW as ea,bT as io,aE as y,aF as Ve,a0 as qn,a2 as Ln,a3 as Jt,j$ as Y,k0 as Mt,aR as Vt,av as ut,bv as no,Y as mt,aD as En,b6 as ao,aw as ui,aX as Je,k1 as so,ev as xs,dY as ro,cX as Cs,k2 as Ns,P as js,ex as Ms,U as ze,k3 as Fs,L as Ut,b0 as Wt,io as oo,k4 as ta,iq as lo,a$ as Ps,eP as co,T as uo,ak as Ts,ba as ia,k5 as mo,k6 as fo,k7 as Is,k8 as re,k9 as go,ka as ho,kb as Ds,kc as As,kd as rt,ke as po,kf as ko,R as vt,kg as On,bh as zn,bi as _n,kh as it,aW as Vs,b9 as vo}from"./index-B-8CDiEL.js";import{P as bo}from"./ProducerBanner-index-Dn4S2NYj.js";import{C as $s,T as Rs,I as yo}from"./ThumbnailFlow-index-BqB_Z74k.js";import{L as qs}from"./LanguageSelection-index-Dn3Syu0G.js";import{m as te}from"./ProducerFilter-intl-Ck6IvgIg.js";import{F as xi}from"./FormLabel-index-DGVYL3SH.js";import{y as So,L as wo,g as Ls,z as xo,I as Co}from"./marketplace-index-BNv8dM9U.js";import{d as Es}from"./dequal-dist-index-tFQomdd2.js";import{O as xt}from"./OverviewCollection-index-CaJbhRaB.js";import{_ as Os,a as Bn,d as No,b as jo,c as Mo}from"./ArticleCardContent-BVliUN3a.js";import{A as Fo}from"./ArticleCard-Dsss21mB.js";import{m as Ne,I as ii,b as Un,C as na,a as Po,F as ot,c as To,d as Wn,e as Hn,T as bn,f as Io,_ as Do,M as Ao,g as Vo,h as hi,H as $o,P as zs}from"./ProducerPodcast-CCWzPrYF.js";import{m as K}from"./ProducerWatchlists-intl-BAbWsVbB.js";import{m as Xi}from"./ProducerBanner-intl-C_T6urTd.js";import{A as Ro,C as qo}from"./Card-index-Z4ltd4kr.js";import{S as Lo,V as Eo}from"./VideoCard-index-BJ8aUnmg.js";import{C as Oo}from"./CompoundSlider-index-DZZOSt8K.js";import{m as pi}from"./VideoPageQuery-DhRteSV-.js";import{F as Ye,b as zo,I as ni,a as ai,c as yn,T as Zt,M as _o,H as aa,d as Bo,e as Ji,W as Uo,C as Wo}from"./ProducerWatchlists-styled-DgXXsHZ1.js";import{I as _s}from"./IconMenu-DcX6-vnR.js";import{_ as Ho,D as Qo,a as Bs}from"./DraggableContent-index-Db2yFQOU.js";import{I as ei}from"./Input-index-Bc1tHrtQ.js";import{H as Go,F as nt,C as Yo,T as Ft,G as sa,E as ra,a as oa,S as Pt,b as la,c as Ko,W as Zo,d as da,e as Xo,f as Xe,g as Jo,h as Us,i as si,j as Ze,u as el,D as tl,k as il,l as nl,n as al,P as Hi,o as Ws,p as Tt}from"./InfoBar-index-DialLV9J.js";import{_ as Qn,b as sl}from"./ProducerVideos-C_2asFOA.js";import{_ as rl}from"./removeVideoFromWatchlist-B7MI0etc.js";import{_ as Gn}from"./ProducerWatchlist-CskToD9v.js";import{C as Hs}from"./Carousel-Ds71PYql.js";import{I as ft}from"./IconWarning-CJZdmaH8.js";import{_ as ol,a as ri,b as Qs,m as en}from"./WatchlistMenu-index-B8cKkmnC.js";import{_ as ll,a as dl,b as cl,c as ul,P as ml,m as ca,u as fl,d as Gs,S as ki,e as tn,H as nn,f as gl,C as hl,g as pl}from"./useEditUserModal-CG5IHzbk.js";import{_ as kl,a as vl}from"./ProducerDataPodcasts-Bsy23f0Y.js";import{P as bl}from"./Placeholder-index-DMKta_L1.js";import{m as yl,u as Ys,a as Ks,D as Sl}from"./DeleteMagazineModal-D1ddmeuA.js";import{S as Sn,m as wn,a as wl}from"./PublishAndDownloadModal-intl-CxqFXEez.js";import{S as Zs,p as an}from"./podcast-DoVSyRXV.js";import{i as ua}from"./isEqual-IGSBFfPj.js";import{m as Ae,u as xl}from"./useUpdateVideo-BglFJfz_.js";import{P as Ee}from"./Pagination-index-CUbQ20BO.js";import{P as Fe}from"./PersistentHeightLoadingSpinner-index-BUM_cYPr.js";import{u as He}from"./usePaginatedQuery-DLRaMKUP.js";import{a as mi}from"./assetAttributes-3MwUYW30.js";import{m as sn}from"./IconLock-Cid9l6sy.js";import{_ as Cl,M as ma}
1from"./UpdateTrack-DU9qFpjq.js";import{T as Nl}from"./Comment-index-B66Zstld.js";import{_ as jl,f as Ml}from"./removeProjectFromFolder-DX_dQOTO.js";import{m as fa,f as Fl,P as Pl}from"./ProjectExplorer-C6sYztfo.js";import{S as Tl}from"./SwitchButton-index-C0ZSGXuh.js";import{u as Il,a as Dl}from"./useUpdateAssets-p6ZuGT10.js";import{U as Al}from"./UnverifiedHint-index-ng669igd.js";import{C as bt}from"./CheckBox-LHAdxNvk.js";import{m as Xs}from"./marketplace-intl-CKHsK72a.js";import{a as Js}from"./SubscriptionUser-BdGpNzRB.js";import{m as ti}from"./ProducerPage-intl-BmQ2W92j.js";import{C as Vl}from"./ContentWide-index-CoEdL4Bc.js";import $l from"./NotFoundPage-index-C-Zcqz0v.js";import{_ as fi,B as er,b as Rl,u as Qi,z as ql,P as Ll}from"./zxcvbn-lib-main-QZp3azXf.js";import{Q as El}from"./QRCode-DwxGU5Ie.js";import{c as Ol,a as zl}from"./array-DUymS4M7.js";import{a as Me}from"./CountrySelection-index-ClsUTg4D.js";import{I as ga}from"./IconEyeCircle-ClIMAjWT.js";import{m as ke}from"./ProducerPasswordChange-intl-BP1jEK58.js";import{R as Yt}from"./RadioButton-index-CGMdsHZe.js";import{D as _l}from"./DatePicker-index-8TJHn9XW.js";import"./FollowButton-DnMUrndT.js";import"./withUpdateUserFollowingMutation-DkStJK8P.js";import"./es-index-BHduCApL.js";import"./deepmerge-dist-cjs-BMV0Lby6.js";import"./useDebounceEffect-index-BXCPh2KU.js";import"./useUpdateEffect-index-BlTTQJ0b.js";import"./Tag-index-DuZlojVC.js";import"./useDebounce-index-Dv7f12rR.js";import"./displayLoadingState-CYB3sHr1.js";import"./ErrorPicture-CCh9YgKw.js";import"./MoreButton-index-1TuFb1j7.js";import"./SmartTime-index-D7lZYwc0.js";import"./AssetOwner-intl-Bq7qyWI2.js";import"./times-8xeTMWXO.js";import"./toInteger-BYryhB7b.js";import"./Overview-styled-BPVk3Ubd.js";import"./InfiniteScroll-DeXwleC1.js";import"./LoadingDropzone-qMrcu8x6.js";import"./connect-BJograE-.js";import"./loadable-DdNr4yeD.js";import"./Error-BjakEj1u.js";import"./LoadingCircle-BR4quEBf.js";import"./molecules-intl-DY7dCEho.js";import"./PublisherDropzone-intl-CFITanVw.js";import"./Poster-CxQBZl2p.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"./upperFirst-Bfd8m95h.js";import"./capitalize-CeB4NcHo.js";import"./_baseIteratee-Do-3x5lu.js";import"./_baseIsEqual-mQ0WyzAo.js";import"./_setToArray-C6O9RY6F.js";import"./_baseUniq-CsHyRt5E.js";import"./_arrayIncludesWith-pBMhzuR3.js";import"./withQuery-p4SDLB0U.js";import"./IconLaunch-BDJls3lp.js";import"./Licenses-intl-DSq18NNp.js";import"./uniq-Db4dtPVI.js";import"./Tags-styled-6kVNkujE.js";import"./customerData-sGaOLMKV.js";import"./CategorySelection-styled-CVB9xwvK.js";import"./MultilingualTabs-index-DhI-vE1_.js";import"./Alugha2GoVideoMeta-intl-B_FpR48I.js";import"./errors-DaTWixw_.js";import"./react-motion-BNZ4BHUC.js";import"./DraggableVideos-styled-BZ5fm9VI.js";import"./addVideoToWatchlist-DtyQtQlQ.js";import"./VideoInfoCollaborationsQuery-DqtP5P2c.js";import"./UserSettingsModalUser-CQeCx9no.js";import"./UserSettingsModalUserWithScheduledPlanDowngrades-CwxWHcUB.js";import"./EditUserModal-styled-CL7nzzCg.js";import"./ScheduledPlanDowngrades-Dk8nWpdc.js";import"./PlanSelect-C3XXQbzy.js";import"./PayForm-intl-DcjQF4Q7.js";import"./EditUserModal-intl-K93dgLnE.js";import"./Whitelist-intl-AOec_Nb2.js";import"./RoleSettings-styled-DvWcZOKc.js";import"./validate-DI5EN0xo.js";import"./formValidation-DkdercPs.js";import"./CreateOrEditBoosterBlueprint-styled-BmkYCHYV.js";import"./IconAdd-D6I_bJAX.js";import"./sortBy-BWh8vZ4E.js";
1import"./LanguageWrapper-index-BDEw7DGx.js";import"./SectionMeta-intl-BHE_IwNM.js";import"./TabList-DdSedcLd.js";import"./skills-BqaQCv58.js";import"./PlanOverview-intl-CfPzJ8TX.js";import"./IconX-k5JiBOXI.js";import"./vsc-index-BKcloEz2.js";import"./NotificationsPage-intl-CEkX00U6.js";import"./BuyCreditsButton-index-D9KQVUQd.js";import"./PricingPage-intl-CuyDLYN0.js";import"./InvoicePage-intl-C-SvvEhq.js";import"./CopyFeedback-index-DGtDE2es.js";import"./DownloadAndPublishModalSections-styled-BcYCxiae.js";import"./Divider-index-C2Y8vWzi.js";import"./Badge-index-BwHdlqvF.js";import"./SegmentSelector-styled-BVsd4jMM.js";import"./AddMedia-styled-Chfdmd1j.js";import"./DiscountBanner-styled-BsNxmtkJ.js";import"./StarsBackground-DtxHn8AW.js";import"./starsBackground-C-35Oakf.js";import"./useChatwoot-CtYz7y7u.js";import"./_baseAssignValue-B9b5URRE.js";const Bl=(t,n)=>[{"@context":"http://schema.org","@type":"Person",name:t.name,url:n,knowsLanguage:t.languages,workLocation:t.country,description:t.profile?.bio||void 0,image:t.avatarProducer?{"@type":"ImageObject",url:t.avatarProducer.href}:void 0}],Ul=(t,n)=>new Map([[/^\/producer\/[0-9a-z-]*\/myContent\/articles\/?$/,t.toUserMyContentArticles(n,!0)],[/^\/producer\/[0-9a-z-]*\/myContent\/images\/?$/,t.toUserMyContentImages(n,!0)],[/^\/producer\/[0-9a-z-]*\/myContent\/podcasts\/?$/,t.toUserMyContentPodcasts(n,!0)],[/^\/producer\/[0-9a-z-]*\/myContent\/podcasts\/?$/,t.toUserMyContentPodcasts(n,!0)],[/^\/producer\/[0-9a-z-]*\/followers(?:\/(?:follower\/?)?)?$/,t.toUserFollowers(n,!0)],[/^\/producer\/[0-9a-z-]*\/followers\/following\/?$/,t.toUserFollowing(n,!0)]]),Wl=({userData:t})=>{const n=de(),a=(t.profile?.bio||"").slice(0,150),o=t.avatarProducer,d=t.name,m=h.useMemo(()=>Ul(n,t.id),[n,t]),{pathname:u}=Bi(),f=n.toUser(t.id,!0),c=h.useMemo(()=>{for(const[i,r]of m)if(i.test(u))return r;return f},[m,u,f]);return e.jsxs(fs,{children:[e.jsx("title",{children:d}),d&&e.jsx("meta",{property:"og:title",content:d}),e.jsx("link",{rel:"canonical",href:c}),e.jsx("meta",{property:"og:url",content:f}),o?e.jsx("meta",{property:"og:image",content:o.href}):e.jsx("meta",{property:"og:image",content:n.toPath(gs,!0)}),e.jsx("meta",{property:"og:site_name",content:"alugha"}),e.jsx("meta",{property:"og:type",content:"website"}),a&&e.jsx("meta",{property:"og:description",content:a.length<150?a:a+"…"}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(Bl(t,f))})]})},Hl=`query ProducerFollowersQuery(
2  $showFollowing: Boolean!
3  $userId: ID!
4  $limit: Int = 10
5  $offset: Int
6) {
7  user(id: $userId) {
8    id
9    followerCount
10    followingCount
11    following(limit: $limit, offset: $offset) @include(if: $showFollowing) {
12      id
13      name
14      avatarAssetId
15      avatarProducer: avatar {
16        href
17      }
18    }
19    followers(limit: $limit, offset: $offset) @skip(if: $showFollowing) {
20      id
21      name
22      avatarAssetId
23      avatarProducer: avatar {
24        href
25      }
26    }
27  }
28}
29`,Ql={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerFollowersQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"showFollowing"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followerCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followingCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"following"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}
29},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"showFollowing"}}}]}],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:"avatarAssetId"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"avatarProducer"},name:{kind:"Name",value:"avatar"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"followers"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"skip"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"showFollowing"}}}]}],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:"avatarAssetId"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"avatarProducer"},name:{kind:"Name",value:"avatar"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:567,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Hl}}},Gl=""+__alugha__.clientFilesBaseUrl+"assets/placeholder-avatar-disabled-CtopKkjs.png",Yl=k.div.withConfig({componentId:"sc-3db49bc8-0"})(["display:flex;flex-direction:column;width:100%;max-width:8rem;align-items:center;"]),tr=ae(["font-size:",";text-transform:uppercase;color:#cccccc;margin:"," 0;width:100%;max-width:",";text-align:center;word-break:break-word;"],p(10),p(16),p(160)),Kl=k.div.withConfig({componentId:"sc-3db49bc8-1"})(["",""],tr),Zl=k(Ie).withConfig({componentId:"sc-3db49bc8-2"})(["",""],tr),ir=ae(["width:",";height:",";border-radius:50%;background-size:cover;background-repeat:no-repeat;background-position:center;border:"," solid #52677e;"],p(80),p(80),p(1)),Xl=k.div.withConfig({componentId:"sc-3db49bc8-3"})(["",""],ir),Jl=k(Ie).withConfig({componentId:"sc-3db49bc8-4"})(["",""],ir),ed=({userId:t,image:n,name:a})=>{const o=de(),l=h.useMemo(()=>({backgroundImage:`url(${n})`}),[n]);return e.jsx(Yl,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(Jl,{to:o.toUser(t),style:l}),e.jsx(Zl,{to:o.toUser(t),children:a})]}):e.jsxs(e.Fragment,{children:[e.jsx(Xl,{style:l}),e.jsx(Kl,{children:a})]})})},ha=O.memo(ed),_=ve({MessageHeaderNotMuchToSee:{id:"app.ProducerPage.Producer.MessageHeaderNotMuchToSee",defaultMessage:"Not much to see here…",description:"About me Header"},MessagTextNoUploadsVideo:{id:"app.ProducerPage.Producer.MessageNoUploadsVideo",defaultMessage:"You haven't uploaded any videos yet.",description:"Message if user dont have any uploaded videos"},MessagTextNoUploadsArticles:{id:"app.ProducerPage.Producer.MessageNoUploadsArticles",defaultMessage:"You haven't uploaded any articles yet.",description:"Message if user dont have any uploaded articles"},MessagTextNoUploadsImages:{id:"app.ProducerPage.Producer.MessageNoUploadsImages",defaultMessage:"You haven't uploaded any images yet.",description:"Message if user dont have any uploaded images"},MessagTextNoUploadsMagazines:{id:"app.ProducerPage.Producer.MessagTextNoUploadsMagazines",defaultMessage:"You haven't uploaded any magazines yet.",description:"Message shown if user didn't upload any magazines"},MessageGetStarted:{id:"app.ProducerPage.Producer.MessageNoUploads",defaultMessage:"Get started!",description:"Message of link to upload new videos/articles"},MessageUserNotUploaded:{id:"app.ProducerPage.Producer.MessageUserNoUploaded",defaultMessage:"User has not uploaded anything yet!",description:"Message if user dont have any uploaded videos/articles"},HeaderFollowing:{id:"app.ProducerPage.Producer.HeaderFollowing",defaultMessage:"Following",description:"Header for Following"},HeaderFollowers:{id:"app.ProducerPage.Producer.HeaderFollowers",defaultMessage:"Followers",description:"Header for Followers"},MessageUserNoFollowers:{id:"app.ProducerPage.Producer.MessageUserNoFollowers",defaultMessage:"no followers",description:""},MessageUserNoSearchResults:{id:"app.ProducerPage.Producer.MessageUserNoSearchResult",defaultMessage:"no results",description:"message if no search results are found"},SortByAbonnementsUserName:{id:"app.ProducerPage.Producer.SortBy.Abonnements.userName",defaultMessage:"Name",description:""},SortByAbonnementsRecentlyAdded:{id:"app.ProducerPage.Producer.SortBy.Abonnements.recentlyAdded",defaultMessage:"Recently added",description:""},SortByImagesModified:{id:"app.ProducerPage.Producer.SortBy.Images.modified",defaultMessage:"Modified",de
29scription:""},SortByImagesCreated:{id:"app.ProducerPage.Producer.SortBy.Images.created",defaultMessage:"Created",description:""},SortByImagesType:{id:"app.ProducerPage.Producer.SortBy.Images.type",defaultMessage:"Type",description:""},SortByImagesPrice:{id:"app.ProducerPage.Producer.SortBy.Images.price",defaultMessage:"Price",description:""},SortByImagesTitle:{id:"app.ProducerPage.Producer.SortBy.Images.title",defaultMessage:"Title",description:""},SortByImagesScore:{id:"app.ProducerPage.Producer.SortBy.Images.score",defaultMessage:"Score",description:""},SortByModified:{id:"app.ProducerPage.Producer.SortBy.Articles.modified",defaultMessage:"Modified",description:""},SortByCreated:{id:"app.ProducerPage.Producer.SortBy.Articles.created",defaultMessage:"Created",description:""},SortByPublished:{id:"app.ProducerPage.Producer.SortBy.Articles.published",defaultMessage:"Published",description:""},SortByAlphabetical:{id:"app.ProducerPage.Producer.SortBy.Videos.alphabetical",defaultMessage:"Alphabetical",description:""},myVideosHeader:{id:"app.ProducerPage.Producer.myVideosHeader",defaultMessage:"My Videos",description:""},videosHeader:{id:"app.ProducerPage.Producer.videosHeader",defaultMessage:"Videos",description:""},filterHeader:{id:"app.ProducerPage.Filter.filterHeader",defaultMessage:"Filter",description:""}}),td=t=>e.jsx(St,{viewBox:"0 0 32 32",...t,children:e.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e.jsx("g",{transform:"translate(-396.000000, -1469.000000)",stroke:"#00AFAA",children:e.jsx("g",{transform:"translate(32.000000, 1450.000000) translate(261.000000, 19.000000)",children:e.jsx("path",{d:"M134.059066,0.5 L103.940934,0.5 C103.77232,0.5 103.619751,0.594434161 103.545889,0.744791814 C103.471553,0.895230449 103.48853,1.07409973 103.589634,1.20685129 L115.546995,16.9193844 L115.546995,27.712 C115.546995,27.8734873 115.633559,28.0210084 115.773505,28.0993452 L121.796234,31.4437894 C121.863986,31.4812305 121.936831,31.5 122.011813,31.5 C122.087729,31.5 122.163864,31.4789514 122.234549,31.4372664 C122.369885,31.3576586 122.453005,31.2128709 122.453005,31.0588235 L122.453005,16.9193844 L122.555117,16.7852042 L134.41048,1.20670174 C134.51147,1.07409973 134.528447,0.895230449 134.453597,0.743748912 C134.380249,0.594434161 134.22768,0.5 134.059066,0.5 Z",id:"Combined-Shape"})})})})}),id=k.div.withConfig({componentId:"sc-f2b7c44b-0"})(["display:flex;flex:1 1 auto;width:100%;overflow:inherit;flex-direction:column;@media only screen and (max-width:48rem){padding:0;}"]),nr=k.h1.withConfig({componentId:"sc-f2b7c44b-1"})(["font-size:",";margin:"," 0;color:",";font-weight:500;height:",";letter-spacing:",";text-transform:uppercase;"],p(18),p(32),({theme:t})=>t.colors.textPrimary,p(21),p(2)),Gi=k(hs).withConfig({componentId:"sc-f2b7c44b-2"})(["margin:0;min-width:",";"],p(160)),J=k.div.withConfig({componentId:"sc-f2b7c44b-3"})(["display:flex;align-items:center;flex:1 1 auto;flex-wrap:wrap;margin:"," 0;min-height:2.75em;",";",";",";"],p(16),t=>t.isRight&&"justify-content: flex-end",t=>t.isCenter&&"justify-content: center",t=>t.isColumn&&"flex-direction: column"),ar=k.button.withConfig({componentId:"sc-f2b7c44b-4"})(["display:flex;position:relative;background:transparent;align-items:center;border:none;margin:0 ",";color:",";",";:hover{cursor:pointer;}:focus{outline:none;}"],p(16),({theme:t})=>t.colors.textPrimary,t=>t.isHighlighted&&ae(["border:"," solid ",";border-radius:",";font-size:",";width:100%;padding:",";justify-content:center;color:",";text-transform:uppercase;margin:0 0 ",";0;"],p(1),({theme:n})=>n.colors.accentPrimary,p(4),p(14),p(11),({theme:n})=>n.colors.accentPrimary,p(16))),$t=k.div.withConfig({componentId:"sc-f2b7c44b-5"})(["display:inline-block;margin:0 ",";"],p(2)),sr=k.div.withConfig({componentId:"sc-f2b7c44b-6"})([""," position:absolute;top:",";right:0;background-color:",";width:",";height:",";font-size:",";border-radius:",";"],wt,p(-3),({theme:t})=>t.colors.accentPrimary,p(16),p(16),p(11),p(10)),rr=k(So).withConfig({componentId:"sc-f2b7c44b-7"})(["font-size:",";"],p(24)),or=k(td).withConfig({componentId:"sc-f2b7c44b-8"})(["font-size:",";margin:0 ",";"],p(16),p(16));k.div.withConfig({componentId:"sc-f2b7c44b-9"})([""," font-size:",";letter-spacing:0;color:",";margin-left:",";flex-direction:column;"],wt,p(12),({theme:t,isHighlighted:n})=>n?t.colors.accentPrimary:"#969696",p(8));const lr=k.div.withConfig({componentId:"sc-f2b7c44b-10"})(["user-select:none;display:flex;width:100%;"]);k.div.withConfig({componentId:"sc-f2b7c44b-11"})(["width:",";background-color:",";"],p(2),({theme:t})=>t.colors.buttonDisabled);k.div.withConfig({componentId:"sc-f2b7c44b-12"})(["display:flex;justify-content:center;flex-direction:column;"]);const Ct=k.div.withConfig({componentId:"sc-f2b7c44b-13"})(["display:flex;justify-content:center;width:100%;max-width:",";flex-direction:",";"],p(1568),t=>t.isRow?"row":"column"),nd=k.div.withConfig({componentId:"sc-f2b7c44b-14"})(["display:flex;justify-content:center;width:100%;flex-direction:column;text-align:center;"]),ad=k.div.withConfig({componentId:"sc-f2b7c44b-15"})(["display:flex;justify-content:flex-start;font-size:",";margin:"," 0;text-align:center;align-items:center;"],p(20),p(16)),sd=k.div.withConfig({componentId:"sc-f2b7c44b-16"})(["display:flex;font-size:",";justify-content:center;text-align:center;margin:2rem 0 2.5rem;letter-spacing:0.5px;line-height:24px;"],p(16)),rd=k.div.withConfig({componentId:"sc-f2b7c44b-17"})(["display:flex;font-size:",";justify-content:center;"],p(24)),od=k.span.withConfig({componentId:"sc-f2b7c44b-18"})(["margin:0 0.375rem;font-size:",";font-weight:500;letter-spacing:0.125rem;text-transform:uppercase;text-align:center;"],p(18)),ld=k(L).withConfig({componentId:"sc-f2b7c44b-19"})(["width:fit-content;margin:0 auto;"]);k.img.withConfig({componentId:"sc-f2b7c44b-20"})(["width:",";height:",";"],p(250),p(250));
29const dd=k(qr).withConfig({componentId:"sc-f2b7c44b-21"})(["color:",";border:none;background-color:transparent;padding:0 0 0 0.25rem;margin:0;font-size:",";:hover{background-color:transparent;cursor:pointer;}"],({theme:t})=>t.colors.accentPrimary,p(16)),cd=k.div.withConfig({componentId:"sc-f2b7c44b-22"})(["flex:1 1 auto;"]),at=k.div.withConfig({componentId:"sc-f2b7c44b-23"})([""," font-weight:500;"," padding:"," 0;font-size:",";text-transform:uppercase;border-bottom:"," solid ",";color:",";:hover{cursor:pointer;}@media only screen and (max-width:26.56rem){margin:0 ",";}"],wt,Rt("4.5rem"),p(7),p(12),p(2),({theme:t,isHighlighted:n})=>n?t.colors.accentPrimary:"transparent",({theme:t,isHighlighted:n})=>n?t.colors.accentPrimary:"#969696",p(16)),pa=ps("alugha:pages:followers"),rn=({userId:t,limit:n,showFollowing:a,totalNumberOfFollowers:o,setNumberOfFilterResults:l})=>{const d=T(),[m,u]=h.useState(o>0),[f,c]=h.useState(0),i=h.useRef(0),r=h.useRef(!1),s=me(),g=h.useMemo(()=>({userId:t,limit:n,showFollowing:a}),[n,t,a]);h.useEffect(()=>{c(v=>v+1)},[g]);const{data:S,loading:N,error:x,fetchMore:j}=ue(Ql,{variables:g});h.useEffect(()=>{x&&pa.error(x)},[x]);const w=h.useMemo(()=>a?S&&S.user&&S.user.following||[]:S&&S.user&&S.user.followers||[],[a,S]);h.useEffect(()=>{l(w.length)},[l,w]),h.useEffect(()=>{i.current=w.length},[w]),h.useEffect(()=>{w.length%n!==0||o<=w.length?u(!1):u(!0)},[o,w,n]);const P=h.useCallback(async()=>{if(!r.current){r.current=!0;try{const v=a?"following":"followers";!(await j({variables:{offset:i.current}}))?.data?.user?.[v]?.length&&s.current&&u(!1)}catch(v){pa.error(v)}finally{r.current=!1}}},[a,j,s]);if(N)return e.jsx(Ct,{children:e.jsx(J,{isCenter:!0,children:e.jsx(fe,{})})});const C=m&&!(w.length%n);return w.length<=0?e.jsx(ha,{image:Gl,name:d.formatMessage(_.MessageUserNoFollowers)}):e.jsx(xt,{isFollowerGrid:!0,onLoadMore:P,hasMoreItems:C,children:w.map((v,b)=>e.jsx(ha,{image:v.avatarProducer?v.avatarProducer.href:gs,userId:v.id,name:v.name},`${v.id}-${b}`))},f)};let ud=class extends h.Component{constructor(){super(...arguments),this.currentOffsetFollowers=0,this.isLoadingMore=!1,this.state={selectedSubMenu:D.Followers,numberOfFilterResults:0},this.handleClickFollowers=this.handleClickSubMenu.bind(this,D.Followers),this.handleClickFollowing=this.handleClickSubMenu.bind(this,D.Following),this.updateSubMenuType=()=>{this.setState(({selectedSubMenu:n},{location:{pathname:a}})=>{let o=D.Followers;return a.includes("/following")?o=D.Following:a.includes("/follower")&&(o=D.Followers),n===o?null:{selectedSubMenu:o}})},this.setNumberOfFilterResults=n=>{this.setState(({numberOfFilterResults:a})=>a===n?null:{numberOfFilterResults:n})},this.setSubMenuType=n=>this.setState({selectedSubMenu:n})}componentDidMount(){this.updateSubMenuType()}componentDidUpdate(n){this.props.location.pathname!==n.location.pathname&&this.updateSubMenuType()}handleClickSubMenu(n){this.setSubMenuType(n)}render(){const{userId:n,limit:a,intl:o,numFollowers:l,numFollowing:d}=this.props,m=`${this.props.linkToUserFollowers}/follower`,u=`${this.props.linkToUserFollowers}/following`;return e.jsxs(O.Fragment,{children:[e.jsxs(J,{style:{marginBottom:"2rem"},children:[e.jsx(Ie,{to:m,onClick:this.handleClickFollowers,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Followers,children:`${o.formatMessage(_.HeaderFollowers)} ${l}`})}),e.jsx(Ie,{to:u,onClick:this.handleClickFollowing,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Following,children:`${o.formatMessage(_.HeaderFollowing)} ${d}`})})]}),e.jsx(Ct,{isRow:!0,children:e.jsx(cd,{children:e.jsxs(Bt,{children:[e.jsx(ie,{path:m,render:()=>e.jsx(rn,{userId:n,showFollowing:!1,limit:a,totalNumberOfFollowers:l,setNumberOfFilterResults:this.setNumberOfFilterResults})}),e.jsx(ie,{path:u,render:()=>e.jsx(rn,{userId:n,showFollowing:!0,limit:a,totalNumberOfFollowers:d,setNumberOfFilterResults:this.setNumberOfFilterResults})}),e.jsx(ie,{exact:!0,render:()=>e.jsx(rn,{userId:n,showFollowing:!1,limit:a,totalNumberOfFollowers:l,setNumberOfFilterResults:this.setNumberOfFilterResults})})]})})})]})}};const md=dt(Tn,ct,li,Ui),fd=md(ud),gd=k(hs).withConfig({componentId:"sc-5894fcda-0"})(["margin:0;flex:1 1 auto;width:100%;"]),dr=k.h1.withConfig({componentId:"sc-5894fcda-1"})(["width:100%;font-size:",";font-weight:normal;letter-spacing:",";margin:0;"],p(22),p(1)),hd=k(wo).withConfig({componentId:"sc-5894fcda-2"})(["button{background-color:transparent;}"]),qe=k.div.withConfig({componentId:"sc-5894fcda-3"})(["display:flex;flex-wrap:wrap;",";",";",";",";",";",";"],t=>t.floatRight&&"float: right",t=>t.isRight&&"justify-content: flex-end",t=>t.margin&&`margin: ${t.margin}`,t=>t.isColumn&&"flex-direction: column",t=>t.isCenter&&"justify-content: center",t=>t.isColumn&&t.isRight&&ae(["flex-direction:column;align-items:flex-end;"])),st=k(wi).withConfig({componentId:"sc-5894fcda-4"})(["margin:0;padding:"," 0;",";"],p(16),t=>t.border&&ae(["padding:"," "," "," ",";border-bottom:"," solid ",";"],p(20),p(16),p(26),p(16),p(1),({theme:n})=>n.colors.accentSecondary)),pt=k(xi).withConfig({componentId:"sc-5894fcda-5"})(["margin-bottom:",";display:inline-block;line-height:",";
29"],p(8),p(24)),kt=k.div.withConfig({componentId:"sc-5894fcda-6"})(["padding-top:0;font-size:",";text-transform:uppercase;letter-spacing:",";font-weight:bold;",";"],p(12),p(1),t=>t.theme.dir==="rtl"?ae(["order:2;"]):ae(["order:1;"])),cr=k.div.withConfig({componentId:"sc-5894fcda-7"})(["font-size:",";text-transform:normal;letter-spacing:",";font-weight:normal;",";"],p(11),p(1),t=>t.theme.dir==="rtl"?ae(["order:2;margin-right:",";"],p(5)):ae(["order:1;margin-left:",";"],p(5))),ur=k.div.withConfig({componentId:"sc-5894fcda-8"})(["width:100%;background:rgb(19,26,32);border:","solid rgb(42,52,63);border-radius:",";position:relative;padding:",";margin-bottom:",";user-select:none;",";@media (min-width:","){padding:"," ",";}@media (min-width:","){padding:"," ",";}@media (min-width:","){padding:"," ",";}@media (min-width:","){padding:"," ",";}@media (min-width:","){padding:"," ",";}"],p(1),p(4),p(24),p(24),t=>t.isMobile&&ae(["display:flex;padding:",";","{font-size:",";}","{font-size:",";}","{padding:"," "," "," ",";border-bottom:"," solid ",";}","{margin-bottom:",";}"],p(0),kt,p(16),cr,p(14),st,p(20),p(16),p(26),p(16),p(1),({theme:n})=>n.colors.accentSecondary,pt,p(14)),p(768),p(24),p(40),p(1024),p(24),p(71),p(1280),p(24),p(84),p(1440),p(24),p(97),p(1920),p(24),p(132));k.div.withConfig({componentId:"sc-5894fcda-9"})(["font-size:",";display:flex;margin:0 ",";",";"],p(20),p(16),t=>t.theme.dir==="rtl"?ae(["order:3;"]):ae(["order:1;"]));const mr=k.div.withConfig({componentId:"sc-5894fcda-10"})(["display:grid;height:fit-content;grid-template-columns:auto;grid-gap:"," ",";",";",";",";"],p(20),p(58),t=>t.isMobile&&ae(["grid-gap:0;width:100%;"]),t=>!t.isMobile&&t.columns&&t.columns===2&&ae(["@media (min-width:","){grid-template-columns:37% auto;grid-gap:"," ",";}@media (min-width:","){grid-template-columns:35% auto;grid-gap:"," ",";}@media (min-width:","){grid-template-columns:34% auto;grid-gap:"," ",";}@media (min-width:","){grid-template-columns:36% auto;grid-gap:"," ",";}@media (min-width:","){grid-template-columns:30% auto;grid-gap:"," ",";}@media (min-width:","){grid-template-columns:30% auto;grid-gap:"," ",";}"],p(640),p(24),p(42),p(768),p(24),p(80),p(1024),p(24),p(95),p(1280),p(24),p(100),p(1440),p(24),p(113),p(1920),p(24),p(152)),t=>!t.isMobile&&t.columns&&t.columns===3&&ae(["grid-template-rows:auto;grid-template-columns:auto auto auto;grid-gap:0 ",";@media (max-width:","){grid-template-columns:auto auto;}@media (max-width:","){grid-template-columns:auto;}"],p(16),p(1024),p(620)));k.div.withConfig({componentId:"sc-5894fcda-11"})(["display:flex;flex-direction:column;flex:1 1 auto;min-width:",";"],p(550));const pd=({theme:t,redHighlight:n})=>n?t.colors.accentNegative:t.colors.accentPrimary,kd=({theme:t,blueHighlight:n,redHighlight:a})=>a?t.colors.accentNegative:n?"white":t.colors.accentPrimary,vd=({theme:t,blueHighlight:n,redHighlight:a})=>a?"transparent":n?t.colors.accentPrimary:"transparent",Ce=k.div.withConfig({componentId:"sc-5894fcda-12"})(["display:flex;flex-direction:column;flex:1 1 auto;",";",";"],t=>t.weightBold&&"font-weight: bold",t=>t.weightLighter&&"font-weight: lighter"),Ke=k.button.withConfig({componentId:"sc-5894fcda-13"})([""," width:",";min-height:",";height:auto;margin:"," ",";text-transform:uppercase;border-radius:",";border:"," solid ",";color:",";background-color:",";font-size:",";font-weight:bold;:hover{cursor:pointer;}:focus{outline:none;}",";",";"],wt,p(188),p(36),p(5),p(10),p(6),p(1),pd,kd,vd,({theme:t})=>t.fontSizes.small,t=>t.disabled&&ae(["opacity:0.4;cursor:not-allowed;pointer-events:none;"]),t=>t.isMobile&&ae(["font-weight:normal;font-size:",";border:none;letter-spacing:",";margin:0;padding:0;min-height:fit-content;width:fit-content;","{width:100%;}"],p(12),p(.39),Ce)),fr=k.div.withConfig({componentId:"sc-5894fcda-14"})(["margin:"," ",";"],p(8),p(10)),gr=k(Wi).withConfig({componentId:"sc-5894fcda-15"})(["position:absolute;top:0;right:0;color:",";width:",";height:",";margin:"," ",";:hover{cursor:pointer;}"],({theme:t})=>t.colors.accentNegative,p(24),p(24),p(24),p(40)),hr=k.button.withConfig({componentId:"sc-5894fcda-16"})([""," background-image:linear-gradient(225deg,#05e6a9 0%,#0575e6 100%);padding:"," 0;line-height:",";color:",";border:none;flex-direction:column;:hover{cursor:pointer;}"],wt,p(8),p(24),({theme:t})=>t.colors.textPrimary);class bd extends h.Component{constructor(){super(...arguments),this.articleLanguagesRef=h.createRef(),this.handleFocusLanguagesField=()=>
29{this.handleClickField(this.articleLanguagesRef)},this.resetFilters=()=>{this.props.handleFilter({languages:[],categories:[]})},this.resetFilterLanguages=()=>{this.props.handleFilter({languages:[]})},this.resetFilterCategories=()=>{this.props.handleFilter({categories:[]})},this.handleLanguageAddTag=n=>{const{handleFilter:a,filterData:o}=this.props,l=o.languages||[];l.find(d=>d===n.code)||a({languages:[...l,n.code]})},this.handleLanguageRemoveTag=n=>{const{handleFilter:a,filterData:o}=this.props,l=o.languages||[];a({languages:l.filter(d=>d!==n.code)})},this.handleCheckedCategory=n=>()=>{const{handleFilter:a,filterData:o}=this.props,l=o.categories||[],m=l.includes(n)?l.filter(u=>u!==n):[...l,n];a({categories:m})}}componentDidMount(){const{articles:n}=this.props;n&&this.props.checkCategories&&this.props.checkCategories(n)}componentDidUpdate(n){const{articles:a}=this.props;a&&!Es(n.articles,this.props.articles)&&this.props.checkCategories&&this.props.checkCategories(a)}handleClickField(n){const{scrollEventToFilter:a,isMobile:o}=this.props;a&&n.current!=null&&o&&a(n.current)}render(){const{intl:n,articles:a,isMobile:o,closeFilter:l,filterData:d}=this.props;return e.jsxs(ur,{isMobile:o,children:[!o&&e.jsx(dr,{children:n.formatMessage(te.filterHeader)}),e.jsxs(mr,{isMobile:o,columns:2,children:[e.jsx("div",{children:e.jsxs(st,{ref:this.articleLanguagesRef,children:[o&&e.jsx(qe,{isRight:!0,floatRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterLanguages,disabled:d.languages&&d.languages.length===0,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(pt,{children:e.jsx(kt,{children:n.formatMessage(te.filterSubHeaderLanguages)})}),e.jsx(qs,{dark:!0,noMargin:!0,reverse:!0,withTags:!0,blackListSelectedLangs:!0,selectedLangs:d.languages&&d.languages.map(m=>ks[m]).filter(m=>!!m),onSelect:this.handleLanguageAddTag,onRemove:this.handleLanguageRemoveTag,onFocusSearch:this.handleFocusLanguagesField})]})}),e.jsx("div",{children:e.jsxs(st,{children:[o&&e.jsx(qe,{isRight:!0,floatRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterCategories,disabled:d.categories&&d.categories.length===0,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(pt,{children:e.jsx(kt,{children:n.formatMessage(te.filterSubHeaderCategories)})}),e.jsx(qe,{isCenter:o,children:Object.keys(Lr).map((m,u)=>{const f=d.categories&&d.categories.includes(m);return e.jsx(O.Fragment,{children:e.jsx($s,{id:m,labelText:n.formatMessage(te[m]),defaultChecked:f,handleChange:this.handleCheckedCategory(m),isMobile:o,icon:e.jsx(vs,{type:m,defaultChecked:f})},`articleCheckBoxBubble_${m}_${u}`)},`articleCategory_${m}_${u}`)})})]})}),o&&e.jsxs(hr,{onClick:l,children:[e.jsx(Ce,{weightBold:!0,children:n.formatMessage(te.filterApplyAndClose)}),e.jsx(Ce,{weightLighter:!0,children:n.formatMessage(te.filterResultsFound,{number:a&&a.length})})]})]}),e.jsxs(qe,{isColumn:!0,isRight:!0,margin:"1rem 0 0 0",children:[!o&&e.jsx(Ke,{redHighlight:!0,onClick:this.resetFilters,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilters)})}),!o&&e.jsxs(O.Fragment,{children:[e.jsx(gr,{onClick:l}),e.jsx(fr,{children:n.formatMessage(te.filterResultsFound,{number:a&&a.length})})]})]})]})}}const yd=dt(ct),Sd=yd(bd),wd=k.form.withConfig({componentId:"sc-78e27b07-0"})(["border-bottom:1px solid ",";padding:0.25rem 1rem;color:",";justify-content:center;align-items:center;display:flex;transition:width 0.1s ease-in-out,border 0.4s ease,background-color 0.5s ease-in-out,box-shadow 0.2s ease-in;overflow:hidden;max-width:25rem;min-width:15rem;width:100%;",";:hover{cursor:pointer;}:focus{outline:none;}"],({theme:t})=>t.colors.borderPrimary,({theme:t})=>t.colors.borderPrimary,t=>t.focused&&ae(["border-bottom:1px solid ",";"],({theme:n})=>n.colors.textPrimary)),xd=k.input.withConfig({componentId:"sc-78e27b07-1"})(["padding:0 0.5rem;background:none;appearance:none;border:none;outline:0;font-size:",";color:",";::placeholder{color:",";font-family:",";}width:100%;"],({theme:t})=>t.fontSizes.button,({theme:t})=>t.colors.textPrimary,({theme:t})=>t.colors.borderPrimary,({theme:t})=>t.fonts.sans),Cd=k.button.withConfig({componentId:"sc-78e27b07-2"})(["",";color:",";width:1.25rem;padding:0.25rem;"],Or,({theme:t})=>t.colors.textPrimary),Nd=ve({placeholder:{id:"app.SearchFilter.placeholder",defaultMessage:"Search",description:"Placeholder for an empty search form"}});
29class jd extends h.PureComponent{constructor(){super(...arguments),this.state={focused:!1,query:this.props?.query||""},this.onFocus=()=>{this.setState({focused:!0}),this.input.select()},this.onBlur=()=>{this.setState({focused:!1})},this.onChange=n=>{n.preventDefault();const a=n.target.value;this.setState({query:a})},this.onSubmit=n=>{n.preventDefault();const{onSubmit:a}=this.props,o=this.state.query;a?a({query:o}):this.input.focus()},this.onInputRef=n=>{this.input=n}}render(){const{intl:n}=this.props,a=n.formatMessage(Nd.placeholder);return e.jsxs(wd,{focused:this.state.focused,method:"get",onSubmit:this.onSubmit,children:[e.jsx(xd,{dir:"auto",autoComplete:"off",type:"search",name:"q",placeholder:a,"aria-label":a,value:this.state.query,onFocus:this.onFocus,onBlur:this.onBlur,onChange:this.onChange,ref:this.onInputRef}),e.jsx(Cd,{type:"submit",children:e.jsx(Er,{})})]})}}const Md=dt(ct),Nt=Md(jd),Fd=`#import "@web/articles/graphql/fragments/ArticleCardArticle.graphql"
30#import "@web/articles/graphql/fragments/ArticleCardContent.graphql"
31
32query producerArticlesQuery(
33  $userId: ID!
34  $limit: Int
35  $offset: Int
36  $orderBy: OrderOption
37  $preferredLanguages: [String!]!
38  $filter: ArticlesFilter
39) {
40  user(id: $userId) {
41    id
42    articles(
43      limit: $limit
44      offset: $offset
45      orderBy: $orderBy
46      filter: $filter
47    ) {
48      id
49      ...ArticleCardArticle
50      content(preferredLanguages: $preferredLanguages) {
51        id
52        ...ArticleCardContent
53      }
54    }
55  }
56}
57`,qt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"producerArticlesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"OrderOption"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"ArticlesFilter"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"articles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ArticleCardArticle"},directives:[]},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ArticleCardContent"},directives:[]}]}}]}}]}}]}}],loc:{start:0,end:632,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Fd}}},pr=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};qt.definitions=pr(qt.definitions.concat(Os.definitions));qt.definitions=pr(qt.definitions.concat(Bn.definitions));const Pd=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Pd(qt,"producerArticlesQuery");const Td=`query ProducerAssetBaseData($userId: ID!, $type: String!) {
58  user(id: $userId) {
59    id
60    name
61    assetCountOwn(types: [$type])
62    articleCount
63    videoCount
64    magazineCount
65  }
66  viewer {
67    id
68  }
69}
70`,Id={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerAssetBaseData"}
70,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],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:"assetCountOwn"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"type"}}]}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"articleCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"videoCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"magazineCount"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"viewer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:248,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Td}}},Ht=(t=>{const{userId:n}=bs(),{data:a,loading:o}=ue(Id,{variables:{userId:n||"",type:t},skip:!n});return h.useMemo(()=>({data:a,loading:o,viewerIsUser:a&&n===a.viewer?.id}),[a,o,n])}),Dd=t=>e.jsx(St,{viewBox:"0 0 24 24",...t,children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",children:[e.jsx("rect",{x:".5",y:".5",width:"23",height:"23",rx:"1",ry:"1"}),e.jsx("path",{d:"M6.5.5v23m11-23v23M.5 6.49h6M.5 12h23m-23 5.5h6m11 0h6m-6-11.01h6"})]})}),Ad=t=>e.jsx(St,{viewBox:"0 0 26 26",...t,children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8.5 19.17H3.17C1.7 19.17.5 20.36.5 21.84s1.19 2.67 2.67 2.67h2.67a2.67 2.67 0 0 0 2.67-2.67v-2.67Zm16-2.67h-5.33c-1.47 0-2.67 1.19-2.67 2.67s1.19 2.67 2.67 2.67h2.67a2.67 2.67 0 0 0 2.67-2.67V16.5Z"}),e.jsx("path",{d:"M8.5 19.17v-16L24.5.5v16m-16-7.33 16-2.67"})]})}),Vd=t=>e.jsx(St,{viewBox:"0 0 24 24",...t,children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",children:[e.jsx("path",{d:"m23.5 10.51-6.23 6.37h-2.39v-2.45l6.22-6.37zM4.33 11.98H12m-7.67-4.9h12.46m-12.46 9.8h4.79"}),e.jsx("path",{d:"M21.97 3.57V2.03c0-.85-.69-1.53-1.53-1.53H2.03C1.18.5.5 1.19.5 2.03v19.93c0 .85.69 1.53 1.53 1.53h18.4c.85 0 1.53-.69 1.53-1.53v-1.5"})]})}),$d=t=>e.jsx(St,{viewBox:"0 0 24 24",...t,children:e.jsxs("g",{fill:"none",stroke:"currentColor",children:[e.jsx("rect",{x:".5",y:"16.64",width:"10",height:"6.86",rx:"1",ry:"1"}),e.jsx("rect",{x:".5",y:".5",width:"10",height:"13.14",rx:"1",ry:"1"}),e.jsx("rect",{x:"13.5",y:".5",width:"10",height:"6.86",rx:"1",ry:"1"}),e.jsx("rect",{x:"13.5",y:"10.36",width:"10",height:"13.14",rx:"1",ry:"1"})]})}),Rd=t=>e.jsx(St,{viewBox:"0 0 24 24",...t,children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",children:[e.jsx("rect",{x:".5",y:".5",width:"23",height:"23",rx:"1",ry:"1"}),e.jsx("circle",{cx:"15.57",cy:"7.73",r:"2.73"}),e.jsx("path",{d:"M16.37 23.5 6.51 11.22.5 17.36v4.93c0 .67.45 1.21 1 1.21zm0 0-2.88-3.59 5.01-4.63 5 4.63v2.59c0 .55-.45 1-1 1z"})]})});var Pe=(function(t){return t.Podcasts="podcasts",t.Videos="videos",t.Articles="articles",t.Images="images",t.Magazines="magazines",t.Watchlists="watchlists",t.Audios="audios",t})({});const qd={podcasts:e.jsx(Un,{}),videos:e.jsx(Dd,{}),articles:e.jsx(Vd,{}),images:e.jsx(Rd,{}),magazines:e.jsx($d,{}),watchlists:e.jsx(ii,{}),audios:e.jsx(Ad,{})},Ld={podcasts:zr.podcastSupport,videos:Xi.ProducerBannerCounterVideos,articles:Xi.ProducerBannerCounterArticles,images:Xi.ProducerBannerCounterImages,magazines:tt.Magazines,watchlists:K.producerWatchlistHeader,audios:F.audios},Ed={podcasts:{emptyContentMessage:Ne.noPodcastsCreated,actionType:"button",buttonMessage:Ne.producerPodcastNewPodcastButton},watchlists:{emptyContentMessage:K.noWatchlistsCreated,actionType:"button",buttonMessage:K.producerWatchlistNewWatchlistButton,hideMessageForNonOwners:!0},videos:{emptyContentMessage:_.MessagTextNoUploadsVideo,actionType:"navigation",navigationPath:t=>t.toPublisher()},articles:{emptyContentMessage:_.MessagTextNoUploadsArticles,actionType:"navigation",navigationPath:t=>t.toPublisher()},images:{emptyContentMessage:_.MessagTextNoUploadsImages,actionType:"navigation",navigationPath:t=>t.toMarketplaceOverview()},audios:{emptyContentMessage:_.MessageUserNotUploaded,actionType:"navigation",navigationPath:t=>t.toMarketplaceOverview()},magazines:{emptyContentMessage:_.MessagTextNoUploadsMagazines,actionType:"navigation",navigationPath:t=>t.toPublisher()}},$e=({contentType:t,viewerIsUserMessage:n,viewerIsUser:a=!1,userName:o,onCreateContent:l})=>{const d=T(),m=de(),{emptyContentMessage:u,actionType:f,buttonMessage:c,navigationPath:i,hideMessageForNonOwners:r}=Ed[t],s=qd[t],g=d.formatMessage(Ld[t]),S=a||!r;return e.jsxs(nd,{children:[e.jsxs(ad,{children:[e.jsx(rd,{children:s}),e.jsxs(od,{children:[g," 0"]})]}
70),S&&e.jsxs(sd,{children:[d.formatMessage(a?n??u:_.MessageUserNotUploaded,{name:o||""}),a&&f==="navigation"&&i&&e.jsx(dd,{href:i(m),children:d.formatMessage(_.MessageGetStarted)})]}),a&&f==="button"&&c&&e.jsx(ld,{variant:"outlined",color:"primary",onClick:l,children:d.formatMessage(c)})]})},Od=({userId:t,limit:n,sort:a,isMobile:o,showFilter:l,filterData:d,usedCategories:m,checkCategories:u,onChangeSort:f,showMenuLinks:c,filterCounter:i,handleSearchValue:r,handleToggleFilter:s,handleFilter:g,scrollToFilter:S})=>{const N=T(),x=Se(),{loading:j,data:w,viewerIsUser:P}=Ht("article"),{data:C,loading:v,fetchMore:b}=ue(qt,{variables:{userId:t,limit:n,offset:0,preferredLanguages:x,orderBy:a.sortValue.sort+a.sortDir}}),M=h.useMemo(()=>j||v,[v,j]),[R,B]=h.useMemo(()=>{const H=C?.user?.articles.length||0,q=H<(w?.user?.articleCount||0);return[H,q]},[C,w]),oe=h.useCallback(()=>{B&&b({variables:{limit:n,offset:R}})},[b,B,n,R]),Q=C?.user?.articles||[];return e.jsxs(Ct,{children:[e.jsx(J,{isCenter:!0,children:e.jsx(Nt,{onSubmit:r})}),e.jsxs(J,{children:[e.jsx(J,{children:c()}),e.jsxs(J,{isRight:!0,isColumn:o,children:[e.jsx(ar,{onClick:s,isHighlighted:o,children:e.jsxs(O.Fragment,{children:[!o&&i()!==""&&e.jsx(sr,{children:e.jsx($t,{children:i()})}),o?e.jsxs(O.Fragment,{children:[e.jsx($t,{children:i()}),e.jsx($t,{children:N.formatMessage(_.filterHeader)}),e.jsx(or,{})]}):e.jsx(rr,{})]})}),e.jsx(Gi,{id:"sort",label:a.sortValue.label,options:a.sortingList,onSelect:f,icon:e.jsx(di,{}),dark:!0,noBorder:!0,isHighlighted:o,fullWidth:o,noSpacer:o,sortDir:a.sortDir})]})]}),l&&e.jsx(lr,{children:e.jsx(Sd,{articles:Q,isMobile:o,usedCategories:m,filterData:d,handleFilter:g,closeFilter:s,checkCategories:u,scrollEventToFilter:S})}),Q&&!!Q.length&&e.jsx(xt,{onLoadMore:oe,hasMoreItems:B,children:Q.map((H,q)=>e.jsx(Fo,{article:kn(Os,H),content:kn(Bn,H.content)},`article-${q}`))}),!M&&Q.length<=0&&e.jsx($e,{contentType:Pe.Articles,viewerIsUser:P,viewerIsUserMessage:_.MessagTextNoUploadsArticles}),M&&e.jsx(J,{isCenter:!0,children:e.jsx(fe,{})})]})},kr=k.img.withConfig({componentId:"sc-aad227ba-0"})(["width:100%;height:100%;overflow:hidden;background-color:#000;object-fit:cover;transition:transform 0.5s cubic-bezier(0.2,0.8,0.2,1) 0s;"]),vr=k.aside.withConfig({componentId:"sc-aad227ba-1"})(["background-color:",";padding:0.625rem 0.75rem;flex:1 1 auto;justify-content:flex-end;display:flex;flex-direction:column;transform:translateZ(0);transition:background-color 0.5s cubic-bezier(0.2,0.8,0.2,1) 0s;"],({theme:t})=>t.colors.backgroundDark),zd=k.div.withConfig({componentId:"sc-aad227ba-2"})(["display:block;font-size:0.925rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-weight:500;color:",";"],({theme:t})=>t.colors.accentPrimary),_d=k.div.withConfig({componentId:"sc-aad227ba-3"})(["flex:1 1 auto;display:flex;flex-direction:column;height:100%;width:100%;text-decoration:none;color:",";background-color:",";cursor:pointer;overflow:hidden;position:relative;z-index:1;border-radius:",";line-height:1.8;transition:transform 0.5s cubic-bezier(0.2,0.8,0.2,1) 0s,background-color 0.5s cubic-bezier(0.2,0.8,0.2,1) 0s;:hover{color:",";","{transform:scale(1.05);}","{background-color:",";}}"],({theme:t})=>t.colors.textPrimary,({theme:t})=>t.colors.backgroundDark,p(6),({theme:t})=>t.colors.accentPrimary,kr,vr,({theme:t})=>t.colors.backgroundCard),Bd=({asset:t})=>{const n=de(),a=T(),o=h.useCallback(f=>{f.preventDefault(),window.open(n.toMarketplace(t.id),"_blank")},[t.id,n]),l=t.imageRepresentation?.href||No,d=t.name||a.formatMessage(F.unknown).toLocaleUpperCase(),m=t.owner?.name||a.formatMessage(F.unknown).toLocaleUpperCase(),u=t.state===0;return e.jsxs(_d,{title:d,onClick:o,children:[u&&e.jsx(Lo,{state:u?0:1,type:_r.IMAGE}),e.jsx(Br,{children:e.jsx(kr,{src:l,alt:""})}),e.jsxs(vr,{children:[e.jsx(zd,{children:d}),t.owner&&e.jsx(Ro,{authorName:m,authorId:t.owner.id})]})]})},Ud=O.memo(Bd),Wd={definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ImageCardAsset"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Asset"}},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:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageRepresentation"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"owner"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]},Hd=`#import "../../ImageCard/ImageCardAssetFragment.graphql"
71
72query producerAssetsQuery(
73  $userId: ID!
74  $limit: Int
75  $offset: Int
76  $orderAssetsBy: AssetOrder
77) {
78  assets(
79    limit: $limit
80    orderBy: $orderAssetsBy
81    offset: $offset
82    userIds: [$userId]
83    ownFiles: false
84    forSale: false
85    types: ["image"]
86  ) {
87    id
88    ...ImageCardAsset
89  }
90}
91`,Ci={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"producerAssetsQuery"}
91,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderAssetsBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"AssetOrder"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"assets"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderAssetsBy"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"userIds"}
91,value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"userId"}}]}},{kind:"Argument",name:{kind:"Name",value:"ownFiles"},value:{kind:"BooleanValue",value:!1}},{kind:"Argument",name:{kind:"Name",value:"forSale"},value:{kind:"BooleanValue",value:!1}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"ListValue",values:[{kind:"StringValue",value:"image",block:!1}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ImageCardAsset"},directives:[]}]}}]}}],loc:{start:0,end:400,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Hd}}},Qd=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ci.definitions=Qd(Ci.definitions.concat(Wd.definitions));const Gd=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Gd(Ci,"producerAssetsQuery");const Yd=({userId:t,limit:n,sort:a,isMobile:o,onChangeSort:l,handleSearchValue:d,showMenuLinks:m})=>{const{loading:u,viewerIsUser:f,data:c}=Ht("image"),{data:i,loading:r,fetchMore:s}=ue(Ci,{variables:{userId:t,limit:n,offset:0,orderAssetsBy:`${a.sortValue.sort}_${a.sortDir}`}}),g=h.useMemo(()=>u||r,[r,u]),[S,N]=h.useMemo(()=>{const j=i?.assets.length||0,w=j<(c?.user?.assetCountOwn||0);return[j,w]},[c,i]),x=h.useCallback(()=>{N&&s({variables:{limit:n,offset:S}})},[s,N,n,S]);return e.jsxs(Ct,{children:[e.jsx(J,{isCenter:!0,children:e.jsx(Nt,{onSubmit:d})}),e.jsxs(J,{children:[e.jsx(J,{children:m()}),e.jsx(J,{isRight:!0,isColumn:o,children:e.jsx(Gi,{id:"sort",label:a.sortValue.label,options:a.sortingList,onSelect:l,icon:e.jsx(di,{}),dark:!0,noBorder:!0,isHighlighted:o,fullWidth:o,noSpacer:o,sortDir:a.sortDir})})]}),!!i?.assets.length&&e.jsx(xt,{onLoadMore:x,hasMoreItems:N,children:i?.assets.map(j=>e.jsx(Ud,{asset:j},j.id))}),!g&&!i?.assets.length&&e.jsx($e,{contentType:Pe.Images,viewerIsUser:f,viewerIsUserMessage:_.MessagTextNoUploadsImages}),g&&e.jsx(J,{isCenter:!0,children:e.jsx(fe,{})})]})};class Kd extends h.Component{constructor(){super(...arguments),this.videoLanguagesRef=h.createRef(),this.handleFocusLanguagesField=()=>{this.handleClickField(this.videoLanguagesRef)},this.resetFilters=()=>{this.props.handleFilter({minDuration:0,maxDuration:this.props.durationUpperBound,languages:[],categories:[],licenses:void 0,subLicenses:void 0,youthProtection:Re.UNLOCKED})},this.resetFilterDuration=()=>{this.props.handleFilter({minDuration:0,maxDuration:this.props.durationUpperBound})},this.resetFilterLanguages=()=>{this.props.handleFilter({languages:[]})},this.resetFilterCategories=()=>{this.props.handleFilter({categories:[],youthProtection:this.props.filterData.youthProtection})},this.resetFilterYouthProtection=()=>{this.props.handleFilter({youthProtection:Re.UNLOCKED})},this.resetFilterLicenses=()=>{this.props.handleFilter({licenses:void 0,subLicenses:void 0})},this.handleLanguageAddTag=n=>{const{handleFilter:a}=this.props,o=this.props.filterData.languages||[];o.find(l=>l===n.code)||a({languages:[...o,n.code]})},this.handleLanguageRemoveTag=n=>{const{handleFilter:a}=this.props,o=this.props.filterData.languages||[];a({languages:o.filter(l=>
91l!==n.code)})},this.handleDurationMinMax=n=>{const{handleFilter:a}=this.props,[o,l]=n;a({minDuration:o,maxDuration:l<this.props.durationUpperBound?l:this.props.durationUpperBound})},this.handleCheckedCategory=n=>()=>{const{handleFilter:a,filterData:o}=this.props,l=o.categories||[],m=l.includes(n)?l.filter(u=>u!==n):[...l,n];a({categories:m})},this.handleChangeYouthProtection=n=>{const{handleFilter:a}=this.props,o=n.value;if(!Object.values(Re).includes(o))throw new Error(`Illegal option value for video youth protection: ${o}`);a({youthProtection:o})},this.handleChangeLicenses=(n,a)=>{const{handleFilter:o}=this.props;o({licenses:n,subLicenses:a})}}componentDidMount(){const{videos:n}=this.props;n&&this.props.checkCategories&&this.props.checkCategories(n)}componentDidUpdate(n){const{videos:a}=this.props;a&&!Es(n.videos,a)&&this.props.checkCategories&&this.props.checkCategories(a)}handleClickField(n){const{scrollEventToFilter:a,isMobile:o}=this.props;a&&n.current!=null&&o&&a(n.current)}render(){const{intl:n,isMobile:a,videos:o,closeFilter:l,filterData:d}=this.props,m=new Map([[Re.UNLOCKED,{value:Re.UNLOCKED,label:n.formatMessage(pi.unlocked)}],[Re.ADULT,{value:Re.ADULT,label:n.formatMessage(pi.adult)}]]);return e.jsxs(ur,{isMobile:a,children:[!a&&e.jsx(dr,{children:n.formatMessage(te.filterHeader)}),e.jsxs(mr,{isMobile:a,columns:2,children:[e.jsxs("div",{children:[e.jsxs(st,{children:[a&&e.jsx(qe,{isRight:!0,floatRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterDuration,disabled:d.minDuration===0&&d.maxDuration===this.props.durationUpperBound,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(pt,{children:e.jsxs("div",{style:{display:"flex"},children:[e.jsx(kt,{children:n.formatMessage(te.filterSubHeaderDuration)}),e.jsx(cr,{children:n.formatMessage(te.filterSubHeaderInMinutes)})]})}),e.jsx(Oo,{domain:[0,this.props.durationUpperBound],maxUpperBound:this.props.durationUpperBound,values:[d.minDuration,d.maxDuration],count:6,onChange:this.handleDurationMinMax,isMobile:a,lastLabel:"∞"})]}),e.jsxs(st,{ref:this.videoLanguagesRef,children:[a&&e.jsx(qe,{isRight:!0,floatRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterLanguages,disabled:d.languages&&d.languages.length===0,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(pt,{children:e.jsx(kt,{children:n.formatMessage(te.filterSubHeaderLanguages)})}),e.jsx(qs,{noMargin:!0,dark:!0,reverse:!0,withTags:!0,blackListSelectedLangs:!0,selectedLangs:d.languages&&d.languages.map(u=>ks[u]).filter(u=>!!u),onSelect:this.handleLanguageAddTag,onRemove:this.handleLanguageRemoveTag,onFocusSearch:this.handleFocusLanguagesField})]}),e.jsxs(st,{children:[a&&e.jsx(qe,{isRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterYouthProtection,disabled:d.youthProtection&&d.youthProtection===Re.UNLOCKED,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(pt,{children:e.jsx(kt,{children:n.formatMessage(te.filterSubHeaderYouthProtection)})}),e.jsx(gd,{label:d.youthProtection===Re.UNLOCKED?n.formatMessage(pi.unlocked):n.formatMessage(pi.adult),options:[...m.values()],onSelect:this.handleChangeYouthProtection,dark:!0})]}),e.jsxs(st,{children:[a&&e.jsx(qe,{isRight:!0,floatRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterLicenses,disabled:d.licenses===void 0,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(hd,{license:d.licenses,subLicense:d.subLicenses,changeLicenses:this.handleChangeLicenses,noPaddingHorizontal:!0,noPaddingVertical:!0,fullWidth:!0,dark:!0})]})]}),e.jsx("div",{children:e.jsxs(st,{children:[a&&e.jsx(qe,{isRight:!0,floatRight:!0,margin:"0 0 1rem 0",children:e.jsx(Ke,{isMobile:!0,redHighlight:!0,onClick:this.resetFilterCategories,disabled:!d.categories||d.categories.length===0,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilter)})})}),e.jsx(pt,{children:e.jsx(kt,{children:n.formatMessage(te.filterSubHeaderCategories)})}),e.jsx(qe,{isCenter:a,children:Object.keys(Ur).map((u,f)=>{const c=d.categories&&d.categories.includes(u),i=u.toLowerCase();return e.jsx(O.Fragment,{children:e.jsx($s,{id:u,labelText:n.formatMessage(te[i]),defaultChecked:c,handleChange:this.handleCheckedCategory(u),isMobile:a,icon:e.jsx(vs,{type:u,defaultChecked:c})},`contentCheckBoxBubble_${u}_${f}`)},`contentCategory_${u}_${f}`)})})]})}),a&&e.jsxs(hr,{onClick:l,children:[e.jsx(Ce,{weightBold:!0,children:n.formatMessage(te.filterApplyAndClose)}),e.jsx(Ce,{weightLighter:!0,children:n.formatMessage(te.filterResultsFound,{number:o&&o.length})})]})]}),e.jsxs(qe,{isColumn:!0,isRight:!0,margin:"1rem 0 0 0",children:[!a&&e.jsx(Ke,{redHighlight:!0,onClick:this.resetFilters,children:e.jsx(Ce,{children:n.formatMessage(te.resetFilters)})}),!a&&e.jsxs(O.Fragment,{children:[e.jsx(gr,{onClick:l}),e.jsx(fr,{children:n.formatMessage(te.filterResultsFound,{number:o&&o.length})})]})]})]})}}const Zd=dt(ct),Xd=Zd(Kd),Jd=k.div.withConfig({componentId:"sc-cadf8dda-0"})(["width:100%;position:relative;color:",";display:flex;justify-content:center;align-items:center;border-radius:",";height:",";border:1px solid rgb(57,68,79);",";"],({theme:t})=>t.colors.textPrimary,p(4),p(106),t=>t.img?`background: linear-gradient(to bottom, rgba(11, 14, 19, 0.14) 0%, rgba(11, 14, 19, 0.7) 100%), url(${t.img}) no-repeat center center; background-size: cover`:"background: linear-gradient(-180deg, rgb(45, 56, 67) 0%, rgb(20, 26, 32) 100%)"),ec=k.div.withConfig({componentId:"sc-cadf8dda-1"})(["position:relative;min-width:calc(50vw - 28px);@media (min-width:","){min-width:calc(33.3vw - 24px);}@media (min-width:","){min-width:auto;}"],({theme:t})=>`${t.newScreenBreakpoints.small}px`,({theme:t})=>`${t.screenBreakpoints.small}
91px`),ka=k.div.withConfig({componentId:"sc-cadf8dda-2"})(["padding-top:",";@media (min-width:","){display:block;position:absolute;width:100%;bottom:0;padding:",";}"],p(14),({theme:t})=>`${t.screenBreakpoints.small}px`,p(14)),xn=k.div.withConfig({componentId:"sc-cadf8dda-3"})(["text-align:start;font-size:",";font-weight:500;letter-spacing:",";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"],p(18),p(.5)),Cn=k.div.withConfig({componentId:"sc-cadf8dda-4"})(["text-align:start;color:",";font-size:",";font-weight:500;letter-spacing:",";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"],({theme:t})=>t.colors.textSecondary,p(12),p(.5)),tc=k.div.withConfig({componentId:"sc-cadf8dda-5"})(["width:100%;display:flex;font-size:",";line-height:",";padding:"," 0 0 0;@media (min-width:","){text-align:end;display:block;position:absolute;top:0;padding:"," ",";}"],p(11),p(13),p(14),({theme:t})=>`${t.screenBreakpoints.small}px`,p(12),p(16)),ic=k.div.withConfig({componentId:"sc-cadf8dda-6"})(["font-weight:bold;text-align:start;font-size:14px;@media (min-width:","){font-size:16px;}"],({theme:t})=>`${t.screenBreakpoints.small}px`),nc=k.div.withConfig({componentId:"sc-cadf8dda-7"})(["font-size:14px;line-height:14px;text-align:start;"]),ac=k.div.withConfig({componentId:"sc-cadf8dda-8"})(["width:100%;line-height:",";text-align:center;"],p(26));k.div.withConfig({componentId:"sc-cadf8dda-9"})(["color:",";font-size:0.65rem;line-height:0.65rem;"],({theme:t})=>t.colors.textPrimary);const va=k.div.withConfig({componentId:"sc-cadf8dda-10"})(["color:",";height:",";","{margin-bottom:",";font-size:",";line-height:",";@media (min-width:","){font-size:",";line-height:",";}}","{font-size:",";line-height:",";}@media (min-width:","){overflow:visible;display:flex;align-items:center;justify-content:center;color:",";text-decoration:none;border-radius:",";height:",";width:100%;position:relative;line-height:1.8;background:transparent;",";}"],({theme:t})=>t.colors.textPrimary,p(180),xn,p(4),p(14),p(16),({theme:t})=>`${t.screenBreakpoints.small}px`,p(16),p(20),Cn,p(12),p(13),({theme:t})=>`${t.screenBreakpoints.small}px`,({theme:t})=>t.colors.textPrimary,p(4),p(210),t=>t.img?`background: linear-gradient(to bottom, rgba(11, 14, 19, 0.14) 0%, rgba(11, 14, 19, 0.7) 100%), url(${t.img}) no-repeat center center; background-size: cover`:"background: linear-gradient(-180deg, rgb(45, 56, 67) 0%, rgb(20, 26, 32) 100%)"),ba=k.button.withConfig({componentId:"sc-cadf8dda-11"})(["padding:",";position:absolute;bottom:0;",";z-index:1;background-color:transparent;border:none;color:white;font-size:1.25rem;:hover{color:",";cursor:pointer;}:focus{outline:none;}"],t=>t.isMobile?`${p(14)} 0 0 ${p(14)}`:`${p(14)}`,In("0"),({theme:t})=>t.colors.accentPrimary),sc=k.div.withConfig({componentId:"sc-cadf8dda-12"})(["background-color:",";width:16rem;left:0;margin-top:0.5rem;padding:1rem;"],({theme:t})=>t.colors.backgroundPrimary2),rc=k.div.withConfig({componentId:"sc-cadf8dda-13"})(["font-size:0.75rem;font-weight:bold;color:",";padding:0 0 0.75rem 0;text-transform:uppercase;"],({theme:t})=>t.colors.textSecondary),oc=k.div.withConfig({componentId:"sc-cadf8dda-14"})(["font-size:0.75rem;color:",";line-height:16px;"],({theme:t})=>t.colors.textSecondary),ya=({watchlistData:t,showWatchlistHover:n})=>{const a=T();return e.jsx(e.Fragment,{children:n&&t?.videoCount!==0?e.jsxs(Ye,{justifyCenter:!0,children:[e.jsx(zo,{children:e.jsx(ys,{})}),e.jsxs(Ye,{column:!0,fitContent:!0,justifyCenter:!0,children:[e.jsx(ic,{children:a.formatMessage(F.watchNow)}),e.jsx(nc,{children:a.formatMessage(K.cardVideoCounter,{count:t?.videoCount||0})})]})]}):e.jsxs(Ye,{column:!0,alignCenter:!0,children:[e.jsx(ni,{size:ai.Big,children:e.jsx(ii,{})}),e.jsx(ac,{children:a.formatMessage(K.cardVideoCounter,{count:t?.videoCount||0})})]})})},Sa=({watchlistData:t})=>{const n=T();return e.jsxs(tc,{children:[e.jsx(ni,{size:ai.Small,children:t.state===Xt.Private?e.jsx(Dn,{}):t.state===Xt.Public?e.jsx(An,{}):e.jsx(Vn,{})}),e.jsx(yn,{size:Zt.Small,children:n.formatMessage(ye[t.state])})]})},wa=({watchlistData:t,mobile:n,showState:a,noHover:o})=>{const[l,d]=h.useState(!1),m=h.useCallback(()=>{o||d(!0)},[o]),u=h.useCallback(()=>{o||d(!1)},[o]);return e.jsx(e.Fragment,{children:n?e.jsxs(va,{onPointerEnter:m,onPointerLeave:u,children:[e.jsx(Jd,{img:t.watchlistThumbnail?.href,children:e.jsx(ya,{watchlistData:t,showWatchlistHover:l})}),e.jsxs(ka,{children:[e.jsx(xn,{children:t.title}),e.jsx(Cn,{children:t.owner.name})]}),a&&e.jsx(Sa,{watchlistData:t})]}):e.jsxs(va,{img:t.watchlistThumbnail?.href,onPointerEnter:m,onPointerLeave:u,children:[e.jsx(ya,{watchlistData:t,showWatchlistHover:l}),a&&e.jsx(Sa,{watchlistData:t}),e.jsxs(ka,{children:[e.jsx(xn,{children:t.title}),e.jsx(Cn,{children:t.owner.name})]})]})})},lc=({watchlistData:t,content:n})=>{const a=de(),o=h.useMemo(()=>t.firstVideoId!==null?`${a.toVideo(t.firstVideoId)}?watchlist=${t.id}`:"",[a,t.firstVideoId,t.id]),l=h.useCallback(d=>{d.stopPropagation()},[]);return e.jsx(Ie,{to:o,onClick:l,children:n})},dc=()=>{const t=T();return e.jsxs(sc,{children:[e.jsx(rc,{children:t.formatMessage(F.information)}),e.jsx(oc,{children:t.formatMessage(K.watchlistNoPublicVideos)})]})},xa=({watchlistData:t,cardIndex:n,width:a,isMobile:o,handleOpenEditorWatchlist:l,handleOpenModal:d,selectedIdxCard:m,isViewer:u,hideMenu:f})=>{const{formatMessage:c}=T(),[i,r]=h.useState(!1),s=Wr("right","left"),g=h.useCallback(N=>{l?.(N)},[l]),S=h.useMemo(()=>[{type:"button",content:c(K.cardMenuOpenEditor),props:{onClick:g},closeContextMenuOnClick:!0},{type:"button",content:c(K.cardMenuDeleteWatchlist),props:{onClick:d}}],[c,g,d]);return e.jsxs(ec,{style:{width:a},children:[t&&t.videoCount!=0?e.jsx(lc,{watchlistData:t,content:e.jsx(wa,{mobile:o,watchlistData:t,showState:!0})}):e.jsx(wa,{mobile:o,watchlistData:t,showState:!0}),u&&!f&&e.jsx(Hr,{items:S,targetAttachment:`bottom ${s}`,menuAttachment:`top ${s}`,children:(N,x)=>e.jsx(ba,{isMobile:o,onClick:()=>{N(),m?.(n)},ref:x,children:e.jsx(_s,{})})}),!u&&t&&t.videoCount===0&&e.jsx(vn,{attachment:`top ${s}`,targetAttachment:`bottom ${s}`,renderTarget:N=>e.jsx(ba,{isMobile:o,ref:N,onMouseOver:()=>r(!0),onMouseOut:()=>r(!1),children:e.jsx(Ss,{})}),renderElement:N=>i&&e.jsx("div",{ref:N,children:e.jsx(dc,{})})})]})},cc=`#import "../fragments/ProducerVideos.graphql"
92
93query ProducerWatchlistVideosQuery(
94  $watchlistId: ID!
95  $preferredLanguages: [String!]!
96) {
97  watchlist(id: $watchlistId) {
98    id
99    owner {
100      id
101    }
102    watchlistThumbnail: thumbnail {
103      href
104    }
105    videos {
106      id
107      ...ProducerVideos
108    }
109  }
110}
111`,Ni={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerWatchlistVideosQuery"}
111,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"watchlistId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"watchlist"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"watchlistId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owner"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"watchlistThumbnail"},name:{kind:"Name",value:"thumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"videos"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideos"},directives:[]}]}}]}}]}}],loc:{start:0,end:356,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:cc}}},uc=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ni.definitions=uc(Ni.definitions.concat(Qn.definitions));const mc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};mc(Ni,"ProducerWatchlistVideosQuery");const fc=({watchlistData:t,onClose:n,onDeleteWatchlist:a})=>{const o=T(),l=Se(),d=me(),m=ge(),{error:u,success:f,graphqlError:c}=Z(),{data:i,loading:r}=ue(Ni,{variables:{watchlistId:t?.id,preferredLanguages:l}}),[s,g]=h.useState([]),[S,N]=h.useState(t.state),[x,j]=h.useState(t.title),[w,P]=h.useState(Ki(t.videoCount||0)),[C,v]=h.useState(),[b,M]=h.useState();h.useEffect(()=>{P(Ki(t.videoCount||0))},[t.videoCount]),h.useEffect(()=>{const $=[];t.categories.map(U=>{const ce={id:U,message:{id:`VideoSettings.category${U.charAt(0).toUpperCase()+U.slice(1)}`,defaultMessage:U.charAt(0).toUpperCase()+U.slice(1)}};$.push(ce)}),g($)},[t.categories]),h.useEffect(()=>{!r&&i?.watchlist?.watchlistThumbnail?.href!==b&&M(i?.watchlist?.watchlistThumbnail?.href)},[i,r,b]);const[R]=W(Ho,{onCompleted:$=>{f(o.formatMessage(K.notificationWatchlistUpdateSuccess,{title:$.updateWatchlist.title}))},onError:c}),[B]=W(rl,{onCompleted:()=>{f(o.formatMessage(K.notificationWatchlistRemoveVideoSuccess,{title:""}))},onError:$=>u($.message)}),oe=h.useCallback($=>{P($)},[]),Q=h.useCallback($=>{s&&!s.find(U=>U.id===$.id)&&g([...s||[],$])},[s]),H=h.useCallback($=>{const U=s?.filter(ce=>ce.id!==$.id);g(U)},[s]),q=h.useCallback($=>{j($.currentTarget.value.trim())},[]),G=h.useCallback($=>{N($.value)},[]),X=h.useMemo(()=>Object.values(Xt).map($=>({value:$,label:o.formatMessage(ye[$]),icon:$===Xt.Private?Dn:$===Xt.Public?An:Vn})),[o]),be=h.useCallback($=>{$&&v($)},[]),Te=h.useCallback(()=>{oe(Ki(t.videoCount||0)),R({variables:{watchlistId:t.id,data:{title:x,state:S,thumbnailAssetId:C,videoOrder:w,categories:Object.values(s).map($=>
111$.id)}}})},[oe,R,t.id,t.videoCount,S,C,x,w,s]),xe=h.useCallback($=>{d.current&&(Te(),n&&n($))},[d,n,Te]),A=h.useCallback(async $=>{const U=$.videoIndex||0;let ce=w.slice();const jt=ce.indexOf(U);ce.splice(jt,1),ce=ce.map(V=>V>U?V-1:V),await B({variables:{videoId:$.videoId,videoIndex:U,watchlistId:$.watchlistId,preferredLanguages:l}}),P(ce)},[l,B,w]),E=h.useCallback(()=>{if(i?.watchlist)return e.jsxs(O.Fragment,{children:[e.jsx(Go,{}),e.jsx(nt,{isEnd:!0,children:e.jsxs(Yo,{onClick:n,children:[e.jsx(Ft,{children:o.formatMessage(K.closeButton)}),e.jsx(Wi,{})]})}),e.jsxs(sa,{noMargin:!0,children:[e.jsx(ra,{href:b,children:e.jsx(ni,{size:ai.Big,children:e.jsx(ii,{})})}),e.jsxs(oa,{children:[e.jsx(Ft,{size:Zt.Medium,isStart:!0,children:t.title}),e.jsx(Ft,{size:Zt.Small,isStart:!0,children:t.owner.name}),e.jsx(Ft,{upperCase:!0,size:Zt.Small,onClick:a,children:o.formatMessage(K.cardMenuDeleteWatchlist)})]})]}),e.jsxs(nt,{margin:!0,children:[e.jsx(Pt,{children:e.jsx(ei,{onChange:q,placeholder:t.title})}),e.jsx(Pt,{children:e.jsx(la,{dark:!0,noMargin:!0,label:S?o.formatMessage(ye[S]):o.formatMessage(ye[t.state]),options:X,onSelect:G})}),e.jsx(Pt,{children:e.jsx(na,{isRequired:s.length<1,selectedCategories:s,optionsSmall:!0,onSelect:Q,onRemove:H})})]}),e.jsx(Ft,{size:Zt.Medium,children:o.formatMessage(K.cardVideoCounter,{count:t.videoCount||0})})]})},[Q,H,G,q,o,n,a,X,S,b,s,t,i?.watchlist]),ee=h.useCallback(()=>{if(i?.watchlist)return e.jsxs(O.Fragment,{children:[e.jsx(ra,{href:b,children:e.jsx(ni,{size:ai.Biggest,children:e.jsx(ii,{})})}),e.jsxs(oa,{children:[e.jsx(nt,{children:e.jsx("div",{children:e.jsxs(Pt,{isFlex:!0,children:[e.jsx(Ko,{children:o.formatMessage(K.editorEditWatchlistName)}),e.jsx(ei,{simple:!0,ref:$=>$&&$.focus(),onChange:q,placeholder:t.title})]})})}),e.jsxs(nt,{children:[e.jsx(Zo,{children:t.owner.name}),e.jsx(da,{}),e.jsx(Ft,{children:o.formatMessage(K.cardVideoCounter,{count:t.videoCount||0})}),e.jsx(da,{}),e.jsx(Pt,{fitContent:!0,children:e.jsx(la,{dark:!0,noBorder:!0,noMargin:!0,label:S?o.formatMessage(ye[S]):o.formatMessage(ye[t.state]),options:X,onSelect:G})})]})]}),e.jsx(Xo,{children:e.jsx(Pt,{children:e.jsx(na,{isRequired:s.length<1,selectedCategories:s,optionsSmall:!0,onSelect:Q,onRemove:H})})})]})},[G,q,Q,H,o,X,S,b,s,t,i?.watchlist]),he=i?.watchlist,pe=le(`(max-width: ${m.newScreenBreakpoints.small-1}px)`),Qe=le(`(max-width: ${m.newScreenBreakpoints.large-1}px)`);return r?e.jsx(nt,{isCenter:!0,children:e.jsx(fe,{})}):e.jsxs("div",{children:[pe&&e.jsx(nt,{children:E()}),!pe&&Qe&&e.jsx(nt,{isCenter:!0,children:ee()}),!Qe&&e.jsx(sa,{children:ee()}),he&&e.jsx(Qo,{watchlistData:he,removeVideo:A,watchlistThumbnailId:C,setWatchlistThumbnailId:be,setOrderOfVideos:oe,watchlistVideoOrder:w||[],withState:!0}),e.jsxs(nt,{isCenter:!0,children:[e.jsx(L,{variant:"outlined",color:"negative",onClick:n,children:o.formatMessage(K.closeButton)}),e.jsx(L,{variant:"outlined",color:"primary",onClick:xe,children:o.formatMessage(K.saveCloseButton)}),e.jsx(L,{variant:"outlined",color:"primary",onClick:Te,children:o.formatMessage(K.saveButton)})]})]})},gc=`#import "./ProducerWatchlist.graphql"
112
113fragment ProducerDataWatchlistsWithoutVideos on User {
114  id
115  name
116  watchlists {
117    id
118    ...ProducerWatchlist
119  }
120}
121`,_e={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProducerDataWatchlistsWithoutVideos"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},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:"watchlists"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerWatchlist"},directives:[]}]}}]}}],loc:{start:0,end:197,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:gc}}},hc=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};_e.definitions=hc(_e.definitions.concat(Gn.definitions));const pc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
121{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};pc(_e,"ProducerDataWatchlistsWithoutVideos");const kc=`#import "../fragments/ProducerDataWatchlistsWithoutVideos.graphql"
122
123query ProducerWatchlistQuery($id: ID!) {
124  user(id: $id) {
125    id
126    ...ProducerDataWatchlistsWithoutVideos
127  }
128}
129`,ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerWatchlistQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerDataWatchlistsWithoutVideos"},directives:[]}]}}]}}],loc:{start:0,end:221,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:kc}}},vc=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};ji.definitions=vc(ji.definitions.concat(_e.definitions));const bc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};bc(ji,"ProducerWatchlistQuery");const yc=((t,n)=>{const a=n.data;if(!a)return;const o=a.createWatchlist.owner.id;let l=t.readFragment({id:`User:${o}`,fragmentName:"ProducerDataWatchlistsWithoutVideos",fragment:_e});if(!l)return;const d={...a.createWatchlist,__typename:"Watchlist"};l=ci(l,{watchlists:m=>m?[...m,d]:[d]}),l&&t.writeFragment({id:`User:${o}`,fragmentName:"ProducerDataWatchlistsWithoutVideos",fragment:_e,data:l})}),Sc=((t,n)=>{const a=n.data;if(!a)return;const o=a.deleteWatchlist.owner.id;let l=t.readFragment({id:`User:${o}`,fragmentName:"ProducerDataWatchlistsWithoutVideos",fragment:_e});if(!l)return;const d=l.watchlists.findIndex(m=>m.id===a.deleteWatchlist.id);d>=0&&(l=ci(l,{watchlists:{$splice:[[d,1]]}}),t.writeFragment({id:`User:${o}`,fragmentName:"ProducerDataWatchlistsWithoutVideos",fragment:_e,data:l}))}),wc=((t,n)=>{const a=n.data;if(!a)return;const o=a.updateUser.id;let l=t.readFragment({id:`User:${o}`,fragmentName:"ProducerDataWatchlistsWithoutVideos",fragment:_e});if(!l)return;const d={...a.updateUser};l=ci(l,{watchlists:{$set:d.watchlists}}),t.writeFragment({id:`User:${o}`,fragmentName:"ProducerDataWatchlistsWithoutVideos",fragment:_e,data:l})}),xc=`#import "../fragments/ProducerWatchlist.graphql"
130
131mutation deleteWatchlist($watchlistId: ID!) {
132  deleteWatchlist(watchlistId: $watchlistId) {
133    id
134    ...ProducerWatchlist
135  }
136}
137`,Mi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteWatchlist"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"watchlistId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteWatchlist"},arguments:[{kind:"Argument",name:{kind:"Name",value:"watchlistId"},value:{kind:"Variable",name:{kind:"Name",value:"watchlistId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerWatchlist"},directives:[]}]}}]}}],loc:{start:0,end:219,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:xc}}},Cc=t=>{const n={};
137return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Mi.definitions=Cc(Mi.definitions.concat(Gn.definitions));const Nc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Nc(Mi,"deleteWatchlist");const jc=`#import "./ProducerDataRoles.graphql"
138#import "./ProducerDataSocials.graphql"
139fragment ProducerData on User {
140  id
141  ...ProducerDataRoles
142  ...ProducerDataSocials
143  name
144  country
145  languages
146  videoCount
147  articleCount
148  followerCount
149  followingCount
150  magazineCount
151  assetCountOwn(types: ["image"])
152  planId
153  avatarAssetId
154  avatarProducer: avatar {
155    href
156  }
157  backgroundAssetId
158  background {
159    href
160  }
161  viewerIsFollowing
162  channels {
163    id
164    platformId
165    platform
166  }
167  whitelistShortcuts {
168    name
169    url
170    isDefault
171  }
172}
173`,et={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProducerData"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerDataRoles"},directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerDataSocials"},directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"videoCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"articleCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followerCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"followingCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"magazineCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"assetCountOwn"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"ListValue",values:[{kind:"StringValue",value:"image",block:!1}]}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"planId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"avatarAssetId"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"avatarProducer"},name:{kind:"Name",value:"avatar"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"backgroundAssetId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"background"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"viewerIsFollowing"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"channels"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"platformId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"platform"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"whitelistShortcuts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isDefault"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:586,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:jc}}},br=t=>{const n={};
173return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};et.definitions=br(et.definitions.concat(ll.definitions));et.definitions=br(et.definitions.concat(dl.definitions));const Mc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Mc(et,"ProducerData");const Fc=`#import "@web/app/graphql/fragments/ProducerData.graphql"
174#import "@web/app/graphql/fragments/ProducerWatchlist.graphql"
175
176mutation watchlists_updateUser($input: UpdateUserDataInput!) {
177  updateUser(input: $input) {
178    id
179    podcastsCount
180    ...ProducerData
181    watchlists {
182      id
183      ...ProducerWatchlist
184    }
185  }
186}
187`,Lt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"watchlists_updateUser"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateUserDataInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"podcastsCount"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerData"},directives:[]},{kind:"Field",name:{kind:"Name",value:"watchlists"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerWatchlist"},directives:[]}]}}]}}]}}],loc:{start:0,end:363,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Fc}}},yr=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Lt.definitions=yr(Lt.definitions.concat(et.definitions));Lt.definitions=yr(Lt.definitions.concat(Gn.definitions));const Pc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Pc(Lt,"watchlists_updateUser");const Tc=({userId:t,isViewer:n,widthCards:a})=>{const o=O.createRef(),l=T(),d=ge(),{graphqlError:m,success:u}=Z(),[f,c]=h.useState(!1),[i,r]=h.useState(!1),[s,g]=h.useState(-1),[S,N]=h.useState(!1),[x,j]=h.useState(-1),[w,P]=h.useState([]),[C,v]=h.useState(0),{data:b,loading:M}=ue(ji,{variables:{id:t}});h.useEffect(()=>{const z=()=>{if(!o.current)return;const se=o.current.getBoundingClientRect();v(se.width)};return z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}},[o]);const[R]=W(Lt,{update:wc,onCompleted:()=>{u(l.formatMessage(K.notificationUpdateWatchlistOrderSuccess))},onError:z=>m(z)}),B=h.useCallback(()=>{c(!0)},[]),oe=h.useCallback(()=>{c(!1)},[]),[Q,{loading:H}]=W(ol,{update:yc,onCompleted:z=>{oe(),u(l.formatMessage(K.notificationWatchlistCreateSuccess,{title:z.createWatchlist.title}))},onError:z=>m(z)}),[q]=W(Mi,{update:Sc,onCompleted:z=>{u(l.formatMessage(K.notificationWatchlistDeleteSuccess,{title:z.deleteWatchlist.title}))},onError:z=>m(z)}),G=h.useCallback(z=>{const se=b?.user?.watchlists,Qt=[];se?.map((Gt,Rr)=>{Qt[z.indexOf(Rr)]=Gt.id}),P(Qt)},[b]),X=h.useCallback(async()=>{const z=b?.user?.name;await R({variables:{input:{name:z,orderedWatchlistIds:w}}}),r(!1)},[b,R,w]),be=h.useCallback(()=>{r(!i)},[i]),Te=h.useCallback((z,se,Qt)=>{Q({variables:{data:{title:z,categories:Object.values(se).map(Gt=>Gt.id),state:Qt}}})},[Q]),xe=h.useCallback(()=>{g(x)},[x]),A=h.useCallback(()=>{g(-1)},[]),E=h.useCallback(z=>{const se=z;(se||se===0)&&j(se)},[]),ee=h.useCallback(()=>{N(!0)},[]),he=h.useCallback(()=>{N(!1)},[]),pe=h.useCallback(z=>se=>{q({variables:{watchlistId:z.id}}).then(()=>{A(se),he(se)})},[q,he,A]),Qe=h.useCallback(z=>{const se=Object.values(z).find((Qt,Gt)=>Gt===x);return e.jsx(O.Fragment,{children:se&&e.jsx(Be,{className:"producerWatchlistDelete",showModal:!0,onRequestClose:he,variant:"flatRounded",size:"small",overflow:"auto",children:e.jsxs(_o,{children:[e.jsx(aa,{children:l.formatMessage(K.deleteWatchlistAlertHeader)}),e.jsx(Bo,{children:e.jsx(ft,{})}),e.jsxs(Ye,{column:!0,alignCenter:!0,children:[e.jsx(Ji,{children:l.formatMessage(K.deleteWatchlistAlertText1)}),e.jsx(Ji,{bold:!0,children:l.formatMessage(K.deleteWatchlistAlertTextNames,{watchlistName:se.title,state:se.state})}),e.jsx(Ji,{children:l.formatMessage(K.deleteWatchlistAlertText2)}
187)]}),e.jsxs(Ye,{justifyCenter:!0,flexWrap:!0,marginTop:"1.5rem",children:[e.jsx(L,{variant:"outlined",color:"negative",onClick:he,children:l.formatMessage(I.cancel)}),e.jsx(L,{variant:"outlined",color:"primary",onClick:pe(se),children:l.formatMessage(I.delete)})]})]})})})},[x,he,pe,l]),$=le(`(max-width: ${d.screenBreakpoints.small}px)`),U=le(`(max-width: ${d.screenBreakpoints.mobile}px)`),ce=le(`(max-width: ${d.screenBreakpoints.tablet}px)`);if(M||!b)return null;let jt,V=null;if(b){const{user:z}=b;z!=null&&(jt=z,V=jt.watchlists)}const ne=$&&a?a/2-8:a||320,Ge=$?180:210;return e.jsxs(O.Fragment,{children:[V!==null&&V.length>0?e.jsxs(Ye,{flexWrap:!0,spaceBetween:!0,marginTop:U?"2rem":"0",children:[e.jsxs(aa,{children:[e.jsx(ni,{size:ai.Big,children:e.jsx(ii,{})}),e.jsx(yn,{children:l.formatMessage(K.producerWatchlistHeader)}),e.jsx("div",{children:e.jsx(yn,{children:V.length})})]}),e.jsxs(Ye,{marginBottom:"1rem",justifyCenter:$,fitContent:!ce,flexWrap:U,children:[n&&V!==null&&V.length>=2&&e.jsx(L,{variant:i?"contained":"outlined",color:"default",onClick:be,children:l.formatMessage(I.edit)}),n&&V!==null&&V.length>0&&e.jsx(L,{variant:"outlined",color:"primary",onClick:B,children:l.formatMessage(K.producerWatchlistNewWatchlistButton)})]})]}):e.jsx(Uo,{borderBottom:!0,children:e.jsx($e,{contentType:Pe.Watchlists,viewerIsUser:!!n,onCreateContent:B,viewerIsUserMessage:K.noWatchlistsCreated})}),M?e.jsx(Ye,{justifyCenter:!0,children:e.jsx(fe,{})}):e.jsx(O.Fragment,{children:V&&V.length>0&&e.jsxs(Wo,{ref:o,children:[i?e.jsx(Bs,{setOrderOfContent:G,widthContent:ne,heightContent:Ge,widthParent:C,children:V&&V.map((z,se)=>e.jsx(xa,{watchlistData:z,cardIndex:se,width:ne,isMobile:$,selectedIdxCard:E,isViewer:n,hideMenu:!0},z.id))}):e.jsx(Hs,{indicators:!0,inlineControls:!0,dark:!0,marginRightPX:16,widthChildren:ne,childrenNoZIndex:!0,watchlist:!0,children:V&&V.map((z,se)=>e.jsx(xa,{watchlistData:z,cardIndex:se,width:ne,isMobile:$,handleOpenEditorWatchlist:xe,handleOpenModal:ee,selectedIdxCard:E,isViewer:n},z.id))}),e.jsx(Ye,{justifyCenter:!0,children:i&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outlined",color:"primary",onClick:X,children:l.formatMessage(I.save)}),e.jsx(L,{variant:"outlined",color:"negative",onClick:be,children:l.formatMessage(I.cancel)})]})}),n&&s>-1&&e.jsx(fc,{onDeleteWatchlist:ee,onClose:A,watchlistData:V[s]}),S&&Qe(V)]})}),f&&e.jsx(Po,{onClose:oe,onSave:Te,isMobile:U,isLoading:H})]})},Ic=`#import "@web/app/graphql/fragments/ProducerDataWatchlists.graphql"
188#import "@web/app/graphql/fragments/ProducerDataPodcasts.graphql"
189
190query producerUserQuery($userId: ID!, $preferredLanguages: [String!]!) {
191  viewer {
192    id
193    ...ProducerDataWatchlists
194    ...ProducerDataPodcasts
195  }
196  user(id: $userId) {
197    id
198    name
199  }
200}
201`,Et={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"producerUserQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},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:"FragmentSpread",name:{kind:"Name",value:"ProducerDataWatchlists"},directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerDataPodcasts"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:370,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Ic}}},Sr=t=>{const n={};
201return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Et.definitions=Sr(Et.definitions.concat(kl.definitions));Et.definitions=Sr(Et.definitions.concat(vl.definitions));const Dc=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Dc(Et,"producerUserQuery");const wr=({userId:t,userName:n,limit:a,videos:o,viewerIsUser:l,videosLoading:d,getVideoCardWidth:m,getVideoCardHeight:u,onLoadMore:f,hasMoreItems:c,usePortrait:i})=>{const r=Se(),{data:s}=ue(Et,{variables:{userId:t,preferredLanguages:r}}),g=h.useCallback(w=>{m(w)},[m]),S=h.useCallback(w=>{u&&u(w)},[u]),N=o?.filter(w=>!!w?.track)||[],x=le("(min-width: 641px) and (max-width: 1024px)");let j;return i&&(j=x?4:6),N?e.jsx(e.Fragment,{children:d?e.jsx(bl,{limit:a,type:Qr.Landscape,fullWidth:!0}):e.jsx(xt,{onLoadMore:f,hasMoreItems:c,portrait:i,columns:j,children:N.filter(w=>w.track!=null).map((w,P)=>e.jsx(Eo,{user:s?.user?.id===s?.viewer?.id?s?.viewer:s?.user,video:w,track:w.track,watchlists:s?.viewer?.watchlists,podcasts:s?.viewer?.podcasts,getVideoCardWidth:g,getVideoCardHeight:S,portrait:i,verticalsSource:"producer"},`video-${P}`))})}):e.jsx($e,{contentType:Pe.Videos,viewerIsUser:l,viewerIsUserMessage:_.MessagTextNoUploadsImages,userName:n})},Ac=`#import "@web/app/graphql/fragments/ProducerVideos.graphql"
202
203query producerVideosQuery(
204  $userId: ID!
205  $limit: Int
206  $offset: Int
207  $orderBy: OrderOption
208  $preferredLanguages: [String!]!
209  $filter: VideosFilter
210) {
211  user(id: $userId) {
212    id
213    videos(
214      limit: $limit
215      offset: $offset
216      orderBy: $orderBy
217      filter: $filter
218      preferredLanguages: $preferredLanguages
219    ) {
220      id
221      ...ProducerVideos
222    }
223  }
224}
225`,Fi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"producerVideosQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"OrderOption"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"VideosFilter"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"videos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}
225},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideos"},directives:[]}]}}]}}]}}],loc:{start:0,end:484,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Ac}}},Vc=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Fi.definitions=Vc(Fi.definitions.concat(Qn.definitions));const $c=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};$c(Fi,"producerVideosQuery");const Rc=({userId:t,limit:n,showFilter:a,isMobile:o,verticalOnly:l,noVerticals:d,sort:m,filterData:u,durationUpperBound:f,usedCategories:c,handleToggleFilter:i,scrollToFilter:r,onChangeSort:s,filterCounter:g,checkCategories:S,handleFilter:N,handleSearchValue:x,showMenuLinks:j})=>{const w=T(),P=Se(),C=me(),[v,b]=h.useState(),{loading:M,data:R,viewerIsUser:B}=Ht("video"),{data:oe,loading:Q,fetchMore:H}=ue(Fi,{variables:{userId:t,preferredLanguages:P,limit:n,orderBy:m.sortValue.sort+m.sortDir,filter:{query:u.query,languages:u.languages,minDuration:u.minDuration&&u.minDuration*60||null,maxDuration:u.maxDuration&&u.maxDuration<=f-20?u.maxDuration*60:null,categories:u.categories,licenses:u.licenses?[u.licenses]:null,subLicenses:u.subLicenses?[u.subLicenses]:null,youthProtection:u.youthProtection,verticalOnly:l,noVerticals:d}}}),q=M||Q,G=oe?.user?.videos.length||0,[X,be]=h.useState(!1);h.useEffect(()=>{G===n?be(!0):G<n&&be(!1)},[n,G]);const Te=h.useCallback(async()=>{if(!q&&X){const E=await H({variables:{limit:n,offset:G}});C.current&&be(!!E.data.user?.videos.length)}},[H,X,C,n,q,G]),xe=oe?.user?.videos||[],A=h.useCallback(E=>{b(E)},[]);return e.jsxs(Ct,{children:[e.jsx(J,{isCenter:!0,children:e.jsx(Nt,{onSubmit:x})}),e.jsxs(J,{children:[e.jsx(J,{children:j()}),e.jsxs(J,{isRight:!0,isColumn:o,children:[e.jsx(ar,{onClick:i,isHighlighted:o,children:e.jsxs(O.Fragment,{children:[!o&&g()!==""&&e.jsx(sr,{children:e.jsx($t,{children:g()})}),o?e.jsxs(O.Fragment,{children:[e.jsx($t,{children:g()}),e.jsx($t,{children:w.formatMessage(_.filterHeader)}),e.jsx(or,{})]}):e.jsx(rr,{})]})}),e.jsx(Gi,{id:"sort",label:m.sortValue.label,options:m.sortingList,onSelect:s,icon:e.jsx(di,{}),dark:!0,noBorder:!0,isHighlighted:o,fullWidth:o,noSpacer:o,sortDir:m.sortDir})]})]}),a&&e.jsx(lr,{children:e.jsx(Xd,{videos:xe,isMobile:o,usedCategories:c,filterData:u,durationUpperBound:f,handleFilter:N,checkCategories:S,closeFilter:i,scrollEventToFilter:r})}),!l&&e.jsxs(e.Fragment,{children:[e.jsx(Tc,{userId:t,isViewer:B,widthCards:v}),!!xe.length&&e.jsx(nr,{children:B?w.formatMessage(_.myVideosHeader):w.formatMessage(_.videosHeader)})]}),xe&&!!xe.length&&e.jsx(wr,{userId:t,userName:R?.user?.name,limit:n,videos:xe,viewerIsUser:B,videosLoading:q,getVideoCardWidth:A,onLoadMore:Te,hasMoreItems:X,usePortrait:l}),!q&&xe.length<=0&&e.jsx($e,{contentType:Pe.Videos,viewerIsUser:B,viewerIsUserMessage:_.MessagTextNoUploadsVideo}),q&&e.jsx(J,{isCenter:!0,children:e.jsx(fe,{})})]})},qc=`query producerMagazinesQuery(
226  $userId: ID!
227  $limit: Int
228  $offset: Int
229  $preferredLanguages: [String!]!
230  $orderBy: OrderOption
231  $query: String
232) {
233  user(id: $userId) {
234    id
235    magazines(
236      limit: $limit
237      offset: $offset
238      orderBy: $orderBy
239      query: $query
240    ) {
241      id
242      state
243      headerColor
244
245      headerImage {
246        id
247        imageRepresentation {
248          href
249        }
250      }
251
252      title(preferredLanguages: $preferredLanguages) {
253        langCode
254        value
255      }
256
257      owner {
258        id
259        name
260        background {
261          href
262        }
263      }
264
265      titles {
266        langCode
267        value
268      }
269      createdAt
270    }
271  }
272}
273`,Lc={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"producerMagazinesQuery"}
273,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"OrderOption"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"magazines"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headerColor"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headerImage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageRepresentation"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"owner"},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:"background"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"titles"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:734,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:qc}}},Ec=({loadingDelete:t,deleteValue:n,closeModal:a,deleteAndCloseModal:o})=>{const{formatMessage:l}=T();return e.jsxs(e.Fragment,{children:[e.jsx(Gr,{children:e.jsx(ft,{})}),e.jsx(Yr,{isCenter:!0,children:n?e.jsxs(e.Fragment,{children:[e.jsx(Xn,{children:l(yl.ModalDeleteMagazine)}),e.jsx(Xn,{bold:!0,children:n})]}):e.jsx(fe,{})}),e.jsxs(Kr,{isCenter:!0,children:[e.jsx(L,{variant:"outlined",color:"primary",onClick:o,disabled:t,children:t?e.jsx(fe,{size:"21px"}):l(I.delete)}),e.jsx(L,{variant:"outlined",color:"negative",onClick:a,children:l(I.cancel)})]})]})},Oc=({editLinkTo:t,deleteValue:n,toggleButtonRef:a,loadingDelete:o,closeMenu:l,onDelete:d})=>{const{formatMessage:m}=T(),{openModal:u,closeModal:f,updateModal:c}=$n(),i=h.useRef(null),r=h.useRef(0),s=h.useCallback(()=>{r.current&&(l(),f(r.current),r.current=0)},[l,f]),g=h.useCallback(async()=>{await d()&&s()},[d,s]),S=h.useMemo(()=>({variant:"flatRounded",onCloseCallback:s,size:"small",modalContent:e.jsx(Ec,{loadingDelete:o,deleteValue:n,deleteAndCloseModal:g,closeModal:s})}),[o,n,g,s]);h.useEffect(()=>{r.current&&S&&c(S)},[r,S,c]);const N=h.useCallback(()=>{r.current=u(S)},[S,u]);return h.useEffect(()=>{const x=j=>{!i?.current?.contains(j.target)&&!a?.current?.contains(j.target)&&!r.current&&l()};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[i,a,l]),e.jsxs(ws,{ref:i,children:[e.jsx(Zr,{to:t,children:m(I.edit)}),e.jsx(Xr,{onClick:N,children:m(I.delete)})]})},zc=({magazine:t})=>{const{formatMessage:n,formatDisplayName:a}=T(),{deleteMagazine:o,loading:l}=Ys(),{success:d}=Z(),m=de(),u=Ue(We)===t.owner.id,{id:f,titles:c,title:i,owner:r}=t,[s,g]=h.useState(!1),S=c?.map(j=>({key:j.langCode,langCode:j.langCode,name:j.langCode.startsWith("c-")&&a(j.value,{fallback:"none",type:"language"})||"",to:m.toMagazineLang(f,j.langCode)})).sort((j,w)=>j.langCode.localeCompare(w.langCode)),N=h.useCallback(j=>{j?.stopPropagation(),g(w=>!w)},[]),x=h.useCallback(async()=>(await o(t.id))?.data?(setTimeout(()=>{d(n(Ks.deleteMagazineSuccess))},500),!0):!1,[t.id,o,d,n]);return e.jsx(qo,{to:m.toMagazine(f),title:i?.value||"",description:"",langCode:i?.langCode||"",authorName:r.name,authorId:r.id,languages:S,noOverlayPlay:!0,isViewer:u,toggleMenu:N,showMenu:s,thumbnailSrc:t?.headerImage?.imageRepresentation?.href||(t?.headerColor?void 0:t.owner?.background?.href),bGcolor:t?.headerColor,cardMenu:e.jsx(Oc,{loadingDelete:l,editLinkTo:m.toEditMagazine(f),deleteValue:i?.value||"",closeMenu:()=>g(!1),onDelete:x})})},_c=({userId:t,limit:n,isMobile:a,sort:o,onChangeSort:l,handleSearchValue:d,showMenuLinks:m,query:u})=>{const f=Se(),{loading:c,viewerIsUser:i,data:r}=Ht("magazine"),{data:s,loading:g,fetchMore:S}=ue(Lc,{variables:{userId:t,limit:n,offset:0,preferredLanguages:f,orderBy:o.sortValue.sort+o.sortDir,query:u}}),N=s?.user?.magazines,x=c||g,[j,w]=h.useMemo(()=>{const C=N?.length||0,v=C<(r?.user?.magazineCount||0);return[C,v]},[r,N]),P=h.useCallback(()=>{w&&S({variables:{limit:n,offset:j}})},[S,w,n,j]);return e.jsxs(Ct,{children:[e.jsx(J,{isCenter:!0,children:e.jsx(Nt,{onSubmit:d})}),e.jsxs(J,{children:[e.jsx(J,{children:m()}),e.jsx(J,{isRight:!0,isColumn:a,children:e.jsx(Gi,{id:"sort",label:o.sortValue.label,options:o.sortingList,onSelect:l,icon:e.jsx(di,{}),dark:!0,noBorder:!0,isHighlighted:a,fullWidth:a,noSpacer:a,sortDir:o.sortDir})})]}),x?e.jsx(J,{isCenter:!0,children:e.jsx(fe,{})}):N?.length?e.jsx(xt,{onLoadMore:P,hasMoreItems:w,children:N.map((C,v)=>e.jsx(zc,{magazine:C},v))}):e.jsx($e,{contentType:Pe.Magazines,viewerIsUser:i,viewerIsUserMessage:_.MessagTextNoUploadsMagazines})]})},Bc=k.div.withConfig({componentId:"sc-8cec7447-0"})(["width:100%;position:relative;color:",";display:flex;justify-content:center;align-items:center;border-radius:",";height:",";border:1px solid rgb(57,68,79);",";"],({theme:t})=>t.colors.textPrimary,p(4),p(106),t=>t.img?`background: linear-gradient(to bottom, rgba(11, 14, 19, 0.14) 0%, rgba(11, 14, 19, 0.7) 100%), url(${t.img}) no-repeat center center; background-size: cover`:"background: linear-gradient(-180deg, rgb(45, 56, 67) 0%, rgb(20, 26, 32) 100%)"),Uc=k.div.withConfig({componentId:"sc-8cec7447-1"})(["position:relative;min-width:calc(50vw - 28px);@media (min-width:","){min-width:calc(33.3vw - 24px);}@media (min-width:","){min-width:auto;}"],({theme:t})=>`${t.newScreenBreakpoints.small}px`,({theme:t})=>`${t.screenBreakpoints.small}px`),Ca=k.div.withConfig({componentId:"sc-8cec7447-2"})(["padding-top:",";@media (min-width:","){display:block;position:absolute;width:100%;bottom:0;padding:",";}"],p(14),({theme:t})=>`${t.screenBreakpoints.small}px`,p(14)),Nn=k.div.withConfig({componentId:"sc-8cec7447-3"})(["text-align:start;font-size:",";font-weight:500;letter-spacing:",";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"],p(18),p(.5)),jn=k.div.withConfig({componentId:"sc-8cec7447-4"})(["text-align:start;color:",";font-size:",";font-weight:500;letter-spacing:",";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"],({theme:t})=>t.colors.textSecondary,p(12),p(.5)),Wc=k.div.withConfig({componentId:"sc-8cec7447-5"})(["width:100%;display:flex;font-size:",";line-height:",";padding:"," 0 0 0;@media (min-width:","){text-align:end;display:block;position:absolute;top:0;padding:"," ",";}"],p(11),p(13),p(14),({theme:t})=>`${t.screenBreakpoints.small}px`,p(12),p(16)),Hc=k.div.withConfig({componentId:"sc-8cec7447-6"})(["font-weight:bold;text-align:start;font-size:14px;@media (min-width:","){font-size:16px;}"],({theme:t})=>`${t.screenBreakpoints.small}
273px`),Qc=k.div.withConfig({componentId:"sc-8cec7447-7"})(["font-size:14px;line-height:14px;text-align:start;"]),Gc=k.div.withConfig({componentId:"sc-8cec7447-8"})(["width:100%;line-height:",";text-align:center;"],p(26));k.div.withConfig({componentId:"sc-8cec7447-9"})(["color:",";font-size:0.65rem;line-height:0.65rem;"],({theme:t})=>t.colors.textPrimary);const Na=k.div.withConfig({componentId:"sc-8cec7447-10"})(["color:",";height:",";","{margin-bottom:",";font-size:",";line-height:",";@media (min-width:","){font-size:",";line-height:",";}}","{font-size:",";line-height:",";}@media (min-width:","){overflow:visible;display:flex;align-items:center;justify-content:center;color:",";text-decoration:none;border-radius:",";height:",";width:100%;position:relative;line-height:1.8;background:transparent;",";}"],({theme:t})=>t.colors.textPrimary,p(180),Nn,p(4),p(14),p(16),({theme:t})=>`${t.screenBreakpoints.small}px`,p(16),p(20),jn,p(12),p(13),({theme:t})=>`${t.screenBreakpoints.small}px`,({theme:t})=>t.colors.textPrimary,p(4),p(210),t=>t.img?`background: linear-gradient(to bottom, rgba(11, 14, 19, 0.14) 0%, rgba(11, 14, 19, 0.7) 100%), url(${t.img}) no-repeat center center; background-size: cover`:"background: linear-gradient(-180deg, rgb(45, 56, 67) 0%, rgb(20, 26, 32) 100%)"),Yc=k(ws).withConfig({componentId:"sc-8cec7447-11"})(["position:absolute;top:0;",";right:1rem;"],In("-0.5rem")),Kc=k(Jr).withConfig({componentId:"sc-8cec7447-12"})(["padding:0;"]),ja=k.button.withConfig({componentId:"sc-8cec7447-13"})(["padding:",";position:absolute;bottom:0;",";z-index:1;background-color:transparent;border:none;color:white;font-size:1.25rem;:hover{color:",";cursor:pointer;}:focus{outline:none;}"],t=>t.isMobile?`${p(14)} 0 0 ${p(14)}`:`${p(14)}`,In("0"),({theme:t})=>t.colors.accentPrimary),Zc=k.div.withConfig({componentId:"sc-8cec7447-14"})(["background-color:",";width:16rem;left:0;margin-top:0.5rem;padding:1rem;"],({theme:t})=>t.colors.backgroundPrimary2),Xc=k.div.withConfig({componentId:"sc-8cec7447-15"})(["font-size:0.75rem;font-weight:bold;color:",";padding:0 0 0.75rem 0;text-transform:uppercase;"],({theme:t})=>t.colors.textSecondary),Jc=k.div.withConfig({componentId:"sc-8cec7447-16"})(["font-size:0.75rem;color:",";line-height:16px;"],({theme:t})=>t.colors.textSecondary),Ma=({videoCount:t,showPodcastHover:n})=>{const{formatMessage:a}=T();return e.jsx(e.Fragment,{children:n&&t!==0?e.jsxs(ot,{justifyCenter:!0,children:[e.jsx(To,{children:e.jsx(ys,{})}),e.jsxs(ot,{column:!0,fitContent:!0,justifyCenter:!0,children:[e.jsx(Hc,{children:a(F.watchNow)}),e.jsx(Qc,{children:a(F.episodes,{count:t||0})})]})]}):e.jsxs(ot,{column:!0,alignCenter:!0,children:[e.jsx(Wn,{size:Hn.Big,children:e.jsx(Un,{})}),e.jsx(Gc,{children:a(F.episodes,{count:t||0})})]})})},Fa=({state:t})=>{const{formatMessage:n}=T();return e.jsxs(Wc,{children:[e.jsx(Wn,{size:Hn.Small,children:t===Jn.Private?e.jsx(Dn,{}):t===Jn.Public?e.jsx(An,{}):e.jsx(Vn,{})}),e.jsx(bn,{size:Io.Small,children:n(ye[t])})]})},eu=({podcastData:t,mobile:n,showState:a,noHover:o})=>{const[l,d]=h.useState(!1),m=h.useCallback(()=>{o||d(!0)},[o]),u=h.useCallback(()=>{o||d(!1)},[o]);return e.jsx(e.Fragment,{children:n?e.jsxs(Na,{onPointerEnter:m,onPointerLeave:u,children:[e.jsx(Bc,{img:t.thumbnail?.href,children:e.jsx(Ma,{videoCount:t.episodesCount||0,showPodcastHover:l})}),e.jsxs(Ca,{children:[e.jsx(Nn,{children:t.podcastSelectedMeta.title}),e.jsx(jn,{children:t.owner?.name})]}),a&&e.jsx(Fa,{state:t.state})]}):e.jsxs(Na,{img:t.thumbnail?.href,onPointerEnter:m,onPointerLeave:u,children:[e.jsx(Ma,{videoCount:t.episodesCount||0,showPodcastHover:l}),a&&e.jsx(Fa,{state:t.state}),e.jsxs(Ca,{children:[e.jsx(Nn,{children:t.podcastSelectedMeta.title}),e.jsx(jn,{children:t.owner?.name})]})]})})},tu=({linkTo:t,handleOpenModal:n,podcast:a})=>{const{formatMessage:o}=T(),{openModal:l}=h.useContext(Rn),d=h.useCallback(f=>f.stopPropagation(),[]),m=h.useCallback(()=>{l({variant:"flatRounded",header:o(wn.publish),headerIcon:e.jsxs(e.Fragment,{children:[e.jsx(Sn,{})," "]}),modalContent:e.jsx(Zs,{podcast:a})})},[l,o,a]),u=h.useCallback(f=>{f.stopPropagation(),n&&n(f)},[n]);return e.jsxs(Kc,{children:[e.jsx(Zi,{href:t,onClick:d,children:o(Ne.cardMenuOpenEditor)}),e.jsx(Zi,{onClick:m,children:o(wn.publish)}),e.jsx(Zi,{onClick:u,children:o(Ne.cardMenuDeletePodcast)})]})},iu=()=>{const{formatMessage:t}=T();return e.jsxs(Zc,{children:[e.jsx(Xc,{children:t(F.information)}),e.jsx(Jc,{children:t(Ne.podcastNoPublicVideos)})]})},Pa=({podcastData:t,cardIndex:n,setSelectedPodcast:a,width:o,isMobile:l,handleOpenModal:d,selectedIdxCard:m,isViewer:u,noMenu:f})=>{const c=de(),i=h.useRef(null),r=h.useRef(null),[s,g]=h.useState(!1),[S,N]=h.useState(!1),x=h.useCallback(P=>{P.stopPropagation(),N(!S),m&&m(n)},[n,m,S]),j=h.useCallback(()=>{a(t.id)},[t,a]),w=h.useCallback(P=>{!i.current?.contains(P.target)&&!r?.current?.contains(P.target)&&N(!1)},[r]);return h.useEffect(()=>(window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)),[w]),e.jsxs(Uc,{style:{width:o},onClick:j,children:[e.jsx(eu,{mobile:l,podcastData:t,showState:!0}),u&&!f&&e.jsx(vn,{attachment:"top right",targetAttachment:l?"bottom right":"middle center",constraints:[{to:"window",attachment:"together"}],renderTarget:P=>e.jsx(ja,{isMobile:l,ref:C=>{P.current=C,r.current=C},onClick:x,children:e.jsx(_s,{})}),renderElement:P=>S&&e.jsx("div",{ref:P,children:e.jsx(Yc,{ref:i,children:e.jsx(tu,{linkTo:c.toPodcast(t.id),handleOpenModal:d,podcast:t})})})}),!u&&t&&t.episodesCount===0&&e.jsx(vn,{attachment:"top right",targetAttachment:l?"bottom right":"middle center",renderTarget:P=>e.jsx(ja,{isMobile:l,ref:P,onMouseOver:()=>g(!0),onMouseOut:()=>g(!1),children:e.jsx(Ss,{})}),renderElement:P=>s&&e.jsx("div",{ref:P,children:e.jsx(iu,{})})})]})},nu=`#import "../fragments/ProducerDataPodcastsWithoutVideos.graphql"
274
275query ProducerPodcastQuery($id: ID!, $preferredLanguages: [String!]!) {
276  user(id: $id) {
277    id
278    ...ProducerDataPodcastsWithoutVideos
279  }
280}
281`,Pi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerPodcastQuery"}
281,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerDataPodcastsWithoutVideos"},directives:[]}]}}]}}],loc:{start:0,end:248,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:nu}}},au=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Pi.definitions=au(Pi.definitions.concat(ri.definitions));const su=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};su(Pi,"ProducerPodcastQuery");const ru=(t=>(n,a)=>{const o=a.data;if(!o)return;const l=o.createPodcast.owner?.id;let d=n.readFragment({id:`User:${l}`,fragmentName:"ProducerDataPodcastsWithoutVideos",fragment:ri,variables:{preferredLanguages:t}});if(!d)return;const m={...o.createPodcast,__typename:"Podcast"};d=ci(d,{podcasts:u=>u?[...u,m]:[m]}),d&&n.writeFragment({id:`User:${l}`,fragmentName:"ProducerDataPodcastsWithoutVideos",fragment:ri,data:d})}),ou=(t=>(n,a)=>{if(!a.data)return;const o=a.data.deletePodcast,l=n.identify({__typename:"User",id:t});n.modify({broadcast:!1,id:l,fields:{podcasts(d){const m=n.identify(o);if(m)return d?.filter(u=>u==null?!0:n.identify(u)!==m)},removedPodcasts(d,{toReference:m}){const u=m(o);return u?[u,...d]:d},podcastsCount(d){return Math.max(0,d-1)},removedPodcastsCount(d){return d+1}}})}),lu=`mutation deletePodcast($podcastId: ID!) {
282  deletePodcast(podcastId: $podcastId) {
283    id
284  }
285}
286`,xr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deletePodcast"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"podcastId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletePodcast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"podcastId"},value:{kind:"Variable",name:{kind:"Name",value:"podcastId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:134,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:lu}}},du=((t,n)=>{const a=n.data;if(!a)return;const o=a.updateUser.id;let l=t.readFragment({id:`User:${o}`,fragmentName:"ProducerDataPodcastsWithoutVideos",fragment:ri});if(!l)return;const d={...a.updateUser};l=ci(l,{podcasts:{$set:d.podcasts}}),t.writeFragment({id:`User:${o}`,fragmentName:"ProducerDataPodcastsWithoutVideos",fragment:ri,data:l})}),cu=`#import "@web/app/graphql/fragments/ProducerData.graphql"
287#import "@web/app/graphql/fragments/ProducerPodcast.graphql"
288
289mutation podcasts_updateUser(
290  $input: UpdateUserDataInput!
291  $preferredLanguages: [String!]!
292) {
293  updateUser(input: $input) {
294    id
295    ...ProducerData
296    podcasts(limit: 0) {
297      id
298      ...ProducerPodcast
299    }
300  }
301}
302`,Ot={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"podcasts_updateUser"}
302,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateUserDataInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerData"},directives:[]},{kind:"Field",name:{kind:"Name",value:"podcasts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"0"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerPodcast"},directives:[]}]}}]}}]}}],loc:{start:0,end:385,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:cu}}},Cr=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ot.definitions=Cr(Ot.definitions.concat(et.definitions));Ot.definitions=Cr(Ot.definitions.concat(Do.definitions));const uu=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};uu(Ot,"podcasts_updateUser");const Nr=({showModal:t,title:n,state:a,handleDeletePodcast:o,closeDeleteModal:l,mutationLoading:d})=>{const m=T(),u=h.useMemo(()=>{if(a){const f=ye[a];return f?m.formatMessage(f):a}return m.formatMessage(F.unknown)},[m,a]);return e.jsx(Be,{className:"producerTableContent",showModal:!!t,header:m.formatMessage(Ne.cardMenuDeletePodcast),onRequestClose:l,size:"small",variant:"flatRounded",ariaHideApp:!1,overflow:"auto",children:e.jsxs(Ao,{children:[e.jsx(Vo,{children:e.jsx(ft,{})}),e.jsx(hi,{children:d?e.jsx(fe,{}):e.jsxs(e.Fragment,{children:[e.jsx(hi,{children:m.formatMessage(Ne.deletePodcastAlertText1)}),e.jsx(hi,{bold:!0,children:m.formatMessage(Ne.deletePodcastAlertTextNames,{podcastName:n,state:u})})]})}),e.jsx(hi,{children:m.formatMessage(Ne.deletePodcastAlertText2)}),e.jsxs(ot,{justifyCenter:!0,flexWrap:!0,marginTop:"1.5rem",children:[e.jsx(L,{variant:"outlined",color:"primary",onClick:o,disabled:d,children:m.formatMessage(I.delete)}),e.jsx(L,{variant:"outlined",color:"negative",onClick:l,disabled:d,children:m.formatMessage(I.cancel)})]})]})})},mu=({userId:t,isViewer:n,widthCards:a,setSelectedPodcast:o})=>{const l=Se(),d=O.createRef(),m=T(),u=ge(),{graphqlError:f,success:c}=Z(),[i,r]=h.useState(!1),[s,g]=h.useState(!1),[S,N]=h.useState(!1),[x,j]=h.useState(-1),[w,P]=h.useState(0),[C,v]=h.useState([]),{data:b,loading:M}=ue(Pi,{variables:{id:t,preferredLanguages:l}});h.useEffect(()=>{const V=()=>{if(!d.current)return;const ne=d.current.getBoundingClientRect();P(ne.width)};return V(),window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}},[d]);const[R]=W(Ot,{update:du,onCompleted:()=>{c(m.formatMessage(Ne.notificationUpdatePodcastOrderSuccess))},onError:f}),[B]=W(Qs,{update:ru(l),onCompleted:V=>{r(!1),c(m.formatMessage(Ne.notificationPodcastCreateSuccess,{title:V.createPodcast.podcastSelectedMeta.title}))},onError:f}),[oe]=W(xr,{update:ou(t),onError:f}),Q=h.useCallback(V=>{const ne=b?.user?.podcasts,Ge=[];ne?.map((z,se)=>
302{Ge[V.indexOf(se)]=z?.id||""}),v(Ge)},[b]),H=h.useCallback(async()=>{const V=b?.user?.name;await R({variables:{input:{name:V,orderedPodcastIds:C},preferredLanguages:l}}),g(!1)},[b,l,R,C]),q=h.useCallback(()=>{r(!0)},[]),G=h.useCallback(()=>{r(!1)},[]),X=h.useCallback(()=>{g(!s)},[s]),be=h.useCallback((V,ne,Ge)=>B({variables:{data:{podcastMeta:V,categories:ne,state:Ge},preferredLanguages:l}}),[l,B]),Te=h.useCallback(V=>{const ne=V;(ne||ne===0)&&j(ne)},[]),xe=h.useCallback(()=>{N(!0)},[]),A=h.useCallback(()=>{N(!1)},[]),E=h.useCallback(V=>ne=>{oe({variables:{podcastId:V.id}}).then(()=>{A(ne)})},[oe,A]),ee=h.useCallback(V=>{const ne=Object.values(V).find((Ge,z)=>z===x);return e.jsx(O.Fragment,{children:ne&&e.jsx(Nr,{showModal:!0,closeDeleteModal:A,handleDeletePodcast:E(ne),title:ne?.podcastSelectedMeta.title||"",state:ne.state})})},[x,A,E]),he=le(`(max-width: ${u.screenBreakpoints.small}px)`),pe=le(`(max-width: ${u.screenBreakpoints.mobile}px)`),Qe=le(`(max-width: ${u.screenBreakpoints.tablet}px)`);if(M||!b)return null;let $,U=null;if(b){const{user:V}=b;V!=null&&($=V,U=$.podcasts)}const ce=he&&a?a/2-8:a||320,jt=he?180:210;return e.jsxs(O.Fragment,{children:[U!==null&&U.length>0?e.jsxs(ot,{flexWrap:!0,spaceBetween:!0,marginTop:pe?"2rem":"0",children:[e.jsxs($o,{children:[e.jsx(Wn,{size:Hn.Big,children:e.jsx(Un,{})}),e.jsx(bn,{children:m.formatMessage(F.podcasts,{count:U.length})}),e.jsx("div",{children:e.jsx(bn,{children:U.length})})]}),e.jsxs(ot,{marginBottom:"1rem",justifyCenter:he,fitContent:!Qe,flexWrap:pe,children:[n&&U!==null&&U.length>=2&&e.jsx(L,{variant:s?"contained":"outlined",color:"default",onClick:X,children:m.formatMessage(I.edit)}),n&&U!==null&&U.length>0&&e.jsx(L,{variant:"outlined",color:"primary",onClick:q,children:m.formatMessage(Ne.producerPodcastNewPodcastButton)})]})]}):e.jsx($e,{contentType:Pe.Podcasts,viewerIsUser:!!n,onCreateContent:q,viewerIsUserMessage:Ne.noPodcastsCreated}),M?e.jsx(ot,{justifyCenter:!0,children:e.jsx(fe,{})}):e.jsx(O.Fragment,{children:U&&U.length>0&&e.jsxs("div",{ref:d,children:[s?e.jsx(Bs,{setOrderOfContent:Q,widthContent:ce,heightContent:jt,widthParent:w,children:U&&U.map((V,ne)=>e.jsx(Pa,{podcastData:V,cardIndex:ne,setSelectedPodcast:Ge=>o(Ge),width:ce,isMobile:he,selectedIdxCard:Te,isViewer:n,noMenu:!0},V.id))}):e.jsx(Hs,{indicators:!0,inlineControls:!0,dark:!0,marginRightPX:16,widthChildren:ce,childrenNoZIndex:!0,watchlist:!0,children:U&&U.map((V,ne)=>e.jsx(Pa,{podcastData:V,cardIndex:ne,setSelectedPodcast:o,width:ce,isMobile:he,handleOpenModal:xe,selectedIdxCard:Te,isViewer:n},V.id))}),e.jsx(ot,{justifyCenter:!0,children:s&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outlined",color:"primary",onClick:H,children:m.formatMessage(I.save)}),e.jsx(L,{variant:"outlined",color:"negative",onClick:X,children:m.formatMessage(I.cancel)})]})}),S&&ee(U)]})}),i&&e.jsx(zs,{onClose:G,onSave:be,isMobile:pe})]})},fu=`#import "@web/app/graphql/fragments/ProducerVideos.graphql"
303
304query PodcastContentQuery(
305  $id: ID!
306  $limit: Int
307  $offset: Int
308  $preferredLanguages: [String!]!
309) {
310  podcast(id: $id) {
311    id
312    episodesCount
313    episodes(limit: $limit, offset: $offset) {
314      id
315      ...ProducerVideos
316    }
317  }
318}
319`,Ti={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PodcastContentQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"podcast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"episodesCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"episodes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}
319},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideos"},directives:[]}]}}]}}]}}],loc:{start:0,end:342,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:fu}}},gu=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ti.definitions=gu(Ti.definitions.concat(Qn.definitions));const hu=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};hu(Ti,"PodcastContentQuery");const pu=({userId:t,selectedPodcast:n,handleVideoCardWidth:a})=>{const{formatMessage:o}=T(),l=Se(),{viewerIsUser:d}=Ht("video"),{data:m,loading:u}=ue(Ti,{variables:{id:n,preferredLanguages:l}}),f=m?.podcast?.episodes||[];return e.jsxs(e.Fragment,{children:[e.jsxs(nr,{children:[o(F.podcasts,{count:1}),!u&&` #${m?.podcast?.episodesCount||0}`]}),u?e.jsx(J,{isCenter:!0,children:e.jsx(fe,{})}):m?.podcast?.episodes?.length?e.jsx(wr,{userId:t,limit:0,videos:f,viewerIsUser:d,videosLoading:u,getVideoCardWidth:a,onLoadMore:()=>null,hasMoreItems:!1}):o(F.noPodcastEpisodes)]})},ku=({userId:t,isMobile:n,handleSearchValue:a,showMenuLinks:o})=>{const l=De(je.PodcastSupport),[d,m]=h.useState(),[u,f]=h.useState(""),{viewerIsUser:c}=Ht("video");return e.jsxs(Ct,{children:[e.jsx(J,{isCenter:!0,children:e.jsx(Nt,{onSubmit:a})}),e.jsxs(J,{children:[e.jsx(J,{children:o()}),e.jsx(J,{isRight:!0,isColumn:n})]}),l&&e.jsx(mu,{userId:t,isViewer:c,widthCards:d,setSelectedPodcast:f}),u&&e.jsx(pu,{userId:t,selectedPodcast:u,handleVideoCardWidth:m})]})};var on,Ta;function vu(){if(Ta)return on;Ta=1,on=t;function t(a){if(a)return n(a)}function n(a){for(var o in t.prototype)a[o]=t.prototype[o];return a}return t.prototype.on=t.prototype.addEventListener=function(a,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(o),this},t.prototype.once=function(a,o){function l(){this.off(a,l),o.apply(this,arguments)}return l.fn=o,this.on(a,l),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(a,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var l=this._callbacks["$"+a];if(!l)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var d,m=0;m<l.length;m++)if(d=l[m],d===o||d.fn===o){l.splice(m,1);break}return this},t.prototype.emit=function(a){this._callbacks=this._callbacks||{};var o=[].slice.call(arguments,1),l=this._callbacks["$"+a];if(l){l=l.slice(0);for(var d=0,m=l.length;d<m;++d)l[d].apply(this,o)}return this},t.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]},t.prototype.hasListeners=function(a){return!!this.listeners(a).length},on}var ln,Ia;function Da(){if(Ia)return ln;Ia=1;var t=Object.prototype.toString;ln=function(a){switch(t.call(a)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return a===null?"null":a===void 0?"undefined":a!==a?"nan":a&&a.nodeType===1?"element":n(a)?"buffer":(a=a.valueOf?a.valueOf():Object.prototype.valueOf.apply(a),typeof a)};function n(a){return!!(a!=null&&(a._isBuffer||a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)))}return ln}var dn,Aa;function bu(){if(Aa)return dn;Aa=1;var t;try{t=Da()}catch{t=Da()}dn=n;function n(a){switch(t(a)){case"object":var l={};for(var o in a)a.hasOwnProperty(o)&&(l[o]=n(a[o]));return l;case"array":for(var l=new Array(a.length),d=0,m=a.length;d<m;d++)l[d]=n(a[d]);return l;case"regexp":var u="";return u+=a.multiline?"m":"",u+=a.global?"g":"",u+=a.ignoreCase?"i":"",new RegExp(a.source,u);case"date":return new Date(a.getTime());default:return a}}return dn}var cn,Va;
319function yu(){if(Va)return cn;Va=1;var t=Object.prototype.toString;return cn=function(n){switch(t.call(n)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return n===null?"null":n===void 0?"undefined":n!==n?"nan":n&&n.nodeType===1?"element":(n=n.valueOf?n.valueOf():Object.prototype.valueOf.apply(n),typeof n)},cn}var un={},$a;function Su(){return $a||($a=1,(function(t){t.linear=function(n){return n},t.inQuad=function(n){return n*n},t.outQuad=function(n){return n*(2-n)},t.inOutQuad=function(n){return n*=2,n<1?.5*n*n:-.5*(--n*(n-2)-1)},t.inCube=function(n){return n*n*n},t.outCube=function(n){return--n*n*n+1},t.inOutCube=function(n){return n*=2,n<1?.5*n*n*n:.5*((n-=2)*n*n+2)},t.inQuart=function(n){return n*n*n*n},t.outQuart=function(n){return 1- --n*n*n*n},t.inOutQuart=function(n){return n*=2,n<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},t.inQuint=function(n){return n*n*n*n*n},t.outQuint=function(n){return--n*n*n*n*n+1},t.inOutQuint=function(n){return n*=2,n<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},t.inSine=function(n){return 1-Math.cos(n*Math.PI/2)},t.outSine=function(n){return Math.sin(n*Math.PI/2)},t.inOutSine=function(n){return .5*(1-Math.cos(Math.PI*n))},t.inExpo=function(n){return n==0?0:Math.pow(1024,n-1)},t.outExpo=function(n){return n==1?n:1-Math.pow(2,-10*n)},t.inOutExpo=function(n){return n==0?0:n==1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)},t.inCirc=function(n){return 1-Math.sqrt(1-n*n)},t.outCirc=function(n){return Math.sqrt(1- --n*n)},t.inOutCirc=function(n){return n*=2,n<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},t.inBack=function(n){var a=1.70158;return n*n*((a+1)*n-a)},t.outBack=function(n){var a=1.70158;return--n*n*((a+1)*n+a)+1},t.inOutBack=function(n){var a=2.5949095;return(n*=2)<1?.5*(n*n*((a+1)*n-a)):.5*((n-=2)*n*((a+1)*n+a)+2)},t.inBounce=function(n){return 1-t.outBounce(1-n)},t.outBounce=function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},t.inOutBounce=function(n){return n<.5?t.inBounce(n*2)*.5:t.outBounce(n*2-1)*.5+.5},t["in-quad"]=t.inQuad,t["out-quad"]=t.outQuad,t["in-out-quad"]=t.inOutQuad,t["in-cube"]=t.inCube,t["out-cube"]=t.outCube,t["in-out-cube"]=t.inOutCube,t["in-quart"]=t.inQuart,t["out-quart"]=t.outQuart,t["in-out-quart"]=t.inOutQuart,t["in-quint"]=t.inQuint,t["out-quint"]=t.outQuint,t["in-out-quint"]=t.inOutQuint,t["in-sine"]=t.inSine,t["out-sine"]=t.outSine,t["in-out-sine"]=t.inOutSine,t["in-expo"]=t.inExpo,t["out-expo"]=t.outExpo,t["in-out-expo"]=t.inOutExpo,t["in-circ"]=t.inCirc,t["out-circ"]=t.outCirc,t["in-out-circ"]=t.inOutCirc,t["in-back"]=t.inBack,t["out-back"]=t.outBack,t["in-out-back"]=t.inOutBack,t["in-bounce"]=t.inBounce,t["out-bounce"]=t.outBounce,t["in-out-bounce"]=t.inOutBounce})(un)),un}var mn,Ra;function wu(){if(Ra)return mn;Ra=1;var t=vu(),n=bu(),a=yu(),o=Su();mn=l;function l(d){if(!(this instanceof l))return new l(d);this._from=d,this.ease("linear"),this.duration(500)}return t(l.prototype),l.prototype.reset=function(){return this.isArray=a(this._from)==="array",this._curr=n(this._from),this._done=!1,this._start=Date.now(),this},l.prototype.to=function(d){return this.reset(),this._to=d,this},l.prototype.duration=function(d){return this._duration=d,this},l.prototype.ease=function(d){if(d=typeof d=="function"?d:o[d],!d)throw new TypeError("invalid easing function");return this._ease=d,this},l.prototype.stop=function(){return this.stopped=!0,this._done=!0,this.emit("stop"),this.emit("end"),this},l.prototype.step=function(){if(!this._done){var d=this._duration,m=Date.now(),u=m-this._start,f=u>=d;if(f)return this._from=this._to,this._update(this._to),this._done=!0,this.emit("end"),this;var c=this._from,i=this._to,r=this._curr,s=this._ease,g=(m-this._start)/d,S=s(g);if(this.isArray){for(var N=0;N<c.length;++N)r[N]=c[N]+(i[N]-c[N])*S;return this._update(r),this}for(var x in c)r[x]=c[x]+(i[x]-c[x])*S;return this._update(r),this}},l.prototype.update=function(d){return arguments.length==0?this.step():(this._update=d,this)},mn}
319var vi={exports:{}},qa;function xu(){return qa||(qa=1,(function(t,n){n=t.exports=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||o;var a=new Date().getTime();function o(d){var m=new Date().getTime(),u=Math.max(0,16-(m-a)),f=setTimeout(d,u);return a=m,f}var l=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.clearTimeout;n.cancel=function(d){l.call(window,d)}})(vi,vi.exports)),vi.exports}var fn,La;function Cu(){if(La)return fn;La=1;var t=wu(),n=xu();fn=a;function a(l,d,m){m=m||{};var u=o(),f=t(u).ease(m.ease||"out-circ").to({top:d,left:l}).duration(m.duration||1e3);f.update(function(i){window.scrollTo(i.left|0,i.top|0)}),f.on("end",function(){c=function(){}});function c(){n(c),f.update()}return c(),f}function o(){var l=window.pageYOffset||document.documentElement.scrollTop,d=window.pageXOffset||document.documentElement.scrollLeft;return{top:l,left:d}}return fn}var gn,Ea;function Nu(){if(Ea)return gn;Ea=1;var t=eo(),n=Cu();function a(o,l,d){var m=document.body,u=document.documentElement,f=o.getBoundingClientRect(),c=u.clientHeight,i=Math.max(m.scrollHeight,m.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight);l=l||0;var r;switch(d){case"top":r=f.top;break;case"middle":r=f.bottom-c/2-f.height/2;break;case"bottom":r=f.bottom-c;break;default:r=f.bottom-c/2-f.height/2;break}var s=i-c;return Math.min(r+l+window.pageYOffset,s)}return gn=function(o,l){l=l||{offset:0,align:"middle"};var d=t.findDOMNode(o);return d===null?0:n(0,a(d,l.offset,l.align),l)},gn}var ju=Nu();const Mu=to(ju),Fu=ps("alugha:ProducerPage"),hn=140,bi=12,we={modified:"Modified",created:"Created",published:"Published",viewsCount:"Views",alphabetical:"Alphabetical"},It={modified:"MODIFIED",created:"CREATED",price:"PRICE",type:"TYPE",title:"NAME",score:"SCORE"};class Pu extends h.Component{constructor(){super(...arguments),this.refOfPageContent=O.createRef(),this.defaultSortValue={label:this.props.intl.formatMessage(_.SortByModified),sort:we.modified},this.sortValueAsset={label:this.props.intl.formatMessage(_.SortByImagesModified)||"Modified",sort:It.modified},this.defaultSortValues=[this.defaultSortValue,{label:this.props.intl.formatMessage(_.SortByCreated)||"Created",sort:we.created}],this.sortingArticleList=[...this.defaultSortValues,{label:this.props.intl.formatMessage(_.SortByPublished)||"Published",sort:we.published},{label:this.props.intl.formatMessage(F.views)||"Views",sort:we.viewsCount}],this.alphabeticalSort={label:this.props.intl.formatMessage(_.SortByAlphabetical)||"Alphabetical",sort:we.alphabetical},this.sortingVideoList=[...this.sortingArticleList,this.alphabeticalSort],this.sortingAssetList=[this.sortValueAsset,{label:this.props.intl.formatMessage(_.SortByImagesCreated)||"Created",sort:It.created},{label:this.props.intl.formatMessage(_.SortByImagesType)||"Type",sort:It.type},{label:this.props.intl.formatMessage(_.SortByImagesPrice)||"Price",sort:It.price},{label:this.props.intl.formatMessage(_.SortByImagesTitle)||"Title",sort:It.title},{label:this.props.intl.formatMessage(_.SortByImagesScore)||"Score",sort:It.score}],this.sortingMagazine=[...this.defaultSortValues],this.state={isMobile:!1,showFilter:!1,sortImages:{sortValue:this.sortValueAsset,sortDir:"DESC",sortingList:this.sortingAssetList},usedVideoCategories:[],filterVideos:{query:"",languages:[],minDuration:0,maxDuration:hn,categories:[],youthProtection:Re.UNLOCKED},sortVideos:{sortValue:this.defaultSortValue,sortDir:"Desc",sortingList:this.sortingVideoList},usedArticleCategories:[],filterArticles:{query:"",languages:[],categories:[]},sortArticles:{sortValue:this.defaultSortValue,sortDir:"Desc",sortingList:this.sortingArticleList},filterMagazines:{query:""},sortMagazines:{sortValue:this.defaultSortValue,sortDir:"Desc",sortingList:this.sortingMagazine}},this.scrollEventToFilterSelector=n=>{n!=null&&Mu(n,{align:"top",duration:500,ease:"inOutSine"})},this.handleSearchValue=({query:n})=>{this.props.selectedMenu===D.Videos&&this.setState({filterVideos:{...this.state.filterVideos,query:n}}),this.props.selectedMenu===D.Articles&&this.setState({filterArticles:{...this.state.filterArticles,query:n}}),this.props.selectedMenu===D.Magazines&&this.setState({filterMagazines:{query:n}})},this.handleToggleFilter=()=>{const{showFilter:n}=this.state;this.setState({showFilter:!n})},this.updateMobileState=()=>{window.innerWidth<=425?this.setState({isMobile:!0}):this.setState({isMobile:!1})},this.setSortCriteria=(n,a,o,l)=>{if(!this.state[`sort${n}`])return()=>{};const d=this.state[`sort${n}`];this.setState({[`sort${n}`]:{sortDir:o.label===d.sortValue.label&&d.sortDir===(l?"DESC":"Desc")?l?"ASC":"Asc":l?"DESC":"Desc",sortValue:o,sortingList:a}})},this.onChangeSort=n=>{const{selectedMenu:a}=this.props;switch(a){case D.Videos:case D.Verticals:this.setSortCriteria("Videos",this.sortingVideoList,n);break;case D.Articles:this.setSortCriteria("Articles",this.sortingArticleList,n);break;case D.Images:this.setSortCriteria("Images",this.sortingAssetList,n,!0);break;case D.Magazines:this.setSortCriteria("Magazines",this.sortingMagazine,n);break;default:Fu.error("Sth went wrong by sorting your content")}},this.handleFilters=(n,a)=>{this.setState(o=>
319(Object.keys(a).forEach(l=>{o[l]!==a[l]&&(o[`filter${n}`][l]=a[l])}),o[`filter${n}`]))},this.handleFilterArticles=n=>{this.handleFilters("Articles",n)},this.filterArticlesCounter=()=>{let n=0;const{languages:a,categories:o}=this.state.filterArticles;return a&&a.length!==0&&(n+=1),o&&o.length!==0&&(n+=1),n===0?"":n},this.checkArticleCategories=n=>{const a=n&&n.map(d=>d.content.categories),o=a&&a.flat(),l=o&&o.filter((d,m,u)=>u.indexOf(d)===m);this.setState({usedArticleCategories:ua(l,this.state.usedArticleCategories)?this.state.usedArticleCategories:l})},this.handleFilterVideos=n=>{this.handleFilters("Videos",n)},this.handleFilterMagazines=n=>{this.handleFilters("Magazines",n)},this.filterVideosCounter=()=>{let n=0;const{languages:a,minDuration:o,maxDuration:l,categories:d,licenses:m,youthProtection:u}=this.state.filterVideos;return a&&a.length!==0&&(n+=1),(o!==0||l!==hn)&&(n+=1),d&&d.length!==0&&(n+=1),m&&m.length!==0&&(n+=1),u!==Re.UNLOCKED&&(n+=1),n===0?"":n},this.checkVideoCategories=n=>{const a=n&&n.map(d=>d.categories),o=a&&a.flat(),l=o&&o.filter((d,m,u)=>u.indexOf(d)===m);this.setState({usedVideoCategories:ua(l,this.state.usedVideoCategories)?this.state.usedVideoCategories:l})},this.handleFilterFollowers=n=>{this.handleFilters("Followers",n)}}componentDidMount(){this.updateMobileState(),window.addEventListener("resize",this.updateMobileState)}componentWillUnmount(){window.removeEventListener("resize",this.updateMobileState)}render(){const{userId:n}=this.props,{isMobile:a,showFilter:o}=this.state;return e.jsx(O.Fragment,{children:e.jsxs(id,{ref:this.refOfPageContent,children:[this.props.selectedMenu===D.Articles&&e.jsx(Od,{userId:n,limit:bi,isMobile:a,showFilter:o,sort:this.state.sortArt
319icles,usedCategories:this.state.usedArticleCategories,filterData:this.state.filterArticles,handleToggleFilter:this.handleToggleFilter,scrollToFilter:this.scrollEventToFilterSelector,onChangeSort:this.onChangeSort,handleFilter:this.handleFilterArticles,handleSearchValue:this.handleSearchValue,filterCounter:this.filterArticlesCounter,checkCategories:this.checkArticleCategories,showMenuLinks:this.props.showMenuLinks}),(this.props.selectedMenu===D.Videos||this.props.selectedMenu===D.Verticals)&&e.jsx(Rc,{userId:n,limit:bi,isMobile:a,showFilter:o,sort:this.state.sortVideos,usedCategories:this.state.usedVideoCategories,filterData:this.state.filterVideos,durationUpperBound:hn,handleToggleFilter:this.handleToggleFilter,scrollToFilter:this.scrollEventToFilterSelector,onChangeSort:this.onChangeSort,handleFilter:this.handleFilterVideos,handleSearchValue:this.handleSearchValue,filterCounter:this.filterVideosCounter,checkCategories:this.checkVideoCategories,showMenuLinks:this.props.showMenuLinks,verticalOnly:this.props.selectedMenu===D.Verticals,noVerticals:this.props.selectedMenu!==D.Verticals}),this.props.selectedMenu===D.Images&&e.jsx(Yd,{userId:n,limit:bi,isMobile:a,sort:this.state.sortImages,onChangeSort:this.onChangeSort,handleSearchValue:this.handleSearchValue,showMenuLinks:this.props.showMenuLinks}),this.props.selectedMenu===D.Magazines&&e.jsx(_c,{userId:n,limit:bi,isMobile:a,handleSearchValue:this.handleSearchValue,showMenuLinks:this.props.showMenuLinks,sort:this.state.sortMagazines,onChangeSort:this.onChangeSort,query:this.state.filterMagazines.query}),this.props.selectedMenu===D.Podcasts&&e.jsx(ku,{userId:n,isMobile:a,handleSearchValue:this.handleSearchValue,showMenuLinks:this.props.showMenuLinks})]})})}}const Tu=dt(Tn,ct,li),Oa=Tu(Pu),za=({isLoggedIn:t,isOwnProducerPage:n,magazinesExist:a,hasMagazineSupportFeature:o})=>!t||!n?a:o;class Iu extends h.Component{constructor(){super(...arguments),this.isLoadingMore=!1,this.state={selectedSubMenu:D.Videos},this.handleClickVideos=this.handleClickSubMenu.bind(this,D.Videos),this.handleClickVerticals=this.handleClickSubMenu.bind(this,D.Verticals),this.handleClickArticles=this.handleClickSubMenu.bind(this,D.Articles),this.handleClickImages=this.handleClickSubMenu.bind(this,D.Images),this.handleClickMagazines=this.handleClickSubMenu.bind(this,D.Magazines),this.handleClickPodcasts=this.handleClickSubMenu.bind(this,D.Podcasts),this.updateSubMenuType=()=>{this.setState(({selectedSubMenu:n})=>{let a=D.Videos;return this.props.location.pathname.includes("/videos")?a=D.Videos:this.props.location.pathname.includes("/verticals")?a=D.Verticals:this.props.location.pathname.includes("/articles")?a=D.Articles:this.props.location.pathname.includes("/images")?a=D.Images:this.props.location.pathname.includes("/magazines")?a=D.Magazines:this.props.location.pathname.includes("/podcasts")&&(a=D.Podcasts),n===a?null:{selectedSubMenu:a}})},this.setSubMenuType=n=>this.setState({selectedSubMenu:n}),this.showRoute=(n,a)=>{const{userId:o}=this.props;return e.jsx(ie,{path:`/producer/:userId/myContent/${n}`,render:()=>e.jsx(Oa,{userId:o,selectedMenu:a,showMenuLinks:this.showMenuLinks,pageContentBoundingClient:this.props.pageContentBoundingClient})})},this.showMenuLinks=()=>{const{intl:n,linker:a,userId:o,viewerId:l,userHasMagazines:d}=this.props,m=!!l,u=l===o,f=d;return e.jsxs(O.Fragment,{children:[e.jsx(Ie,{to:a.toUserMyContentVideos(o),onClick:this.handleClickVideos,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Videos,children:n.formatMessage(F.videos,{count:2})})}),e.jsx(Ie,{to:a.toUserMyContentVerticals(o),onClick:this.handleClickVerticals,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Verticals,children:"Verticals"})}),e.jsx(Ie,{to:a.toUserMyContentArticles(o),onClick:this.handleClickArticles,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Articles,children:n.formatMessage(F.articles,{count:2})})}),e.jsx(Ie,{to:a.toUserMyContentImages(o),onClick:this.handleClickImages,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Images,children:n.formatMessage(F.images)})}),e.jsx(ea.Consumer,{children:({isFeatureEnabled:c})=>{const i=c(je.MagazineSupport);return za({isLoggedIn:m,isOwnProducerPage:u,magazinesExist:f,hasMagazineSupportFeature:i})&&e.jsx(Ie,{to:a.toUserMyContentMagazines(o),onClick:this.handleClickMagazines,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Magazines,children:n.formatMessage(F.magazines,{count:2})})})}}),e.jsx(Ie,{to:a.toUserMyContentPodcasts(o),onClick:this.handleClickPodcasts,children:e.jsx(at,{isHighlighted:this.state.selectedSubMenu===D.Podcasts,children:n.formatMessage(F.podcasts,{count:2})})})]})}}componentDidMount(){this.updateSubMenuType()}componentDidUpdate(n){this.props.location.pathname!==n.location.pathname&&this.updateSubMenuType()}handleClickSubMenu(n){this.setSubMenuType(n)}render(){const{userId:n,viewerId:a,userHasMagazines:o}=this.props,l=!!a,d=a===n,m=o;return e.jsx(O.Fragment,{children:e.jsx(ea.Consumer,{children:({isFeatureEnabled:u})=>{const f=u(je.MagazineSupport),c=za({isLoggedIn:l,isOwnProducerPage:d,magazinesExist:m,hasMagazineSupportFeature:f});return e.jsxs(Bt,{children:[this.showRoute("videos",D.Videos),this.showRoute("verticals",D.Verticals),this.showRoute("articles",D.Articles),this.showRoute("images",D.Images),c&&this.showRoute("magazines",D.Magazines),this.showRoute("podcasts",D.Podcasts),e.jsx(ie,{exact:!0,render:()=>e.jsx(Oa,{userId:n,selectedMenu:D.Videos,showMenuLinks:this.showMenuLinks,pageContentBoundingClient:this.props.pageContentBoundingClient})})]})}})})}}const Du=dt(Tn,ct,li,Ui),_a=Du(Iu),Ba=ve({TrashHeader:{id:"app.ProducerPage.Organizer.Trash.Header",defaultMessage:"{count, plural, =0 {Trash 0 files} one {Trash # file} other {Trash # files}}"},TrashHint:{id:"app.ProducerPage.Organizer.Trash.Hint",defaultMessage:"Items will be completely removed after being in the trash can for 2 weeks."}}),gi=t=>
319e.jsx(St,{viewBox:"0 0 18 18",className:t.className,children:e.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e.jsx("path",{d:"M8.99970582,0 C13.970431,0 18,4.02943725 18,9 C18,13.8818027 14.1130593,17.8557914 9.26507674,17.9961629 L8.99970582,18 L8.99970582,17 C13.4181282,17 16.9999673,13.418278 16.9999673,9 C16.9999673,4.581722 13.4181282,1 8.99970582,1 C6.2938707,1 3.84049847,2.25578277 1.62320041,4.80025728 L5.07100842,4.8 C5.31507296,4.8 5.51806093,4.97687516 5.56015623,5.21012437 L5.5681661,5.3 C5.5681661,5.54545989 5.39229641,5.74960837 5.16037314,5.79194433 L5.07100842,5.8 L0.497157688,5.8 C0.253093146,5.8 0.0501051722,5.62312484 0.00800987596,5.38987563 L0,5.3 L0,0.7 C0,0.423857625 0.222585079,0.2 0.497157688,0.2 C0.74122223,0.2 0.944210204,0.376875161 0.9863055,0.610124368 L0.994315376,0.7 L0.995306192,4.00054403 C3.36289508,1.34398728 6.03624366,0 8.99970582,0 Z",fill:"currentColor",fillRule:"nonzero"})})}),Ua=ve({NotificationRestoreError:{id:"app.ProducerOrganizerTrash.restoreVideoError",defaultMessage:"Oops! Something went wrong while restoring your video, please try again later"},NotificationRestoreSuccess:{id:"app.ProducerOrganizerTrash.restoreVideoSuccess",defaultMessage:'Video "{title}" has been restored successfully.'}}),Au=`#import "@web/app/graphql/fragments/ProducerVideosTrackAssets.graphql"
320#import "@web/app/graphql/fragments/VideoCardVideo.graphql"
321#import "@web/app/graphql/fragments/VideoCardTrack.graphql"
322#import "@web/dubbr/graphql/fragments/VideoInfoAsset.graphql"
323
324fragment organizerVideo on Video {
325  id
326  state
327  languages
328  published
329  created
330  views
331  platform
332  platformId
333  asset {
334    id
335    ...VideoInfoAsset
336    duration
337  }
338  owner {
339    id
340    name
341  }
342  tracks {
343    id
344    langCode
345    title
346    description
347    state
348    thumbnail {
349      href
350    }
351    thumbnailHigh: thumbnail {
352      href
353    }
354    portraitThumbnail {
355      href
356    }
357    portraitThumbnailHigh: portraitThumbnail {
358      href
359    }
360    thumbnailAssetId
361    ...ProducerVideosTrackAssets
362    asset {
363      id
364      ...VideoInfoAsset
365    }
366  }
367  track(preferredLanguages: $preferredLanguages) {
368    id
369    langCode
370    title
371    state
372    description
373    thumbnailAssetId
374    ...ProducerVideosTrackAssets
375    ...VideoCardTrack
376  }
377  categories
378  youthProtection
379  thumbnailAssetId
380  backgroundAudioAsset {
381    id
382    type
383    format
384    representations {
385      href
386    }
387  }
388  viewerCanRemove
389  ...VideoCardVideo
390  tracksCount
391  collaborations {
392    id
393    state
394  }
395}
396`,Le={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"organizerVideo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Video"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"published"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"created"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"views"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"platform"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"platformId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"VideoInfoAsset"},directives:[]},{kind:"Field",name:{kind:"Name",value:"duration"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"owner"},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:"tracks"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"thumbnailHigh"},name:{kind:"Name",value:"thumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"portraitThumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"portraitThumbnailHigh"},name:{kind:"Name",value:"portraitThumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"thumbnailAssetId"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideosTrackAssets"},directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"VideoInfoAsset"},directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"track"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnailAssetId"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideosTrackAssets"},directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"VideoCardTrack"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"categories"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"youthProtection"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnailAssetId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"backgroundAudioAsset"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"representations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"viewerCanRemove"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"VideoCardVideo"},directives:[]},{kind:"Field",name:{kind:"Name",value:"tracksCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"collaborations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1280,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Au}}},Yi=t=>{const n={};
396return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Le.definitions=Yi(Le.definitions.concat(sl.definitions));Le.definitions=Yi(Le.definitions.concat(jo.definitions));Le.definitions=Yi(Le.definitions.concat(Mo.definitions));Le.definitions=Yi(Le.definitions.concat(io.definitions));const Vu=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Vu(Le,"organizerVideo");const $u=`#import "@web/app/components/molecules/ProducerOrganizer/Videos/organizerVideoFragment.graphql"
397
398query removedVideosQuery(
399  $limit: Int = 12
400  $offset: Int = 0
401  $preferredLanguages: [String!]!
402) {
403  viewer {
404    id
405    name
406    removedVideos(limit: $limit, offset: $offset) {
407      id
408      ...organizerVideo
409    }
410  }
411}
412`,Ii={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"removedVideosQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"organizerVideo"},directives:[]}]}}]}}]}}],loc:{start:0,end:361,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:$u}}},Ru=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ii.definitions=Ru(Ii.definitions.concat(Le.definitions));const qu=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
412{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};qu(Ii,"removedVideosQuery");const Lu=`mutation restoreVideo($id: ID!) {
413  restoreVideo(id: $id) {
414    id
415  }
416}
417`,Eu={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"restoreVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restoreVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:111,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Lu}}},Ou=(()=>{const t=Ue(We),[n,{loading:a}]=W(Eu);return h.useCallback(o=>{if(!a)return n({variables:{id:o},update:(l,d)=>{if(!d.data||!t)return;const m=d.data.restoreVideo,u=l.identify({__typename:"User",id:t});l.modify({broadcast:!1,id:u,fields:{removedVideos(f){const c=l.identify(m);if(c)return f.filter(i=>l.identify(i)!==c)},videos:(f,{DELETE:c})=>c,removedVideosCount(f){return Math.max(0,f-1)},videoCount:(f,{DELETE:c})=>c}})}})},[a,n,t])}),zu=k.div.withConfig({componentId:"sc-a1b4c044-0"})(["width:100%;"]),_u=5,Bu=({stateContent:t,removedCountData:n,setCountFiles:a})=>{const o=T(),l=ge(),d=Se(),{error:m,success:u,graphqlError:f}=Z(),c=me(),i=n?.viewer?.removedVideosCount||0;h.useEffect(()=>{a(i)},[i,a]);const r=Ou(),s=h.useCallback(({videoId:b,title:M})=>{r(b)?.then(()=>{c.current&&u(o.formatMessage(Ua.NotificationRestoreSuccess,{title:M}))}).catch(R=>{if(c.current)try{f(R)}catch{m(o.formatMessage(Ua.NotificationRestoreError))}})},[m,f,o,c,r,u]),g=le(`(max-width: ${l.newScreenBreakpoints.medium-1}px)`),S=h.useMemo(()=>g?[{type:y.Section,accessor:b=>b,options:[y.Thumb,y.Title,y.Languages,y.Text,y.Actions]}]:[{type:y.Thumb,accessor:b=>b?.track?.thumbnail?.href||b?.thumbnail?.href||void 0},{type:y.Title,accessor:b=>b.track?.title||`(${o.formatMessage(F.noTitle)})`},{type:y.Languages,accessor:"languages"},{type:y.Text,header:o.formatMessage(tt.Visibility).toUpperCase(),accessor:b=>t(b?.state)},{type:y.Actions}],[o,t,g]),N=h.useMemo(()=>{if(!g)return[{icon:gi,label:o.formatMessage(F.restore),onClick:b=>s({videoId:b.original.id,title:b.original?.track?.title||`(${o.formatMessage(F.noTitle)})`}),defaultColor:l.colors.accentPrimary}]},[s,o,l.colors.accentPrimary,g]),x=h.useMemo(()=>{if(g)return b=>[{handler:()=>s({videoId:b.original.id,title:b.original?.track?.title||`(${o.formatMessage(F.noTitle)})`}),label:o.formatMessage(F.restore)}]},[s,o,g]),{currentPage:j,loading:w,pages:P,setCurrentPage:C,viewElements:v}=He(i,Ii,"viewer.removedVideos",{variables:{preferredLanguages:d}},_u);return i?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:w,delayHeightResolution:20,CustomWrapper:zu,children:e.jsx(Ve,{data:v,columnOptions:S,actions:N,contextActions:x,assetType:"video",disableLinks:!0,withPaginationBelow:!1})}),e.jsx(Ee,{currentPage:j,pages:P,setCurrentPage:C})]}):e.jsx("div",{children:o.formatMessage(Ae.NoDataAvailable)})},Wa=O.memo(Bu),Ha=ve({NotificationRestoreError:{id:"app.ProducerOrganizerTrash.restoreArticleError",defaultMessage:"Oops! Something went wrong while restoring your article, please try again later"},NotificationRestoreSuccess:{id:"app.ProducerOrganizerTrash.restoreArticleSuccess",defaultMessage:'Article "{title}" has been restored successfully.'}}),Uu=`#import "@web/articles/graphql/fragments/ArticleCardContent.graphql"
418
419fragment organizerArticle on Article {
420  id
421  state
422  languages
423  published
424  created
425  views
426  content(preferredLanguages: $preferredLanguages) {
427    id
428    ...ArticleCardContent
429    text
430    tags
431    name
432  }
433  video {
434    id
435    thumbnail(width: 350) {
436      href
437    }
438    thumbnailHigh: thumbnail(width: 700) {
439      href
440    }
441  }
442}
443`,oi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"organizerArticle"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Article"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"published"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"created"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"views"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ArticleCardContent"},directives:[]},{kind:"Field",name:{kind:"Name",value:"text"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"video"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[{kind:"Argument",name:{kind:"Name",value:"width"},value:{kind:"IntValue",value:"350"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",alias:{kind:"Name",value:"thumbnailHigh"},name:{kind:"Name",value:"thumbnail"},arguments:[{kind:"Argument",name:{kind:"Name",value:"width"},value:{kind:"IntValue",value:"700"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:447,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Uu}}},Wu=t=>{const n={};
443return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};oi.definitions=Wu(oi.definitions.concat(Bn.definitions));const Hu=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Hu(oi,"organizerArticle");const Qu=`#import "@web/app/components/molecules/ProducerOrganizer/Articles/organizerArticleFragment.graphql"
444
445query removedArticlesQuery(
446  $limit: Int = 12
447  $offset: Int = 0
448  $preferredLanguages: [String!]!
449) {
450  viewer {
451    id
452    name
453    removedArticles(limit: $limit, offset: $offset) {
454      id
455      ...organizerArticle
456    }
457  }
458}
459`,Di={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"removedArticlesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedArticles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"organizerArticle"},directives:[]}]}}]}}]}}],loc:{start:0,end:371,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Qu}}},Gu=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Di.definitions=Gu(Di.definitions.concat(oi.definitions));const Yu=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
459{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Yu(Di,"removedArticlesQuery");const Ku=`mutation restoreArticle($id: ID!) {
460  restoreArticle(id: $id) {
461    id
462  }
463}
464`,Zu={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"restoreArticle"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restoreArticle"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:115,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Ku}}},Xu=(()=>{const t=Ue(We),[n,{loading:a}]=W(Zu);return h.useCallback(o=>{if(!a)return n({variables:{id:o},update:(l,d)=>{if(!d.data||!t)return;const m=d.data.restoreArticle,u=l.identify({__typename:"User",id:t});l.modify({broadcast:!1,id:u,fields:{removedArticles(f){const c=l.identify(m);if(c)return f.filter(i=>l.identify(i)!==c)},articles(f,{toReference:c}){const i=c(m);return i?[i,...f]:f},removedArticlesCount(f){return Math.max(0,f-1)},articleCount(f){return f+1}}})}})},[a,n,t])}),Ju=k.div.withConfig({componentId:"sc-64f0df-0"})(["width:100%;"]),em=5,tm=({stateContent:t,removedCountData:n,setCountFiles:a})=>{const o=T(),l=ge(),d=Se(),{error:m,success:u}=Z(),f=me(),c=n?.viewer?.removedArticlesCount||0;h.useEffect(()=>{a(c)},[c,a]);const i=Xu(),r=h.useCallback(({articleId:v,title:b})=>{i(v)?.then(()=>{f.current&&u(o.formatMessage(Ha.NotificationRestoreSuccess,{title:b}))}).catch(()=>{f.current&&m(o.formatMessage(Ha.NotificationRestoreError))})},[m,o,f,i,u]),s=le(`(max-width: ${l.newScreenBreakpoints.medium-1}px)`),g=h.useMemo(()=>s?[{type:y.Section,accessor:v=>v,options:[y.Thumb,y.Title,y.Languages,y.Text,y.Actions]}]:[{type:y.Thumb,accessor:v=>v?.content?.picture?.href||void 0},{type:y.Title,accessor:v=>v?.content?.title||`(${o.formatMessage(F.noTitle)})`},{type:y.Languages,accessor:"languages"},{type:y.Text,header:o.formatMessage(tt.Visibility).toUpperCase(),accessor:v=>t(v?.state)},{type:y.Actions}],[o,t,s]),S=h.useMemo(()=>{if(!s)return[{icon:gi,label:o.formatMessage(F.restore),onClick:v=>r({articleId:v.original.id,title:v.original.content.title}),defaultColor:l.colors.accentPrimary}]},[r,o,l.colors.accentPrimary,s]),N=h.useMemo(()=>{if(s)return v=>[{handler:()=>r({articleId:v.original.id,title:v.original.content.title}),label:o.formatMessage(F.restore)}]},[r,o,s]),{currentPage:x,loading:j,pages:w,setCurrentPage:P,viewElements:C}=He(c,Di,"viewer.removedArticles",{variables:{preferredLanguages:d}},em);return c?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:j,delayHeightResolution:20,CustomWrapper:Ju,children:e.jsx(Ve,{data:C,columnOptions:g,actions:S,contextActions:N,assetType:"article",disableLinks:!0,withPaginationBelow:!1})}),e.jsx(Ee,{currentPage:x,pages:w,setCurrentPage:P})]}):e.jsx("div",{children:o.formatMessage(Ae.NoDataAvailable)})},im=O.memo(tm),Qa=ve({NotificationRestoreError:{id:"app.ProducerOrganizerTrash.restoreAssetError",defaultMessage:"Oops! Something went wrong while restoring your {type}, please try again later"},NotificationRestoreSuccess:{id:"app.ProducerOrganizerTrash.restoreAssetSuccess",defaultMessage:'{type} "{title}" has been restored successfully.'}}),jr={definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"organizerAsset"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Asset"}},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:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"categories"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"created"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageRepresentation"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"representations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"owner"},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:"forSale"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isInUse"},arguments:[],directives:[]}]}}]},nm=`#import "@web/app/components/molecules/ProducerOrganizer/Assets/organizerAssetFragment.graphql"
465
466query removedAssetsQuery(
467  $types: [String!]
468  $limit: Int = 12
469  $offset: Int = 0
470) {
471  viewer {
472    id
473    name
474    removedAssets(types: $types, limit: $limit, offset: $offset) {
475      id
476      ...organizerAsset
477    }
478  }
479}
480`,Ai={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"removedAssetsQuery"}
480,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedAssets"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"organizerAsset"},directives:[]}]}}]}}]}}],loc:{start:0,end:362,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:nm}}},am=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ai.definitions=am(Ai.definitions.concat(jr.definitions));const sm=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};sm(Ai,"removedAssetsQuery");const rm=`mutation restoreAsset($id: ID!) {
481  restoreAsset(id: $id) {
482    id
483  }
484}
485`,om={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"restoreAsset"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restoreAsset"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:111,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:rm}}},lm=(()=>{const t=Ue(We),[n,{loading:a}]=W(om);return h.useCallback((o,l)=>{if(!a)return n({variables:{id:o},update:(d,m)=>{if(!m.data)return;const u=m.data.restoreAsset;d.modify({broadcast:!1,optimistic:!0,fields:{assets(c,{toReference:i,storeFieldName:r}){if(!r.endsWith(`:{"forSale":false,"ownFiles":false,"types":["${l}"],"userIds":["${t}"]}`))return c;const s=i(u);return s?[s,...c]:c}
485}});const f=d.identify({__typename:"User",id:t});d.modify({broadcast:!1,id:f,fields:{assetCountOwn(c,{storeFieldName:i}){return i.includes(`"types":["${l}"]`)?c+1:c},removedAssetCount(c,{storeFieldName:i}){return i.includes(`"types":["${l}"]`)?Math.max(0,c-1):c},removedAssets(c,{storeFieldName:i}){if(!i.includes(`"types":["${l}"]`))return c;const r=d.identify(u);return r?c.filter(s=>d.identify(s)!==r):c}}})}})},[a,n,t])}),dm=k.div.withConfig({componentId:"sc-567f4104-0"})(["width:100%;"]),cm=5,um=({stateContent:t,removedCountData:n,setCountFiles:a,assetType:o})=>{const l=T(),d=ge(),{error:m,success:u}=Z(),f=me(),c=n?.viewer?.removedAssetCount||0;h.useEffect(()=>{a(c)},[c,a]);const i=lm(),r=h.useCallback(({assetId:v,title:b})=>{i(v,o)?.then(()=>{f.current&&u(l.formatMessage(Qa.NotificationRestoreSuccess,{title:b,type:o}))}).catch(()=>{f.current&&m(l.formatMessage(Qa.NotificationRestoreError,{type:o}))})},[o,m,l,f,i,u]),s=le(`(max-width: ${d.newScreenBreakpoints.medium-1}px)`),g=h.useMemo(()=>s?[{type:y.Section,accessor:v=>v,options:[y.Thumb,y.Title,y.Text,y.Actions]}]:[{type:y.Thumb,accessor:v=>v?.imageRepresentation?.href||v?.representations[0]?.href||void 0},{type:y.Title,accessor:v=>v?.name||`(${l.formatMessage(F.noTitle)})`},{type:y.Text,header:l.formatMessage(tt.Visibility).toUpperCase(),accessor:v=>t(v?.state)},{type:y.Actions}],[l,t,s]),S=h.useMemo(()=>{if(!s)return[{icon:gi,label:l.formatMessage(F.restore),onClick:v=>r({assetId:v.original.id,title:v.original.name||`(${l.formatMessage(F.noTitle)})`}),defaultColor:d.colors.accentPrimary}]},[r,l,d.colors.accentPrimary,s]),N=h.useMemo(()=>{if(s)return v=>[{handler:()=>r({assetId:v.original.id,title:v.original.name||`(${l.formatMessage(F.noTitle)})`}),label:l.formatMessage(F.restore)}]},[r,l,s]),{pages:x,currentPage:j,setCurrentPage:w,viewElements:P,loading:C}=He(c||0,Ai,"viewer.removedAssets",{variables:{types:[o]}},cm);return c?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:C,delayHeightResolution:20,CustomWrapper:dm,children:e.jsx(Ve,{data:P,columnOptions:g,actions:S,contextActions:N,assetType:o,disableLinks:!0,withPaginationBelow:!1})}),e.jsx(Ee,{currentPage:j,pages:x,setCurrentPage:w})]}):e.jsx("div",{children:l.formatMessage(Ae.NoDataAvailable)})},Ga=O.memo(um),Ya=ve({NotificationRestoreError:{id:"app.ProducerOrganizerTrash.restoreMagazineError",defaultMessage:"Oops! Something went wrong while restoring your magazine, please try again later"},NotificationRestoreSuccess:{id:"app.ProducerOrganizerTrash.restoreMagazineSuccess",defaultMessage:'Magazine "{title}" has been restored successfully.'}}),mm=`query removedMagazinesQuery(
486  $limit: Int = 12
487  $offset: Int = 0
488  $preferredLanguages: [String!]!
489) {
490  viewer {
491    id
492    name
493    paginatedRemovedMagazines: removedMagazines(
494      limit: $limit
495      offset: $offset
496    ) {
497      id
498      headerColor
499      headerImage {
500        id
501        imageRepresentation {
502          href
503        }
504      }
505      owner {
506        id
507        background {
508          href
509        }
510      }
511      title(preferredLanguages: $preferredLanguages) {
512        langCode
513        value
514      }
515      state
516      createdAt
517    }
518  }
519}
520`,fm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"removedMagazinesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},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:"name"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"paginatedRemovedMagazines"},name:{kind:"Name",value:"removedMagazines"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}
520},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headerColor"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headerImage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageRepresentation"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"owner"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"background"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:603,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:mm}}},gm=`mutation restoreMagazine($id: ID!) {
521  restoreMagazine(id: $id) {
522    id
523  }
524}
525`,hm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"restoreMagazine"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restoreMagazine"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:gm}}},pm=(()=>{const t=Ue(We),[n,{loading:a}]=W(hm);return h.useCallback(o=>{if(!a)return n({variables:{id:o},update:(l,d)=>{if(!d.data||!t)return;const m=d.data.restoreMagazine,u=l.identify({__typename:"User",id:t});l.modify({broadcast:!1,id:u,fields:{removedMagazines(f){const c=l.identify(m);if(c)return f.filter(i=>l.identify(i)!==c)},magazines(f,{toReference:c}){const i=c(m);return i?f&&[i,...f]:f},removedMagazinesCount(f){return Math.max(0,f-1)},magazineCount(f){return f+1}}})}})},[a,n,t])}),km=k.div.withConfig({componentId:"sc-3fd8399-0"})(["width:100%;"]),vm=5,bm=({removedCountData:t,setCountFiles:n,stateContent:a})=>{const o=T(),l=ge(),d=Se(),{error:m,success:u}=Z(),f=me(),c=t?.viewer?.removedMagazinesCount||0;h.useEffect(()=>{n(c)},[c,n]);const i=pm(),r=h.useCallback(async({magazineId:v,title:b})=>{try{const M=await i(v),R=M&&M.data?.restoreMagazine||!1;f.current&&R&&u(o.formatMessage(Ya.NotificationRestoreSuccess,{title:b}))}catch{if(!f.current)return;m(o.formatMessage(Ya.NotificationRestoreError))}},[m,o,f,i,u]),s=le(`(max-width: ${l.newScreenBreakpoints.medium-1}px)`),g=h.useMemo(()=>s?[{type:y.Section,accessor:v=>v,options:[y.Thumb,y.Title,y.Text,y.Actions]}]:[{type:y.Thumb,accessor:v=>v},{type:y.Title,accessor:v=>v?.title.value||o.formatMessage(F.noTitle)},{type:y.Text,header:o.formatMessage(tt.Visibility).toUpperCase(),accessor:v=>a(v?.state)},{type:y.Actions}],[o,s,a]),S=h.useMemo(()=>
525{if(!s)return[{icon:gi,label:o.formatMessage(F.restore),onClick:v=>r({magazineId:v.original.id,title:v.original?.title?.value||`(${o.formatMessage(F.noTitle)})`}),defaultColor:l.colors.accentPrimary}]},[r,o,l.colors.accentPrimary,s]),N=h.useMemo(()=>{if(s)return v=>[{handler:()=>r({magazineId:v.original.id,title:v.original?.title?.value||`(${o.formatMessage(F.noTitle)})`}),label:o.formatMessage(F.restore)}]},[r,o,s]),{currentPage:x,loading:j,pages:w,setCurrentPage:P,viewElements:C}=He(c,fm,"viewer.paginatedRemovedMagazines",{variables:{preferredLanguages:d}},vm);return c?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:j,delayHeightResolution:20,CustomWrapper:km,children:e.jsx(Ve,{data:C,columnOptions:g,actions:S,contextActions:N,assetType:"magazine",disableLinks:!0,withPaginationBelow:!1})}),e.jsx(Ee,{currentPage:x,pages:w,setCurrentPage:P})]}):e.jsx("div",{children:o.formatMessage(Ae.NoDataAvailable)})},ym=O.memo(bm),Ka=ve({NotificationRestoreError:{id:"app.ProducerOrganizerTrash.restorePodcastError",defaultMessage:"Oops! Something went wrong while restoring your podcast, please try again later"},NotificationRestoreSuccess:{id:"app.ProducerOrganizerTrash.restorePodcastSuccess",defaultMessage:'Podcast "{title}" has been restored successfully.'}}),Sm=`query removedPodcastQuery(
526  $limit: Int = 12
527  $offset: Int = 0
528  $preferredLanguages: [String!]!
529) {
530  viewer {
531    id
532    name
533    removedPodcasts(limit: $limit, offset: $offset) {
534      id
535      state
536      podcastSelectedMeta(preferredLanguages: $preferredLanguages) {
537        langCode
538        title
539      }
540      thumbnail(preferredLanguages: $preferredLanguages) {
541        href
542        fileName
543        format
544        width
545        height
546      }
547    }
548  }
549}
550`,wm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"removedPodcastQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedPodcasts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"podcastSelectedMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fileName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"width"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"height"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:504,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Sm}}},xm=`mutation restorePodcast($podcastId: ID!) {
551  restorePodcast(podcastId: $podcastId) {
552    id
553  }
554}
555`,Cm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"restorePodcast"}
555,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"podcastId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restorePodcast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"podcastId"},value:{kind:"Variable",name:{kind:"Name",value:"podcastId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:136,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:xm}}},Nm=(()=>{const t=Ue(We),[n,{loading:a}]=W(Cm);return h.useCallback(o=>{if(!a)return n({variables:{podcastId:o},update:(l,d)=>{if(!d.data||!t)return;const m=d.data.restorePodcast,u=l.identify({__typename:"User",id:t});l.modify({broadcast:!1,id:u,fields:{removedPodcasts(f){const c=l.identify(m);if(c)return f.filter(i=>l.identify(i)!==c)},podcasts(f,{toReference:c}){const i=c(m);return i?f&&[i,...f]:f},removedPodcastsCount(f){return Math.max(0,f-1)},podcastsCount(f){return f+1}}})}})},[a,n,t])}),jm=k.div.withConfig({componentId:"sc-ef67c473-0"})(["width:100%;"]),Mm=5,Fm=({removedCountData:t,setCountFiles:n})=>{const{formatMessage:a}=T(),o=ge(),l=Se(),{error:d,graphqlError:m,success:u}=Z(),f=me(),c=t?.viewer?.removedPodcastsCount||0;h.useEffect(()=>{n(c)},[c,n]);const i=Nm(),r=h.useCallback(({videoId:v,title:b})=>{i(v)?.then(()=>{f.current&&u(a(Ka.NotificationRestoreSuccess,{title:b}))}).catch(M=>{if(f.current)try{m(M)}catch{d(a(Ka.NotificationRestoreError))}})},[d,m,a,f,i,u]),s=le(`(min-width: ${o.newScreenBreakpoints.medium}px)`),g=h.useMemo(()=>s?[{type:y.Thumb,accessor:v=>v?.track?.thumbnail?.href||v?.thumbnail?.href||void 0},{type:y.Title,accessor:v=>v.podcastSelectedMeta?.title||`(${a(F.noTitle)})`},{type:y.Text,header:a(tt.Visibility).toUpperCase(),accessor:v=>a(ye[v.state])},{type:y.Actions}]:[{type:y.Section,accessor:v=>v,options:[y.Thumb,y.Title,y.Text,y.Actions]}],[a,s]),S=h.useMemo(()=>{if(s)return[{icon:gi,label:a(F.restore),onClick:v=>r({videoId:v.original.id,title:v.original?.track?.title||`(${a(F.noTitle)})`}),defaultColor:o.colors.accentPrimary}]},[r,a,o.colors.accentPrimary,s]),N=h.useMemo(()=>{if(!s)return v=>[{handler:()=>r({videoId:v.original.id,title:v.original?.track?.title||`(${a(F.noTitle)})`}),label:a(F.restore)}]},[r,a,s]),{currentPage:x,loading:j,pages:w,setCurrentPage:P,viewElements:C}=He(c,wm,"viewer.removedPodcasts",{variables:{preferredLanguages:l}},Mm);return c?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:j,delayHeightResolution:20,CustomWrapper:jm,children:e.jsx(Ve,{data:C,columnOptions:g,actions:S,contextActions:N,assetType:"podcast",disableLinks:!0,withPaginationBelow:!1})}
555),e.jsx(qn,{children:e.jsx(Ln,{children:e.jsx(Jt,{xs:12,style:{display:"flex",justifyContent:"center"},children:e.jsx(Ee,{currentPage:x,pages:w,setCurrentPage:P})})})})]}):e.jsx("div",{children:a(Ae.NoDataAvailable)})},Pm=O.memo(Fm),Tm=`query organizerRemovedCounts($types: [String!], $isAsset: Boolean = false) {
556  viewer {
557    id
558    removedVideosCount
559    removedArticlesCount
560    removedAssetCount(types: $types) @include(if: $isAsset)
561    removedMagazinesCount
562    removedPodcastsCount
563  }
564}
565`,Im={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerRemovedCounts"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"isAsset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},defaultValue:{kind:"BooleanValue",value:!1},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:"removedVideosCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedArticlesCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedAssetCount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"isAsset"}}}]}]},{kind:"Field",name:{kind:"Name",value:"removedMagazinesCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"removedPodcastsCount"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:298,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Tm}}},Dt=k.div.withConfig({componentId:"sc-4189e188-0"})(["display:flex;justify-content:center;align-items:center;font-weight:500;"," padding:"," 0;font-size:",";text-transform:uppercase;color:#969696;border-bottom:"," solid transparent;",";:hover{cursor:pointer;color:",";border-bottom:2px solid ",";}@media (max-width:","){","}"],Rt("4.5rem"),p(7),p(12),p(2),t=>t.isHighlighted&&ae(["color:",";border-bottom:2px solid ",";"],({theme:n})=>n.colors.accentPrimary,({theme:n})=>n.colors.accentPrimary),({theme:t})=>t.colors.accentPrimary,({theme:t})=>t.colors.accentPrimary,({theme:t})=>`${t.newScreenBreakpoints.small-1}px`,Rt("1.5rem")),Dm=({onClose:t,selectedArchiveMenu:n})=>{const a=T(),[o,l]=h.useState(n),[d,m]=h.useState(),[u,f]=h.useState(0);h.useEffect(()=>{o===Y.Audios?m("audio"):o===Y.Images&&m("image")},[o]);const{data:c}=ue(Im,{variables:{types:d?[d]:null,isAsset:d==="image"||d==="audio"}}),i=De(je.MagazineSupport),r=De(je.PodcastSupport),s=h.useCallback(N=>{switch(N){case 0:case Vt.PRIVATE:case Mt.Private:return a.formatMessage(ye.Private);case 1:case Vt.PUBLISHED:case Mt.Published:return a.formatMessage(ye.Public);case 2:case Vt.UNLISTED:case Mt.Unlisted:return a.formatMessage(ye.Unlisted);case 3:case Vt.DRAFT:return a.formatMessage(ye.Draft);case Vt.ERROR:case Mt.Error:return a.formatMessage(ye.Error);case Mt.Followers:return a.formatMessage(ye.Followers);case Mt.Members:return a.formatMessage(ye.Members);default:return"-"}},[a]),g=()=>e.jsxs(O.Fragment,{children:[e.jsx(Dt,{onClick:()=>l(Y.Videos),isHighlighted:o===Y.Videos,children:a.formatMessage(F.videos,{count:2})}),e.jsx(Dt,{onClick:()=>l(Y.Articles),isHighlighted:o===Y.Articles,children:a.formatMessage(F.articles,{count:2})}),e.jsx(Dt,{onClick:()=>l(Y.Images),isHighlighted:o===Y.Images,children:a.formatMessage(F.images)}),e.jsx(Dt,{onClick:()=>l(Y.Audios),isHighlighted:o===Y.Audios,children:a.formatMessage(F.audios)}),i&&e.jsx(Dt,{onClick:()=>l(Y.Magazines),isHighlighted:o===Y.Magazines,children:a.formatMessage(F.magazines,{count:2})}),r&&e.jsx(Dt,{onClick:()=>l(Y.Podcasts),isHighlighted:o===Y.Podcasts,children:a.formatMessage(F.podcasts,{count:2})})]}),S=()=>{switch(o){case Y.Videos:return e.jsx(Wa,{stateContent:s,removedCountData:c,setCountFiles:f});case Y.Articles:return e.jsx(im,{stateContent:s,removedCountData:c,setCountFiles:f});case Y.Images:return e.jsx(Ga,{setCountFiles:f,removedCountData:c,stateContent:s,assetType:"image"});case Y.Audios:return e.jsx(Ga,{setCountFiles:f,removedCountData:c,stateContent:s,assetType:"audio"});case Y.Magazines:return e.jsx(ym,{stateContent:s,setCountFiles:f,removedCountData:c});case Y.Podcasts:return e.jsx(Pm,{removedCountData:c,setCountFiles:f});default:return e.jsx(Wa,{stateContent:s,removedCountData:c,setCountFiles:f})}};return e.jsx(Be,{className:"producerTableTrash",showModal:!0,hint:a.formatMessage(Ba.TrashHint),header:e.jsxs(e.Fragment,{children:[e.jsxs(Xe,{children:[e.jsx(Jo,{children:e.jsx(ut,{})}),e.jsx(Us,{children:a.formatMessage(Ba.TrashHeader,{count:u})})]}),e.jsx(Xe,{children:g()})]}),variant:"flatRounded",overflow:"auto",ariaHideApp:!1,onRequestClose:()=>t(!1),children:e.jsx(Xe,{children:S()})})},Am=`#import "./organizerVideoFragment.graphql"
566
567query organizerVideos(
568  $limit: Int = 12
569  $offset: Int = 0
570  $preferredLanguages: [String!]!
571  $filter: VideosFilter
572  $orderBy: OrderOption
573) {
574  viewer {
575    id
576    name
577    videos(
578      limit: $limit
579      offset: $offset
580      filter: $filter
581      orderBy: $orderBy
582      preferredLanguages: $preferredLanguages
583    ) {
584      id
585      ...organizerVideo
586    }
587  }
588}
589`,Vi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerVideos"}
589,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"VideosFilter"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"OrderOption"}},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"videos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}},{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"organizerVideo"},directives:[]}]}}]}}]}}],loc:{start:0,end:455,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Am}}},Vm=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Vi.definitions=Vm(Vi.definitions.concat(Le.definitions));const $m=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};$m(Vi,"organizerVideos");const Rm=5,qm=({showModal:t,videoId:n,filteredTracks:a=[],tracksCount:o,closeModal:l,updateVideoState:d,updateTrackState:m})=>{const u=T(),f=ge(),[c]=h.useState(5),[i,r]=h.useState(1),s=h.useMemo(()=>Math.ceil(o/Rm)||1,[o]);h.useEffect(()=>{d(n,1),r(v=>Math.min(v,s))},[s,a,o,d,n]);const g=i*c,S=g-c,N=a.slice(S,g),x=h.useCallback(()=>{l()},[l]),j=h.useCallback(async(...v)=>{const b=v[0].state,M=v[0].trackId;await m(M,{state:b})},[m]),w=h.useMemo(()=>[{type:y.Thumb,accessor:v=>v?.thumbnail?.href||no},{type:y.Title,accessor:v=>v?.title||u.formatMessage(F.noTitle)},{type:y.Languages,accessor:"languages"},{type:y.Visibility,accessor:"state"}],[u]),P=h.useMemo(()=>[{type:y.Section,accessor:v=>v,options:[y.Thumb,y.Title,y.Languages,y.Visibility]}],[]),C=le(`(max-width: ${f.newScreenBreakpoints.large-1}px)`);return e.jsxs(Be,{className:"producerTracksTableContent",showModal:!!t,header:u.formatMessage(sn.ModalUpdateTrackHeader),onRequestClose:l,variant:"flatRounded",ariaHideApp:!1,overflow:"auto",children:[e.jsxs(si,{isCenter:!0,children:[e.jsx(Ze,{children:u.formatMessage(sn.ModalUpdateTrack1)}),e.jsx(Ze,{children:u.formatMessage(sn.ModalUpdateTrack2)})]}),e.jsxs(si,{children:[a.length&&e.jsx(Ve,{data:N,columnOptions:C?P:w,noHeader:C,updateTrackState:j,assetType:"video",actions:[],disableLinks:!0,withPaginationBelow:!1}),e.jsx(Xe,{children:e.jsx(Ee,{pages:s,currentPage:i,setCurrentPage:r})})]}),e.jsx(Xe,{isCenter:!0,children:e.jsx(L,{variant:"outlined",color:"primary",onClick:x,children:u.formatMessage(I.close)})})]})},Lm=(()=>{const t=T(),{success:n,error:a}=Z(),o=me(),[l]=W(Cl);return h.useCallback(async(d,m)=>{try{const u=await l({variables:{trackId:d,input:m}});if(u&&u.data&&u.data.updateTrack){if(!o.current)return;n(t.formatMessage(Ae.NotificationUpdateStateSuccess))}}catch{if(!o.current)return;a(t.formatMessage(Ae.NotificationUpdateStateError))}},[a,t,o,n,l])}),Em=[{type:y.Section,accessor:t=>t,options:[y.Thumb,y.Title,y.Languages,y.Assets,y.Visibility,y.Date,y.Actions]}],Om=({data:t,showRemoveBtn:n})=>{const a=T(),o=de(),l=ge(),d=mt(),m=En(),[u,f]=h.useState(null),[c,i]=h.useState(null),[r,s]=h.useState(!1),g=me(),[S]=W(jl),N=h.useCallback(({id:A,title:E})=>{f({id:A,title:E})},[]),x=h.useCallback(()=>{r||f(null)},[r]),j=h.useCallback(({id:A,state:E})=>{i({id:A,state:E})},[]),w=h.useCallback(()=>{r||i(null)},[r]),P=xl(),C=Lm(),{mutation:v}=el(void 0),b=h.useCallback((...A)=>{const E=A[0].state,ee=A[0].videoId;E!==1?P(ee,E):j({id:ee,state:E})},[j,P]),M=h.useCallback(async()=>
589{if(u&&!r)try{s(!0),await v(u.id)}finally{g.current&&s(!1)}},[v,g,u,r]),R=h.useCallback(A=>A?.track?.thumbnail?.href?A.track.thumbnail.href:A?.thumbnail?.href?A.thumbnail.href:void 0,[]),B=h.useMemo(()=>[{type:y.Thumb,accessor:A=>R(A)},{type:y.Title,accessor:A=>A.track?.title||a.formatMessage(F.noTitle)},{type:y.Languages,accessor:"languages",style:{whiteSpace:"nowrap",minWidth:"200px"}},{type:y.Visibility,accessor:"state",style:{whiteSpace:"nowrap",minWidth:"150px"}},{type:y.Date,accessor:A=>a.formatDate(A.created),header:a.formatMessage(mi.created).toLocaleUpperCase(),style:{whiteSpace:"nowrap",minWidth:"100px"}},{type:y.Assets,accessor:"languages"},{type:y.Actions}],[a,R]),oe=h.useCallback(async A=>{!await m(a.formatMessage(en.activeCollaborations),e.jsx(e.Fragment,{children:e.jsx(Nl,{children:a.formatMessage(en.activeCollaborationsWarning,{videoTitle:`${A?.track?.title}`})})}),a.formatMessage(en.reviewButton))||!A||d.push(`${o.toDubbrVideoInfo(A.id)}`)},[d,o,a,m]),Q=h.useCallback(A=>{const E=t.find(ee=>ee.id===A.original.id);E?.collaborations.length!==0&&E?.collaborations.find(ee=>ee.state===ao.Active)?oe(E):N({id:A.original.id,title:A.original?.track?.title||`(${a.formatMessage(F.noTitle)})`})},[t,a,N,oe]),H=h.useCallback(async A=>{const E=t.find(ee=>ee.id===A.original.id);E&&await S({variables:{projectId:E.id},update:(ee,he)=>{he.data?.removeProjectFromFolder&&(ee.modify({id:ee.identify({__typename:"ProjectFolder",id:he.data.removeProjectFromFolder.id}),fields:{projectsCount:pe=>typeof pe=="number"?Math.max(0,pe-1):pe}}),ee.modify({id:ee.identify({__typename:"User",id:E.owner.id}),fields:{videos(pe,{storeFieldName:Qe,toReference:$}){const U=ee.identify({__typename:"Video",id:E.id});if(U){if(Qe.includes(`"projectFolderId":"${he.data?.removeProjectFromFolder.id}"`))return pe.filter(ce=>ee.identify(ce)!==U);if(Qe.includes('"withoutProjectFolder":true')){const ce=$({__typename:"Video",id:E.id});return ce?[ce,...pe]:pe}return pe}}}}))}})},[S,t]),q=h.useMemo(()=>{const A=[{icon:ut,onClick:E=>Q(E),label:a.formatMessage(I.delete).toLocaleUpperCase(),defaultColor:l.colors.accentNegative},{icon:ui,withRouterLinkTo:E=>E.original.id?o.toDubbrVideoInfo(E.original.id):void 0,label:a.formatMessage(I.edit).toLocaleUpperCase(),defaultColor:l.colors.accentPrimary}];return n?[A[0],A[1],{icon:Ml,onClick:E=>H(E),label:a.formatMessage(fa.unLinkVideo),defaultColor:l.colors.accentNegative}]:A},[a,o,l.colors.accentNegative,l.colors.accentPrimary,n,Q,H]),G=h.useMemo(()=>A=>{const E=[{handler:()=>Q(A),label:a.formatMessage(I.delete).toLocaleUpperCase()},{withRouterLinkTo:ee=>ee.original.id?o.toDubbrVideoInfo(ee.original.id):void 0,label:a.formatMessage(I.edit).toLocaleUpperCase()}];return n?[E[0],E[1],{handler:()=>H(A),label:a.formatMessage(fa.unLinkVideo).toLocaleUpperCase()}]:E},[a,o,n,Q,H]),X=le(`(max-width: ${l.screenBreakpoints.large}px)`),be=t.find(A=>A.id===c?.id),Te=be?.tracks,xe=be?.tracksCount;return e.jsxs(e.Fragment,{children:[u?.id&&e.jsx(tl,{showModal:!!u,title:u?.title,closeDeleteModal:x,handleDeleteVideo:M,mutationLoading:r}),!!c&&!!c?.id&&e.jsx(qm,{showModal:!!c,videoId:c.id,filteredTracks:Te,tracksCount:xe,closeModal:w,updateVideoState:P,updateTrackState:C}),e.jsx(Ve,{data:t,columnOptions:X?Em:B,noHeader:X,updateVideoState:b,assetType:"video",actions:X?[]:q,contextActions:X?G:void 0,withPaginationBelow:!1})]})},zm=({selectedMenu:t})=>{const{formatMessage:n}=T(),a=Je(),o=mt(),l=Bi(),d=h.useMemo(()=>t==="videos"?[{label:n(_.SortByImagesModified)||"Modified",sort:we.modified},{label:n(_.SortByCreated)||"Created",sort:we.created},{label:n(_.SortByPublished)||"Published",sort:we.published},{label:n(F.views)||"Views",sort:we.viewsCount},{label:n(_.SortByAlphabetical)||"Alphabetical",sort:we.alphabetical}]:[],[t,n]),m=h.useCallback(i=>{const r=a.get("sort"),S=r?.replace("Asc","").replace("Desc","")===i.sort&&r?.includes("Desc")?"Asc":"Desc";a.set("sort",`${i.sort}${S}`);const N=`${l.pathname}?${a.toString()}`;o.push(N)},[o,a,l]),u=h.useCallback(i=>{m(i)},[m]),f=h.useMemo(()=>i=>{const r=i.get("sort");if(!r)return;const s=r.endsWith("Asc")?"Asc":"Desc",g=r.replace(/(Asc|Desc)$/,"");return Object.values(so).includes(r)?{sortOption:{label:(()=>{switch(g){case we.created:return n(_.SortByCreated);case we.modified:return n(_.SortByModified);case we.published:return n(_.SortByPublished);case we.viewsCount:return n(F.views);case we.alphabetical:return n(_.SortByAlphabetical);default:return n(_.SortByModified)}})(),sort:g},sortDir:s}:void 0},[n]),c=h.useMemo(()=>f(a)||{sortOption:{label:n(_.SortByImagesModified)||"Modified",sort:"Modified"},sortDir:"Desc"},[a,n,f]);return{sortOptions:d,onChangeSort:u,sortByValues:c}},_m=k(di).withConfig({componentId:"sc-94711998-0"})(["font-size:1.25rem;vertical-align:top;"]),Bm=({videosCount:t,limit:n,projectFolderId:a,setProjectFolderId:o})=>{const{formatMessage:l}=T(),d=Se(),m=ge(),u=Je(),f=mt(),c=de(),i=!u.get("folders")&&u.get("onlyUnassigned")==="1",[r,s]=h.useState(null),[g,S]=h.useState(null),N=le(`(max-width: ${m.newScreenBreakpoints.small-1}px)`),{sortOptions:x,onChangeSort:j,sortByValues:w}=zm({selectedMenu:Y.Videos}),P=h.useCallback(q=>{s(q)},[s]),C=h.useCallback(q=>{const G=new URLSearchParams(u);q?G.set("folders",q):G.delete("folders");const X=c.organizerProjectFolderBaseMatch.split("/:")[0],be=decodeURIComponent(`${X}?${G.toString()}`);f.push(be)},[f,u,c]),v=h.useCallback(()=>{u.get("onlyUnassigned")?(u.delete("onlyUnassigned"),u.delete("folders")):(u.set("onlyUnassigned","1"),u.set("folders",""),u.delete("folders"));const q=`${location.pathname}?${u.toString()}`;f.push(decodeURIComponent(q))},[f,u]),b=h.useCallback(q=>{if(S(q),q?.length){const G=q.join("/");C(G)}else C(null)}
589,[S,C]);h.useEffect(()=>{const q=u.get("folders");if(!q||!r)return;const G=q.split("/"),X=Fl(r,G);X&&(S(G),s(X.subfolders?.length?X.subfolders:null))},[u,r]);const M=xs(c.organizerProjectFolderBaseMatch),R=h.useMemo(()=>{const q=M?.params.folderId;return i?null:q||a||null},[M,a,i]),{pages:B,currentPage:oe,viewElements:Q,loading:H}=He(t||0,Vi,"viewer.videos",{variables:{preferredLanguages:d,filter:{query:u.get("q"),projectFolderId:R,withoutProjectFolder:i},orderBy:w.sortOption.sort+w.sortDir}},n,"pageParam");return h.useEffect(()=>{a===null&&S(null)},[a,S]),e.jsxs(e.Fragment,{children:[e.jsxs(Fe,{loading:H,heightTrigger:Q,delayHeightResolution:20,children:[e.jsx(Pl,{currentFolders:r,selectedFolder:g,handleSetCurrentFolders:P,handleSetSelectedFolder:b,forProducerArchive:!0,selectedFolderId:R,setProjectFolderId:o,paramsFolderId:M?.params.folderId,withAddNewFolder:!0}),Q.length?e.jsxs(e.Fragment,{children:[e.jsxs(il,{children:[!a&&e.jsxs(e.Fragment,{children:[e.jsx(Tl,{brighter:!0,uniSize:!0,checked:i,leftLabel:l(Ae.filterVideosNotAssignedAnyFolder),onChange:v}),e.jsx(nl,{})]}),e.jsx(al,{id:"sort",label:w.sortOption.label,options:x,onSelect:j,icon:e.jsx(_m,{}),dark:!0,noBorder:!0,isHighlighted:N,fullWidth:N,noSpacer:N,sortDir:w.sortDir})]}),e.jsx(Om,{data:Q,showRemoveBtn:!!a})]}):!R&&e.jsx($e,{contentType:Pe.Videos,viewerIsUser:!0})]}),e.jsx(Hi,{children:e.jsx(Ee,{currentPage:oe,pages:B,setCurrentPage:q=>{f.push(c.toUserOrganizerVideos(q,!1,u))}})})]})},Za=O.memo(Bm),Um=`#import "./organizerArticleFragment.graphql"
590
591query organizerArticles(
592  $limit: Int = 12
593  $offset: Int = 0
594  $preferredLanguages: [String!]!
595  $filter: ArticlesFilter
596) {
597  viewer {
598    id
599    name
600    paginatedArticles: articles(
601      limit: $limit
602      offset: $offset
603      filter: $filter
604    ) {
605      id
606      ...organizerArticle
607    }
608  }
609}
610`,$i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerArticles"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"ArticlesFilter"}},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:"name"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"paginatedArticles"},name:{kind:"Name",value:"articles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"organizerArticle"},directives:[]}]}}]}}]}}],loc:{start:0,end:390,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Um}}},Wm=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};$i.definitions=Wm($i.definitions.concat(oi.definitions));const Hm=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
610{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Hm($i,"organizerArticles");const Xa=ve({ArticleTableNoArticlesAvailable:{id:"app.ProducerPage.Organizer.ArticleTable.noArticleAvailable",defaultMessage:"No articles available"},ModalDeleteArticleHeader:{id:"app.ProducerPage.Organizer.ArticleTable.deleteArticleHeader",defaultMessage:"Delete Article"},ModalDeleteArticle1:{id:"app.ProducerPage.Organizer.ArticleTable.deleteArticle1",defaultMessage:"Are you sure you want to delete this article?"},ModalDeleteArticle2:{id:"app.ProducerPage.Organizer.ArticleTable.deleteArticle2",defaultMessage:"Article can never be recovered. Deleting the article means that this will be gone forever."}}),Qm=({showModal:t,title:n,handleDeleteArticle:a,closeDeleteModal:o,mutationLoading:l})=>{const d=T();return e.jsxs(Be,{className:"producerTableContent",showModal:!!t,header:d.formatMessage(Xa.ModalDeleteArticleHeader),onRequestClose:o,size:"small",variant:"flatRounded",ariaHideApp:!1,overflow:"auto",children:[e.jsx(Ws,{children:e.jsx(ft,{})}),e.jsx(si,{isCenter:!0,children:l?e.jsx(fe,{}):e.jsxs(e.Fragment,{children:[e.jsx(Ze,{children:d.formatMessage(Xa.ModalDeleteArticle1)}),e.jsx(Ze,{bold:!0,children:n})]})}),e.jsxs(Xe,{isCenter:!0,children:[e.jsx(L,{variant:"outlined",color:"primary",onClick:a,disabled:l,children:d.formatMessage(I.delete)}),e.jsx(L,{variant:"outlined",color:"negative",onClick:o,disabled:l,children:d.formatMessage(I.cancel)})]})]})},Gm=`mutation deleteArticle($id: ID!) {
611  deleteArticle(id: $id) {
612    id
613  }
614}
615`,Ym={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteArticle"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteArticle"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:113,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Gm}}},Km=(()=>{const t=Ue(We),[n]=W(Ym);return h.useCallback(a=>n({variables:{id:a},update:(o,l)=>{if(!l.data||!t)return;const d=l.data.deleteArticle,m=o.identify({__typename:"User",id:t});o.modify({broadcast:!1,id:m,fields:{articles(u){const f=o.identify(d);if(f)return u.filter(c=>o.identify(c)!==f)},removedArticles(u,{toReference:f}){const c=f(d);return c?[c,...u]:u},articleCount(u){return Math.max(0,u-1)},removedArticlesCount(u){return u+1}}})}}),[n,t])}),Zm=`mutation updateArticle($input: UpdateArticleInput!) {
616  updateArticle(input: $input) {
617    id
618    state
619    languages
620    categories
621  }
622}
623`,Xm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateArticle"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateArticleInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateArticle"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"categories"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:177,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Zm}}},Jm=(()=>{const t=T(),{success:n,error:a}=Z(),o=me(),[l]=W(Xm);return h.useCallback(async(d,m)=>{try{const u=await l({variables:{input:{id:d,state:m}}});if(u&&u.data&&u.data.updateArticle){if(!o.current)return;n(t.formatMessage(Ae.NotificationUpdateStateSuccess))}}catch{if(!o.current)return;a(t.formatMessage(Ae.NotificationUpdateStateError))}},[a,t,o,n,l])}),ef=[{type:y.Section,accessor:t=>t,options:[y.Thumb,y.Title,y.Languages,y.Visibility,y.Date,y.Actions]}],tf=({data:t})=>{const n=T(),a=de(),o=ge(),[l,d]=h.useState(null),[m,u]=h.useState(!1),{graphqlError:f}=Z(),c=me(),i=h.useCallback(({id:C,title:v})=>{d({id:C,title:v})},[]),r=h.useCallback(()=>{m||d(null)},[m]),s=Jm(),g=Km(),S=h.useCallback((...C)=>{const v=Vt[C[0].state],b=C[0].articleId;s(b,v)},[s]),N=h.useCallback(async()=>
623{if(l&&!m)try{if(u(!0),await g(l.id),!c.current)return;r()}catch(C){if(!c.current)return;f(C)}finally{c.current&&u(!1)}},[r,g,f,c,l,m]),x=h.useMemo(()=>[{type:y.Thumb,accessor:C=>C?.content?.picture?.href},{type:y.Title,accessor:C=>C?.content?.title},{type:y.Languages,accessor:"languages",style:{whiteSpace:"nowrap",minWidth:"250px"}},{type:y.Visibility,accessor:"state",style:{whiteSpace:"nowrap",minWidth:"200px"}},{type:y.Date,accessor:C=>n.formatDate(C.created),header:n.formatMessage(mi.created).toLocaleUpperCase(),style:{whiteSpace:"nowrap",minWidth:"150px"}},{type:y.Actions}],[n]),j=h.useMemo(()=>[{icon:ut,onClick:C=>i({id:C.original.id,title:C.original.content.title}),label:n.formatMessage(I.delete).toLocaleUpperCase(),defaultColor:o.colors.accentNegative},{icon:ui,withRouterLinkTo:C=>C.original.id?a.toPath(`/edit-article?a=${C.original.id}`):void 0,label:n.formatMessage(I.edit).toLocaleUpperCase(),defaultColor:o.colors.accentPrimary}],[n,a,i,o.colors.accentNegative,o.colors.accentPrimary]),w=h.useMemo(()=>C=>[{handler:()=>i({id:C.original.id,title:C.original.content.title}),label:n.formatMessage(I.delete).toLocaleUpperCase()},{withRouterLinkTo:v=>v.original.id?a.toPath(`/edit-article?a=${v.original.id}`):void 0,label:n.formatMessage(I.edit).toLocaleUpperCase()}],[n,a,i]),P=le(`(max-width: ${o.newScreenBreakpoints.large-1}px)`);return e.jsxs(e.Fragment,{children:[e.jsx(Qm,{showModal:!!l,title:l?.title,closeDeleteModal:r,handleDeleteArticle:N,mutationLoading:m}),e.jsx(Ve,{data:t,columnOptions:P?ef:x,noHeader:P,updateArticleState:S,assetType:"article",actions:P?[]:j,contextActions:P?w:void 0,withPaginationBelow:!1})]})},nf=({articlesCount:t,limit:n})=>{const a=Se(),o=Je(),{pages:l,currentPage:d,viewElements:m,loading:u}=He(t||0,$i,"viewer.paginatedArticles",{variables:{preferredLanguages:a,filter:{query:o.get("q")}}},n,"pageParam"),f=de(),c=mt(),i=Je();return e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:u,heightTrigger:m,delayHeightResolution:20,children:m.length?e.jsx(tf,{data:m}):e.jsx($e,{contentType:Pe.Articles,viewerIsUser:!0})}),e.jsx(Hi,{children:e.jsx(Ee,{currentPage:d,pages:l,setCurrentPage:r=>{c.push(f.toUserOrganizerArticles(r,!1,i))}})})]})},af=O.memo(nf),sf=`#import "./organizerAssetFragment.graphql"
624
625query organizerAssets(
626  $limit: Int = 12
627  $offset: Int = 0
628  $orderAssetsBy: AssetOrder
629  $ownFiles: Boolean
630  $userIds: [ID!]
631  $forSale: Boolean
632  $types: [String!]
633  $query: String
634) {
635  paginatedAssets: assets(
636    limit: $limit
637    orderBy: $orderAssetsBy
638    offset: $offset
639    userIds: $userIds
640    ownFiles: $ownFiles
641    forSale: $forSale
642    types: $types
643    query: $query
644  ) {
645    id
646    ...organizerAsset
647  }
648}
649`,Ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerAssets"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderAssetsBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"AssetOrder"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownFiles"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userIds"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"forSale"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}
649,{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"paginatedAssets"},name:{kind:"Name",value:"assets"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderAssetsBy"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"userIds"},value:{kind:"Variable",name:{kind:"Name",value:"userIds"}}},{kind:"Argument",name:{kind:"Name",value:"ownFiles"},value:{kind:"Variable",name:{kind:"Name",value:"ownFiles"}}},{kind:"Argument",name:{kind:"Name",value:"forSale"},value:{kind:"Variable",name:{kind:"Name",value:"forSale"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"organizerAsset"},directives:[]}]}}]}}],loc:{start:0,end:510,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:sf}}},rf=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ri.definitions=rf(Ri.definitions.concat(jr.definitions));const of=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};of(Ri,"organizerAssets");const Kt=ve({ModalDeleteImageHeader:{id:"app.ProducerPage.Organizer.VideoTable.deleteImageHeader",defaultMessage:"Delete image"},ModalDeleteError:{id:"app.ProducerPage.Organizer.deleteError",defaultMessage:"Sorry, you can't delete {title}, because it is in use."},ModalDeleteImage1:{id:"app.ProducerPage.Organizer.VideoTable.deleteImage1",defaultMessage:"Are you sure that you want to delete this image?"},ModalDeleteImage2:{id:"app.ProducerPage.Organizer.VideoTable.deleteImage2",defaultMessage:"The image can never be recovered. Deleting the image means that this will be gone forever."},ModalDeleteAudioHeader:{id:"app.ProducerPage.Organizer.VideoTable.deleteAudioHeader",defaultMessage:"Delete audio"},ModalDeleteAudio1:{id:"app.ProducerPage.Organizer.VideoTable.deleteAudio1",defaultMessage:"Are you sure that you want to delete this audio file?"},ModalDeleteAudio2:{id:"app.ProducerPage.Organizer.VideoTable.deleteAudio2",defaultMessage:"The audio can never be recovered. Deleting the audio means that this will be gone forever."}}),lf=({showModal:t,type:n,title:a,assetId:o,handleDeleteAsset:l,closeDeleteModal:d,mutationLoading:m,deleteableAssets:u})=>{const f=T(),c=u.find(i=>i.id===o);return e.jsxs(Be,{showModal:!!t,header:n==="image"?f.formatMessage(Kt.ModalDeleteImageHeader):f.formatMessage(Kt.ModalDeleteAudioHeader),onRequestClose:d,size:"small",variant:"flatRounded",ariaHideApp:!1,overflow:"auto",children:[e.jsx(Ws,{children:e.jsx(ft,{})}),c?e.jsx(si,{isCenter:!0,children:m?e.jsx(fe,{}):e.jsxs(e.Fragment,{children:[n==="image"&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{children:f.formatMessage(Kt.ModalDeleteImage1)}),e.jsx(Ze,{bold:!0,children:a})]}),n==="audio"&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{children:f.formatMessage(Kt.ModalDeleteAudio1)}),e.jsx(Ze,{bold:!0,children:a})]})]})}):e.jsx(si,{isCenter:!0,children:e.jsx(Ze,{children:f.formatMessage(Kt.ModalDeleteError,{title:a})})}),e.jsxs(Xe,{isCenter:!0,children:[c&&e.jsx(L,{variant:"outlined",color:"primary",onClick:l,disabled:m,children:f.formatMessage(I.delete)}),e.jsx(L,{variant:"outlined",color:"negative",onClick:d,disabled:m,children:f.formatMessage(I.cancel)})]})]})},df=[{type:y.Section,accessor:t=>t,options:[y.Thumb,y.Title,y.Visibility,y.Date,y.Actions]}],cf=({data:t,type:n})=>{const a=T(),o=de(),l=ge(),[d,m]=h.useState(null),[u,f]=h.useState(!1),{graphqlError:c}=Z(),i=me(),r=h.useCallback(({assetId:b,title:M})=>{m({assetId:b,title:M})},[]),s=h.useCallback(()=>{u||m(null)},[u]),g=Il(),S=Dl(),N=h.useCallback((...b)=>{const M=b[0].state,R=b[0].assetId;g(R,{forSale:M})},[g]),x=h.useCallback(async()=>
649{if(d&&!u)try{f(!0),await S(d.assetId,n),i.current&&s()}catch(b){i.current&&c(b)}finally{i.current&&f(!1)}},[s,S,c,i,d,u,n]),j=h.useMemo(()=>[{type:y.Thumb,accessor:b=>b?.representations.filter(M=>M.format===b.format)[0]?.href||b?.representations[0]?.href},{type:y.Title,accessor:b=>b?.name||a.formatMessage(F.noTitle)},{type:y.Visibility,accessor:b=>b?.forSale},{type:y.Date,accessor:b=>a.formatDate(b.created),header:a.formatMessage(mi.created).toLocaleUpperCase()},{type:y.Actions}],[a]),w=h.useMemo(()=>[{icon:ut,onClick:b=>r({assetId:b.original.id,title:b?.original?.name||`(${a.formatMessage(F.noTitle)})`}),label:a.formatMessage(I.delete).toLocaleUpperCase(),defaultColor:l.colors.accentNegative},{icon:ui,withRouterLinkTo:b=>b.original.id?o.toMarketplace(b.original.id):void 0,label:a.formatMessage(I.edit).toLocaleUpperCase(),defaultColor:l.colors.accentPrimary}],[a,o,r,l.colors.accentNegative,l.colors.accentPrimary]),P=h.useMemo(()=>b=>[{handler:()=>r({assetId:b.original.id,title:b?.original?.name||`(${a.formatMessage(F.noTitle)})`}),label:a.formatMessage(I.delete).toLocaleUpperCase()},{withRouterLinkTo:M=>M.original.id?o.toMarketplace(M.original.id):void 0,label:a.formatMessage(I.edit).toLocaleUpperCase()}],[a,o,r]),C=le(`(max-width: ${l.newScreenBreakpoints.large-1}px)`),v=t.filter(b=>b.isInUse!==!0);return e.jsxs(e.Fragment,{children:[e.jsx(lf,{showModal:!!d,type:n,assetId:d?.assetId,title:d?.title,closeDeleteModal:s,handleDeleteAsset:x,mutationLoading:u,deleteableAssets:v}),e.jsx(Ve,{data:t,columnOptions:C?df:j,noHeader:C,updateAssetState:N,assetType:n,actions:C?[]:w,contextActions:C?P:void 0,withPaginationBelow:!1})]})},uf=`query organizerQuery(
650  $types: [String!]
651  $isAsset: Boolean = false
652  $filter: VideosFilter
653  $query: String
654) {
655  viewer {
656    id
657    articleCount(query: $query)
658    videoCount(filter: $filter)
659    magazineCount(query: $query)
660    podcastsCount(query: $query)
661    assetCountOwn(types: $types, query: $query) @include(if: $isAsset)
662  }
663}
664`,Mr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"isAsset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},defaultValue:{kind:"BooleanValue",value:!1},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"VideosFilter"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},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:"articleCount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"videoCount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"magazineCount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"podcastsCount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"assetCountOwn"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"isAsset"}}}]}]}]}}]}}],loc:{start:0,end:378,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:uf}}},mf=({userId:t,limit:n,type:a})=>{const o=Je(),{data:l,loading:d=!0}=ue(Mr,{variables:{types:[a],isAsset:!0,query:o.get("q")}}),{pages:m,currentPage:u,viewElements:f,loading:c}
664=He(l?.viewer?.assetCountOwn||0,Ri,"paginatedAssets",{variables:{forSale:!1,ownFiles:!1,userIds:[t],types:[a],query:o.get("q")}},n,"pageParam"),i=de(),r=mt();return e.jsxs(Fe,{loading:d,children:[e.jsx(Fe,{loading:c,heightTrigger:f,delayHeightResolution:20,children:f.length?e.jsx(cf,{data:f,type:a}):e.jsx($e,{contentType:a==="image"?Pe.Images:Pe.Audios,viewerIsUser:!!t})}),e.jsx(Hi,{children:e.jsx(Ee,{currentPage:u,pages:m,setCurrentPage:s=>{a==="image"?r.push(i.toUserOrganizerImages(s,!1,o)):a==="audio"&&r.push(i.toUserOrganizerAudios(s,!1,o))}})})]})},Ja=O.memo(mf),ff=`query organizerMagazines(
665  $limit: Int = 12
666  $offset: Int = 0
667  $preferredLanguages: [String!]!
668  $query: String
669) {
670  viewer {
671    id
672    name
673    paginatedMagazines: magazines(
674      limit: $limit
675      offset: $offset
676      query: $query
677    ) {
678      id
679      state
680      headerColor
681      headerImage {
682        id
683        imageRepresentation {
684          href
685        }
686      }
687      owner {
688        id
689        background {
690          href
691        }
692      }
693      title(preferredLanguages: $preferredLanguages) {
694        langCode
695        value
696      }
697      createdAt
698    }
699  }
700}
701`,gf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerMagazines"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},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:"name"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"paginatedMagazines"},name:{kind:"Name",value:"magazines"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headerColor"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headerImage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageRepresentation"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"owner"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"background"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:623,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:ff}}},hf=`mutation updateMagazine_state($id: ID!, $state: MagazineState) {
702  updateMagazine(id: $id, input: { state: $state }) {
703    id
704    state
705  }
706}
707`,pf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateMagazine_state"}
707,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"state"}},type:{kind:"NamedType",name:{kind:"Name",value:"MagazineState"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateMagazine"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"state"},value:{kind:"Variable",name:{kind:"Name",value:"state"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:180,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:hf}}},kf=[{type:y.Section,accessor:t=>t,options:[y.Thumb,y.Title,y.Visibility,y.Date,y.Actions]}],vf=({data:t})=>{const n=T(),a=de(),o=ge(),[l,d]=h.useState(null),[m,u]=h.useState(!1),{graphqlError:f,success:c}=Z(),i=me(),[r]=W(pf,{onCompleted:()=>c(n.formatMessage(Ks.updatedStateSuccess)),onError:f}),s=h.useCallback(({id:v,title:b})=>{d({id:v,title:b})},[]),g=h.useCallback(()=>{m||d(null)},[m]),{deleteMagazine:S}=Ys(),N=h.useCallback(async()=>{if(l&&!m)try{u(!0),await S(l.id),i.current&&g()}catch(v){i.current&&f(v)}finally{i.current&&u(!1)}},[g,S,f,i,l,m]),x=h.useMemo(()=>[{type:y.Thumb,accessor:v=>v},{type:y.Title,accessor:v=>v?.title.value||n.formatMessage(F.noTitle)},{type:y.Visibility,accessor:"state",header:n.formatMessage(tt.Visibility).toUpperCase()},{type:y.Date,accessor:v=>n.formatDate(v?.createdAt),header:n.formatMessage(mi.created).toLocaleUpperCase()},{type:y.Actions}],[n]),j=h.useMemo(()=>[{icon:ut,onClick:v=>s({id:v.original.id,title:v.original?.title?.value||`(${n.formatMessage(F.noTitle)})`}),label:n.formatMessage(I.delete).toLocaleUpperCase(),defaultColor:o.colors.accentNegative},{icon:ui,withRouterLinkTo:v=>v.original.id?a.toEditMagazine(v.original.id):void 0,label:n.formatMessage(I.edit).toLocaleUpperCase(),defaultColor:o.colors.accentPrimary}],[n,a,s,o.colors.accentNegative,o.colors.accentPrimary]),w=h.useCallback(async(...v)=>{const b=v[0].state,M=v[0].magazineId;await r({variables:{id:M||"",state:b}})},[r]),P=h.useMemo(()=>v=>[{handler:()=>s({id:v.original.id,title:v.original?.title?.value||`(${n.formatMessage(F.noTitle)})`}),label:n.formatMessage(I.delete).toLocaleUpperCase()},{withRouterLinkTo:b=>b.original.id?a.toEditMagazine(b.original.id):void 0,label:n.formatMessage(I.edit).toLocaleUpperCase()}],[n,a,s]),C=le(`(max-width: ${o.newScreenBreakpoints.large-1}px)`);return e.jsxs(e.Fragment,{children:[e.jsx(Sl,{showModal:!!l,title:l?.title,closeDeleteModal:g,handleDeleteMagazine:N,mutationLoading:m}),e.jsx(Ve,{data:t,columnOptions:C?kf:x,noHeader:C,assetType:"magazine",actions:C?[]:j,contextActions:C?P:void 0,withPaginationBelow:!1,updateMagazineState:w})]})},bf=({limit:t,magazineCount:n})=>{const{formatMessage:a}=T(),o=Se(),l=Je(),{pages:d,currentPage:m,viewElements:u,loading:f}=He(n||0,gf,"viewer.paginatedMagazines",{variables:{preferredLanguages:o,query:l.get("q")}},t,"pageParam"),c=de(),i=mt();return e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:f,heightTrigger:u,delayHeightResolution:20,children:n?e.jsxs(e.Fragment,{children:[e.jsx(vf,{data:u}),!u.length&&e.jsx("p",{children:a(Ae.errorFetchMagazines)})]}):e.jsx($e,{contentType:Pe.Magazines,viewerIsUser:!0})}),e.jsx(Hi,{children:e.jsx(Ee,{currentPage:m,pages:d,setCurrentPage:r=>{i.push(c.toUserOrganizerMagazines(r,!1,l))}})})]})},yf=O.memo(bf),Sf=`query organizerPodcasts(
708  $limit: Int = 12
709  $offset: Int = 0
710  $preferredLanguages: [String!]
711  $query: String
712) {
713  viewer {
714    id
715    name
716    podcasts(limit: $limit, offset: $offset, query: $query) {
717      id
718      ownerEmail
719      state
720      podcastSelectedMeta(preferredLanguages: $preferredLanguages) {
721        langCode
722        title
723      }
724      podcastMeta {
725        langCode
726        title
727      }
728      created
729      episodesCount
730      thumbnail(preferredLanguages: $preferredLanguages) {
731        href
732        fileName
733        format
734        width
735        height
736      }
737    }
738  }
739}
740`,wf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"organizerPodcasts"}
740,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"12"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"0"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},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:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"podcasts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownerEmail"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"podcastSelectedMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"podcastMeta"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"created"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"episodesCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fileName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"format"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"width"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"height"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:636,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Sf}}},xf=`mutation updatePodcast_state($id: ID!, $state: PodcastState) {
741  updatePodcast(podcastId: $id, data: { state: $state }) {
742    id
743    state
744  }
745}
746`,Cf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updatePodcast_state"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"state"}},type:{kind:"NamedType",name:{kind:"Name",value:"PodcastState"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updatePodcast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"podcastId"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"state"},value:{kind:"Variable",name:{kind:"Name",value:"state"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:183,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:xf}}},Nf=(()=>{const t=Ue(We),[n]=W(xr);return h.useCallback(a=>n({variables:{podcastId:a},update:(o,l)=>{if(!l.data||!t)return;const d=l.data.deletePodcast,m=o.identify({__typename:"User",id:t});o.modify({broadcast:!1,id:m,fields:{podcasts(u){const f=o.identify(d);if(f)return u?.filter(c=>c==null?!0:o.identify(c)!==f)},removedPodcasts(u,{toReference:f}){const c=f(d);return c?[c,...u]:u},podcastsCount(u){return Math.max(0,u-1)},removedPodcastsCount(u){return u+1}}})}}),[n,t])}),jf=[{type:y.Section,accessor:t=>t,options:[y.Thumb,y.Title,y.Visibility,y.Date,y.Actions]}],Mf=({data:t})=>{const n=T(),a=ge(),o=de(),l=me(),d=Nf(),{graphqlError:m,success:u}=Z(),{openModal:f}=h.useContext(Rn),[c,i]=h.useState(!1),[r,s]=h.useState(null),[g]=W(Cf,{onCompleted:()=>
746u(n.formatMessage(an.updatedStateSuccess)),onError:m}),S=h.useMemo(()=>[{type:y.Thumb,accessor:M=>M?.thumbnail?.href},{type:y.Title,accessor:M=>M?.podcastSelectedMeta.title},{type:y.Text,accessor:M=>M?.episodesCount,header:n.formatMessage(F.numberOfEpisodes).toLocaleUpperCase(),style:{whiteSpace:"nowrap",minWidth:"150px"}},{type:y.Visibility,accessor:"state",style:{whiteSpace:"nowrap",minWidth:"150px"}},{type:y.Date,accessor:M=>n.formatDate(M.createdAt),header:n.formatMessage(mi.created).toLocaleUpperCase(),style:{whiteSpace:"nowrap",minWidth:"150px"}},{type:y.Actions}],[n]),N=h.useCallback(async(...M)=>{const R=M[0].state,B=M[0].podcastId;await g({variables:{id:B||"",state:R}})},[g]),x=h.useCallback(({id:M,title:R,state:B})=>{s({id:M,title:R,state:B})},[]),j=h.useCallback(M=>{f({variant:"flatRounded",header:n.formatMessage(wn.publish),headerIcon:e.jsxs(e.Fragment,{children:[e.jsx(Sn,{})," "]}),modalContent:e.jsx(Zs,{podcast:M})})},[n,f]),w=h.useMemo(()=>[{icon:ut,onClick:M=>x({id:M.original.id,title:M.original.podcastSelectedMeta.title,state:M.original.state}),label:n.formatMessage(I.delete).toLocaleUpperCase(),defaultColor:a.colors.accentNegative},{icon:ui,withRouterLinkTo:M=>M.original.id?o.toPodcast(M.original.id):void 0,label:n.formatMessage(I.edit).toLocaleUpperCase(),defaultColor:a.colors.accentPrimary},{icon:Sn,onClick:M=>j(M.original),label:n.formatMessage(an.publish),defaultColor:a.colors.accentPrimary}],[n,a.colors.accentNegative,a.colors.accentPrimary,x,o,j]),P=h.useMemo(()=>M=>[{handler:()=>x({id:M.original.id,title:M.original.podcastSelectedMeta.title,state:void 0}),label:n.formatMessage(I.delete).toLocaleUpperCase()},{withRouterLinkTo:R=>R.original.id?o.toPodcast(R.original.id):void 0,label:n.formatMessage(I.edit).toLocaleUpperCase()},{handler:()=>j(M.original),label:n.formatMessage(an.publish).toLocaleUpperCase()}],[n,o,x,j]),C=h.useCallback(()=>{c||s(null)},[c]),v=h.useCallback(async()=>{if(r&&!c)try{i(!0),await d(r.id),l.current&&C()}catch(M){l.current&&m(M)}finally{l.current&&i(!1)}},[C,d,m,l,r,c]),b=le(`(max-width: ${a.newScreenBreakpoints.large-1}px)`);return e.jsxs(e.Fragment,{children:[e.jsx(Nr,{showModal:!!r,title:r?.title,state:r?.state,closeDeleteModal:C,handleDeletePodcast:v,mutationLoading:c}),e.jsx(Ve,{data:t,columnOptions:b?jf:S,noHeader:b,updatePodcastState:N,assetType:"podcast",actions:b?[]:w,contextActions:b?P:void 0,withPaginationBelow:!1})]})},Ff=({limit:t,podcastsCount:n})=>{const{formatMessage:a}=T(),o=de(),l=Je(),d=mt(),m=Ue(We),u=Se(),f=T(),c=ge(),{graphqlError:i,success:r}=Z(),[s,g]=h.useState(!1),{pages:S,currentPage:N,viewElements:x,loading:j}=He(n||0,wf,"viewer.podcasts",{variables:{query:l.get("q")}},t,"pageParam"),w=le(`(max-width: ${c.screenBreakpoints.mobile}px)`),P=h.useCallback(()=>{g(!0)},[]),C=h.useCallback(()=>{g(!1)},[]),[v]=W(Qs,{update:M=>{const R=M.identify({__typename:"User",id:m});M.modify({id:R,fields:{podcastsCount(B){return typeof B=="number"?Math.max(0,B+1):B}}})},onCompleted:M=>{g(!1),r(f.formatMessage(Ne.notificationPodcastCreateSuccess,{title:M.createPodcast.podcastSelectedMeta.title}))},onError:i}),b=h.useCallback((M,R,B)=>v({variables:{data:{podcastMeta:M,categories:R,state:B},preferredLanguages:u}}),[u,v]);return e.jsxs(e.Fragment,{children:[e.jsx(Fe,{loading:j,heightTrigger:x,delayHeightResolution:20,children:n?e.jsxs(e.Fragment,{children:[e.jsx(Mf,{data:x}),!x.length&&e.jsx("p",{children:a(Ae.errorFetchPodcast)})]}):e.jsx($e,{contentType:Pe.Podcasts,viewerIsUser:!0,onCreateContent:P})}
746),e.jsx(qn,{children:e.jsx(Ln,{children:e.jsx(Jt,{xs:12,style:{display:"flex",justifyContent:"center"},children:e.jsx(Ee,{currentPage:N,pages:S,setCurrentPage:M=>{d.push(o.toUserOrganizerPodcasts(M,!1,l))}})})})}),s&&e.jsx(zs,{onClose:C,onSave:b,isMobile:w})]})},Pf=O.memo(Ff),Tf=({selectedMenu:t})=>{const n=T(),a=de(),o=ge(),l=Bi(),d=new URLSearchParams(l.search),m=De(je.MagazineSupport),u=De(je.PodcastSupport),f=h.useMemo(()=>({borderBottom:`2px solid ${o.colors.accentPrimary}`,color:o.colors.accentPrimary}),[o]);return e.jsxs(e.Fragment,{children:[e.jsx(Tt,{title:n.formatMessage(F.videos,{count:2}),to:a.toUserOrganizerVideos(1,!1,d),activeStyle:f,isActive:()=>t===Y.Videos,children:n.formatMessage(F.videos,{count:2})}),e.jsx(Tt,{title:n.formatMessage(F.articles,{count:2}),to:a.toUserOrganizerArticles(1,!1,d),activeStyle:f,isActive:()=>t===Y.Articles,children:n.formatMessage(F.articles,{count:2})}),e.jsx(Tt,{title:n.formatMessage(F.images),to:a.toUserOrganizerImages(1,!1,d),activeStyle:f,isActive:()=>t===Y.Images,children:n.formatMessage(F.images)}),e.jsx(Tt,{title:n.formatMessage(F.audios),to:a.toUserOrganizerAudios(1,!1,d),activeStyle:f,isActive:()=>t===Y.Audios,children:n.formatMessage(F.audios)}),m&&e.jsx(Tt,{title:n.formatMessage(F.magazines,{count:2}),to:a.toUserOrganizerMagazines(1,!1,d),activeStyle:f,isActive:()=>t===Y.Magazines,children:n.formatMessage(F.magazines,{count:2})}),u&&e.jsx(Tt,{title:n.formatMessage(F.podcasts,{count:2}),to:a.toUserOrganizerPodcasts(1,!1,d),activeStyle:f,isActive:()=>t===Y.Podcasts,children:n.formatMessage(F.podcasts,{count:2})})]})},gt=10,If=({userId:t})=>{const{formatMessage:n}=T(),a=de(),o=Bi(),l=Je(),d=mt(),[m,u]=h.useState(null),f=!l.get("folders")&&l.get("onlyUnassigned")==="1",{data:c,loading:i}=ue(Mr,{variables:{query:l.get("q"),filter:{projectFolderId:m,query:l.get("q"),withoutProjectFolder:f}}}),r=De(je.PublishContent),s=De(je.MagazineSupport),g=De(je.PodcastSupport),[S,N]=h.useState(!1),j=xs(a.organizerBaseMatchPath)?.params.subPage||Y.Videos,w=h.useCallback(P=>{const C=P.query;C?l.set("q",C):l.delete("q");const v=`${o.pathname}?${l.toString()}`;d.push(decodeURIComponent(v))},[d,l,o]);return e.jsxs(Fe,{loading:i,children:[e.jsxs(Xe,{spaceBetween:!0,children:[e.jsx(Us,{children:n(F.archive)}),e.jsx(Nt,{onSubmit:w,query:l.get("q")}),e.jsx(L,{color:"default",variant:"outlined",onClick:()=>N(!S),children:n(I.trash)}),S&&e.jsx(Dm,{onClose:N,selectedArchiveMenu:j})]}),r===!1&&e.jsx(Al,{}),e.jsx(Xe,{...ro("organizer-menu-tabs"),children:e.jsx(Tf,{selectedMenu:j})}),e.jsxs(Bt,{children:[e.jsx(ie,{path:"/archive/videos/:page?",render:()=>e.jsx(Za,{videosCount:c?.viewer?.videoCount,limit:gt,setProjectFolderId:u,projectFolderId:m})}),e.jsx(ie,{path:"/archive/articles/:page?",render:()=>e.jsx(af,{articlesCount:c?.viewer?.articleCount,limit:gt})}),e.jsx(ie,{path:"/archive/images/:page?",render:()=>e.jsx(Ja,{userId:t,limit:gt,type:"image"})}),e.jsx(ie,{path:"/archive/audios/:page?",render:()=>e.jsx(Ja,{userId:t,limit:gt,type:"audio"})}),s&&e.jsx(ie,{path:"/archive/magazines/:page?",render:()=>e.jsx(yf,{limit:gt,magazineCount:c?.viewer?.magazineCount})}),g&&e.jsx(ie,{path:"/archive/podcasts/:page?",render:()=>e.jsx(Pf,{limit:gt,podcastsCount:c?.viewer?.podcastsCount})}),e.jsx(ie,{path:"/archive",render:()=>e.jsx(Za,{videosCount:c?.viewer?.videoCount,limit:gt,setProjectFolderId:u,projectFolderId:m})})]})]})},Df=k.div.withConfig({componentId:"sc-b33a6523-0"})(["font-size:",";margin:"," 0;color:",";font-weight:500;height:",";letter-spacing:",";text-transform:uppercase;"],({theme:t})=>t.fontSizes.big,p(24),({theme:t})=>t.colors.textPrimary,p(21),p(2)),es=k.div.withConfig({componentId:"sc-b33a6523-1"})(["display:flex;align-items:center;flex:1 1 auto;flex-wrap:wrap;margin:"," 0;position:relative;",";",";",";",";",";"],p(16),t=>t.isRight&&"justify-content: flex-end",t=>t.isCenter&&"justify-content: center",t=>t.isColumn&&"flex-direction: column",t=>t.spaceBetween&&"justify-content: space-between",t=>t.withMarginBottom&&"margin-bottom: 2rem;"),ts=k(Cs).withConfig({componentId:"sc-b33a6523-2"})([""," font-weight:500;"," padding:"," 0;font-size:",";text-transform:uppercase;color:#969696;border-bottom:"," solid transparent;:hover{cursor:pointer;}@media only screen and (max-width:26.56rem){margin:0 ",";}"],wt,Rt("4.5rem"),p(7),p(12),p(2),p(16)),Af=k(L).withConfig({componentId:"sc-b33a6523-3"})(["position:absolute;top:-0.5rem;right:0;margin-top:0;margin-right:0;"]),Vf=k.div.withConfig({componentId:"sc-b33a6523-4"})(["font-size:",";"],p(100)),$f=k.div.withConfig({componentId:"sc-b33a6523-5"})(["display:grid;grid-gap:1.5rem;grid-template-columns:"," auto;align-items:center;"],p(100)),Rf=k.div.withConfig({componentId:"sc-b33a6523-6"})(["margin-top:1.5rem;align-self:center;"]),qf=k.div.withConfig({componentId:"sc-e9712560-0"})(["display:grid;position:relative;grid-gap:1rem;grid-template-columns:minmax(0,9.375rem) minmax(0,auto);margin-bottom:2rem;color:",";cursor:pointer;"],({theme:t})=>t.colors.textPrimary),Lf=k.h1.withConfig({componentId:"sc-e9712560-1"})(["font-size:1rem;font-weight:bold;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:1.5rem;"]),Ef=k.span.withConfig({componentId:"sc-e9712560-2"})(["color:",";margin-right:0.625rem;font-weight:bold;text-transform:initial;"],({theme:t})=>t.colors.dubbrTimelineLabelColor),Of=k.span.withConfig({componentId:"sc-e9712560-3"})(["text-transform:uppercase;vertical-align:middle;:before{content:'|';display:inline-block;margin-right:0.625rem;}"]),zf=k.p.withConfig({componentId:"sc-e9712560-4"})(["height:2rem;font-size:0.875rem;overflow:hidden;margin-bottom:0;position:relative;"]),_f=k.span.withConfig({componentId:"sc-e9712560-5"})(["margin:0;padding-right:3.5rem;padding-left:0.5rem;position:absolute;bottom:0;right:0;background:linear-gradient( to right,",","," 20% );"],({theme:t})=>js(.2,t.colors.backgroundPrimary),({theme:t})=>t.colors.backgroundPrimary),Bf=k.div.withConfig({componentId:"sc-e9712560-6"})(["display:inline-block;margin-right:0.625rem;vertical-align:middle;max-width:calc(100% - 15.25rem);"]),Uf=k(Wi).withConfig({componentId:"sc-e9712560-7"})(["position:absolute;font-size:1rem;top:0;right:0;color:",";"],({theme:t})=>t.colors.accentNegative),Wf=k.div.withConfig({componentId:"sc-e9712560-8"})(["font-size:",";"],p(100)),Hf=k.div.withConfig({componentId:"sc-e9712560-9"})(["display:grid;grid-gap:1.5rem;grid-template-columns:"," auto;align-items:center;"],p(100)),Qf=k.div.withConfig({componentId:"sc-e9712560-10"})(["margin-top:1.5rem;align-self:center;"]),Gf=k.div.withConfig({componentId:"sc-e9712560-11"})(["font-weight:bold;text-align:center;"]),is=k.a.withConfig({componentId:"sc-e9712560-12"})(["color:",";",";"],({theme:t})=>t.colors.textPrimary,({hideSlash:t})=>!t&&ae([":after{content:' / ';}"])),Yf=k.div.withConfig({componentId:"sc-e9712560-13"})(["display:inline-block;padding-left:0.5rem;"]),Kf=k(Ns).withConfig({componentId:"sc-e9712560-14"})(["font-size:1rem;display:inline-block;"]),Zf=k(bt).withConfig({componentId:"sc-e9712560-15"})(["display:block;font-weight:bold;padding-bottom:0.75rem;border-bottom:0.05rem solid ",";"],({theme:t})=>t.colors.textPrimary),ns=ve({deleteError:{id:"app.Producer.ViewedArticles.DeleteError",defaultMessage:"Oops! Something went wrong while removing the article from the activities, please try again later"},deleteSuccess:{id:"app.Producer.ViewedArticles.DeleteSuccess",defaultMessage:"Article has been successfully removed from your activities."}}),Xf=`mutation deleteViews {
747  deleteViews
748}
749`,Jf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteViews"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteViews"},arguments:[],directives:[]}]}}],loc:{start:0,end:77,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Xf}}},eg=`mutation deleteViewsByItemId($items: [String!]!) {
750  deleteViewsByItemId(items: $items)
751}
752`,Fr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteViewsByItemId"}
752,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"items"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteViewsByItemId"},arguments:[{kind:"Argument",name:{kind:"Name",value:"items"},value:{kind:"Variable",name:{kind:"Name",value:"items"}}}],directives:[]}]}}],loc:{start:0,end:128,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:eg}}},Pr=(t,{groupId:n,itemIds:a})=>(o,l)=>{if(!l.data?.deleteViewsByItemId)return;const d=o.identify({__typename:"GroupedView",itemId:n});let m=!1;const u=a.map(c=>o.identify({__typename:t==="video"?"Track":"ArticleContent",id:c})),f=t==="video"?"tracks":"articleContents";o.modify({id:d,fields:{[f]:c=>{if(!c)return c;const i=c.filter(r=>{const s=o.identify(r);return!u.includes(s)});return m=i.length===0,i}}}),m&&o.evict({id:d}),o.gc()},tg=t=>n=>{const[a]=W(Fr),o=l=>a({variables:{items:l.itemIds},update:Pr("article",l)});return e.jsx(t,{...n,deleteViewsByItemId:o})},ig=t=>n=>{const[a]=W(Fr),o=l=>a({variables:{items:l.itemIds},update:Pr("video",l)});return e.jsx(t,{...n,deleteViewsByItemId:o})},ng=()=>{const[t]=W(Jf,{update:(n,a)=>{a.data?.deleteViews&&n.modify({fields:{viewsByGroup(){return[]}}})}});return t},Kn=class Kn extends O.Component{constructor(n){super(n),this.refOfDescription=O.createRef(),this.state={showDots:!1,deleteItems:[],showLanguages:!1,showDeletionPromptModal:!1},this.openPrompt=a=>{a.stopPropagation(),this.setState({showDeletionPromptModal:!0})},this.cancelPrompt=()=>{this.setState({deleteItems:[],showDeletionPromptModal:!1})},this.onClickTether=a=>{a.stopPropagation(),a.preventDefault(),this.setState(o=>({showLanguages:!o.showLanguages}))},this.onClickWrapper=a=>{if(!this.state.showDeletionPromptModal){const{article:o}=this.props,l=this.props.linker.toArticle(o.itemId||"");a.preventDefault(),l&&window.open(l,"_blank","noopener noreferrer")}},this.onClickCheckBox=a=>{const o=a.currentTarget.id;this.setState(({deleteItems:l})=>l.includes(o)?{deleteItems:l.filter(d=>d!==o)}:{deleteItems:[...l,o]})},this.onClickAllCheckBox=()=>{this.setState(({deleteItems:a},{article:o})=>a.length===o.articleContents?.length?{deleteItems:[]}:{deleteItems:o.articleContents?.map(l=>l.id)||[]})},this.langHref=a=>a.stopPropagation(),this.messages=ve({hoverTitle:{id:"app.Producer.ViewedArticles.hoverTitle",defaultMessage:"Delete article from activities list"}}),this.onClickDeleteActivity=this.onClickDeleteActivity.bind(this)}componentDidMount(){this._isMounted=!0,this.refOfDescription.current&&this.setState(()=>this.refOfDescription.current?{showDots:this.refOfDescription.current.scrollHeight>this.refOfDescription.current.clientHeight}:null)}componentWillUnmount(){this._isMounted=!1}async onClickDeleteActivity(){if(!this.state.deleteItems.length||!this.props.article.itemId)return;const n=await this.props.deleteViewsByItemId({groupId:this.props.article.itemId,itemIds:this.state.deleteItems});if(this._isMounted){if(!n?.data?.deleteViewsByItemId){this.context.error(this.props.intl.formatMessage(ns.deleteError));return}this.context.success(this.props.intl.formatMessage(ns.deleteSuccess)),this.setState({showDeletionPromptModal:!1,deleteItems:[]})}}render(){const{intl:n,article:a}=this.props,o=a?.articleContents&&a.articleContents[0],l=a?.articleContents?.map(d=>d.langCode);return e.jsxs(qf,{onClick:this.onClickWrapper,children:[e.jsxs(Be,{className:"producerViewdArticleDelete",showModal:this.state.showDeletionPromptModal,onRequestClose:this.cancelPrompt,variant:"flatRounded",size:"small",overflow:"auto",ariaHideApp:!1,children:[e.jsxs(Hf,{children:[e.jsx(Wf,{children:e.jsx(ft,{})}),e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(ze,{id:"app.Producer.ViewedArticles.deleteHead",defaultMessage:"Are you sure you want to delete this article from your activities?"})}),e.jsxs(Gf,{children:[a.articleContents&&a.articleContents.length>1&&e.jsx(Zf,{id:"all",isRight:!0,handleChange:this.onClickAllCheckBox,defaultChecked:a.articleContents.length===this.state.deleteItems.length,children:n.formatMessage(Xs.all)}),a?.articleContents?.map(d=>e.jsx("p",{children:e.jsxs(bt,{id:d.id,isRight:!0,handleChange:this.onClickCheckBox,defaultChecked:this.state.deleteItems.includes(d.id),children:[d.title," (",d.langCode,")"]})},d.langCode))]}),e.jsx("p",{children:e.jsx(ze,{id:"app.Producer.ViewedArticles.deleteSubhead",defaultMessage:"Your item can never be recovered. Deleting the item has no impact on the article."})})]})]}),e.jsxs(Qf,{children:[e.jsx(L,{variant:"outlined",color:"negative",onClick:this.cancelPrompt,children:n.formatMessage(I.cancel)}),e.jsx(L,{variant:"outlined",color:"primary",onClick:this.onClickDeleteActivity,disabled:!this.state.deleteItems.length,children:n.formatMessage(I.delete)})]})]}),e.jsx(Uf,{title:n.formatMessage(this.messages.hoverTitle),onClick:this.openPrompt}),e.jsx("div",{children:e.jsx(Rs,{thumb:o?.article?.video?.thumbnail?.href||o?.picture?.href,type:"article",views:o?.article.views||0})}),e.jsxs("div",{children:[e.jsx(Lf,{children:o?.title}),e.jsx(Bf,{children:e.jsx(Ls,{user:o?.article?.owner||null,nameRight:!0,imgSize:"1.5rem",oneLine:!0})}),e.jsxs(Of,{children:[e.jsxs(Ef,{children:[e.jsx(ze,{id:"app.Producer.ViewedArticles.recentlyArticles",defaultMessage:"Read in"}),":"]}),l?.slice(0,3).map((d,m)=>e.jsx(is,{hideSlash:l.length-1===m||m>1,onClick:this.langHref,href:this.props.linker.toArticleLang(a.itemId||"",d),children:d},d)),l&&l?.length>3&&e.jsx(Yf,{onClick:this.onClickTether,children:e.jsx(Fs,{showContent:this.state.showLanguages,header:n.formatMessage(tt.Languages),iconContent:e.jsx(Kf,{}),children:l?.map((d,m)=>e.jsx(is,{hideSlash:l?.length-1===m,onClick:this.langHref,href:this.props.linker.toArticleLang(a.itemId||"",d),children:d.toUpperCase()},d))})})]}),e.jsxs(zf,{ref:this.refOfDescription,children:[o?.description,this.state.showDots&&e.jsx(_f,{children:"..."})]})]})]})}};Kn.contextType=Ms;let Mn=Kn;const ag=dt(ct,li,Ui,tg),sg=ag(Mn),rg=`query ProducerViewedArticlesQuery($offset: Int!, $limit: Int!, $query: String) {
753  viewsByGroup(offset: $offset, limit: $limit, types: Article, query: $query) {
754    itemId
755
756    articleContents {
757      id
758
759      article {
760        id
761        views
762
763        owner {
764          id
765          name
766          avatar {
767            href
768          }
769        }
770
771        video {
772          id
773
774          thumbnail {
775            href
776          }
777        }
778      }
779
780      created
781      title
782      langCode
783      description
784
785      picture {
786        href
787      }
788    }
789  }
790}
791`,og={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerViewedArticlesQuery"}
791,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewsByGroup"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"EnumValue",value:"Article"}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"articleContents"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"article"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"views"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owner"},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:"avatar"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"video"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"created"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"picture"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:597,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:rg}}},pn=10,lg=({query:t})=>{const n=me(),[a,o]=h.useState(!0),{data:l,loading:d,fetchMore:m}=ue(og,{variables:{offset:0,limit:pn,query:t}});h.useEffect(()=>{l&&(!l.viewsByGroup?.length||l.viewsByGroup.length<pn)&&o(!1)},[l]);const u=h.useCallback(async()=>{const f=l?.viewsByGroup;if(a===!0&&f){const c=await m({variables:{offset:f.length}});(!c.data.viewsByGroup?.length||c.data.viewsByGroup.length<pn)&&n.current&&o(!1)}},[l,a,m,n]);return d?e.jsx(fe,{}):e.jsx(xt,{onLoadMore:u,hasMoreItems:a,isActivityGrid:!0,children:(l?.viewsByGroup||[]).map(f=>e.jsx(sg,{article:f},f.itemId))})},dg=k.div.withConfig({componentId:"sc-3b5e5416-0"})(["display:grid;position:relative;grid-gap:1rem;grid-template-columns:minmax(0,9.375rem) minmax(0,auto);margin-bottom:2rem;color:",";cursor:pointer;"],({theme:t})=>t.colors.textPrimary),cg=k.h1.withConfig({componentId:"sc-3b5e5416-1"})(["font-size:1rem;font-weight:bold;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:1.5rem;"]),ug=k.span.withConfig({componentId:"sc-3b5e5416-2"})(["color:",";margin-right:0.625rem;font-weight:bold;text-transform:initial;"],({theme:t})=>t.colors.dubbrTimelineLabelColor),mg=k.span.withConfig({componentId:"sc-3b5e5416-3"})(["text-transform:uppercase;vertical-align:middle;:before{content:'|';display:inline-block;margin-right:0.625rem;}"]),fg=k.p.withConfig({componentId:"sc-3b5e5416-4"})(["height:2rem;font-size:0.875rem;overflow:hidden;margin-bottom:0;position:relative;"]);k.img.withConfig({componentId:"sc-3b5e5416-5"})(["width:100%;min-height:100px;"]);const gg=k.span.withConfig({componentId:"sc-3b5e5416-6"})(["margin:0;padding-right:3.5rem;padding-left:0.5rem;position:absolute;bottom:0;right:0;background:linear-gradient( to right,",","," 20% );"],({theme:t})=>js(.2,t.colors.backgroundPrimary),({theme:t})=>t.colors.backgroundPrimary),hg=k.div.withConfig({componentId:"sc-3b5e5416-7"})(["display:inline-block;margin-right:0.625rem;vertical-align:middle;max-width:calc(100% - 15.25rem);"]),pg=k(Wi).withConfig({componentId:"sc-3b5e5416-8"})(["position:absolute;font-size:1rem;top:0;right:0;color:",";"],({theme:t})=>t.colors.accentNegative),kg=k.div.withConfig({componentId:"sc-3b5e5416-9"})(["font-size:",";"],p(100)),vg=k.div.withConfig({componentId:"sc-3b5e5416-10"})(["display:grid;grid-gap:1.5rem;grid-template-columns:"," auto;align-items:center;"],p(100)),bg=k.div.withConfig({componentId:"sc-3b5e5416-11"})(["margin-top:1.5rem;align-self:center;"]),yg=k.div.withConfig({componentId:"sc-3b5e5416-12"})(["margin:2rem;"]),as=k.a.withConfig({componentId:"sc-3b5e5416-13"})(["color:",";",";"],({theme:t})=>t.colors.textPrimary,({hideSlash:t})=>!t&&ae([":after{content:' / ';}"])),Sg=k.div.withConfig({componentId:"sc-3b5e5416-14"})(["display:inline-block;padding-left:0.5rem;"]),wg=k(Ns).withConfig({componentId:"sc-3b5e5416-15"})(["font-size:1rem;display:inline-block;"]),xg=k(bt).withConfig({componentId:"sc-3b5e5416-16"})(["display:block;font-weight:bold;padding-bottom:0.75rem;border-bottom:0.05rem solid ",";"],({theme:t})=>t.colors.textPrimary),ss=ve({deleteError:{id:"app.Producer.ViewedVideos.DeleteError",defaultMessage:"Oops! Something went wrong while removing the activity, please try again later"},deleteSuccess:{id:"app.Producer.ViewedVideos.DeleteSuccess",defaultMessage:"The activity has been successfully removed"}}),Zn=class Zn extends O.Component{constructor(n){super(n),this.refOfDescription=O.createRef(),this.state={showDots:!1,deleteItems:[],showLanguages:!1,showDeletionPromptModal:!1},this.onClickWrapper=a=>{const{video:o}=this.props;if(!this.state.showDeletionPromptModal&&this.props.video.itemId){const l=this.props.linker.toVideo(o.itemId||"");a.preventDefault(),l&&window.open(l,"_blank","noopener noreferrer")}},this.langHref=a=>a.stopPropagation(),this.openPrompt=a=>{a.stopPropagation(),this.setState({showDeletionPromptModal:!0})},this.cancelPrompt=()=>{this.setState({deleteItems:[],showDeletionPromptModal:!1})},this.onClickTether=a=>{a.stopPropagation(),a.preventDefault(),this.setState(o=>({showLanguages:!o.showLanguages}))},this.onClickCheckBox=a=>{const o=a.currentTarget.id;this.setState(({deleteItems:l})=>l.includes(o)?{deleteItems:l.filter(d=>d!==o)}:{deleteItems:[...l,o]})},this.onClickAllCheckBox=()=>{this.setState(({deleteItems:a},{video:o})=>a.length===o.tracks?.length?{deleteItems:[]}:{deleteItems:o.tracks?.map(l=>l.id)||[]})},this.messages=ve({hoverTitle:{id:"app.Producer.ViewedVideos.hoverTitle",defaultMessage:"Delete video from activities list"}}),this.onClickDeleteActivity=this.onClickDeleteActivity.bind(this)}componentDidMount(){this._isMounted=!0,this.refOfDescription.current&&this.setState(()=>this.refOfDescription.current?{showDots:this.refOfDescription.current.scrollHeight>this.refOfDescription.current.clientHeight}:null)}componentWillUnmount(){this._isMounted=!1}async onClickDeleteActivity(){if(!this.state.deleteItems.length||!this.props.video.itemId)return;const n=await this.props.deleteViewsByItemId({groupId:this.props.video.itemId,itemIds:this.state.deleteItems});if(this._isMounted){if(!n?.data?.deleteViewsByItemId){const a=this.props.video.tracks?.[0].title||"Unknown";this.context.error(this.props.intl.formatMessage(ss.deleteError,{title:a}));return}this.context.success(this.props.intl.formatMessage(ss.deleteSuccess)),this.setState({showDeletionPromptModal:!1,deleteItems:[]})}}render(){const{intl:n,video:a}=this.props,o=a?.tracks&&a?.tracks[0],l=a?.tracks?.map(d=>d.langCode)||null;return e.jsxs(dg,{onClick:this.onClickWrapper,children:[e.jsxs(Be,{className:"producerViewedVideoDelete",showModal:this.state.showDeletionPromptModal,onRequestClose:this.cancelPrompt,variant:"flatRounded",size:"small",overflow:"auto",ariaHideApp:!1,children:[e.jsxs(vg,{children:[e.jsx(kg,{children:e.jsx(ft,{})}),e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(ze,{id:"app.Producer.ViewedVideos.deleteHead",defaultMessage:"Are you sure you want to delete this video from your activities?"})}),e.jsxs(yg,{children:[a?.tracks&&a.tracks.length>1&&e.jsx(xg,{id:"all",isRight:!0,handleChange:this.onClickAllCheckBox,defaultChecked:a?.tracks?.length===this.state.deleteItems.length,children:n.formatMessage(Xs.all)}),a?.tracks?.map(d=>e.jsx("p",{children:e.jsxs(bt,{id:d.id,isRight:!0,handleChange:this.onClickCheckBox,defaultChecked:this.state.deleteItems.includes(d.id),children:[d.title," (",d.langCode,")"]})},d.langCode))]}),e.jsx(ze,{id:"app.Producer.ViewedVideos.deleteSubhead",defaultMessage:"Your item can never be recovered. Deleting the item has no impact on the video."})]})]}),e.jsxs(bg,{children:[e.jsx(L,{variant:"outlined",color:"negative",onClick:this.cancelPrompt,children:n.formatMessage(I.cancel)}),e.jsx(L,{variant:"outlined",color:"primary",onClick:this.onClickDeleteActivity,disabled:!this.state.deleteItems.length,children:n.formatMessage(I.delete)})]})]}),e.jsx(pg,{title:n.formatMessage(this.messages.hoverTitle),onClick:this.openPrompt}),e.jsx("div",{children:e.jsx(Rs,{thumb:o?.video?.thumbnail?.href,type:"video",views:o?.video?.views||0})}),e.jsxs("div",{children:[e.jsx(cg,{children:o?.title}),e.jsx(hg,{children:e.jsx(Ls,{user:o?.video?.owner||null,nameRight:!0,imgSize:"1.5rem",oneLine:!0})}),e.jsxs(mg,{children:[e.jsxs(ug,{children:[e.jsx(ze,{id:"app.Producer.ViewedVideos.recentlyVideos",defaultMessage:"Viewed in"}),":"]}),l?.slice(0,3).map((d,m)=>e.jsx(as,{hideSlash:l?.length-1===m||m>1,onClick:this.langHref,href:this.props.linker.toVideoLang(a.itemId||"",d),children:d},d)),l&&l.length>3&&e.jsx(Sg,{onClick:this.onClickTether,children:e.jsx(Fs,{showContent:this.state.showLanguages,header:n.formatMessage(tt.Languages),iconContent:e.jsx(wg,{}),children:l?.map((d,m)=>e.jsx(as,{hideSlash:l?.length-1===m,onClick:this.langHref,href:this.props.linker.toVideoLang(a.itemId||"",d),children:d.toUpperCase()},d))})})]}),e.jsxs(fg,{ref:this.refOfDescription,children:[o?.description,this.state.showDots&&e.jsx(gg,{children:"..."})]})]})]})}};Zn.contextType=Ms;let Fn=Zn;const Cg=dt(ct,li,Ui,ig),Ng=Cg(Fn),jg=`query ProducerViewedVideosQuery($offset: Int!, $limit: Int!, $query: String) {
792  viewsByGroup(offset: $offset, limit: $limit, types: Video, query: $query) {
793    itemId
794
795    tracks {
796      id
797      title
798      description
799      langCode
800
801      video {
802        id
803        views
804
805        owner {
806          id
807          name
808
809          avatar {
810            href
811          }
812        }
813
814        thumbnail {
815          href
816        }
817      }
818    }
819  }
820}
821`,Mg={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerViewedVideosQuery"}
821,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewsByGroup"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"EnumValue",value:"Video"}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tracks"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"video"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"views"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"owner"},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:"avatar"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"thumbnail"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:484,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:jg}}},yi=10,rs=({query:t})=>{const n=me(),[a,o]=h.useState(!0),{data:l,fetchMore:d,loading:m}=ue(Mg,{variables:{offset:0,limit:yi,query:t}});h.useEffect(()=>{l&&(!l.viewsByGroup?.length||l.viewsByGroup.length<yi)&&o(!1)},[l]);const u=h.useCallback(async()=>{const f=l?.viewsByGroup;if(a===!0&&f){const c=await d({variables:{offset:f.length,limit:yi}});(!c.data.viewsByGroup?.length||c.data.viewsByGroup.length<yi)&&n.current&&o(!1)}},[l,a,d,n]);return m?e.jsx(Ut,{}):e.jsx(xt,{onLoadMore:u,hasMoreItems:a,isActivityGrid:!0,children:(l?.viewsByGroup||[]).map(f=>e.jsx(Ng,{video:f},f.itemId))})},os=ve({deleteError:{id:"app.Producer.Activities.DeleteError",defaultMessage:"Oops! Something went wrong while deleting your activities, please try again later"},deleteSuccess:{id:"app.Producer.Activities.DeleteSuccess",defaultMessage:"Your activities have been successfully deleted."}}),Fg=()=>{const t=T(),n=de(),{success:a,error:o}=Z(),[l,d]=h.useState(!1),[m,u]=h.useState(""),f=ng(),c=h.useCallback(async r=>{if(!r){d(!0);return}d(!1);const{data:s}=await f();if(!s?.deleteViews){o(t.formatMessage(os.deleteError));return}a(t.formatMessage(os.deleteSuccess))},[f,o,t,a]),i=h.useCallback(r=>{u(r.query)},[]);return e.jsxs(O.Fragment,{children:[e.jsxs(Be,{className:"producerViewedDelete",showModal:l,onRequestClose:()=>d(!1),variant:"flatRounded",size:"small",overflow:"auto",ariaHideApp:!1,children:[e.jsxs($f,{children:[e.jsx(Vf,{children:e.jsx(ft,{})}),e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(ze,{id:"app.Producer.Activities.deleteHead",defaultMessage:"Are you sure you want to delete all of your activities?"})}),e.jsx("p",{children:e.jsx(ze,{id:"app.Producer.Activities.deleteSubhead",defaultMessage:"Your activites can never be recovered. Deleting all of your activities has no impact on the videos and articles."})})]})]}),e.jsxs(Rf,{children:[e.jsx(L,{variant:"outlined",color:"negative",onClick:()=>d(!1),children:t.formatMessage(I.cancel)}),e.jsx(L,{variant:"outlined",color:"primary",onClick:()=>c(!0),children:t.formatMessage(I.delete)})]})]}),e.jsxs(es,{spaceBetween:!0,children:[e.jsx(Df,{children:e.jsx(ze,{id:"app.Producer.Activities.activities",defaultMessage:"View your activities"})}),e.jsx(Nt,{onSubmit:i})]}),e.jsxs(es,{withMarginBottom:!0,children:[e.jsx(ts,{title:t.formatMessage(F.videos,{count:2}),to:n.toUserActivitiesVideos(),activeStyle:{borderBottom:"2px s
821olid #00afaa",color:"#00afaa"},exact:!0,children:t.formatMessage(F.videos,{count:2})}),e.jsx(ts,{title:t.formatMessage(F.articles,{count:2}),to:n.toUserActivitiesArticles(),activeStyle:{borderBottom:"2px solid #00afaa",color:"#00afaa"},children:t.formatMessage(F.articles,{count:2})}),e.jsx(Af,{color:"negative",variant:"text",onClick:()=>c(),children:e.jsx(ze,{id:"app.Producer.Activities.deleteAll",defaultMessage:"Delete all activites"})})]}),e.jsxs(Bt,{children:[e.jsx(ie,{path:n.toUserActivitiesVideos(),render:()=>e.jsx(rs,{query:m})}),e.jsx(ie,{path:n.toUserActivitiesArticles(),render:()=>e.jsx(lg,{query:m})}),e.jsx(ie,{exact:!0,path:n.toUserActivities(),render:()=>e.jsx(rs,{query:m})})]})]})},Pg=`#import "@web/app/graphql/fragments/SubscriptionUser.graphql"
822#import "@web/app/graphql/fragments/ViewerStats.graphql"
823#import "@web/app/graphql/fragments/UserWallet.graphql"
824
825query PaymentPageQuery($states: [CreditTransactionState!]) {
826  viewer {
827    id
828    email
829    plan {
830      id
831      name
832    }
833    scheduledPlanDowngrades {
834      id
835      effectiveAt
836      alughaPlanId
837      plan {
838        id
839        name
840      }
841    }
842    wallet {
843      id
844      ...UserWallet
845    }
846    stats {
847      ...ViewerStatsFragment
848    }
849  }
850  viewerAsSubscriber {
851    ...SubscriptionUser
852  }
853}
854`,lt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentPageQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"states"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreditTransactionState"}}}},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:"email"},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:"scheduledPlanDowngrades"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"effectiveAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alughaPlanId"},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:"wallet"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"UserWallet"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"stats"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ViewerStatsFragment"},directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"viewerAsSubscriber"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SubscriptionUser"},directives:[]}]}}]}}],loc:{start:0,end:619,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Pg}}},Yn=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};lt.definitions=Yn(lt.definitions.concat(Js.definitions));lt.definitions=Yn(lt.definitions.concat(cl.definitions));lt.definitions=Yn(lt.definitions.concat(ul.definitions));const Tg=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
854{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Tg(lt,"PaymentPageQuery");const Ig=t=>{const{authService:n}=Wt(),a=!!n?.isPersona,{isOpen:o,open:l,close:d}=oo(),m=Je(),{data:u,loading:f}=ue(lt,{variables:{states:[ta.Completed,ta.Pending]},skip:!n||a});return h.useEffect(()=>{f||!n||m.get("open_buy_credits")==="1"&&l()},[m,f,n,l]),!n||f?e.jsx(Ut,{}):a||!u?.viewer?null:u?.viewerAsSubscriber?.__typename=="PaddleBillingSubscriber"?e.jsx("h1",{children:"Paddle Billing is under construction"}):e.jsxs(e.Fragment,{children:[e.jsx(ml,{params:t.match.params,user:u.viewer,viewerAsSubscriber:u?.viewerAsSubscriber,totalCreditTransactions:u.viewer.wallet?.totalCreditTransactions}),e.jsx(lo,{isOpen:o,close:d})]})},Dg={definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProducerDataPrivate"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"gender"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"birthday"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subtitleRules"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]},Ag=`#import "./ProducerData.graphql"
855#import "./ProducerDataPrivate.graphql"
856
857fragment ProducerViewerData on User {
858  id
859  ...ProducerData
860  ...ProducerDataPrivate
861  profiles {
862    id
863    langCode
864    bio
865    hobbies
866  }
867  videoSettingsDefaults {
868    hideComments
869    hideInsights
870    playPreroll
871    playPostroll
872    subtitleRuleId
873  }
874  adConfig {
875    watchlistId
876    skippableAfter
877  }
878}
879`,yt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProducerViewerData"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerData"},directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerDataPrivate"},directives:[]},{kind:"Field",name:{kind:"Name",value:"profiles"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"langCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bio"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hobbies"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"videoSettingsDefaults"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hideComments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hideInsights"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"playPreroll"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"playPostroll"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subtitleRuleId"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"adConfig"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"watchlistId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"skippableAfter"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:425,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Ag}}},Tr=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};yt.definitions=Tr(yt.definitions.concat(et.definitions));yt.definitions=Tr(yt.definitions.concat(Dg.definitions));const Vg=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
879{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Vg(yt,"ProducerViewerData");const $g=`#import "../fragments/ProducerData.graphql"
880#import "../fragments/ProducerViewerData.graphql"
881
882query ProducerQuery($id: ID!, $preferredLanguages: [String!]) {
883  viewer {
884    id
885    ...ProducerViewerData
886  }
887  user(id: $id) {
888    id
889    profile(preferredLanguages: $preferredLanguages) {
890      id
891      bio
892    }
893    ...ProducerData
894  }
895}
896`,zt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProducerQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},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:"FragmentSpread",name:{kind:"Name",value:"ProducerViewerData"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profile"},arguments:[{kind:"Argument",name:{kind:"Name",value:"preferredLanguages"},value:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bio"},arguments:[],directives:[]}]}},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerData"},directives:[]}]}}]}}],loc:{start:0,end:376,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:$g}}},Ir=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};zt.definitions=Ir(zt.definitions.concat(et.definitions));zt.definitions=Ir(zt.definitions.concat(yt.definitions));const Rg=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Rg(zt,"ProducerQuery");const qg=k.div.withConfig({componentId:"sc-e49221d4-0"})(["display:flex;justify-content:center;width:100%;flex-direction:column;"]),Lg=k.div.withConfig({componentId:"sc-e49221d4-1"})(["display:flex;justify-content:center;font-size:2rem;margin:1rem 0;font-weight:bold;color:",";"],({theme:t})=>t.colors.accentPrimary),Eg=k.div.withConfig({componentId:"sc-e49221d4-2"})(["display:flex;font-size:1.25rem;justify-content:center;"]);k.div.withConfig({componentId:"sc-e49221d4-3"})(["display:flex;justify-content:center;"]);k.div.withConfig({componentId:"sc-e49221d4-4"})([""," width:100%;max-width:98rem;background-color:#141a20;height:3rem;"],wt);k.div.withConfig({componentId:"sc-e49221d4-5"})(["overflow-x:auto;white-space:nowrap;display:flex;scrollbar-color:rgba(64,76,88,1) transparent;scrollbar-width:thin;::-webkit-scrollbar{height:10px;}::-webkit-scrollbar-track{border-radius:5px;}::-webkit-scrollbar-thumb{background:rgba(64,76,88,1);border-radius:5px;}::-webkit-scrollbar-thumb:hover{background:rgba(64,76,88,0.5);}"]);const Og=k.div.withConfig({componentId:"sc-e49221d4-6"})(["display:flex;justify-content:center;font-weight:500;padding:1rem 0;margin:0 1.5rem;font-size:0.75rem;text-transform:uppercase;border-bottom:0.125rem solid ",";color:",";:hover{cursor:pointer;}@media only screen and (max-width:26.56rem){margin:0 1rem;}"],({theme:t,isHighlighted:n})=>n?t.colors.accentPrimary:"transparent",({theme:t,isHighlighted:n})=>n?t.colors.accentPrimary:"#969696"),zg=ae(["white-space:nowrap;transition:0.2s color ease;padding:0;margin:0;:hover{color:",";}"],({theme:t})=>t.colors.textHighlighted);k(Og.withComponent(Ie)).withConfig({componentId:"sc-e49221d4-7"})(["",""],zg);const ls=k(Vl).withConfig({componentId:"sc-e49221d4-8"})(["display:flex;justify-content:center;padding-bottom:11rem;margin-top:2.9375rem;"]),_g=k.div.withConfig({componentId:"sc-e49221d4-9"})(["width:100%;padding:1rem 0 0 0;"]);k.button.withConfig({componentId:"sc-e49221d4-10"})(["color:",";display:flex;background-color:transparent;min-width:4.25rem;max-width:5.25rem;border:none;margin:",";:hover{cursor:pointer;}"],({theme:t})=>t.colors.textPrimary,t=>t.noMargin?"0 0 0 0":" 0 0 2.5rem 0");k.div.withConfig({componentId:"sc-e49221d4-11"})(["display:flex;width:100%;align-items:center;justify-content:space-between;"]);k.div.withConfig({componentId:"sc-e49221d4-12"})(["font-size:0.75rem;text-transform:uppercase;font-weight:bold;color:#ffffff;"]);const Bg=`#import "@web/shared/graphql/fragments/auth2FAPrompt.graphql"
897
898mutation EnableAuthFactorTOTPStep1 {
899  enableAuthFactorTOTPStep1 {
900    ...Auth2FAPrompt
901    ... on Auth2FATOTPRegister {
902      loginToken
903      totpURI
904    }
905  }
906}
907`,qi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"EnableAuthFactorTOTPStep1"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enableAuthFactorTOTPStep1"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Auth2FAPrompt"},directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Auth2FATOTPRegister"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"loginToken"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totpURI"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:265,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Bg}}},Ug=t=>{const n={};
907return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};qi.definitions=Ug(qi.definitions.concat(fi.definitions));const Wg=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Wg(qi,"EnableAuthFactorTOTPStep1");const Dr=k.div.withConfig({componentId:"sc-e36f7224-0"})(["display:flex;flex-flow:column nowrap;align-items:center;"]);k.div.withConfig({componentId:"sc-e36f7224-1"})(["margin:3rem 6rem;"]);const Hg=k.h1.withConfig({componentId:"sc-e36f7224-2"})(["margin-top:0;font-size:1.5rem;"]),Qg=k.div.withConfig({componentId:"sc-e36f7224-3"})(["display:flex;flex-wrap:nowrap;margin:2rem 0 1rem 0;flex-direction:column;@media (min-width:700px){flex-direction:row;}"]),ds=k.div.withConfig({componentId:"sc-e36f7224-4"})(["flex:1 1 auto;padding:0 1rem;"]),Gg=k.ol.withConfig({componentId:"sc-e36f7224-5"})(["width:350px;li{margin-bottom:0.5rem;}"]),Ar=k.div.withConfig({componentId:"sc-e36f7224-6"})(["margin-top:1rem;display:flex;flex-flow:row nowrap;justify-content:center;width:100%;"]),Yg=k.div.withConfig({componentId:"sc-e36f7224-7"})(["display:flex;justify-content:center;"]),Kg=k.p.withConfig({componentId:"sc-e36f7224-8"})(["font-size:12px;font-weight:bold;margin-bottom:0.3rem;"]),Zg=k.p.withConfig({componentId:"sc-e36f7224-9"})(["font-size:12px;margin-top:0.3rem;"]),Xg=`#import "@web/shared/graphql/fragments/authTokenSetFragment.graphql"
908
909mutation EnableAuthFactorTOTPStep2($input: Submit2FaTOTPInput!) {
910  enableAuthFactorTOTPStep2(input: $input) {
911    user {
912      id
913      twoFactor {
914        id
915        totpEnabled
916      }
917    }
918    tokens {
919      ...AuthTokenSetFragment
920    }
921    backupCodes
922  }
923}
924`,Li={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"EnableAuthFactorTOTPStep2"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Submit2FaTOTPInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enableAuthFactorTOTPStep2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"twoFactor"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totpEnabled"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"tokens"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AuthTokenSetFragment"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"backupCodes"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:373,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Xg}}},Jg=t=>{const n={};
924return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Li.definitions=Jg(Li.definitions.concat(Ps.definitions));const eh=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};eh(Li,"EnableAuthFactorTOTPStep2");const ht=ve({manualEntryHeading:{id:"app.EnableTOTPButton.QRCodeView.manualEntryHeading",defaultMessage:"Manual Entry:",description:"Heading above the code to manually register an authenticator app without scanning the QR code"},authenticatorSetupHeading:{id:"app.EnableTOTPButton.QRCodeView.authenticatorSetupHeading",defaultMessage:"Authenticator Setup"},authenticatorSetupText1:{id:"app.EnableTOTPButton.QRCodeView.authenticatorSetupText1",defaultMessage:"Download your favorite authenticator app or browser extension."},authenticatorSetupText2:{id:"app.EnableTOTPButton.QRCodeView.authenticatorSetupText2",defaultMessage:"Scan the QR code, or enter the key manually."},authenticatorSetupText3:{id:"app.EnableTOTPButton.QRCodeView.authenticatorSetupText3",defaultMessage:"Verify your authenticator app by entering the six-digit code in the field below."},codeInputPlaceholder:{id:"app.EnableTOTPButton.QRCodeView.codeInputPlaceholder",defaultMessage:"Authenticator Code"},registerAuthenticatorButton:{id:"app.EnableTOTPButton.registerAuthenticatorButton",defaultMessage:"Register Authenticator App"}}),th=Ol({code:zl().matches(/^(\d){6}$/).required()}),ih=({totpURI:t,loginToken:n,next:a,closeModal:o})=>{const{authService:l}=Wt(),{graphqlError:d,clearNotification:m}=Z(),{formatMessage:u}=T(),f=h.useMemo(()=>new URL(t).searchParams.get("secret"),[t]),[c,{loading:i}]=W(Li,{onError:d,onCompleted(S){l?.setAuthTokens(S.enableAuthFactorTOTPStep2.tokens),a(S.enableAuthFactorTOTPStep2.backupCodes??void 0)}}),r=h.useCallback(S=>{i||(m(),c({variables:{input:{loginToken:n,totpResult:S.code}}}))},[i,m,c,n]),s=co({initialValues:{code:""},onSubmit:r,validationSchema:th,validateOnMount:!0}),g=h.useCallback(S=>{s.setFieldValue(S.currentTarget.name,S.currentTarget.value.trim().slice(0,6))},[s]);return l?e.jsx(Dr,{children:e.jsxs("form",{onSubmit:s.handleSubmit,children:[e.jsxs(Qg,{children:[e.jsxs(ds,{children:[e.jsx(Yg,{children:e.jsx(El,{value:t,size:"small"})}),e.jsx(Kg,{children:u(ht.manualEntryHeading)}),e.jsx(Zg,{children:e.jsx("code",{children:f})})]}),e.jsxs(ds,{children:[e.jsx(Hg,{children:u(ht.authenticatorSetupHeading)}),e.jsxs(Gg,{children:[e.jsx("li",{children:u(ht.authenticatorSetupText1)}),e.jsx("li",{children:u(ht.authenticatorSetupText2)}),e.jsx("li",{children:u(ht.authenticatorSetupText3)})]}),e.jsx(uo,{name:"code",type:"text",autoFocus:!0,placeholder:u(ht.codeInputPlaceholder),required:!0,onChange:g,value:s.values.code})]})]}),e.jsxs(Ar,{children:[e.jsx(L,{variant:"contained",color:"primary",type:"submit",disabled:!s.isValid,"aria-label":i?u(F.loading):void 0,children:i?e.jsx(fe,{size:"24px"}):u(I.save)}),e.jsx(L,{variant:"contained",color:"negative",type:"button",disabled:i,onClick:o,children:u(I.cancel)})]})]})}):e.jsx(fe,{size:"24px"})},nh=({data:t,finish:n,cancel:a})=>{const[o,l]=h.useState(),{formatMessage:d}=T(),m=h.useCallback(u=>{u?l(u):n()},[n]);return t.__typename==="Auth2FAPromptBasic"?e.jsx(e.Fragment,{children:"2FA is already active, 2FA prompt is currently not implemented"}):o?e.jsxs(Dr,{children:[e.jsx(er,{backupCodes:o}),e.jsx(Ar,{children:e.jsx(L,{variant:"contained",color:"primary",type:"submit",onClick:n,children:d(I.close)})})]}):e.jsx(ih,{...t,next:m,closeModal:a})},ah={marginLeft:0,marginRight:0},sh=()=>{const{openModal:t,closeModal:n,updateModal:a}=$n(),{graphqlError:o,clearNotification:l}=Z(),d=h.useRef(null),m=h.useRef(void 0),{formatMessage:u}=T(),[f,{data:c,loading:i}]=W(qi,{fetchPolicy:"no-cache",onError:o,onCompleted:S=>{m.current=S.enableAuthFactorTOTPStep1.loginToken}}),[r]=W(Rl),s=h.useMemo(()=>c?{variant:"flatRounded",hideHeader:!0,modalContent:e.jsx(nh,{finish:()=>{m.current=void 0,d.current&&(n(d.current),d.current=0)},cancel:()=>{d.current&&(n(d.current),d.current=0)},data:c.enableAuthFactorTOTPStep1}),onCloseCallback(){m.current&&r({variables:{loginToken:m.current}})},size:"small"}:void 0,[c,r,n]),g=h.useCallback(()=>{i||(l(),f())},[i,l,f]);return h.useEffect(()=>{d.current?s?a(s):(n(d.current),d.current=0):s&&(d.current=t(s))},[a,n,t,s]),e.jsx(L,{type:"button",variant:"contained",color:"primary",onClick:g,disabled:i,"aria-label":i?u(F.loading):void 0,style:ah,children:i?e.jsx(fe,{size:"24px"}):u(ht.registerAuthenticatorButton)})},rh=`#import "@web/shared/graphql/fragments/auth2FAPrompt.graphql"
925
926mutation GenBackupCodes {
927  genBackupCodes {
928    ...Auth2FAPrompt
929  }
930}
931`,Ei={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GenBackupCodes"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"genBackupCodes"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Auth2FAPrompt"},directives:[]}]}}]}}],loc:{start:0,end:173,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:rh}}},oh=t=>{const n={};
931return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Ei.definitions=oh(Ei.definitions.concat(fi.definitions));const lh=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};lh(Ei,"GenBackupCodes");const cs=ve({buttonText:{id:"app.GenerateBackupCodesButton.buttonText",defaultMessage:"Generate new backup codes"},promptText:{id:"app.GenerateBackupCodesButton.promptText",defaultMessage:"Overwrite existing backup codes?"}});function Pn(t){return new Promise(n=>{setTimeout(n,t)})}const dh=k.div.withConfig({componentId:"sc-ebeda97f-0"})(["display:flex;flex-flow:column nowrap;align-items:center;"]),ch={marginLeft:0,marginRight:0},uh=({userId:t,hasExistingCodes:n})=>{const{openModal:a,closeModal:o}=$n(),[l,d]=h.useState(!1),{formatMessage:m}=T(),u=me(),f=En(m(cs.promptText)),c=h.useRef(null),{open2FaPrompt:i}=Qi(),r=h.useCallback(async w=>{c.current||(await Pn(200),u.current&&(c.current=a({variant:"flatRounded",hideHeader:!0,modalContent:e.jsxs(dh,{children:[e.jsx(er,{backupCodes:w}),e.jsx("div",{children:e.jsx(L,{type:"button",variant:"contained",color:"primary",onClick:()=>{c.current&&o(c.current)},children:m(I.close)})})]}),size:"small",onCloseCallback(){c.current=0}})))},[a,o,m,u]),{graphqlError:s,clearNotification:g}=Z(),[S,{loading:N}]=W(Ei,{onError:w=>{setTimeout(()=>{s(w)},200)},onCompleted:w=>{i(w.genBackupCodes,P=>{if(P?.__typename==="BackupCodesResult")return r(P.backupCodes)})},update:(w,{data:P})=>{P?.genBackupCodes&&w.modify({id:w.identify({__typename:"User",id:t}),fields:{twoFactor:C=>typeof C!="object"||!("twoFactor"in C)?C:{...C,twoFactor:{...C.twoFactor,backupCodesMissing:!1}}}})}}),x=l||N,j=h.useCallback(async()=>{if(!x){if(c.current&&o(c.current),n){d(!0);const w=await f();if(d(!1),!w)return}g(),await Pn(200),u.current&&await S()}},[o,x,n,f,S,g,u]);return e.jsx(L,{type:"button",variant:"contained",color:"primary",onClick:j,style:ch,children:m(cs.buttonText)})},mh=`#import "@web/shared/graphql/fragments/auth2FAPrompt.graphql"
932
933mutation DisableTOTP {
934  disableAuthFactorTOTP {
935    ...Auth2FAPrompt
936  }
937}
938`,Oi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DisableTOTP"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"disableAuthFactorTOTP"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Auth2FAPrompt"},directives:[]}]}}]}}],loc:{start:0,end:177,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:mh}}},fh=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};Oi.definitions=fh(Oi.definitions.concat(fi.definitions));const gh=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
938{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};gh(Oi,"DisableTOTP");const hh={marginLeft:0,marginRight:0},ph=({userId:t})=>{const{graphqlError:n,clearNotification:a}=Z(),{open2FaPrompt:o}=Qi(),{cache:l}=Ts(),{formatMessage:d}=T(),[m,{loading:u}]=W(Oi,{onError:n,onCompleted(f){o(f.disableAuthFactorTOTP,()=>{l.modify({id:l.identify({__typename:"TwoFactorState",id:t}),fields:{totpEnabled:()=>!1}})})}});return e.jsx(L,{type:"button",variant:"contained",color:"negative",onClick:()=>{u||(a(),m())},disabled:u,"aria-label":u?d(F.loading):void 0,style:hh,children:u?e.jsx(fe,{size:"24px"}):d(Me.disableAuthenticator)})},kh=k.div.withConfig({componentId:"sc-a5b1f90a-0"})(["display:flex;width:100%;flex-direction:column;margin:2rem 0;"]),vh=k.div.withConfig({componentId:"sc-a5b1f90a-1"})(["display:grid;column-gap:6px;grid-template-columns:auto auto auto auto auto;@media only screen and (max-width:","){align-items:center;row-gap:6px;grid-template-columns:auto;}"],({theme:t})=>`${t.newScreenBreakpoints.large-1}px`),us=k.div.withConfig({componentId:"sc-a5b1f90a-2"})(["font-size:24px;display:flex;margin-top:0.5rem;",";"],({isHighlighted:t,theme:n})=>t&&ae(["color:",";"],n.colors.accentPrimary)),At=k.div.withConfig({componentId:"sc-a5b1f90a-3"})(["",";@media only screen and (max-width:","){text-align:center;}"],({spaceBetween:t})=>t&&ae(["display:flex;align-items:center;justify-content:space-between;"]),({theme:t})=>`${t.newScreenBreakpoints.large-1}px`),ms=k(L).withConfig({componentId:"sc-a5b1f90a-4"})(["margin:0;"]),bh=k.div.withConfig({componentId:"sc-a5b1f90a-5"})(["margin:1rem 0;color:",";display:flex;"],({theme:t})=>t.colors.accentNegative),yh=`#import "@web/shared/graphql/fragments/authTokenSetFragment.graphql"
939#import "@web/shared/graphql/fragments/auth2FAPrompt.graphql"
940
941mutation updateUserPassword($currentPassword: String!, $newPassword: String!) {
942  updateUserPassword(
943    currentPassword: $currentPassword
944    newPassword: $newPassword
945  ) {
946    ... on UserAndTokenSet {
947      tokens {
948        ...AuthTokenSetFragment
949      }
950    }
951    ...Auth2FAPrompt
952  }
953}
954`,_t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateUserPassword"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"currentPassword"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"newPassword"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateUserPassword"},arguments:[{kind:"Argument",name:{kind:"Name",value:"currentPassword"},value:{kind:"Variable",name:{kind:"Name",value:"currentPassword"}}},{kind:"Argument",name:{kind:"Name",value:"newPassword"},value:{kind:"Variable",name:{kind:"Name",value:"newPassword"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UserAndTokenSet"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tokens"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AuthTokenSetFragment"},directives:[]}]}}]}},{kind:"FragmentSpread",name:{kind:"Name",value:"Auth2FAPrompt"},directives:[]}]}}]}}],loc:{start:0,end:463,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:yh}}},Vr=t=>{const n={};return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};_t.definitions=Vr(_t.definitions.concat(Ps.definitions));_t.definitions=Vr(_t.definitions.concat(fi.definitions));const Sh=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>
954{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Sh(_t,"updateUserPassword");const wh=t=>{const{authService:n}=Wt(),{graphqlError:a}=Z(),{open2FaPrompt:o}=Qi(),l=h.useCallback(u=>{if(!n)throw new Error("auth service not available");n?.setAuthTokens(u),t?.()},[n,t]),[d]=W(_t,{onCompleted:u=>{u.updateUserPassword.__typename==="UserAndTokenSet"?l(u.updateUserPassword.tokens):o(u.updateUserPassword,f=>{f?.__typename==="UserAndTokenSet"&&l(f.tokens)})},onError:a});return h.useCallback((u,f)=>n&&u&&f?d({variables:{currentPassword:u,newPassword:f}}):null,[n,d])},xh=()=>{const t=T(),[n,a]=h.useState("password"),[o,l]=h.useState(""),[d,m]=h.useState(""),[u,f]=h.useState(""),c=me(),i=h.useMemo(()=>{try{return ql(d||"")}catch{return}},[d]),[r,s]=h.useState(!1),[g,S]=h.useState(void 0),{success:N,error:x}=Z(),j=h.useCallback(async()=>{c.current&&(S(void 0),s(!1),l(""),m(""),f(""),await Pn(500),c.current&&N(t.formatMessage(ke.successU
954pdatePassword)))},[t,c,N]),w=wh(j),{authService:P}=Wt(),C=h.useMemo(()=>({"Use a few words, avoid common phrases":t.formatMessage(ke.default),"Straight rows of keys are easy to guess":t.formatMessage(ke.spatial1),"Short keyboard patterns are easy to guess":t.formatMessage(ke.spatial2),"Sequences like abc or 6543 are easy to guess":t.formatMessage(ke.sequence),'Repeats like "aaa" are easy to guess':t.formatMessage(ke.repeat1),'Repeats like "abcabcabc" are only slightly harder to guess than "abc"':t.formatMessage(ke.repeat2),"Recent years are easy to guess":t.formatMessage(ke.regex),"Dates are often easy to guess":t.formatMessage(ke.date)}),[t]),v=h.useMemo(()=>({"Current password is incorrect":t.formatMessage(ke.isIncorrect),"New password is too weak":t.formatMessage(ke.isWeak),"Current and new passwords are equal":t.formatMessage(ke.isEqual)}),[t]),b=H=>{l(H.currentTarget.value)},M=H=>{m(H.currentTarget.value)},R=H=>{f(H.currentTarget.value)},B=h.useCallback(async H=>{if(!P)return;H.preventDefault();const q=i&&Object.keys(C).find(G=>G===i.feedback.warning);if(q)S(C[q]),s(!0);else if(!i||i.score<3)S(t.formatMessage(ke.extraFeedback)),s(!0);else if(o&&d)try{await w(o,d)}catch(G){const X=Object.keys(v).find(be=>G.message.includes(v[be]));x(X||t.formatMessage(ke.errorUpdatePassword))}},[P,o,x,v,t,C,d,i,w]),oe=h.useMemo(()=>!P||!o||!d||!u||d!=u,[P,o,d,u]),Q=h.useCallback(()=>{a(n==="password"?"text":"password")},[n]);return e.jsxs(kh,{children:[e.jsxs(vh,{children:[e.jsx(At,{children:e.jsx(ei,{value:o,onChange:b,placeholder:t.formatMessage(ke.currentPassword),type:n})}),e.jsxs(At,{children:[e.jsx(ei,{value:d,onChange:M,placeholder:t.formatMessage(ke.newPassword),type:n}),!!d&&e.jsx(Ll,{strengthScore:i?.score,hideLabel:!d})]}),e.jsx(At,{children:e.jsx(ei,{value:u,onChange:R,placeholder:t.formatMessage(ke.confirmNewPassword),type:n})}),e.jsxs(ia,{query:"(min-width: 1024px)",children:[e.jsx(At,{children:e.jsx(ms,{variant:"outlined",color:"primary",onClick:B,disabled:oe,children:t.formatMessage(I.change)})}),e.jsx(At,{children:e.jsx(us,{isHighlighted:n!=="password",children:e.jsx(ga,{onClick:Q})})})]}),e.jsx(ia,{query:"(max-width: 1024px)",children:e.jsxs(At,{spaceBetween:!0,children:[e.jsx(ms,{variant:"outlined",color:"primary",onClick:B,disabled:oe,children:t.formatMessage(I.change)}),e.jsx(us,{isHighlighted:n!=="password",children:e.jsx(ga,{onClick:Q})})]})})]}),r&&e.jsx(bh,{children:t.formatMessage(ke.passwordInformation,{message:g})})]})},Ch=({deletionReason:t,setDeletionReason:n,setContinueButtonDisabled:a})=>{const o=T(),{selectableReason:l,optionalReason:d}=t,m=l==="other"?!d:!l;return h.useEffect(()=>(a(!!m),()=>{a(!1)}),[m,a]),e.jsxs(mo,{children:[e.jsx(fo,{children:e.jsxs(Is,{children:[" ",o.formatMessage(re.deleteReasonsText)," "]})}),e.jsxs(go,{children:[e.jsx(Yt,{label:o.formatMessage(re.requestedLanguageNotFound),value:"requestedLanguageNotFound",checked:l==="requestedLanguageNotFound",onChange:u=>n({...t,selectableReason:u.target.value})}),e.jsx(Yt,{label:o.formatMessage(re.tooComplicated),value:"tooComplicated",checked:l==="tooComplicated",onChange:u=>n({...t,selectableReason:u.target.value})}),e.jsx(Yt,{label:o.formatMessage(re.badQuality),value:"quality",checked:l==="quality",onChange:u=>n({...t,selectableReason:u.target.value})}),e.jsx(Yt,{label:o.formatMessage(re.tooExpensive),value:"expensive",checked:l==="expensive",onChange:u=>n({...t,selectableReason:u.target.value})}),e.jsx(Yt,{label:o.formatMessage(re.other),value:"other",checked:l==="other",onChange:u=>n({...t,selectableReason:u.target.value})})]}),l==="other"&&e.jsx(ho,{onChange:u=>{n({...t,optionalReason:u.target.value})},placeholder:o.formatMessage(re.otherPlaceholder),value:d,required:!0})]})},Nh=`#import "@web/app/graphql/fragments/SubscriptionUser.graphql"
955
956query DeleteUserAccountQuery {
957  viewer {
958    id
959  }
960  viewerAsSubscriber {
961    ...SubscriptionUser
962  }
963}
964`,zi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DeleteUserAccountQuery"},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:"viewerAsSubscriber"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SubscriptionUser"},directives:[]}]}}]}}],loc:{start:0,end:207,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Nh}}},jh=t=>{const n={};
964return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};zi.definitions=jh(zi.definitions.concat(Js.definitions));const Mh=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Mh(zi,"DeleteUserAccountQuery");const Fh=()=>{const t=T();return e.jsx(e.Fragment,{children:e.jsxs(Ds,{children:[e.jsxs(Is,{children:[" ",t.formatMessage(re.needToKnowHeader)," "]}),e.jsxs(As,{children:[e.jsx(rt,{children:t.formatMessage(re.needToKnowText1)}),e.jsx(rt,{children:t.formatMessage(re.needToKnowText2)}),e.jsx(rt,{children:t.formatMessage(re.needToKnowText3)}),e.jsx(rt,{children:t.formatMessage(re.needToKnowText4)})]})]})})},Ph=({handleCloseModal:t,handleFinish:n,handleOpenCancelModal:a,processing:o})=>{const[l,d]=h.useState({selectableReason:"",optionalReason:""}),[m,u]=h.useState(!1),f=T(),{graphqlError:c}=Z(),{data:i,loading:r,error:s}=ue(zi);h.useEffect(()=>{s&&c(s)},[s,c]);const g=h.useMemo(()=>i?.viewerAsSubscriber?.__typename=="PaddleClassicSubscriber"?i.viewerAsSubscriber:null,[i?.viewerAsSubscriber]),S=h.useMemo(()=>{if(g?.nextPayment){const x=new Date((new Date().getUTCFullYear()+11).toString());return new Date(g?.nextPayment.date)<x}return!1},[g]);if(r||o)return e.jsx(xo,{children:e.jsx(Ut,{})});if(!i?.viewer)return null;const N=g?.downgradeIntent||null;return S&&g?e.jsx(ma,{handleCloseModal:t,finishButton:e.jsx(L,{variant:"contained",color:"negative",onClick:a,children:f.formatMessage(ca.cancelSubscription)}),nextButtonColor:"negative",children:e.jsxs("div",{style:{margin:"0.25rem 4rem 0.75rem 4rem",textAlign:"center"},children:[e.jsx("p",{children:f.formatMessage(re.activeSubscriptionText)}),N&&e.jsx("p",{children:f.formatMessage(ca.downgradeSchedule,{effectiveAt:f.formatDate(N.effectiveAt,{day:"2-digit",month:"2-digit",year:"numeric"}),planName:N.targetPlan.name.replace(" "," ")})})]})}):e.jsxs(ma,{handleCloseModal:t,isContinueDisabled:m,finishButton:e.jsx(L,{variant:"contained",color:"negative",onClick:()=>n(l.selectableReason==="other"?l.optionalReason:l.selectableReason),children:f.formatMessage(re.confirmDeletion)}),titleForDisabling:f.formatMessage(re.selectAReason),nextButtonColor:"negative",children:[e.jsx(Fh,{}),e.jsx(Ch,{deletionReason:l,setDeletionReason:d,setContinueButtonDisabled:u}),e.jsxs(Ds,{children:[e.jsx("p",{children:f.formatMessage(re.confirmDeletionText)}),e.jsx("p",{children:f.formatMessage(re.confirmDeletionText2)})]})]})},Th=`#import "@web/shared/graphql/fragments/auth2FAPrompt.graphql"
965
966mutation requestAccountRemovalMutation($reason: String) {
967  requestAccountRemoval(reason: $reason) {
968    ...Auth2FAPrompt
969  }
970}
971`,_i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"requestAccountRemovalMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reason"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"requestAccountRemoval"},arguments:[{kind:"Argument",name:{kind:"Name",value:"reason"},value:{kind:"Variable",name:{kind:"Name",value:"reason"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Auth2FAPrompt"},directives:[]}]}}]}}],loc:{start:0,end:229,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Th}}},Ih=t=>{const n={};
971return t.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};_i.definitions=Ih(_i.definitions.concat(fi.definitions));const Dh=(t,n)=>{const a=(i,r)=>{if(i.kind==="FragmentSpread")r.add(i.name.value);else if(i.kind==="VariableDefinition"){const s=i.type;s.kind==="NamedType"&&r.add(s.name.value)}return i&&"selectionSet"in i&&i.selectionSet&&i.selectionSet.selections.forEach(s=>{a(s,r)}),i&&"variableDefinitions"in i&&i.variableDefinitions&&i.variableDefinitions.forEach(s=>{a(s,r)}),i&&"definitions"in i&&i.definitions&&i.definitions.forEach(s=>{a(s,r)}),r},o=i=>{const r={};return i.definitions.forEach(function(s){"name"in s&&s.name&&(r[s.name.value]=a(s,new Set))}),r},l=(i,r)=>{for(let s=0;s<i.definitions.length;s++){const g=i.definitions[s];if(g&&"name"in g&&g.name&&g.name.value==r)return g}},d=o(t),m=Object.assign({},t,{definitions:[l(t,n)]}),u=d[n]||new Set,f=new Set;let c=new Set;for(u.forEach(i=>{c.add(i)});c.size>0;){const i=c;c=new Set,i.forEach(r=>{f.has(r)||(f.add(r),(d[r]||new Set).forEach(g=>{c.add(g)}))})}return f.forEach(i=>{const r=l(t,i);r&&m.definitions.push(r)}),m};Dh(_i,"requestAccountRemovalMutation");const Ah=()=>e.jsx(ko,{children:e.jsx(ut,{})}),Vh={marginLeft:0,marginRight:0},$h=({planName:t})=>{const n=T(),a=h.useRef(0),{openModal:o,updateModal:l,closeModal:d}=h.useContext(Rn),m=me(),[u,f]=h.useState(!1),c=Ue(We),{cache:i}=Ts(),{open:r,Modal:s}=fl(t||"",c||""),g=h.useCallback(()=>{a.current&&(d(a.current),a.current=0)},[d]),S=h.useCallback(()=>{g(),f(!0)},[g]);h.useEffect(()=>{u&&(r(),f(!1))},[u,r]);const{graphqlError:N,clearNotification:x}=Z(),[j,{loading:w}]=W(_i,{onError:N}),{open2FaPrompt:P,promptModalId:C}=Qi(),v=h.useCallback(async R=>{if(!c||w)return;x();const{data:B}=await j({variables:{reason:R}});!B||!m.current||P(B.requestAccountRemoval,()=>{i.evict({id:i.identify({__typename:"User",id:c})})})},[i,c,m,P,w,j,x]),b=h.useMemo(()=>({variant:"flatRounded",header:n.formatMessage(Me.deleteAccount),headerIcon:e.jsx(Ah,{}),overflow:"auto",size:"small",onCloseCallback:g,modalContent:e.jsx(Ph,{handleCloseModal:g,handleFinish:v,processing:w,handleOpenCancelModal:S,showCancelModal:u}),fullscreenMaxHeight:700}),[n,g,v,S,u,w]),M=h.useCallback(()=>{a.current=o(b)},[o,b]);return h.useEffect(()=>{C.current||!a.current||l(b)},[C,a,b,l]),e.jsxs(po,{children:[e.jsxs("p",{children:[n.formatMessage(re.deleteAccountSubHeader1),e.jsx("span",{children:"😔"})]}),e.jsx("p",{children:n.formatMessage(re.deleteAccountSubHeader2)}),e.jsxs(As,{children:[e.jsxs(rt,{children:[n.formatMessage(re.deleteAccountSectionItem1)," "]}),e.jsxs(rt,{children:[n.formatMessage(re.deleteAccountSectionItem2)," "]}),e.jsxs(rt,{children:[n.formatMessage(re.deleteAccountSectionItem3)," "]}),e.jsxs(rt,{children:[n.formatMessage(re.deleteAccountSectionItem4)," "]})]}),e.jsx(L,{variant:"contained",color:"negative",onClick:M,style:Vh,children:n.formatMessage(Me.deleteAccount)}),s]})},Rh=`query SecuritySettingsPageQuery {
972  viewer {
973    id
974    plan {
975      id
976      name
977    }
978    twoFactor {
979      id
980      totpEnabled
981      backupCodesMissing
982    }
983  }
984}
985`,qh={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SecuritySettingsPageQuery"},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:"twoFactor"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totpEnabled"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"backupCodesMissing"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:207,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Rh}}},Lh=()=>{const t=De(je.Auth2FactorTOTP),{formatMessage:n}=T(),{data:a,loading:o}=ue(qh);if(o)return e.jsx(Ut,{});if(!a?.viewer)return e.jsx(vt,{to:"/404"});const{backupCodesMissing:l,totpEnabled:d}=a.viewer.twoFactor,m=t||d;return e.jsxs(Gs,{children:[m&&e.jsxs(e.Fragment,{children:[e.jsx(ki,{children:n(Me.twoFactorHeader)}),e.jsxs("div",{children:[l&&e.jsx(tn,{$isWarning:!0,children:n(Me.backupCodesMissing)}),e.jsx(tn,{children:n(Me.twoFactorText)}),d?e.jsx(ph,{userId:a.viewer.id}):e.jsx(sh,{})]}),e.jsx(nn,{})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx(ki,{children:n(Me.backupCodesHeader)}),e.jsx(tn,{children:n(Me.backupCodesText)}),e.jsx(uh,{userId:a.viewer.id,hasExistingCodes:!l}),e.jsx(nn,{})]}),e.jsx(ki,{children:n(Me.headerChangePassword)}),e.jsx(xh,{}),e.jsx(nn,{}),e.jsx(ki,{children:n(Me.deleteAccount)}),e.jsx($h,{planName:a.viewer.plan?.name})]})},Eh=k.div.withConfig({componentId:"sc-6bc1d3d3-0"})(["display:block;color:",";margin:0 auto;"],({theme:t})=>t.colors.textPrimary);k.h2.withConfig({componentId:"sc-6bc1d3d3-1"})(["margin-bottom:-0.5rem;"]);const Oh=k.h3.withConfig({componentId:"sc-6bc1d3d3-2"})(["font-size:",";letter-spacing:0.25rem;font-weight:normal;margin:1rem 0;"],({theme:t})=>t.fontSizes.bigger),zh=`mutation RevokeTokenMutation($tokenId: ID!) {
986  revokeToken(tokenId: $tokenId)
987}
988`,_h={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RevokeTokenMutation"}
988,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"revokeToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenId"},value:{kind:"Variable",name:{kind:"Name",value:"tokenId"}}}],directives:[]}]}}],loc:{start:0,end:119,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:zh}}},Bh=`query ListTokensQuery {
989  listTokens {
990    id
991    name
992    scopes
993    expired
994
995    createdAt
996    expiresAt
997  }
998}
999`,$r={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListTokensQuery"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listTokens"},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:"scopes"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"expired"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"expiresAt"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:151,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Bh}}},Uh=(t,n)=>{const a=En(),{graphqlError:o}=Z(),[l,{loading:d}]=W(_h,{onError:o,refetchQueries:[$r]});return h.useCallback(async()=>{if(d)return;await a(`Revoke token '${n}'?`,"","Delete")&&await l({variables:{tokenId:t}})},[d,a,n,l,t])},Wh=({tokenId:t,tokenName:n})=>{const a=Uh(t,n),o=ge();return e.jsx(On,{children:e.jsxs(zn,{onClick:a,defaultColor:o.colors.accentNegative,children:[e.jsx(ut,{style:{marginTop:0}}),e.jsx(_n,{children:"Revoke"})]})})},Hh=`mutation CreateTokenMutation(
1000  $name: String!
1001  $scopes: [ApiTokenScope!]!
1002  $expiration: DateTime
1003) {
1004  createToken(name: $name, scopes: $scopes, expiration: $expiration)
1005}
1006`,Qh={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateTokenMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"scopes"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ApiTokenScope"}}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"expiration"}},type:{kind:"NamedType",name:{kind:"Name",value:"DateTime"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"scopes"},value:{kind:"Variable",name:{kind:"Name",value:"scopes"}}},{kind:"Argument",name:{kind:"Name",value:"expiration"},value:{kind:"Variable",name:{kind:"Name",value:"expiration"}}}],directives:[]}]}}],loc:{start:0,end:213,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Hh}}},Gh=(t,n,a)=>{const{graphqlError:o}=Z(),[l,{loading:d}]=W(Qh,{onError:u=>{setTimeout(()=>o(u),200)}});return h.useCallback(async()=>{if(!d)return await l({variables:{name:t,scopes:n,expiration:a?.toISOString()}}).then(u=>!u.error&&u.data?{name:t,value:u.data.createToken}:void 0)},[l,d,t,n,a])},Yh=({onCreate:t})=>{const n=ge(),a=T(),[o,l]=h.useState([]),d=h.useCallback(x=>{const j=x.target.id;o.includes(j)?l(o.filter(w=>w!==j)):l([...o,j])},[o,l]),[m,u]=h.useState(""),[f,c]=h.useState(null),i=Gh(m,Array.from(o.values()),f??void 0),r=[it.ReadVideos,it.ReadTracks],s=[it.ManageVideos,it.ManageTracks],g=[it.STT,
1006it.MTL,it.TTS,it.JobStatus],[S,N]=h.useState(!1);return e.jsxs("div",{children:[e.jsxs(wi,{children:[e.jsx(xi,{capitalize:!0,children:a.formatMessage(Me.tokenCreationName)}),e.jsx(gl,{type:"text",value:m,onChange:x=>u(x.target.value)})]}),e.jsxs(wi,{children:[e.jsx(xi,{capitalize:!0,children:a.formatMessage(Me.tokenScopes)}),e.jsx(qn,{fluid:!0,style:{margin:0},children:e.jsxs(Ln,{children:[e.jsx(Jt,{children:r.map(x=>e.jsx(bt,{id:x,handleChange:d,checked:o.includes(x),labelText:x},x))}),e.jsx(Jt,{children:s.map(x=>e.jsx(bt,{id:x,handleChange:d,checked:o.includes(x),labelText:x},x))}),e.jsx(Jt,{children:g.map(x=>e.jsx(bt,{id:x,handleChange:d,checked:o.includes(x),labelText:x},x))})]})})]}),e.jsxs(wi,{children:[e.jsx(xi,{capitalize:!0,children:a.formatMessage(Me.tokenExpiration)}),e.jsx(_l,{value:f,onChange:c,disableDateBeforeToday:!0,todayDaysOffset:1})]}),e.jsx(On,{children:e.jsxs(zn,{onClick:async()=>{if(!m||S)return;N(!0);const x=await i();N(!1),t(x)},defaultColor:n.colors.accentPrimary,isDisabled:!m||S,children:[e.jsx(Co,{}),e.jsx(_n,{children:"Create"})]})})]})},Oe=ve({loading:{id:"admin.ApiTokensTable.Loading",defaultMessage:"Fetching existing tokens…"},loaded:{id:"admin.ApiTokensTable.Loaded",defaultMessage:"API Tokens"},name:{id:"admin.ApiTokensTable.Name",defaultMessage:"Name"},created:{id:"admin.ApiTokensTable.Created",defaultMessage:"Created At"},expiresAt:{id:"admin.ApiTokensTable.Expires",defaultMessage:"Expires At"},scopes:{id:"admin.ApiTokensTable.Scopes",defaultMessage:"Scopes"},hasExpired:{id:"admin.ApiTokensTable.HasExpired",defaultMessage:"Expired"},actions:{id:"admin.ApiTokensTable.Actions",defaultMessage:"Actions"},never:{id:"admin.ApiTokensTable.Never",defaultMessage:"Never"},noTokens:{id:"admin.ApiTokensTable.NoTokens",defaultMessage:"No Tokens"}}),Kh=()=>{const{graphqlError:t}=Z(),n=T(),a=h.useMemo(()=>[{type:y.Text,accessor:g=>g?.name,header:n.formatMessage(Oe.name)},{id:"ColumnTypeDate_CreatedAt",type:y.Date,accessor:g=>n.formatDate(g.createdAt,{day:"2-digit",month:"2-digit",year:"numeric"})+" "+n.formatTime(g.createdAt,{hourCycle:"h23"}),header:n.formatMessage(Oe.created)},{id:"ColumnTypeDate_ExpiresAt",type:y.Date,accessor:g=>g.expiresAt?n.formatDate(g.expiresAt,{day:"2-digit",month:"2-digit",year:"numeric"})+" "+n.formatTime(g.expiresAt,{hourCycle:"h23"}):n.formatMessage(Oe.never),header:n.formatMessage(Oe.expiresAt)},{id:"ColumnTypeText_Scopes",type:y.Text,accessor:g=>g.scopes.length?g.scopes.join(", "):"N/A",header:n.formatMessage(Oe.scopes)},{id:"ColumnTypeText_Expired",type:y.Text,accessor:g=>n.formatMessage(g.expired?F.yes:F.no),header:n.formatMessage(Oe.hasExpired)},{type:y.Actions,header:n.formatMessage(Oe.actions)}],[n]),o=h.useMemo(()=>[{render:g=>e.jsx(Wh,{tokenId:g.original.id,tokenName:g.original.name})}],[]),{data:l,loading:d,refetch:m,error:u}=ue($r);h.useEffect(()=>{u&&t(u)},[u,t]);const[f,c]=h.useState(!1),[i,r]=h.useState(void 0),s=h.useCallback(g=>{c(!1),m(),r(g)},[m,r]);return e.jsxs(Eh,{children:[e.jsx(Oh,{children:n.formatMessage(d?Oe.loading:Oe.loaded)}),i&&e.jsx(wl,{label:i.name.length>16?`${i.name.substring(0,16)}…`:i.name,url:i.value,hideOpenButton:!0}),e.jsx(Fe,{loading:d,heightTrigger:l?.listTokens?.length,delayHeightResolution:20,children:(l?.listTokens&&l?.listTokens.length||0)<=0?e.jsx("div",{children:n.formatMessage(Oe.noTokens)}):e.jsx(Ve,{data:l?.listTokens||[],columnOptions:a,actions:o,withPaginationBelow:!1})}),e.jsx(Be,{showModal:f,onRequestClose:()=>s(void 0),variant:"flatRounded",header:"Create Token",children:e.jsx(Yh,{onCreate:g=>s(g)})}),e.jsx(On,{style:{justifyContent:"flex-start",marginTop:"1rem",marginBottom:"1rem"},children:e.jsxs(zn,{onClick:()=>c(!0),children:[e.jsx(yo,{}),e.jsx(_n,{children:"Create"})]})})]})},Zh=()=>{const t=De(je.ApiSettings);return e.jsx(Gs,{children:t&&e.jsx(Kh,{})})},Xh=({user:t})=>e.jsx(hl,{user:t}),Jh=k.div.withConfig({componentId:"sc-c686501f-0"})(["display:flex;flex-wrap:nowrap;flex-direction:column;align-items:stretch;@media (min-width:","px){flex-direction:row;}"],t=>t.theme.newScreenBreakpoints.large),ep=k.nav.withConfig({componentId:"sc-c686501f-1"})(["min-width:140px;flex:1 1 auto;display:flex;flex-wrap:nowrap;flex-direction:row;@media (min-width:","px){padding-top:75px;flex-direction:column;}"],t=>t.theme.newScreenBreakpoints.large),Si=k(Cs).withConfig({componentId:"sc-c686501f-2"})(["padding:0 10px;display:flex;flex-flow:column nowrap;text-align:start;position:relative;margin-bottom:32px;color:#51667b;"," &.active{color:",";"," "," :before{content:'';width:4px;height:16px;top:1px;background-color:",";position:absolute;",";}}"],Rt("10px"),({theme:t})=>
1006t.colors.accentPrimary,vo("10px"),Rt("0"),({theme:t})=>t.colors.accentPrimary,({theme:t})=>t.dir==="ltr"?"left:0px":"right:0px"),tp=k.div.withConfig({componentId:"sc-c686501f-3"})(["flex:1 1 100%;"]),ip=({viewer:t,showMarketplace:n,handleShowMarketplace:a,handleCloseMarketplace:o})=>{const l=de(),{formatMessage:d}=T(),{authService:m}=Wt(),{viewer:u,loading:f}=Vs(),c=!!m?.isPersona,i=u!=null&&(!u.activeManager||u.activeManager?.isFullAccessManagerOfViewer),r=De(je.ApiSettings),s=De(je.AdsEnabled);return!m||f?e.jsx(Ut,{}):e.jsxs(Jh,{children:[e.jsxs(ep,{children:[e.jsx(Si,{exact:!0,to:l.toUserSettings(),children:d(F.profile)}),!c&&e.jsx(Si,{exact:!0,to:l.toUserSettingsSecurity(),children:d(ti.menuEntrySecurity)}),r&&!c&&e.jsx(Si,{exact:!0,to:l.toUserApiSettings(),children:d(ti.menuEntryApi)}),s&&i&&e.jsx(Si,{exact:!0,to:l.toUserAdSettings(),children:d(ti.menuEntryAd)})]}),e.jsx(tp,{children:e.jsxs(Bt,{children:[e.jsx(ie,{path:"/settings",render:()=>e.jsx(pl,{user:t,showMarketplace:n,handleShowMarketplace:a,handleCloseMarketplace:o}),exact:!0}),c?e.jsx(vt,{from:"/settings/security",to:"/settings"}):e.jsx(ie,{path:"/settings/security",render:()=>e.jsx(Lh,{}),exact:!0}),r&&!c?e.jsx(ie,{path:"/settings/api",render:()=>e.jsx(Zh,{}),exact:!0}):e.jsx(vt,{from:"/settings/api",to:"/settings"}),s&&i?e.jsx(ie,{path:"/settings/advertisement",render:()=>e.jsx(Xh,{user:t}),exact:!0}):e.jsx(vt,{from:"/settings/advertisement",to:"/settings"})]})})]})};var D=(function(t){return t[t.Videos=0]="Videos",t[t.Articles=1]="Articles",t[t.Images=2]="Images",t[t.Followers=3]="Followers",t[t.Following=4]="Following",t[t.Magazines=5]="Magazines",t[t.Podcasts=6]="Podcasts",t[t.Verticals=7]="Verticals",t})({});const np=8,Qv=()=>{const t=T(),n=de(),a=Se(),{authService:o}=Wt(),l=Vs(),d=!!o?.isPersona,m=h.useRef(null),[u,f]=h.useState(!1),[c,i]=h.useState(0),r=l?.viewer?.id,{userId:s,subPage:g,path:S}=bs(),N=h.useCallback(()=>f(!0),[]),x=h.useCallback(()=>f(!1),[]);h.useEffect(()=>{const R=()=>{m.current&&i(m.current.getBoundingClientRect().left)};return R(),window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}},[]);const j=!s&&!r,{data:w,loading:P,error:C}=ue(zt,{variables:{id:s||r||"",preferredLanguages:a},skip:j});if(P)return e.jsx(Ut,{});if(C||!w||j)return e.jsx($l,{});if(g==="organizer"&&s)return S?e.jsx(vt,{to:`/archive/${S}`}):e.jsx(vt,{to:"/archive/videos"});const{viewer:v,user:b}=w;if(!b)return e.jsx("div",{children:e.jsx(ls,{children:e.jsxs(qg,{children:[e.jsx(Lg,{children:t.formatMessage(ti.messageHeaderUpps)}),e.jsx(Eg,{children:t.formatMessage(ti.messageTextNoUserAvailable)})]})})});const M=v?.id===b.id?v:void 0;return e.jsxs("div",{ref:m,children:[e.jsx(fs,{children:e.jsx("meta",{name:"robots",content:"index,follow"})}),e.jsx(Wl,{userData:b}),e.jsx(bo,{viewerIsOwner:v?v.id===b.id:!1,user:b,viewer:M,viewerIsLoggedIn:!!v}),e.jsx(ls,{children:e.jsx(_g,{children:e.jsxs(Bt,{children:[M&&e.jsx(ie,{path:"/settings",render:()=>e.jsx(ip,{viewer:kn(yt,M),showMarketplace:u,handleShowMarketplace:N,handleCloseMarketplace:x})}),e.jsx(ie,{path:"/producer/:userId/myContent",render:()=>e.jsx(_a,{userId:b.id,pageContentBoundingClient:c,viewerId:r,userHasMagazines:!!b.magazineCount})}),M&&e.jsx(ie,{path:"/activities",render:()=>e.jsx(Fg,{})}),e.jsx(ie,{path:"/producer/:userId/followers",render:()=>e.jsx(fd,{userId:b.id,numFollowers:b.followerCount,numFollowing:b.followingCount,limit:np,linkToUserFollowers:n.toUserFollowers(b.id)})}),M&&e.jsx(ie,{path:"/archive",render:()=>e.jsx(If,{userId:b.id})}),M&&(d?e.jsx(vt,{from:"/payment/:section?/:page?",to:"/archive"}):e.jsx(ie,{path:"/payment/:section?/:page?",component:Ig})),e.jsx(ie,{exact:!0,render:()=>e.jsx(_a,{userId:b.id,pageContentBoundingClient:c,viewerId:r,userHasMagazines:!!b.magazineCount})})]})})})]})};export{D as SubMenuTypes,Qv 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.