{"version":3,"file":"index-CJVPqu14.js","sources":["../../../app/assets/javascripts/apps/spacious_website/pages/buildings/city_level_overseas_properties_landing_page/page_visit_count/index.ts"],"sourcesContent":["\nimport {\n isLocalStorageEnabled,\n\n getDataFromLocalStorage,\n\n setDataToLocalStorage,\n} from \"app/local_storages/native_api_adapter\"\n\nconst COOKIE_KEY = \"App.Pages.Cities.OverseasProperties.Index.Data.PageVisitCount.value\"\n\n\nconst getValue = () => {\n if (!isLocalStorageEnabled()) { return 0 }\n\n // String\n const value_from_cookie = getDataFromLocalStorage(COOKIE_KEY).data\n if (typeof value_from_cookie !== \"string\") { return 0 }\n\n const parsed_integer = parseInt(value_from_cookie, 10)\n if (isNaN(parsed_integer)) { return 0 }\n\n return parsed_integer\n}\n\nconst incrementValue = () => {\n const new_value = getValue() + 1\n setDataToLocalStorage(COOKIE_KEY, new_value.toString())\n}\n\nexport default {\n getValue,\n incrementValue,\n}\n"],"names":["COOKIE_KEY","getValue","isLocalStorageEnabled","value_from_cookie","getDataFromLocalStorage","parsed_integer","incrementValue","new_value","setDataToLocalStorage","OverseasPagesVisitCount"],"mappings":"sDASA,MAAMA,EAAa,sEAGbC,EAAW,IAAM,CACjB,GAAA,CAACC,IAAkC,MAAA,GAGjC,MAAAC,EAAoBC,EAAwBJ,CAAU,EAAE,KAC1D,GAAA,OAAOG,GAAsB,SAAmB,MAAA,GAE9C,MAAAE,EAAiB,SAASF,EAAmB,EAAE,EACjD,OAAA,MAAME,CAAc,EAAY,EAE7BA,CACT,EAEMC,EAAiB,IAAM,CACrB,MAAAC,EAAYN,IAAa,EACTO,EAAAR,EAAYO,EAAU,UAAU,CACxD,EAEeE,EAAA,CACb,SAAAR,EACA,eAAAK,CACF"}