1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9458],{69458:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I});var i=r(95155),o=r(12115),a=r(73346),n=r(56162),s=r(37144),c=r(90385),l=r(23881),d=r(10246),u=r.n(d);let f=e=>{let{title:t,description:r,notificationType:a,onClose:n,duration:s,onCardClick:c}=e,d=(0,o.useRef)();return(0,o.useEffect)(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{n()},null!=s?s:5e3)},[r]),a?(0,i.jsx)(l.A,{title:t,description:r,notificationType:a,isRead:!0,crossNotification:n,className:"".concat(u().toast," ").concat(u().notification_toast," fixed shadow-md z-[3]"),onCardClick:c}):(0,i.jsx)(i.Fragment,{})};var p=r(83790),y=r(20063),w=r(12165),g=r(51717),v=r(39012);let m={title:"",body:"",url:"",type:"",notficationId:""},I=()=>{let[e,t]=(0,o.useState)(m),r=(0,y.useRouter)(),l=(0,n.j)(),d=(0,y.useSearchParams)().get(v.i.NOTIFICATION_ID);(0,o.useEffect)(()=>{u()},[]),(0,o.useEffect)(()=>{d&&l((0,s.ZL)(d))},[l,d]),(0,o.useEffect)(()=>{a.BV&&!(0,w.nr)()&&(0,p.xD)(a.BV,e=>{let r=e.data;if((c.I.NEW_MESSAGE!==(null==r?void 0:r.type)&&c.I.NEW_MENTION!==(null==r?void 0:r.type)||(null==r?void 0:r.url)!==window.location.href)&&(null==r?void 0:r.title)&&r.body&&r.type){var i;t({title:r.title,body:null!=(i=r.richDescription)?i:r.body,url:r.url,type:r.type,notficationId:r.notficationId})}})},[]);let u=()=>{(0,g.iD)()&&l((0,s.NZ)())};return e.type?(0,i.jsx)(f,{description:e.body,onClose:()=>{t(m)},notificationType:e.type,title:e.title,onCardClick:async()=>{await l((0,s.ZL)(e.notficationId)),t(m),window.location.href.split("?")[0]===e.url.split("?")[0]?window.location.href=e.url:r.push(e.url)}}):(0,i.jsx)(i.Fragment,{})}},73346:(e,t,r)=>{r.d(t,{BV:()=>s,Q8:()=>n,ed:()=>c});var i=r(52078),o=r(83790),a=r(6596);let n,s,c,l=0;try{if(!((()=>{{let e=window.navigator.userAgent.toLowerCase(),t=/safari/.test(e),r=/iphone|ipod|ipad/.test(e),i=/wv/.test(e);if(r&&!t||i)return!0}return!1})()||window.isWebView)){let e=(0,i.Wp)({apiKey:"AIzaSyB_b5Fmjn42EB4cnKpLyTKbI1auc_rPpEQ",authDomain:"youcater-prod.firebaseapp.com",projectId:"youcater-prod",storageBucket:"youcater-prod.appspot.com",messagingSenderId:"23671389218",appId:"1:23671389218:web:3fbd112aaffe433a0d5e7b",measurementId:"G-721N50B119"},"fcm");s=(0,o.dG)(e),c=(0,a.aU)(e);let t=async()=>{if("serviceWorker"in navigator)try{let e=await navigator.serviceWorker.register(window.location.origin+"/firebase-messaging-sw.js");return await navigator.serviceWorker.ready,e}catch(e){console.error("Service Worker registration failed:",e)}};n=async(e,r)=>{if(await (0,o.TT)())if("granted"===e&&s)return r&&await t(),await (0,o.gf)(s,{vapidKey:""}).catch(t=>{if(l<=3)return l++,n(e,!0);console.error("An error occurred while retrieving token. ",t)});else console.error("Notification permission denied")},t()}}catch(e){console.log("Error initializing Firebase:",e)}}}]);
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.