{"version":3,"file":"static/js/FreeBetBetslipTypeSliceAdvanced.9128e52f.chunk.js","mappings":"0QAQA,MAEaA,EAAgCA,KAAO,IAADC,EACjD,MAEMC,GAF6D,QAAnBD,EAAGE,EAAAA,EAAMC,kBAAU,IAAAH,OAAA,EAAhBA,EAAkBI,SAExCC,WAEtBC,EAAQC,IAAUC,EAAAA,EAAAA,GAAyBP,IAKlDQ,EAAAA,EAAAA,GAAoB,CAClBH,SACAC,SACAG,SALmBC,IAAQC,EAAAA,EAAAA,IAAqBD,EAAM,MAAM,GAM5DE,KAhBgC,IAiB/BC,MAAKC,IACNb,EAAAA,EAAMc,UAASC,EAAAA,EAAAA,KAAwBF,GAAS,GAChD,E,qCClBG,MAAMG,EAAsCA,KACjD,MAAMC,GAAcC,EAAAA,EAAAA,IAAYC,EAAAA,IAC1BC,GAAaF,EAAAA,EAAAA,IAAYG,EAAAA,IAO/B,OANAC,EAAAA,EAAAA,GAAY,CACV,CAACC,EAAAA,EAAiBC,eAAgB3B,KAGpC4B,EAAAA,EAAAA,iBAAgB5B,EAA+B,IAG7CoB,IAAgBS,EAAAA,GAAsBC,WAChB,IAAtBP,EAAWQ,QAEJC,EAAAA,EAAAA,KAACC,EAAAA,EAAyB,CAACC,YAAU,IAGvC,IAAI,C,iJClBb,MAAM,8BAAEC,IAAkCC,EAAAA,EAAAA,IACxC,IACE,4DAKSC,EAA0CA,KACrD,MAAMjB,GAAcC,EAAAA,EAAAA,IAAYC,EAAAA,IAC1BgB,GAAejB,EAAAA,EAAAA,IAAYG,EAAAA,IAAcO,OAE/C,OACEQ,EAAAA,EAAAA,MAAAC,EAAAA,SAAA,CAAAC,SAAA,EACIrB,IAAgBS,EAAAA,GAAsBC,WACrB,IAAjBQ,KAAuBN,EAAAA,EAAAA,KAACG,EAA6B,KACvDH,EAAAA,EAAAA,KAACU,EAAAA,gCAA+B,MAC/B,C","sources":["newelements/_Betslip/managers/FreeBetManager/utils/fetchFreeBetAmounts/advanced.ts","newelements/_Betslip/managers/FreeBetManager/BetslipTypeBaseSlices/advanced.tsx","newelements/_Betslip/managers/ProfitBoostManager/BetslipTypeBaseSlices/advanced.tsx"],"sourcesContent":["import { buildFreeBetArgsFromBets } from 'newelements/_Betslip/managers/FreeBetManager/utils/build-free-bet-args-from-bets';\nimport { fetchFreeBetAmounts } from 'newelements/_Betslip/managers/FreeBetManager/utils/fetchFreeBetAmounts';\nimport { fireCheckProfitBoost } from 'newelements/_Betslip/managers/ProfitBoostManager/actions';\nimport store from 'store';\nimport { setAdvancedFreeBetsData } from 'store/actions';\nimport { IBetslipRootStateInitialData } from 'store/reducers/betslip';\n\n// @Todo need to create some mapping for \"Type\" field and use it on \"Do Bet\", \"Get Free Bets\" and \"Create Bet\" calls\nconst ADVANCED_FREE_BET_CALL_TYPE = 2;\n\nexport const fetchAdvancedMultipleFreeBets = () => {\n  const betslipStore: IBetslipRootStateInitialData = store.getState()?.betSlip;\n\n  const allBets = betslipStore.allLsBets;\n\n  const [events, isLive] = buildFreeBetArgsFromBets(allBets);\n  const callback: Parameters<\n    typeof fetchFreeBetAmounts\n  >['0']['callback'] = data => fireCheckProfitBoost(data, null, true);\n\n  fetchFreeBetAmounts({\n    events,\n    isLive,\n    callback,\n    type: ADVANCED_FREE_BET_CALL_TYPE\n  }).then(amounts => {\n    store.dispatch(setAdvancedFreeBetsData(amounts));\n  });\n};\n","import { FC, useLayoutEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { EAdvancedSelectedTabs } from 'interfaces/bet-data';\nimport { EFreeBetsActions } from 'newelements/_Betslip/managers/FreeBetManager/actions';\nimport { FreeBetManagerSliceSingle } from 'newelements/_Betslip/managers/FreeBetManager/BetTypeBaseSlice/single';\nimport { fetchAdvancedMultipleFreeBets } from 'newelements/_Betslip/managers/FreeBetManager/utils/fetchFreeBetAmounts/advanced';\nimport { useEventbus } from 'newhooks/generic/useEventbus';\nimport { getAdvancedSelectedTab, getAllBetIds } from 'store/selectors/betslip';\n\nexport const FreeBetBetslipTypeSliceAdvanced: FC = () => {\n  const selectedTab = useSelector(getAdvancedSelectedTab);\n  const allBetsIds = useSelector(getAllBetIds);\n  useEventbus({\n    [EFreeBetsActions.GET_FREE_BETS]: fetchAdvancedMultipleFreeBets\n  });\n\n  useLayoutEffect(fetchAdvancedMultipleFreeBets, []);\n\n  if (\n    selectedTab === EAdvancedSelectedTabs.MULTIPLES ||\n    allBetsIds.length === 1\n  ) {\n    return <FreeBetManagerSliceSingle getOnMount />;\n  }\n\n  return null;\n};\n","import { FC } from 'react';\nimport { useSelector } from 'react-redux';\nimport { lazy } from 'utils/generic/lazy';\nimport { EAdvancedSelectedTabs } from 'interfaces/bet-data';\nimport { ProfitBoostManagerSliceMultiple } from 'newelements/_Betslip/managers/ProfitBoostManager/BetTypeBaseSlice/multiple';\nimport { getAdvancedSelectedTab, getAllBetIds } from 'store/selectors/betslip';\n\nconst { ProfitBoostManagerSliceSingle } = lazy(\n  () =>\n    import(\n      /* webpackChunkName: \"ProfitBoostManagerSliceSingle\" */ 'newelements/_Betslip/managers/ProfitBoostManager/BetTypeBaseSlice/single'\n    )\n);\n\nexport const ProfitBoostBetslipTypeSliceAdvanced: FC = () => {\n  const selectedTab = useSelector(getAdvancedSelectedTab);\n  const allBetsCount = useSelector(getAllBetIds).length;\n\n  return (\n    <>\n      {(selectedTab === EAdvancedSelectedTabs.MULTIPLES ||\n        allBetsCount === 1) && <ProfitBoostManagerSliceSingle />}\n      <ProfitBoostManagerSliceMultiple />\n    </>\n  );\n};\n"],"names":["fetchAdvancedMultipleFreeBets","_store$getState","allBets","store","getState","betSlip","allLsBets","events","isLive","buildFreeBetArgsFromBets","fetchFreeBetAmounts","callback","data","fireCheckProfitBoost","type","then","amounts","dispatch","setAdvancedFreeBetsData","FreeBetBetslipTypeSliceAdvanced","selectedTab","useSelector","getAdvancedSelectedTab","allBetsIds","getAllBetIds","useEventbus","EFreeBetsActions","GET_FREE_BETS","useLayoutEffect","EAdvancedSelectedTabs","MULTIPLES","length","_jsx","FreeBetManagerSliceSingle","getOnMount","ProfitBoostManagerSliceSingle","lazy","ProfitBoostBetslipTypeSliceAdvanced","allBetsCount","_jsxs","_Fragment","children","ProfitBoostManagerSliceMultiple"],"sourceRoot":""}