1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3584],{81602:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/resources",function(){return s(97714)}])},97714:function(e,a,s){"use strict";s.r(a),s.d(a,{default:function(){return g}});var r=s(85893),n=s(67294),t=s(32162),i=s(99811),l=s(39332),o=s(11163),c=s(29739),d=s(84369),u=s(43795),h=s(5246),p=s(92201),m=s(37550),x=s(33299),j=()=>{var e;let[a,s]=(0,n.useState)(!1),{resourcesPaginated:t,allowedResources:i,deleteResource:j}=(0,c.g)(),f=(0,l.useSearchParams)(),[g,w]=(0,n.useState)(""),{data:y,status:N}=(0,x.useSession)(),k=(null==y?void 0:null===(e=y.user)||void 0===e?void 0:e.role)==="ADMIN",v=f.get("q");(0,n.useEffect)(()=>{v&&w(decodeURI(v))},[v]);let[b,C]=(0,n.useState)(1),_=(0,o.useRouter)();(0,n.useEffect)(()=>{_.isReady&&s(!0)},[_.isReady]);let S=()=>{window.scrollTo({top:0,behavior:"smooth"})},{data:R,isLoading:Z}=t({take:15,skip:(b-1)*15,search:v,loaded:a});return((0,n.useEffect)(()=>{i||"authenticated"!==N||_.push("/")},[i]),i||"authenticated"!==N)?"unauthenticated"===N?(0,r.jsx)("section",{className:"course-area pt-40 pb-120",children:(0,r.jsx)("div",{className:"container",children:(0,r.jsx)("div",{className:"row mb-20",children:(0,r.jsxs)("div",{className:"row mb-20",children:[(0,r.jsx)("p",{children:"You must be Signed In to view this page"}),(0,r.jsx)(d.ZP,{type:"primary",style:{backgroundColor:"#06c994",width:200},onClick:()=>_.push("/sign-in"),children:"Sign In"})]})})})}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("section",{className:"course-area pt-40 pb-120",children:(0,r.jsxs)("div",{className:"container",children:[(0,r.jsxs)("div",{className:"row mb-20 justify-content-end",children:[k?(0,r.jsx)(d.ZP,{type:"primary",className:"mr-10",style:{width:150,backgroundColor:"#06c994"},onClick:()=>_.push("/resources/create"),children:"Add Resource"}):null,(0,r.jsx)(u.default.Search,{placeholder:"Search for resources",allowClear:!0,defaultValue:g,value:g,onChange:e=>{w(e.target.value)},onSearch:(e,a)=>_.push("/resources?q=".concat(encodeURI(e))),style:{width:250}})]}),Z||"loading"===N?(0,r.jsx)("div",{className:"row mb-20",children:(0,r.jsx)(h.Z,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row mb-20",children:(0,r.jsx)(p.Z,{dataSource:null==R?void 0:R.items,columns:[{title:"Name",dataIndex:"name",key:"name",render:(e,a)=>(0,r.jsx)("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:e})},{title:"Type",dataIndex:"type",key:"type",render:e=>(0,r.jsx)("span",{children:e.toLowerCase().charAt(0).toUpperCase()+e.toLowerCase().slice(1)})},{title:"",key:"action",width:200,render:(e,a)=>[(0,r.jsx)(d.ZP,{type:"primary",href:a.link,target:"_blank",rel:"noopener noreferrer",style:{backgroundColor:"#06c994",marginRight:10},children:"Download"},"download-".concat(a.id)),k?(0,r.jsx)(d.ZP,{danger:!0,onClick:()=>j(a.id),icon:(0,r.jsx)("i",{className:"far fa-trash-alt"})},"delete-".concat(a.id)):null]}],rowKey:"id",pagination:!1})}),(0,r.jsx)("div",{className:"basic-pagination",children:(0,r.jsx)(m.Z,{defaultCurrent:b,total:(null==R?void 0:R.total)||0,hideOnSinglePage:!0,pageSize:15,onChange:e=>{e!==b&&C(e),S()}})})]})]})})}):(0,r.jsx)("p",{children:"Not allowed"})},f=s(55572),g=()=>(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(t.Z,{pageTitle:"Resources"}),(0,r.jsx)(f.Z,{title:"Resources",subtitle:"Resources"}),(0,r.jsx)(j,{})]})}},function(e){e.O(0,[8090,8379,7219,5246,5456,4853,4789,5390,9569,7550,7230,2201,2755,5517,2888,9774,179],function(){return e(e.s=81602)}),_N_E=e.O()}]);
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.