{"version":3,"sources":["common/modals/notifications/notification.jsx.jsx"],"names":["connect","state","getUser","dispatch","togglePurchaseCoinsRedux","data","loadCreditPrices","callback","reduceUnreadCount","markNotificationAsRead","_ref","toggleModal","showModal","unreadNotifications","ref","useRef","currentSlide","setCurrentSlide","useState","options","beforeChange","current","next","slidesToShow","slidesToScroll","arrows","fade","dots","adaptiveHeight","useEffect","length","_unreadNotifications$","_unreadNotifications$2","ids","id","_jsxs","Modal","className","centered","show","onHide","children","_jsx","type","onClick","src","process","alt","_createElement","Slider","key","map","notif","index","_notif$additionalData","_notif$image","_notif$image2","_notif$additionalData2","_notif$additionalData3","_notif$image3","_notif$image4","_notif$image5","_notif$amount","Fragment","topic","amountType","concat","position","getNumberWithOrdinal","additionalData","bgGameName","subtitle","image","medium","prizeValueUSD","toLocaleString","width","height","amount","href","e","preventDefault","slickNext"],"mappings":"+GAAA,4EA0NeA,uBAJUC,IAAK,CAC5BC,QAASA,YAAQD,OAPSE,IAAQ,CAClCC,yBAA2BC,GAASF,EAASC,aAAyBC,IACtEC,iBAAmBC,GAAaJ,EAASG,YAAiBC,IAC1DC,kBAAoBH,GAASF,EAASK,aAAkBH,IACxDI,uBAAwBA,CAACJ,EAAME,IAAaJ,EAASM,YAAuBJ,EAAME,OAMrEP,EAlMf,SAA2BU,GAOvB,IAPwB,QAC1BR,EAAO,YACPS,EAAW,UACXC,EAAS,oBACTC,EAAmB,kBACnBL,EAAiB,uBACjBC,GACDC,EACC,MAAMI,EAAMC,iBAAO,OACZC,EAAcC,GAAmBC,mBAAS,GAgB3CC,EAAU,CACdC,aAAcA,CAACC,EAASC,KACtBL,EAAgBK,EAAK,EAEvBC,aAAc,EACdC,eAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,gBAAgB,GAclB,OAZAC,qBAAU,KACR,GAAIjB,IACqB,OAAnBC,QAAmB,IAAnBA,OAAmB,EAAnBA,EAAqBiB,QAAS,EAAG,CAAC,IAADC,EAAAC,EACnC,MA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W,QAAK,IAALA,OAAK,EAALA,EAAOa,YACJ,uBACsB,KAAjB,OAALb,QAAK,IAALA,OAAK,EAALA,EAAOa,YACP,YACsB,KAAjB,OAALb,QAAK,IAALA,OAAK,EAALA,EAAOa,YACP,kBACA,qBAAsB,sBArF3BZ,EA6FJ,OAKjBX,cAAA,OAAKL,UAAU,iBAAgBI,SAC7BC,cAAA,KACEqC,KAAK,KACL1C,UAAU,+BACVO,QAAUoC,IACRA,EAAEC,iBACFjE,GAAkC,OAAnBH,QAAmB,IAAnBA,OAAmB,EAAnBA,EAAqBiB,QAAS,EAAIhB,EAAIO,QAAQ6D,YAAcvE,EAAYqE,EAAE,EACzFvC,SAEDzB,GAAkC,OAAnBH,QAAmB,IAAnBA,OAAmB,EAAnBA,EAAqBiB,QAAS,EAAI,OAAS,gBAKrE,G","file":"static/js/49.efa30ae2.chunk.js","sourcesContent":["import React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport { Modal } from \"react-bootstrap\";\nimport {\n togglePurchaseCoinsRedux,\n getUser,\n loadCreditPrices,\n markNotificationAsRead,\n reduceUnreadCount,\n} from \"store/user\";\nimport { connect } from \"react-redux\";\nimport Slider from \"react-slick\";\nimport { getNumberWithOrdinal } from \"utils/misc\";\n\n// Images\nconst closeIcon = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/coins-close-icon.svg\";\nconst ticketLogo = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/ticketLogo-1.svg\";\nconst ticketLogo2 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/ticketLogo-2.svg\";\nconst img1 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/ticket-winner-1.png\";\nconst img2 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/ticket-winner-2.png\";\nconst img3 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/ticket-winner-3.png\";\nconst img4 = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/t-coins-logo.png\";\nconst xpAwardImg = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/xpAward.png\";\nconst xpAwardIcon = process.env.REACT_APP_WEBSITE_ASSETS_URL + \"images/xpLogoLight.svg\";\n\nfunction NotificationsModal({\n getUser,\n toggleModal,\n showModal,\n unreadNotifications,\n reduceUnreadCount,\n markNotificationAsRead,\n}) {\n const ref = useRef(null);\n const [currentSlide, setCurrentSlide] = useState(0);\n // Redux states\n // const { showPurchaseCoins, loadingPrice, creditPrices } = getUser;\n\n // Call Package listing GET API when modal opens\n // useEffect(() => {\n // if (!showPurchaseCoins) {\n // setTab(1);\n // } else {\n // loadCreditPrices((creditRes) => {});\n // ethToUSD((usdValue) => {\n // setethdata(usdValue?.rates?.USD);\n // });\n // }\n // }, [showPurchaseCoins]);\n\n const options = {\n beforeChange: (current, next) => {\n setCurrentSlide(next);\n },\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n fade: true,\n dots: true,\n adaptiveHeight: true,\n };\n useEffect(() => {\n if (showModal) {\n if (unreadNotifications?.length > 0) {\n const data = {\n ids: [unreadNotifications[currentSlide]?.id ?? 0],\n };\n markNotificationAsRead(data, () => {\n reduceUnreadCount(unreadNotifications?.length - 1);\n });\n }\n }\n }, [showModal, currentSlide]);\n return (\n \n
\n
Award Notification
\n \n
\n
\n \n {unreadNotifications?.map((notif, index) => (\n \n
\n
{notif?.topic === \"CONTEST\" && notif?.amountType === 6 ? \"XP\" : \"Prize\"} Awarded
\n
\n {notif?.type === \"WINNER\"\n ? \"YOU WON THE SWEEPSTAKES!\"\n : notif?.topic === \"CONTEST\"\n ? `YOU PLACED ${notif?.position}${getNumberWithOrdinal(notif?.position)} IN ${\n notif?.additionalData?.bgGameName\n }`\n : notif?.subtitle}\n
\n
\n
\n \n {notif?.type === \"WINNER\" && (\n
\n ${notif?.additionalData?.prizeValueUSD?.toLocaleString()}\n
\n )}\n
\n \n
\n
\n
\n
\n \n {notif?.type !== \"WINNER\" && (\n
\n \n
\n )}\n
\n \n {notif?.type === \"WINNER\" ? \"SWEEPSTAKES WINNER\" : notif?.amount?.toLocaleString()}\n
\n {notif?.type !== \"WINNER\" && (\n
\n {notif?.amountType === 1\n ? \"Arcade Coins Awarded\"\n : notif?.amountType === 6\n ? \"XP POINTS\"\n : notif?.amountType === 2\n ? \"Tickets Awarded\"\n : \"Loot Coins Awarded\"}{\" \"}\n
\n )}\n
\n
\n
\n \n \n \n ))}\n \n \n\n
\n {\n e.preventDefault();\n currentSlide < unreadNotifications?.length - 1 ? ref.current.slickNext() : toggleModal(e);\n }}\n >\n {currentSlide < unreadNotifications?.length - 1 ? \"Next\" : \"Dismiss\"}\n \n
\n \n );\n}\n\nconst mapDispatchToProps = (dispatch) => ({\n togglePurchaseCoinsRedux: (data) => dispatch(togglePurchaseCoinsRedux(data)),\n loadCreditPrices: (callback) => dispatch(loadCreditPrices(callback)),\n reduceUnreadCount: (data) => dispatch(reduceUnreadCount(data)),\n markNotificationAsRead: (data, callback) => dispatch(markNotificationAsRead(data, callback)),\n});\nconst mapStateToProps = (state) => ({\n getUser: getUser(state),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(NotificationsModal);\n"],"sourceRoot":""}