import{gP as x,aX as y,az as s,f7 as d,aj as f,hs as L,ht as j,bN as F,ao as a,aZ as C,b5 as B,hq as P,r as k,p as A,E as H,hr as T,f as E,e as V,a$ as w,aq as N}from"./app-k0jcl5PQ.js";import{B as O,P as R}from"./PHV_KuUR.chunk.js";import{P as q,F as v}from"./DDqFZOL-.chunk.js";import{u as U}from"./CAxN5LKv.chunk.js";import{u as D}from"./K3ic94bc.chunk.js";import{u as M}from"./o0yo3n9K.chunk.js";import{g as Z,a as z}from"./DgH2y00K.chunk.js";import"./BKsI6eJC.chunk.js";import"./DoGfHyrk.chunk.js";import"./CA48zo75.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";import"./sncKO62z.chunk.js";import"./Bdp-qhf0.chunk.js";import"./DVESw1e9.chunk.js";import"./CofWDDSQ.chunk.js";import"./DwvfEevL.chunk.js";import"./DIAJ896Y.chunk.js";const I="libraries.library";function ma(t){var i,n,c,m;const{focusSearchBar:u}=x(),{hasPermissions:h}=y(),b=s(d.domainLibraries(["customLibrary","sharedLibrary"])),r=s(d.library(t.id)),e=D((n=(i=r.data)==null?void 0:i.categoryTree)==null?void 0:n.id),o=s(f.currentUser()),S=!!o.data&&L.getOrSetSortType(o.data.id,t.sort,j.AtoZ);F({title:(c=r.data)==null?void 0:c.name}),U(r),M(r);function g(){var p;return h(C.ViewSearch)?a.jsx(B,{svg:w,appLink:{application:V.SEARCH,action:E.Search.HOME,params:{source:T.School}},className:"btn btn-outline-dark mb-3 me-2 d-none d-sm-inline-block",onClick:u,analyticsData:{},analyticsOptions:{entity:H.SearchResults,location:A.Libraries,actionType:k.Click,descriptor:P.School},children:a.jsx(N,{namespace:I,phrase:"searchLibrary",options:{smartCount:((p=b.data)==null?void 0:p.length)??1}})}):a.jsx(a.Fragment,{})}return a.jsxs(a.Fragment,{children:[r.data?a.jsx(O,{heading:r.data.name,blockColourClass:Z(r.data),logo:(m=r.data.owner)==null?void 0:m.logo}):a.jsx(R,{}),e!=null&&e.items?e.items.length?a.jsx("div",{className:"mt-3 px-2",children:a.jsx(v,{folders:e.items,getAppLink:l=>z(t.id,l,S),expandFolders:!0,extraButtons:g()})}):a.jsx(a.Fragment,{}):a.jsx("div",{className:"mt-3 px-3",children:a.jsx(q,{count:10})})]})}export{ma as LibraryView};
//# sourceMappingURL=BxBrMSTg.chunk.js.map
