PageSourceSearch

https://faust-web.com/assets/index-C5nAMHgO.js

js faust-web.com collected 2026-10-03 23:58:44 UTC 26,799 bytes, 3 lines download raw bytes

1import{r as l,m as ke,aG as Ee,ak as Ie,Z as je,dd as ye,dn as xe,a7 as we,e as Me,aD as Re,ao as Pe,K as Ue,dp as De,Q as Le,aW as M,p as $e,b7 as Oe,b8 as Ge,b3 as Qe,j as t,dq as he,D as Z}from"./index-DRGEFsBz.js";import{L as Ve}from"./LibrarySearchInput-Ao-V8VJA.js";import{D as ze}from"./Dropdown-DrOh3bzk.js";import{S as Fe}from"./SortDirectionToggle-sRUz5T0x.js";import{M as He}from"./MigrateMangaModal-B8SCniAA.js";import{A as fe,b as We,c as te,a as qe,d as Ke}from"./TitleActionsMenu-CJumwC8C.js";import{u as Ye}from"./useCurrentTeamMute-DBoxUjBG.js";import{u as Je}from"./usePageTitle-CRZvMCd9.js";import{b as Ze}from"./useResponsive-Cgv-pe3P.js";import{b as Xe}from"./mangaQueries-ygDGrzGS.js";import{L as Ae}from"./LibraryCard-CVlKuSIL.js";import"./Icon-DF6olaqW.js";import"./sort-icon-TU-lRz87.js";import"./MultiTeamSelector-DiJsQwkP.js";import"./SearchDropdown-BVGuOS_U.js";import"./edit-thin-BhKJLYcO.js";import"./index-l1hCtgvc.js";import"./ageVisibility-C2AEwWVI.js";import"./AdultContentLockOverlay-CGQD8N8K.js";const et=[{value:"rating",label:"За оцінками"},{value:"alphabet",label:"За алфавітом"},{value:"newest",label:"Нові"}],tt=(e,n,a)=>[...e].sort((m,T)=>{let S=0;switch(n){case"rating":const u=m.averageRating??0;S=(T.averageRating??0)-u;break;case"alphabet":S=m.name.localeCompare(T.name,"uk");break;case"newest":const k=m.updatedDate?new Date(m.updatedDate).getTime():0;S=(T.updatedDate?new Date(T.updatedDate).getTime():0)-k;break;default:S=m.name.localeCompare(T.name,"uk")}return a?-S:S}),nt="_container_v763h_1",st="_dockSafeSection_v763h_9",ot="_pageHeader_v763h_28",rt="_titleSection_v763h_37",it="_pageTitle_v763h_45",at="_controlsPanel_v763h_54",ct="_controls_v763h_54",lt="_controlsDropdown_v763h_88",dt="_gridDensityButton_v763h_93",ut="_gridDensityButtonMobile_v763h_125",gt="_searchRow_v763h_129",mt="_actions_v763h_134",ht="_tooltipWrap_v763h_142",yt="_teamInfo_v763h_156",ft="_teamDescription_v763h_162",pt="_mutedNotice_v763h_169",St="_verificationNotice_v763h_179",vt="_verificationNoticeRejected_v763h_197",Ct="_loading_v763h_202",_t="_error_v763h_203",Tt="_emptyState_v763h_204",kt="_bulkActionsRow_v763h_227",xt="_syncEditGrid_v763h_235",At="_syncEditGridCompact_v763h_247",bt="_syncEditCard_v763h_305",Nt="_syncEditCheckbox_v763h_309",Bt="_syncBadge_v763h_353",Et="_syncBadgeSelectionMode_v763h_369",It="_syncBadgeRunning_v763h_375",jt="_syncBadgeActive_v763h_396",wt="_syncBadgeSuspended_v763h_401",Mt="_syncSourceUrlRow_v763h_406",Rt="_syncSourceUrlInput_v763h_410",Pt="_syncSourceUrlEmpty_v763h_437",Ut="_syncStickyBar_v763h_462",Dt="_syncStickyActions_v763h_480",Lt="_controlsPanelAuthor_v763h_543",$t="_gridDensityButtonDesktop_v763h_550",i={container:nt,dockSafeSection:st,pageHeader:ot,titleSection:rt,pageTitle:it,controlsPanel:at,controls:ct,controlsDropdown:lt,gridDensityButton:dt,gridDensityButtonMobile:ut,searchRow:gt,actions:mt,tooltipWrap:ht,teamInfo:yt,teamDescription:ft,mutedNotice:pt,verificationNotice:St,verificationNoticeRejected:vt,loading:Ct,error:_t,emptyState:Tt,bulkActionsRow:kt,syncEditGrid:xt,syncEditGridCompact:At,syncEditCard:bt,syncEditCheckbox:Nt,syncBadge:Bt,syncBadgeSelectionMode:Et,syncBadgeRunning:It,syncBadgeActive:jt,syncBadgeSuspended:wt,syncSourceUrlRow:Mt,syncSourceUrlInput:Rt,syncSourceUrlEmpty:Pt,syncStickyBar:Ut,syncStickyActions:Dt,controlsPanelAuthor:Lt,gridDensityButtonDesktop:$t},Ot=15e3,Gt=new Set(["pendingverification","underreview","pending","under_review"]),Qt=()=>{var re,ie,ae,ce,le;const[e,n]=l.useState("rating"),[a,h]=l.useState(!1),[m,T]=l.useState(""),{isAuthorProfile:S,activeAuthorProfileId:u}=ke(),s=!!(S&&u),{data:k=[]}=Ee({enabled:s}),j=(u==null?void 0:u.toLowerCase())||null,g=k.find(D=>D.id.toLowerCase()===j),x=((g==null?void 0:g.verificationStatus)||"").toString().trim().toLowerCase(),I=!!(s&&x&&Gt.has(x));Je(s?"Мої твори":"Проєкти команди");const{isAdmin:A}=Ie(),{teamInfo:f,teamId:C,teamName:b,teamRole:$,isTeamOwner:N}=je({preferActiveTeam:!0}),{isMuted:R,mutedDue:P}=Ye({preferActiveTeam:!0}),{isMobile:_,isTablet:v}=Ze(),p=A||N||$===Pe.MODERATOR,K=P?new Date(P).toLocaleDateString("uk-UA"):null,{user:U,loading:H}=ye(),y=ye({user:U?{...U,teamInfo:f??U.teamInfo??null}:null,loading:H}),{isVerificationBlocked:O,isVerificationRejected:Y,tooltipMessage:w}=y,V=f??((re=y.user)==null?void 0:re.teamInfo)??null,z=(ce=(ae=(ie=y.user)==null?void 0:ie.teamInfo)==null?void 0:ae.rejectionReason)==null?void 0:ce.trim(),W=!!((V==null?void 0:V.canUseAutoSync)??((le=U==null?void 0:U.teamInfo)==null?void 0:le.canUseAutoSync)),{data:q=[]}=xe(C,{enabled:!!C&&W}),ne=q.some(D=>D.syncStatus==="Active"||D.isSyncInProgress),{data:o,isLoading:c,error:r}=we(C,void 0,{enabled:!s,refetchInterval:ne?Ot:!1}),{data:d=[],isLoading:B,error:G}=Me({queryKey:["author-team-projects-page",u],enabled:s,queryFn:async()=>
1{if(!u)return[];const D=[];let F=1,J=1;do{const E=await Re({page:F,pageSize:100,ukrainianAuthorProfileId:u});D.push(...E.titles),J=E.totalPages||1,F+=1}while(F<=J);return D.map(E=>{var ee;return{id:E.id,slug:E.slug??void 0,name:E.name,originalName:((ee=E.originalName)==null?void 0:ee.trim())??"",coverImageUrl:E.coverImageUrl||"",averageRating:E.averageRating??void 0,updatedDate:E.updatedDate??void 0,translatedChaptersCount:E.translatedChaptersCount??void 0,releasedChaptersCount:E.releasedChaptersCount??void 0,translationStatus:E.translationStatus||void 0,TranslationStatus:E.translationStatus||void 0}})}}),Q=l.useMemo(()=>s?d:o??[],[s,d,o]),se=H||(s?B:c),X=s?G:r,oe=l.useMemo(()=>{if(!Q)return[];const D=tt(Q,e,a),F=m.trim().toLowerCase();return F?D.filter(J=>{var de,L;const E=((de=J.name)==null?void 0:de.toLowerCase())??"",ee=((L=J.originalName)==null?void 0:L.toLowerCase())??"";return E.includes(F)||ee.includes(F)}):D},[Q,e,a,m]),ue=()=>h(D=>!D);return{user:U,teamInfo:s?{teamId:u||"",teamName:(g==null?void 0:g.name)||"Автор"}:V,teamId:C,teamName:s?(g==null?void 0:g.name)||"Автор":b,isTeamAdmin:p,teamProjects:Q,filteredProjects:oe,error:X,isLoading:se,isAuthorAccount:s,isAdmin:A,isTeamMuted:s?!1:R,mutedUntil:K,isVerificationBlocked:s?!1:O,isVerificationRejected:s?!1:Y,tooltipMessage:s?"":w,isAuthorPendingVerification:I,authorMigrationTooltipMessage:I?"Поки профіль автора на верифікації, переносити проєкти не можна.":"",rejectionReason:z,canUseAutoSync:s?!1:W,isMobile:_,isTablet:v,sortBy:e,setSortBy:n,isDescending:a,toggleSortDirection:ue,searchQuery:m,setSearchQuery:T}},Vt=e=>{if(!e)return"—";const n=new Date(e);return Number.isNaN(n.getTime())?"—":n.toLocaleString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(",","")},zt=e=>(e==null?void 0:e.toLowerCase())==="zenko"?"Zenko":"MIU",Ft=(e,n="MIU")=>{if(!(e!=null&&e.trim()))return n;const a=e.trim().toLowerCase();return a.includes("zenko.online")?"Zenko":a.includes("manga.in.ua")?"MIU":n},pe=e=>e?e.isSyncInProgress||e.syncStatus==="Running"?"⏳":e.syncStatus==="Active"?"⚡":e.syncStatus==="Suspended"?"⚠️":"⚪":"⚪",Se=e=>{if(!e)return"Синхронізація не підключена";if(e.isSyncInProgress||e.syncStatus==="Running"){const n=e.progressProcessedChapters??0,a=e.progressTotalChapters??0;return`Оновлення в процесі...${a>0?`
2Прогрес: ${n}/${a}`:`
3Прогрес: ${n}/?`}`}return e.syncStatus==="Suspended"?"Синхронізацію призупинено":e.lastSyncAt?`Останнє оновлення: ${Vt(e.lastSyncAt)}`:e.syncStatus==="Active"||e.isSyncEnabled?"Синхронізація активна":e.sourceUrl?"Синхронізація налаштована":"Синхронізація не підключена"},ve=[],Ce=e=>`${(e==null?void 0:e.lastSyncAt)??""}|${(e==null?void 0:e.lastSyncMessage)??""}`,Ht=({teamId:e,canUseAutoSync:n,filteredProjects:a=ve,teamProjects:h=ve})=>{const m=Ue(),[T,S]=l.useState(!1),[u,s]=l.useState(new Set),[k,j]=l.useState({}),[g,x]=l.useState(!1),[I,A]=l.useState(!1),[f,C]=l.useState([]),b=l.useRef(!1),$=l.useRef(!1),N=l.useRef(!1),R=l.useRef({}),P=De({onError:()=>{M.error("Не вдалося застосувати налаштування синхронізації"),A(!1)}}),{data:_=[]}=xe(e,{enabled:!!e&&n,refetchInterval:o=>(o.state.data??[]).some(r=>r.isSyncInProgress)||I?2e3:!1}),v=l.useMemo(()=>new Set(h.map(o=>o.id)),[h]);l.useEffect(()=>{b.current=!1,$.current=!1,s(new Set),j({}),S(!1),A(!1),C([]),N.current=!1,R.current={}},[e]),l.useEffect(()=>{_.some(o=>o.isSyncInProgress)&&A(!1)},[_]),l.useEffect(()=>{const o=_.some(c=>c.isSyncInProgress);$.current&&!o&&e&&(m.invalidateQueries({queryKey:Le.projects()}),m.invalidateQueries({queryKey:["title"]}),m.invalidateQueries({queryKey:["latest-updates"]})),$.current=o},[m,_,e]),l.useEffect(()=>{if(!I)return;const o=window.setTimeout(()=>{A(!1)},15e3);return()=>{window.clearTimeout(o)}},[I]);const p=l.useMemo(()=>{const o=new Map;return _.forEach(c=>{o.set(c.titleId,c)}),o},[_]);l.useEffect(()=>{if(b.current||_.length===0)return;const o=_.filter(c=>c.isSyncEnabled).filter(c=>v.has(c.titleId)).map(c=>c.titleId);s(c=>c.size===o.length&&o.every(r=>c.has(r))?c:new Set(o)),b.current=!0},[_,v]),l.useEffect(()=>{j(o=>{const c={...o};let r=!1;return _.forEach(d=>{var B;c[d.titleId]===void 0&&(B=d.sourceUrl)!=null&&B.trim()&&(c[d.titleId]=d.sourceUrl,r=!0)}),r?c:o})},[_]),l.useEffect(()=>{if(f.length===0)return;f.some(c=>
3{const r=p.get(c);return(r==null?void 0:r.isSyncInProgress)||(r==null?void 0:r.syncStatus)==="Running"})&&(N.current=!0)},[f,p]),l.useEffect(()=>{f.length===0||I||!f.every(r=>{const d=p.get(r);return!(d!=null&&d.isSyncInProgress)&&(d==null?void 0:d.syncStatus)!=="Running"})||!f.every(r=>{const d=p.get(r),B=R.current[r]??"";return Ce(d)!==B})||!N.current||(f.forEach(r=>{var G;const d=p.get(r),B=(G=d==null?void 0:d.lastSyncMessage)==null?void 0:G.trim();if(B){M.success(B);return}M.success("Тайтл успішно оновлено")}),S(!1),C([]),N.current=!1,R.current={})},[I,f,p]);const K=u.size,U=l.useCallback(()=>{const o=a.map(c=>c.id);s(new Set(o))},[a]),H=l.useCallback(()=>{s(new Set)},[]),y=l.useCallback(()=>{S(o=>!o)},[]),O=l.useCallback(()=>{S(!1),C([]),N.current=!1,R.current={};const o=_.filter(c=>c.isSyncEnabled).filter(c=>v.has(c.titleId)).map(c=>c.titleId);s(new Set(o))},[_,v]),Y=l.useCallback(o=>{s(c=>{const r=new Set(c);return r.has(o)?r.delete(o):r.add(o),r})},[]),w=l.useCallback(o=>{var d;const c=k[o];if(c!==void 0)return c;const r=p.get(o);return(d=r==null?void 0:r.sourceUrl)!=null&&d.trim()?r.sourceUrl:""},[k,p]),V=l.useCallback((o,c)=>{j(r=>({...r,[o]:c})),c.trim()&&s(r=>{if(r.has(o))return r;const d=new Set(r);return d.add(o),d})},[]),z=l.useCallback(o=>o.map(c=>{var X;const r=p.get(c),d=zt(r==null?void 0:r.sourceType),B=w(c).trim(),G=((X=r==null?void 0:r.sourceUrl)==null?void 0:X.trim())??"",Q=B||G,se=Ft(Q,d);return{titleId:c,sourceType:se,sourceUrl:Q}}),[w,p]),W=l.useCallback(async()=>{if(!e){M.error("Не вдалося визначити активну команду");return}const o=Array.from(u).filter(r=>v.has(r));if(o.length===0){M.error("Оберіть хоча б один тайтл");return}if(o.filter(r=>{var G,Q;const d=w(r).trim(),B=((Q=(G=p.get(r))==null?void 0:G.sourceUrl)==null?void 0:Q.trim())??"";return!d&&!B}).length>0){M.error("Додайте посилання для всіх обраних тайтлів");return}try{R.current=o.reduce((r,d)=>(r[d]=Ce(p.get(d)),r),{}),N.current=!1,C(o),A(!0),await P.mutateAsync({teamId:e,items:z(o)}),M.success("Синхронізацію запущено")}catch{C([]),N.current=!1,R.current={}}},[e,u,v,P,z,w,p]),q=l.useCallback(async o=>{var d,B;if(!e){M.error("Не вдалося визначити активну команду");return}if(!o||!v.has(o)){M.error("Тайтл не належить активній команді");return}const c=w(o).trim(),r=((B=(d=p.get(o))==null?void 0:d.sourceUrl)==null?void 0:B.trim())??"";if(!c&&!r){M.error("Додайте посилання на джерело для цього тайтлу");return}x(!0);try{A(!0),await P.mutateAsync({teamId:e,items:z([o])}),M.success("Оновлення тайтлу поставлено в чергу")}catch{}finally{x(!1)}},[e,v,P,z,w,p]),ne=P.isPending&&!g;return{isSyncEditMode:T,toggleSyncEditMode:y,closeSyncEditMode:O,selectedSyncTitleIds:u,selectedSyncCount:K,handleSelectAllVisible:U,handleClearSyncSelection:H,handleToggleSyncSelection:Y,getSyncSourceUrl:w,handleSourceUrlChange:V,handleApplySyncConfig:W,syncByTitleId:p,isBulkSyncPending:ne,isQuickToggleSyncPending:g,toggleSyncForTitle:q}},_e=(e,n,a)=>Math.min(Math.max(e,n),a),Te=e=>(e??"").trim().toLowerCase(),Wt=({isVerificationBlocked:e})=>{const[n,a]=l.useState(null),h=$e(),{isAuthorProfile:m,isTeamAccount:T,activeAuthorProfileId:S}=ke(),u=(n==null?void 0:n.titleId)??"",{data:s,isLoading:k,isError:j}=Xe(u),g=l.useMemo(()=>Oe(s==null?void 0:s.volumes),[s]),x=Te(S),I=Te(s==null?void 0:s.ukrainianAuthorProfileId),A=!!(n&&((s==null?void 0:s.mangaType)||"").toLowerCase()==="malyopys"&&(((s==null?void 0:s.ownerType)||"").toLowerCase()==="ukrainianauthor"||I)),f=!!(m&&n&&(!A||!x||I!==x)),C=!!(T&&n&&((s==null?void 0:s.mangaType)||"").toLowerCase()==="malyopys"),b=f||C,$=f,N=$||
3C,R=f?"Ви можете редагувати тільки власні мальописи активного профілю автора.":C?"Для команди редагування мальописів недоступне.":"",P=$?"Ви можете додавати розділи тільки до власних мальописів активного профілю автора.":C?"Для команди додавання розділів на мальописах недоступне.":"",_=e?"Команда не пройшла верифікацію":N?P:!n||g?"":k?"Завантаження інформації про тайтл...":j?"Не вдалося отримати томи для тайтлу":"Створіть том, щоб додати розділ",v=l.useCallback(()=>{a(null)},[]),p=l.useCallback((y,O)=>{O.preventDefault(),O.stopPropagation();const w=O.currentTarget.getBoundingClientRect(),V=window.innerWidth-te-fe,z=window.innerHeight-te-qe,W=_e(w.right-fe,te,Math.max(te,V)),q=_e(w.bottom+We,te,Math.max(te,z));a({titleId:y,position:{top:q,left:W}})},[]),K=l.useCallback(()=>{if(!n)return;if(b){M.error(R,{id:`author-edit-block-${n.titleId}`}),v();return}const y=s==null?void 0:s.slug;if(!y){M.error("Не вдалося відкрити редагування: відсутній slug тайтлу."),v();return}h(Ge(y)),v()},[n,v,R,b,h,s==null?void 0:s.slug]),U=l.useCallback(()=>{if(!n)return;if(N){M.error(P,{id:`author-add-chapter-block-${n.titleId}`}),v();return}if(!g)return;const y=s==null?void 0:s.slug;if(!y){M.error("Не вдалося відкрити додавання розділу: відсутній slug тайтлу."),v();return}h(Qe(y,g)),v()},[n,P,v,N,g,h,s==null?void 0:s.slug]),H=l.useCallback(()=>{h("/titles/create")},[h]);return{actionsMenuState:n,selectedTitleId:u,latestVolumeId:g,addChapterTooltip:_,closeActionsMenu:v,handleProjectActionsClick:p,handleMenuEditTitle:K,handleMenuAddChapter:U,navigateToCreateTitle:H,isEditBlockedByRoleRules:b,editBlockedTooltip:R,isAddChapterBlockedByRoleRules:N}},be="teamProjectsGridDensity",me=[2,3,4],qt=()=>{if(typeof window>"u")return 2;const e=window.localStorage.getItem(be),n=e?Number(e):NaN;return n===2||n===3||n===4?n:2},Kt=(e,n,a)=>n?e:a?e===2?4:e===3?5:6:e===2?6:e===3?7:8,Yt=(e,n)=>{const[a,h]=l.useState(qt);l.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(be,a.toString())}catch(u){console.warn("Failed to persist team projects grid density",u)}},[a]);const m=l.useCallback(()=>{h(u=>{const k=(me.indexOf(u)+1)%me.length;return me[k]})},[]);return{gridColumns:l.useMemo(()=>Kt(a,e,n),[a,e,n]),gridScale:a===2?"standard":"compact",toggleGridDensity:m}},Jt=e=>{const n=e.name.trim().toLocaleLowerCase("uk-UA"),a=e.originalName.trim();return a?a.toLocaleLowerCase("uk-UA")===n?"":a:""},Zt=({project:e,syncStatus:n,showSyncControls:a,showEditBadge:h=!0,gridScale:m,gridColumns:T,isMobile:S,isTablet:u,onProjectActionsClick:s,buildSyncTooltip:k,getSyncBadgeIcon:j})=>{const g=Jt(e),x=e.slug||e.id;return t.jsxs("div",{className:i.syncEditCard,children:[t.jsx(Ae,{title:e.name,subtitle:g,image:e.coverImageUrl||"/placeholder-cover.jpg",badges:a&&(n==null?void 0:n.syncStatus)==="Active"?["🔄"]:[],mangaType:"",translationStatus:"",mangaId:x,density:m,columns:T,isMobile:S,isTablet:u,showEditBadge:h,onEditClick:I=>s(e.id,I),translatedChaptersCount:e.translatedChaptersCount??0,releasedChaptersCount:e.releasedChaptersCount??0}),a&&t.jsx(he,{content:k(n),isEnabled:!0,placement:"top",children:t.jsx("span",{className:`${i.syncBadge} ${n!=null&&n.isSyncInProgress||(n==null?void 0:n.syncStatus)==="Running"?i.syncBadgeRunning:""} ${(n==null?void 0:n.syncStatus)==="Active"?i.syncBadgeActive:""} ${(n==null?void 0:n.syncStatus)==="Suspended"?i.syncBadgeSuspended:""}`,children:j(n)})})]})},Xt=e=>{const n=e.name.trim().toLocaleLowerCase("uk-UA"),a=e.originalName.trim();return a?a.toLocaleLowerCase("uk-UA")===n?"":a:""},en=({project:e,syncStatus:n,showSyncControls:a,isSelected:h,currentSourceUrl:m,gridScale:T,gridColumns:S,isMobile:u,isTablet:s,onToggleSyncSelection:k,onSourceUrlChange:j,buildSyncTooltip:g,getSyncBadgeIcon:x})=>{const I=Xt(e),A=e.slug||e.id;return t.jsxs("div",{className:i.syncEditCard,children:[t.jsxs("label",{className:i.syncEditCheckbox,children:[t.jsx("input",{type:"checkbox",checked:h,onChange:()=>k(e.id)}),t.jsx("span",{children:"Обрати"})]}),t.jsx("div",{onClickCapture:f=>{f.target.closest('input[type="checkbox"]')||(f.preventDefault(),f.stopPropagation(),k(e.id))},children:t.jsx(Ae,{title:e.name,subtitle:I,image:e.coverImageUrl||"/placeholder-cover.jpg",badges:[],mangaType:"",translationStatus:"",mangaId:A,density:T,columns:S,isMobile:u,isTablet:s,translatedChaptersCount:e.translatedChaptersCount??0,releasedChaptersCount:e.releasedChaptersCount??0})}),t.jsx("div",{className:i.syncSourceUrlRow,children:t.jsx("input",{type:"url",placeholder:"Додати посилання",value:m,onChange:f=>j(e.id,f.target.value),className:`${i.syncSourceUrlInput} ${m.trim()?"":i.syncSourceUrlEmpty}`})}),a&&t.jsx(he,{content:g(n),isEnabled:!0,placement:"top",children:t.jsx("span",{className:`${i.syncBadge} ${i.syncBadgeSelectionMode} ${n!=null&&n.isSyncInProgress||(n==null?void 0:n.syncStatus)==="Running"?i.syncBadgeRunning:""} ${(n==null?void 0:n.syncStatus)==="Active"?i.syncBadgeActive:""} ${(n==null?void 0:n.syncStatus)==="Suspended"?i.syncBadgeSuspended:""}`,children:x(n)})})]})},_n=()=>{const[e,n]=l.useState(!1),{teamInfo:a,teamProjects:h,filteredProjects:m,error:T,isLoading:S,isAuthorAccount:u,isAdmin:s,isTeamMuted:k,mutedUntil:j,isVerificationBlocked:g,isVerificationRejected:x,tooltipMessage:I,isAuthorPendingVerification:A,authorMigrationTooltipMessage:f,rejectionReason:C,canUseAutoSync:b,isMobile:$,isTablet:N,sortBy:R,setSortBy:P,isDescending:_,toggleSortDirection:v,searchQuery:p,setSearchQuery:K}=Qt(),U=g||A,H=A?f:"Команда не пройшла верифікацію",{gridColumns:y,gridScale:O,toggleGridDensity:Y}=Yt($,N),{isSyncEditMode:w,toggleSyncEditMode:V,closeSyncEditMode:z,selectedSyncTitleIds:W,selectedSyncCount:q,handleSelectAllVisible:ne,handleClearSyncSelection:o,handleToggleSyncSelection:c,getSyncSourceUrl:r,handleSourceUrlChange:d,handleApplySyncConfig:B,syncByTitleId:G,isBulkSyncPending:Q,isQuickToggleSyncPending:se,toggleSyncForTitle:X}=Ht({teamId:a==null?void 0:a.teamId,canUseAutoSync:b,filteredProjects:m,teamProjects:h}),{actionsMenuState:oe,selectedTitleId:ue,latestVolumeId:re,addChapterTooltip:ie,closeActionsMenu:ae,handleProjectActionsClick:ce,handleMenuEditTitle:le,handleMenuAddChapter:D,navigateToCreateTitle:F,isEditBlockedByRoleRules:J,editBlockedTooltip:E,isAddChapterBlockedByRoleRules:ee}=Wt({isVerificationBlocked:g}),de=b?()=>X(ue):void 0;return S?t.jsx("div",{className:i.container,children:t.jsx("div",{className:i.dockSafeSection,children:t.jsx("div",{className:i.loading,children:"Завантаження..."})})}):a?T?t.jsx("div",{className:i.container,children:t.jsx("div",{className:i.dockSafeSection,children:t.jsxs("div",{className:i.error,children:[t.jsx("h1",{children:"Помилка завантаження"}),t.jsx("p",{children:"Не вдалося завантажити проєÐ
3ºÑ‚и команди. Спробуйте ще раз."})]})})}):t.jsx("div",{className:i.container,children:t.jsxs("div",{className:i.dockSafeSection,children:[t.jsx("div",{className:i.pageHeader,children:t.jsxs("div",{className:i.titleSection,children:[t.jsxs("h1",{className:i.pageTitle,children:[u?"Мої твори":"Проєкти команди"," (",m.length,p&&h?` з ${h.length}`:"",")"]}),t.jsxs("div",{className:`${i.controlsPanel} ${u?i.controlsPanelAuthor:""}`,children:[t.jsxs("div",{className:i.controls,children:[t.jsx(ze,{label:"Сортувати",options:et,value:R,onChange:L=>P(L),placeholder:"Оберіть сортування",className:i.controlsDropdown}),t.jsx(Fe,{isDescending:_,onToggle:v}),t.jsxs("button",{type:"button",className:`${i.gridDensityButton} ${i.gridDensityButtonDesktop}`,onClick:Y,"aria-label":`Кількість колонок: ${y}`,title:`Кількість колонок: ${y}`,children:[t.jsx("i",{className:"ri-layout-grid-line","aria-hidden":"true"}),t.jsxs("span",{children:[y,"x"]})]})]}),t.jsxs("div",{className:i.searchRow,children:[t.jsx(Ve,{value:p,onChange:K,placeholder:u?"Пошук по твоїх тайтлах...":"Пошук по тайтлах команди..."}),u&&t.jsxs("button",{type:"button",className:`${i.gridDensityButton} ${i.gridDensityButtonMobile}`,onClick:Y,"aria-label":`Кількість колонок: ${y}`,title:`Кількість колонок: ${y}`,children:[t.jsx("i",{className:"ri-layout-grid-line","aria-hidden":"true"}),t.jsxs("span",{children:[y,"x"]})]})]}),t.jsxs("div",{className:i.actions,children:[b&&t.jsx(Z,{variant:"outline",onClick:V,disabled:g,children:"Оновлення тайтлів"}),s&&t.jsx(Z,{variant:"outline",onClick:()=>n(!0),disabled:U,title:U?H:void 0,children:"Перенести проєкт"}),t.jsx(he,{content:I,isEnabled:g,placement:"bottom",children:t.jsx("span",{className:i.tooltipWrap,children:t.jsx(Z,{variant:"filled",onClick:F,disabled:k||g||A,children:u?"Додати твір":"Додати проєкт"})})})]})]})]})}),t.jsxs("div",{className:i.teamInfo,children:[t.jsx("p",{className:i.teamDescription,children:u?`Твори автора "${a.teamName}"`:`Тайтли, над якими працює команда "${a.teamName}"`}),k&&t.jsxs("div",{className:i.mutedNotice,children:["Команда в муті",j?` до ${j}`:"",". Додавання тайтлів тимчасово недоступне."]}),g&&t.jsxs("div",{className:`${i.verificationNotice} ${x?i.verificationNoticeRejected:""}`,children:[t.jsx("strong",{children:x?"Команду не підтверджено":"Команда проходить перевірку"}),t.jsx("span",{children:x?"Додавання та редагування тайтлів недоступне.":"Поки що ви не можете додавати чи редагувати тайтли."}),x&&t.jsx("span",{children:C?`Причина: ${C}.`:"Причина відхилення не вказана."}),x&&t.jsx("span",{children:"Команда буде архівована через 7 днів."})]}),A&&t.jsxs("div",{className:i.verificationNotice,children:[t.jsx("strong",{children:"Профіль автора проходить перевірку"}),t.jsx("span",{children:"Поки ви на верифікації, переносити проєкти не можна."})]})]}),w&&h&&h.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:i.bulkActionsRow,children:[t.jsx(Z,{variant:"outline",onClick:ne,children:"Обрати всі"}),t.jsx(Z,{variant:"outline",onClick:o,children:"Скасувати вибір"})]}),t.jsx("div",{className:`${i.syncEditGrid} ${O==="compact"?i.syncEditGridCompact:""}`,style:{"--grid-columns":y},children:m.map(L=>{const ge=b?G.get(L.id):void 0,Ne=W.has(L.id),Be=r(L.id);return t.jsx(en,{project:L,syncStatus:ge,showSyncControls:b,isSelected:Ne,currentSourceUrl:Be,gridScale:O,gridColumns:y,isMobile:$,isTablet:N,onToggleSyncSelection:c,onSourceUrlChange:d,buildSyncTooltip:Se,getSyncBadgeIcon:pe},L.id)})})]}):h&&h.length>0?m.length>0?t.jsx("div",{className:`${i.syncEditGrid} ${O==="compact"?i.syncEditGridCompact:""}`,style:{"--grid-columns":y},children:m.map(L=>{const ge=b?G.get(L.id):void 0;return t.jsx(Zt,{project:L,syncStatus:ge,showSyncControls:b,showEditBadge:!0,gridScale:O,gridColumns:y,isMobile:$,isTablet:N,onProjectActionsClick:ce,buildSyncTooltip:Se,getSyncBadgeIcon:pe},L.id)})}):t.jsxs("div",{className:i.emptyState,children:[t.jsx("h2",{children:"Нічого не знайдено"}),t.jsx("p",{children:"Спробуйте змінити запит у пошуку."})]}):t.jsxs("div",{className:i.emptyState,children:[t.jsx("h2",{children:u?"У Вас поки немає проєÐ
3ºÑ‚ів":"Поки що немає проєктів"}),t.jsx("p",{children:u?"Ваш авторський профіль ще не має жодного тайтлу.":"Ваша команда ще не працює над жодним тайтлом."})]}),a.teamId&&e&&s&&t.jsx(He,{isOpen:e,onClose:()=>n(!1),defaultTeamId:a.teamId}),oe&&t.jsx(Ke,{position:oe.position,onClose:ae,onEditTitle:le,onAddChapter:D,onToggleSync:de,syncToggleLabel:"Оновити з джерела",isSyncToggleDisabled:se||g,syncToggleTooltip:g?"Команда не пройшла верифікацію":void 0,isEditDisabled:g||J,editTooltip:g?"Команда не пройшла верифікацію":E,isAddChapterDisabled:!re||g||ee,addChapterTooltip:ie}),w&&t.jsxs("div",{className:i.syncStickyBar,children:[t.jsxs("span",{children:["Обрано тайтлів: ",q]}),t.jsxs("div",{className:i.syncStickyActions,children:[t.jsx(Z,{variant:"outline",onClick:z,children:"Скасувати"}),t.jsx(Z,{variant:"filled",onClick:B,disabled:Q||q===0,children:"Застосувати"})]})]})]})}):t.jsx("div",{className:i.container,children:t.jsx("div",{className:i.dockSafeSection,children:t.jsxs("div",{className:i.emptyState,children:[t.jsx("h1",{children:"Профіль автора"}),t.jsx("p",{children:"Оберіть або створіть профіль автора, щоб керувати творами."})]})})})};export{_n as TeamProjectsPage};

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.