{"version":3,"file":"static/js/sportsbook-sports-menu.af752cf6.chunk.js","mappings":"+JAIA,MAAMA,EAAuB,GAEhBC,EAAmBA,KAC9B,MAAMC,GAAUC,EAAAA,EAAAA,MAEVC,GAAOC,EAAAA,EAAAA,cACX,SAACC,GAAiDC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,IAE9CP,EAAWI,KAAM,GAAEM,OAAOC,gBAAgBD,OAAOJ,SAASM,UAG5DV,EAAQE,KAAKE,EACf,GACA,IAGIO,GAAUR,EAAAA,EAAAA,cAAY,IACnBL,EAAWc,OACjB,IAEGC,GAASV,EAAAA,EAAAA,cAAaW,IAC1B,MAAMC,EAAUJ,IAChBX,EAAQE,KAAKa,GAAWD,EAAY,GACnC,IAEH,MAAO,CAAEd,UAASE,OAAMS,UAASE,SAAQT,SAAUJ,EAAQI,SAAU,C","sources":["newhooks/generic/useCustomHistory.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useHistory as useReactRouterHistory } from 'react-router-dom';\nimport { LocationDescriptor } from 'history';\n\nconst STATE_FROM: string[] = [];\n\nexport const useCustomHistory = () => {\n const history = useReactRouterHistory();\n\n const push = useCallback(\n (location: LocationDescriptor, skipPushToStateFrom = false) => {\n if (!skipPushToStateFrom) {\n STATE_FROM.push(`${window.getPathname()}${window.location.search}`);\n }\n\n history.push(location);\n },\n []\n );\n\n const getFrom = useCallback(() => {\n return STATE_FROM.pop();\n }, []);\n\n const goBack = useCallback((fallbackUrl: string) => {\n const fromUrl = getFrom();\n history.push(fromUrl || fallbackUrl);\n }, []);\n\n return { history, push, getFrom, goBack, location: history.location };\n};\n"],"names":["STATE_FROM","useCustomHistory","history","useReactRouterHistory","push","useCallback","location","arguments","length","undefined","window","getPathname","search","getFrom","pop","goBack","fallbackUrl","fromUrl"],"sourceRoot":""}