PageSourceSearch

https://iiitdplaybook.web.app/static/js/19.137f0f76.chunk.js

js iiitdplaybook.web.app collected 2026-10-03 12:26:45 UTC 6,383 bytes, 2 lines download raw bytes

1(this["webpackJsonpstudent-playbook"]=this["webpackJsonpstudent-playbook"]||[]).push([[19],{252:function(t,e,a){},279:function(t,e,a){"use strict";a.d(e,"a",(function(){return i}));var n=a(82);var r=a(99);function i(t){return function(t){if(Array.isArray(t))return Object(n.a)(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Object(r.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},437:function(t,e,a){"use strict";a.r(e);var n=a(13),r=a.n(n),i=a(26),o=a(10),c=a(0),s=(a(252),a(15)),l=a(2),u=a(201),d=a(27),b=a(93),p=a(279),f=a(250),h=a(253),m=a(418),g=a(254),j=a(251),x=a(247);var y=function(t){var e=t.item,a=t.uid,n=2.5/3*280,b=Object(l.useState)(!1),y=Object(o.a)(b,2),v=y[0],O=y[1],k=Object(l.useState)(!1),S=Object(o.a)(k,2),B=S[0],w=S[1],N=Object(l.useState)(0),C=Object(o.a)(N,2),I=C[0],A=C[1],L="#fff",_="#fafafa";Object(l.useEffect)((function(){e.title&&(A(e.boughtBy.length),O(e.boughtBy.includes(a)),w(""===a))}),[e.boughtBy]);var R=Object(u.a)({root:{display:"inline-block",maxWidth:n,minWidth:n,maxHeight:280,background:"linear-gradient(45deg, ".concat(L,", ").concat(_,")"),borderRadius:10},actionArea:{width:n,height:280,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},media:{maxWidth:120,maxHeight:120,border:"none",display:"block",margin:"0 auto",objectFit:"contain",paddingTop:"30px"},content:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},title:{fontSize:15,fontWeight:"bold",textAlign:"center",color:"#141414"},info:{fontSize:12,textAlign:"center",margin:"5%"},button:{color:"#23a6d5",border:"1px solid #23a6d5",fontSize:"11px",margin:"5px",marginLeft:"10px",marginBottom:"10px",padding:"5px 7px !important",minWidth:"30px !important",maxHeight:"30px !important",float:"right",position:"absolute",top:3,right:3,zIndex:"2","&:hover":{backgroundColor:"#248fb6",color:"white"}},active:{color:"#FFF",background:"#48C854",border:"1px solid #fff"},disabled:{color:"grey",background:"#eee",border:"1px solid #C8C8C8"}})(),D=function(){var t=Object(i.a)(r.a.mark((function t(){var n;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.boughtBy.indexOf(a),A(I-1),e.boughtBy.splice(n,1),s.a.database().ref("Supplies/"+e.key+"/boughtBy").child(n).remove();case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=Object(i.a)(r.a.mark((function t(){var n;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=s.a.database().ref("Supplies/"+e.key),A(I+1),e.boughtBy.push(a),n.set({boughtBy:Object(p.a)(e.boughtBy),description:e.description,image:e.image,pathLink:e.pathLink,title:e.title,category:e.category});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return Object(c.jsx)(f.a,{className:R.root,style:{background:"linear-gradient(45deg, ".concat(L,", ").concat(_,")")},children:Object(c.jsxs)(h.a,{className:R.actionArea,children:[Object(c.jsx)(m.a,{title:"Crocin Pain Relief Tablet"===e.title?"We know":"I've bought this",children:B?Object(c.jsx)(d.a,{size:"small",className:"".concat(R.button," ").concat(R.disabled),disabled:!0,children:"+1"}):Object(c.jsx)(d.a,{size:"small",className:v?"".concat(R.button," ").concat(R.active):R.button,onClick:function(){var t=!v;O(t),t?W():D()},children:"+1"})}),Object(c.jsxs)("a",{href:e.pathLink,target:"_blank",style:{margin:"0%",opacity:"1"},children:[Object(c.jsx)(g.a,{className:R.media,component:"img",src:e.image,title:e.title}),Object(c.jsxs)(j.a,{className:R.content,children:[Object(c.jsx)(x.a,{className:R.title,style:{whiteSpace:"pre-line"},children:e.title}),Object(c.jsx)(x.a,{className:R.info,color:"textSecondary",children:"Crocin Pain Relief Tablet"===e.title?"Bought by everyone":1===I?"Bought by "+I+" student":"Bought by "+I+" students"})]})]})]})})};var v=function(t){var e=t.itemList,a=s.a.auth().currentUser;return e.map((function(t){return Object(c.jsx)(y,{item:t,uid:null===a?"":a.uid})}))};e.default=function(){var t=Object(l.useState)(0),e=Object(o.a)(t,2),a=e[0],n=e[1],p=Object(l.useState)([]),f=Object(o.a)(p,2),h=f[0],m=f[1],g=["All","Stationery","Design","Books","Laptops","Tech Accessories","Room Decor","Other"],j=function(){var t=Object(i.a)(r.a.mark((function t(){var e;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=s.a.database().ref("Supplies"),t.next=3,e.once("value",(function(t){var e=[];t.forEach((function(t){var a={};a.title=t.val().title,a.description=t.val().description,a.image=t.val().image,a.pathLink=t.val().pathLink,a.boughtBy=t.val().boughtBy,a.category=t.val().category,a.key=t.key,e.push(a)})),m(e)}));case 3:return t.abrupt("return",h);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(l.useEffect)((function(){j()}),[]);var x,y=Object(u.a)({root:{background:"linear-gradient(90deg,#1EB0F6 6.32%, #2BD4DF 100%)",borderRadius:"15p
1x",border:"none",color:"white"},notRoot:{borderRadius:"15px",background:"#f0f0f0",border:"none"}})();return Object(c.jsxs)("div",{className:"supplies",children:[Object(c.jsx)(b.a,{loggedIn:localStorage.getItem("isSignedIn"),colorStatus:!0}),Object(c.jsx)("h1",{className:"main_heading",children:"Supplies"}),Object(c.jsx)("h2",{className:"sub_heading",children:"Common college supplies used by students"}),Object(c.jsx)("div",{className:"supplies__button",children:g.map((function(t,e){return Object(c.jsx)(d.a,{onClick:function(){return n(e)},variant:a===e?"contained":"outlined",className:a===e?y.root:y.notRoot,children:t})}))}),Object(c.jsxs)("div",{className:"explore__body",children:[Object(c.jsx)("a",{href:"https://docs.google.com/forms/d/e/1FAIpQLSfwv9CsW6ISTb4kPCjHRJ72S7UnqvEQtJZWI11YNrTvlkfmVg/viewform",target:"_blank",class:"float",children:Object(c.jsx)("i",{class:"fa fa-plus my-float",children:" Add a product"})}),0===a?Object(c.jsx)("div",{className:"cardsDiv_supply",children:Object(c.jsx)(v,{itemList:h})}):Object(c.jsx)("div",{className:"cardsDiv_supply",children:Object(c.jsx)(v,{itemList:(x=g[a].split(" ")[0],h.filter((function(t){return!!t.category&&t.category.includes(x)})))})})]})]})}}}]);
2//# sourceMappingURL=19.137f0f76.chunk.js.map

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.