"use strict";(globalThis.webpackChunk_affine_web=globalThis.webpackChunk_affine_web||[]).push([[8588],{28588:(e,l,s)=>{s.r(l),s.d(l,{AllPage:()=>_,Component:()=>A});var t=s(36870),o=s(77562),i=s(4892),r=s(93965),a=s(24312),n=s(10980),c=s(17049),d=s(33907),h=s(86326),j=s(84064),x=s(11352),p=s(79085),C=s(69628);let g=({filters:e,onChangeFilters:l})=>{let s=(0,n.h1)(c.j).workspace,i=(0,C.P)(),r=(0,n.h1)(p.Y),a=(0,h.useCallback)(l=>{r.addCollection({...l,filterList:e}),i.jumpToCollection(s.id,l.id)},[r,e,i,s.id]);return e.length?(0,t.jsxs)("div",{className:"_1cq2p9c0",children:[(0,t.jsx)("div",{style:{flex:1},children:(0,t.jsx)(o.L0,{propertiesMeta:s.docCollection.meta.properties,value:e,onChange:l})}),(0,t.jsx)("div",{children:e.length>0?(0,t.jsx)(o.QP,{onConfirm:a}):null})]}):null};var u=s(26605),f=s(65423),m=s(26798),w=s(4285),k=s(94002),b=s(86639),F=s(45483),P=s(37064);let v=({showCreateNew:e,filters:l,onChangeFilters:s})=>{let i=(0,n.h1)(c.j).workspace,{importFile:r,createEdgeless:a,createPage:d}=(0,u.z)(i.docCollection),h=(0,w.V)(async()=>{(await r()).isWorkspaceFile?k.u4.allDocs.header.actions.createWorkspace({control:"import"}):k.u4.allDocs.header.actions.createDoc({control:"import"})},[r]);return(0,t.jsx)(f.Y,{left:(0,t.jsx)(o.oi,{filterList:l,onChangeFilterList:s,propertiesMeta:i.docCollection.meta.properties}),right:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.F5,{size:"small",className:(0,P.A)("_14r0nk21",!e&&"_14r0nk23"),onCreateEdgeless:e=>a(!(0,b.C4)(e)||"new-tab"),onCreatePage:e=>d(!(0,b.C4)(e)||"new-tab"),onImportFile:h,children:(0,t.jsx)(F.PlusIcon,{})}),(0,t.jsx)(o.ze,{})]}),center:(0,t.jsx)(m.w,{activeFilter:"docs"})})},_=()=>{let e=(0,n.h1)(c.j).workspace,l=(0,n.h1)(d.q).globalContext,s=(0,i.Q)(e.docCollection),[r,p]=(0,h.useState)(!0),[C,u]=(0,h.useState)([]),f=(0,o.Iu)(s,{filters:C}),m=(0,j.Tq)();(0,h.useEffect)(()=>{if(m)return l.isAllDocs.set(!0),()=>{l.isAllDocs.set(!1)}},[l,m]);let w=(0,a.s9)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.EY,{title:w["All pages"]()}),(0,t.jsx)(j.tC,{icon:"allDocs"}),(0,t.jsx)(j.XP,{children:(0,t.jsx)(v,{showCreateNew:!r,filters:C,onChangeFilters:u})}),(0,t.jsx)(j.s$,{children:(0,t.jsxs)("div",{className:"_14r0nk24",children:[(0,t.jsx)(g,{filters:C,onChangeFilters:u}),f.length>0?(0,t.jsx)(o.jF,{setHideHeaderCreateNewPage:p,filters:C}):(0,t.jsx)(x.Pp,{type:"all",heading:(0,t.jsx)(o.Rj,{}),docCollection:e.docCollection})]})})]})},A=()=>(r.xG.debug("AllPage"),(0,t.jsx)(_,{}))}}]); //# sourceMappingURL=chunk.8588.0bb69e24.js.map