"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[306],{6257:function(e,r,n){n.d(r,{Eo:function(){return t.Eo},PL:function(){return t.PL},QT:function(){return t.QT},UQ:function(){return t.UQ},cf:function(){return t.cf},iE:function(){return t.iE},zN:function(){return t.zN}});var t=n(1294)},1172:function(e,r,n){var t=n(6042),o=n(9396),i=n(828),a=n(5893),s=n(7294),c=n(1042),u=n(6677),l=n(5657),d=n(3872),f=n(1664),v=n.n(f),h=n(2161),p=n(1163);r.Z=function(e){(0,p.useRouter)();var r,n,f="2020",g=(0,s.useState)(),m=g[0],x=g[1],b=(0,i.Z)((0,u.Kx)(c.Z.firestore().collection("noonies-ads"),{snapshotListenOptions:{includeMetadataChanges:!0}}),3),y=b[0],j=b[1],w=b[2],N=(0,i.Z)((0,u.Xi)(c.Z.firestore().doc("noonies-misc/2020")),2);N[0],N[1];console.log(e),(0,s.useEffect)((function(){if(w)throw new Error(w.message);if(!j&&!(null===y||void 0===y?void 0:y.empty)){var r=null===y||void 0===y?void 0:y.docs.map((function(e){var r=e.data();return(0,o.Z)((0,t.Z)({},r),{categories:r.categories.map((function(e){return e.id}))})})),n=null===r||void 0===r?void 0:r.find((function(r){return r.categories.includes(e.slug)}));n&&x(n)}}),[y,j,w]);return(0,a.jsxs)("section",{className:"mt-4 p-4 mb-64 w-full grid gap-6 bg-[#d2f8d2] items-start text-gray-800",id:e.slug,children:[(0,a.jsxs)("header",{className:"grid gap-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex flex-col-reverse lg:flex-row",children:(0,a.jsx)("h3",{className:"mb-1 text-2xl text-green-800 xs:text-3xl sm:text-4xl leading-6 font-semibold font-display",children:e.isHome?(0,a.jsx)(v(),{href:"/".concat(f,"/").concat(e.slug),passHref:!0,children:(0,a.jsx)("a",{className:" text-green-800 border-b-4 border-transparent hover:border-green-800",children:"Future Heroes"===e.title?"Internet Heroes":e.title})}):"Future Heroes"===e.title?"Internet Heroes":e.title})}),(0,a.jsx)("p",{className:"text-lg leading-7 mt-3",children:e.description})]}),m&&(0,a.jsx)("div",{children:(0,a.jsxs)("p",{className:"",children:["Presented by"," ",(0,a.jsx)("a",{href:m.url,target:"_blank",rel:"noreferrer",onClick:function(){return e=m.sponsor.name,void l.B({action:"clicked_".concat(e),category:"sponsor",label:"categorySection",value:""});var e},className:" border-b-2 border-transparent text-gray-800 hover:border-gray-800 font-bold",children:m.sponsor.name})]})})]}),(0,a.jsx)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4 items-start",children:0===(null===(r=e.awards)||void 0===r?void 0:r.length)?(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(h.Z,{title:"There are currently no awards in the category"})}):null===(n=e.awards)||void 0===n?void 0:n.map((function(e,r){var n;return(0,a.jsx)(d.Z,{title:e.title,slug:e.slug,year:e.year,description:e.description,category:e.category,nomineeCount:(null===(n=e.nominees)||void 0===n?void 0:n.filter((function(e){return!e.status||"approved"===e.status})).length)||0,awardVotes:e.votes||0},r)}))}),e.isHome&&e.awards.length>0&&(0,a.jsx)(v(),{href:"/".concat(f,"/").concat(e.slug),passHref:!0,children:(0,a.jsxs)("a",{className:" border-b-2 border-transparent text-gray-800 hover:border-gray-800 font-semibold text-lg justify-self-start",children:["More ",e.title," awards ",(0,a.jsx)("i",{className:"fad fa-arrow-right"})]})})]})}},2161:function(e,r,n){var t=n(5893);n(7294);r.Z=function(e){var r=e.title,n=e.description;return(0,t.jsx)("div",{className:"rounded-sm bg-yellow-50 p-4",children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("i",{className:"fal fa-exclamation-triangle h-5 w-5 text-yellow-400","aria-hidden":"true"})}),(0,t.jsxs)("div",{className:"ml-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:r}),n&&(0,t.jsx)("div",{className:"mt-2 text-sm text-yellow-700",children:(0,t.jsx)("p",{children:n})})]})]})})}},1802:function(e,r,n){var t=n(5893),o=(n(7294),n(4184)),i=n.n(o);r.Z=function(e){var r=e.extraClassNames,n=e.disabled,o=e.loading,a=e.onClick,s=e.borderColor,c=e.type,u=e.color,l=e.padding,d=void 0===l?"px-3 py-2":l,f=e.children;return(0,t.jsx)("button",{type:c,className:i()("cursor-pointer inline-flex items-center justify-center text-sm font-bold rounded-sm focus:outline-none disabled:opacity-50 disabled:pointer-events-none",d,"green"===u?"bg-orange-willpower text-white focus:ring-2 focus:ring-offset-2 focus:ring-orange-willpower":"danger will robinson"===u?"bg-red-600 text-white focus:ring-2 focus:ring-offset-2 focus:ring-red-600":"transparent"===u?"bg-transparent border-0":"bg-transparent border-2 ","green"===s?"border-newGreen-medium":"border-orange-willpower",r),onClick:a,disabled:n||o,children:f})}},2857:function(e,r,n){var t=n(5893);n(7294);r.Z=function(e){var r=e.children;return(0,t.jsx)("div",{className:"grid my-0 mx-auto px-4 2xl:px-0 max-w-screen-2xl w-full gap-10 grid-cols-1",children:r})}},8007:function(e,r,n){var t=n(5893);n(7294);r.Z=function(e){return(0,t.jsx)("span",{className:"emoji",role:"img","aria-label":e.label?e.label:"","aria-hidden":e.label?"false":"true",children:e.symbol})}},6685:function(e,r,n){var t=n(5893);n(7294);r.Z=function(){return(0,t.jsx)("div",{className:"grid place-items-center",children:(0,t.jsx)("i",{className:"text-2xl fad fa-spinner-third fa-spin"})})}},6731:function(e,r,n){n.d(r,{Z:function(){return h}});var t=n(5893),o=n(290),i=n.n(o),a=n(8810),s=n(8617),c=n(4793),u=n(3838),l=(n(7294),function(e){var r=e.hits;return(0,t.jsx)("ul",{className:"relative -top-1 z-10 max-h-[50vh] p-2 overflow-y-scroll",children:r.map((function(e){var r=e.objectID,n=e.title,o=e.nominees,i=e.year,a=e.slug,s=e.category;return(0,t.jsx)("li",{className:"border-b-2 text-gray-700 bg-white",children:(0,t.jsxs)("a",{href:"https://noonies.hackernoon.com/".concat(i,"/").concat(s,"/").concat(i,"-").concat(a),className:"p-2 text-gray-700 hover:bg-gray-100 grid gap-2 grid-cols-[auto,1fr]",children:[(0,t.jsx)("span",{className:"pt-[0.5rem] text-gray-700",children:i}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold sm:text-base text-gray-900",children:n}),(0,t.jsxs)("small",{className:"text-gray-600",children:[null===o||void 0===o?void 0:o.slice(0,10).map((function(e){return e.name})).join(", "),"..."]})]})]})},r)}))})}),d=i()("MO7DWH9Y8C","e0088941fa8f9754226b97fa87a7c340"),f=(0,a.Z)(l),v=(0,s.Z)((function(e){var r=e.searchState,n=e.children;return r&&r.query?n:null})),h=function(){return(0,t.jsx)("div",{children:(0,t.jsxs)(c.Z,{searchClient:d,indexName:"noonies",children:[(0,t.jsx)(u.Z,{autoFocus:!0,showLoadingIndicator:!1,translations:{submitTitle:"Search",resetTitle:"Clear",placeholder:"Search for awards or nominees"}}),(0,t.jsx)(v,{children:(0,t.jsx)(f,{})})]})})}},6677:function(e,r,n){n.d(r,{Kx:function(){return p},Xi:function(){return j},d4:function(){return m},fM:function(){return g},ky:function(){return y}});var t=n(6257),o=n(7294);function i(e,r,n,t){return new(n||(n=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(r){i(r)}}function s(e){try{c(t.throw(e))}catch(r){i(r)}}function c(e){var r;e.done?o(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}c((t=t.apply(e,r||[])).next())}))}function a(e,r){var n,t,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,t&&(o=2&i[0]?t.return:i[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;switch(t=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,t=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(s){i=[6,s],t=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var s=function(){return s=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},s.apply(this,arguments)},c=function(e){return{loading:void 0===e||null===e,value:e}},u=function(e){var r=e?e():void 0,n=(0,o.useReducer)((function(e,r){switch(r.type){case"error":return s(s({},e),{error:r.error,loading:!1,value:void 0});case"reset":return c(r.defaultValue);case"value":return s(s({},e),{error:void 0,loading:!1,value:r.value});default:return e}}),c(r)),t=n[0],i=n[1],a=function(){var r=e?e():void 0;i({type:"reset",defaultValue:r})},u=function(e){i({type:"error",error:e})},l=function(e){i({type:"value",value:e})};return(0,o.useMemo)((function(){return{error:t.error,loading:t.loading,reset:a,setError:u,setValue:l,value:t.value}}),[t.error,t.loading,a,u,l,t.value])},l=function(e,r,n){var t=(0,o.useRef)(e);return(0,o.useEffect)((function(){r(e,t.current)||(t.current=e,n&&n())})),t},d=function(e,r){var n=!e&&!r,o=!!e&&!!r&&(0,t.Eo)(e,r);return n||o},f=function(e,r){return l(e,d,r)},v=function(e,r){var n=!e&&!r,o=!!e&&!!r&&(0,t.iE)(e,r);return n||o},h=function(e,r){return l(e,v,r)},p=function(e,r){var n=u(),i=n.error,a=n.loading,s=n.reset,c=n.setError,l=n.setValue,d=n.value,f=h(e,s);(0,o.useEffect)((function(){if(f.current){var e=(null===r||void 0===r?void 0:r.snapshotListenOptions)?(0,t.cf)(f.current,r.snapshotListenOptions,l,c):(0,t.cf)(f.current,l,c);return function(){e()}}l(void 0)}),[f.current]);var v=[d,a,i];return(0,o.useMemo)((function(){return v}),v)},g=function(e,r){var n=u(),t=n.error,s=n.loading,c=n.reset,l=n.setError,d=n.setValue,f=n.value,v=!0,p=h(e,c),g=function(e,r){return i(void 0,void 0,void 0,(function(){var n,t,o;return a(this,(function(i){switch(i.label){case 0:if(!e)return d(void 0),[2];n=b(null===r||void 0===r?void 0:r.getOptions),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n(e)];case 2:return t=i.sent(),v&&d(t),[3,4];case 3:return o=i.sent(),v&&l(o),[3,4];case 4:return[2]}}))}))};(0,o.useEffect)((function(){return g(p.current,r),function(){v=!1}}),[p.current]);var m=[f,s,t,function(){return g(p.current,r)}];return(0,o.useMemo)((function(){return m}),m)},m=function(e,r){var n=null===r||void 0===r?void 0:r.snapshotOptions,t=p(e,r),i=t[0],a=t[1],s=t[2],c=[x(i,n),a,s,i];return(0,o.useMemo)((function(){return c}),c)},x=function(e,r){return(0,o.useMemo)((function(){return null===e||void 0===e?void 0:e.docs.map((function(e){return e.data(r)}))}),[e,r])},b=function(e){switch((void 0===e?{source:"default"}:e).source){default:case"default":return t.PL;case"cache":return t.UQ;case"server":return t.zN}},y=function(e,r){var n=u(),i=n.error,a=n.loading,s=n.reset,c=n.setError,l=n.setValue,d=n.value,v=f(e,s);(0,o.useEffect)((function(){if(v.current){var e=(null===r||void 0===r?void 0:r.snapshotListenOptions)?(0,t.cf)(v.current,r.snapshotListenOptions,l,c):(0,t.cf)(v.current,l,c);return function(){e()}}l(void 0)}),[v.current]);var h=[d,a,i];return(0,o.useMemo)((function(){return h}),h)},j=function(e,r){var n=null===r||void 0===r?void 0:r.snapshotOptions,t=y(e,r),i=t[0],a=t[1],s=t[2],c=[(0,o.useMemo)((function(){return null===i||void 0===i?void 0:i.data(n)}),[i,n]),a,s,i];return(0,o.useMemo)((function(){return c}),c)}}}]);