{"version":3,"file":"static/js/24634.ffb14127.chunk.js","mappings":"wMAQO,MAAMA,EAAwBA,CACnCC,EAIAC,EACAC,EACAC,KAEA,MAAMC,EAAU,CACdA,QAASC,EAAAA,EAAaC,wBACtBC,OAAQ,CACNC,UAAW,CAACR,GACZS,OAAQ,CACN,CACEC,WAAY,gBACZC,cAAeV,KAIrBW,IAAKC,EAAAA,GAAaC,eAGpBC,EAAAA,EAAaC,MAAMC,IACjBA,EAAOC,YAAYd,EAAS,GAAIF,EAAU,KAAMC,EAAe,GAC/D,EAGSgB,EAA0BA,KACrC,MAAMf,EAAU,CACdA,QAASC,EAAAA,EAAae,2BACtBb,OAAQ,CAAC,EACTK,IAAKC,EAAAA,GAAaC,eAGdZ,EAAYmB,IACR,OAAJA,QAAI,IAAJA,GAAAA,EAAMC,SACRC,EAAAA,EAAMC,UAASC,EAAAA,EAAAA,IAAqBJ,EAAKC,SAC3C,EAGFP,EAAAA,EAAaC,MAAMC,IACjBA,EAAOC,YAAYd,EAAS,GAAIF,EAAS,GACzC,C","sources":["services/sportsbook/notifications.ts"],"sourcesContent":["import { CommandNames } from 'utils/constants/swarm/swarm-command-names';\nimport RidGenerator from 'utils/swarm/rid-generator';\nimport { UserNotificationsResponse } from 'interfaces/notifications';\nimport { WebsocketEnhanced } from 'interfaces/spring-websocket-interfaces';\nimport { connectingWS } from 'hooks/useSpringConnect';\nimport store from 'store';\nimport { setUserNotifications } from 'store/actions/sport-data';\n\nexport const setGamesNotifications = (\n gameInfo: {\n id: number;\n game_start_ts: number;\n },\n shouldSubscribe: boolean,\n callback: Function,\n updateCallback?: Function\n): void => {\n const command = {\n command: CommandNames.SET_GAMES_NOTIFICATIONS,\n params: {\n game_list: [gameInfo],\n events: [\n {\n event_name: 'MatchFinished',\n is_subscribed: shouldSubscribe\n }\n ]\n },\n rid: RidGenerator.gForCommand()\n };\n\n connectingWS.then((socket: WebsocketEnhanced) => {\n socket.sendCommand(command, '', callback, null, updateCallback);\n });\n};\n\nexport const getUserAllNotifications = (): void => {\n const command = {\n command: CommandNames.GET_USER_ALL_NOTIFICATIONS,\n params: {},\n rid: RidGenerator.gForCommand()\n };\n\n const callback = (resp: UserNotificationsResponse) => {\n if (resp?.details) {\n store.dispatch(setUserNotifications(resp.details));\n }\n };\n\n connectingWS.then((socket: WebsocketEnhanced) => {\n socket.sendCommand(command, '', callback);\n });\n};\n"],"names":["setGamesNotifications","gameInfo","shouldSubscribe","callback","updateCallback","command","CommandNames","SET_GAMES_NOTIFICATIONS","params","game_list","events","event_name","is_subscribed","rid","RidGenerator","gForCommand","connectingWS","then","socket","sendCommand","getUserAllNotifications","GET_USER_ALL_NOTIFICATIONS","resp","details","store","dispatch","setUserNotifications"],"sourceRoot":""}