{"version":3,"sources":["views/Home/Home.tsx","hooks/useParsedQueryString.ts","hooks/useCookie.ts"],"names":["Home","cookie","useCookie","parsedQs","search","useLocation","useMemo","length","parse","parseArrays","ignoreQueryPrefix","useParsedQueryString","store","ref","to","key","useCallback","value","Cookies","set","get"],"mappings":"oOAgBeA,EAXQ,WAErB,IAAMC,EAASC,YAAU,YACnBC,ECJO,WACb,IAAQC,EAAWC,cAAXD,OACR,OAAOE,mBACL,kBAAOF,GAAUA,EAAOG,OAAS,EAAIC,gBAAMJ,EAAQ,CAAEK,aAAa,EAAOC,mBAAmB,IAAU,KACtG,CAACN,IDAcO,GAGjB,OAFAV,EAAOW,MAAMT,EAASU,KAGpB,cAAC,IAAD,CAAUC,GAAG,kB,iCEZjB,6BAqBeZ,IAlBG,SAACa,GAejB,MAAO,CAAEH,MAdWI,uBAAY,SAACC,GAC3BA,GACFC,IAAQC,IACNJ,EACAE,KAGH,CAACF,IAOyBK,IALXJ,uBAAY,WAE5B,OADaE,IAAQE,IAAIL,KAExB,CAACA,O","file":"static/js/16.b46cd49a.chunk.js","sourcesContent":["import React from 'react'\nimport { Redirect } from 'react-router-dom'\nimport useCookie from 'hooks/useCookie'\nimport useParsedQueryString from 'hooks/useParsedQueryString'\n\nconst Home: React.FC = () => {\n // store cookie referral\n const cookie = useCookie('referral')\n const parsedQs = useParsedQueryString()\n cookie.store(parsedQs.ref)\n\n return (\n \n )\n}\n\nexport default Home\n","import { parse, ParsedQs } from 'qs'\nimport { useMemo } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nexport default function useParsedQueryString(): ParsedQs {\n const { search } = useLocation()\n return useMemo(\n () => (search && search.length > 1 ? parse(search, { parseArrays: false, ignoreQueryPrefix: true }) : {}),\n [search]\n )\n}\n","import { useCallback } from 'react'\nimport Cookies from 'js-cookie'\n\nconst useCookie = (key) => {\n const storeCookie = useCallback((value) => {\n if (value) {\n Cookies.set(\n key,\n value,\n )\n }\n }, [key])\n\n const getCookie = useCallback(() => {\n const data = Cookies.get(key)\n return data\n }, [key])\n\n return { store: storeCookie, get: getCookie }\n}\n\nexport default useCookie"],"sourceRoot":""}