): void => {\n setCountryFilter(\n new RegExp(\n `(${e.target.value.replace(/ /, \"\").replace(/(.)/g, \"(^| )$1.+\")})|(.*${e.target.value}.*)`,\n \"i\"\n )\n )\n }\n\n return (\n \n \n \n \n \n onZoneSelected(value)}\n />\n \n \n \n {mapImageUrl &&
}\n {searchBar && (\n \n \n }\n type=\"text\"\n name=\"country_search\"\n placeholder={searchBar?.placeholder || \"\"}\n />\n \n \n )}\n \n \n {uniqueLetters.map(letter => (\n \n \n \n \n ))}\n \n \n \n )\n}\n\nexport default ZoneNavigator\n","import React from \"react\"\nimport styled from \"styled-components\"\nimport { graphql, navigate } from \"gatsby\"\nimport qs from \"qs\"\n\nimport {\n CoverageQuery,\n ContentfulParagraph,\n ContentfulInstructionSection,\n ContentfulZoneNavigator,\n ContentfulHeading,\n QueryRestCountryZonesArgs,\n} from \"../../types/graphql-types\"\nimport colors from \"../utils/colors\"\nimport Instruction from \"../components/index/instruction\"\nimport { RoundedContainer, StepImg } from \"../components/get-started/instructionSections\"\nimport { SingleColumnContainer, Column, GridRoot, Section } from \"../components/layout\"\nimport Heading from \"../components/heading\"\nimport ZoneNavigator, { Country } from \"../components/coverage/zoneNavigator\"\nimport Paragraph from \"../components/paragraph\"\nimport ProPage from \"../components/ProPage\"\nimport { NavSpacer } from \"../components/page\"\n\ninterface Props {\n location: Location\n data: CoverageQuery\n}\n\nconst Container = styled(Section)`\n background-color: ${colors.tealLight};\n padding-bottom: 0;\n`\n\nconst CoverageFirstHeading = styled(Heading)`\n margin-top: 1.25em;\n margin-bottom: 0;\n`\n\nconst CoverageInstructionContainer = styled(GridRoot)`\n margin-top: 40px;\n`\n\nconst getZoneFromQuery = (countryZones: QueryRestCountryZonesArgs[], zone: string = \"0\") => {\n const parsedZone = Number.parseInt(zone, 10)\n if (Number.isNaN(parsedZone) || parsedZone > countryZones.length - 1) {\n return 1\n }\n return parsedZone\n}\n\nconst Coverage = ({ location, data }: Props) => {\n const { page, countryZones } = data\n const queryParams = qs.parse(location.search, { ignoreQueryPrefix: true })\n const zone = getZoneFromQuery(\n countryZones.nodes as QueryRestCountryZonesArgs[],\n (queryParams?.zone || \"0\").toString()\n )\n\n const countries: Country[] = []\n countries.push(...(countryZones.nodes[zone].countries! as Country[]))\n\n const onZoneSelected = (selectedZone: number) => {\n navigate(location.pathname.replace(/\\/?$/, `/?zone=${selectedZone}`), { replace: true })\n }\n\n const sections = page?.sections?.map((section, index) => {\n switch (section?.internal?.type) {\n case \"ContentfulHeading\":\n const HeadingComponent = index === 0 ? CoverageFirstHeading : Heading\n\n return (\n \n \n \n \n \n )\n case \"ContentfulParagraph\":\n return (\n \n \n \n \n \n )\n case \"ContentfulZoneNavigator\":\n return (\n \n )\n case \"ContentfulInstructionSection\":\n const instruction: ContentfulInstructionSection = section as ContentfulInstructionSection\n\n return (\n \n \n \n {instruction.description?.paragraph && (\n \n )}\n \n {instruction.image?.file?.url && (\n {
}\n )}\n \n \n )\n default:\n return NOT FOUND {section?.internal?.type}
\n }\n })\n\n return (\n \n \n {sections}\n \n )\n}\n\nexport default Coverage\n\nexport const pageQuery = graphql`\n query CoveragePro($locale: String = \"en\") {\n page: contentfulPage(\n label: { eq: \"Hmd connect pro coverage page\" }\n node_locale: { eq: $locale }\n ) {\n metadata {\n ...Metadata\n }\n sections {\n ... on ContentfulHeading {\n header: heading\n internal {\n type\n }\n }\n ... on ContentfulParagraph {\n ...ParagraphWithRemark\n internal {\n type\n }\n }\n ... on ContentfulZoneNavigator {\n heading {\n heading\n }\n zones {\n ...Zone\n }\n searchBar {\n name\n placeholder\n }\n internal {\n type\n }\n }\n ... on ContentfulInstructionSection {\n ...InstructionSection\n internal {\n type\n }\n }\n }\n }\n countryZones: allRestCountryZonesPro {\n nodes {\n name\n countries {\n name\n countryCode\n }\n }\n }\n }\n`\n","import React from \"react\"\nimport styled from \"styled-components\"\nimport clsx from \"clsx\"\n\nimport { InputLabel, DescriptionLabel, ErrorLabel } from \"./labels\"\nimport { InputProps, InputStyles, FormElementContainer } from \"./form\"\n\nimport Icon from \"../Icon\"\nimport colors from \"../../utils/colors\"\n\ninterface Props {\n isMail?: boolean\n hasSubmit?: boolean\n submitDisabled?: boolean\n left?: string | JSX.Element | JSX.Element[]\n}\n\nconst InputContainer = styled.div`\n position: relative;\n`\n\nconst InputElement = styled.input`\n padding-right: 60px;\n ${InputStyles}\n`\n\nconst LeftIcon = styled.div`\n position: absolute;\n top: 12px;\n left: 17px;\n height: 32px;\n border-right: 2px solid ${colors.gray};\n\n svg {\n padding-top: 4px;\n padding-right: 12px;\n }\n`\n\nconst RightIcon = styled.div<{ top?: string; right?: string }>`\n position: absolute;\n ${props => `top: ${props.top ? props.top : \"17px\"};`}\n ${props => `right: ${props.right ? props.right : \"17px\"};`}\n`\n\nconst SubmitButton = styled.button`\n padding-top: 5px;\n background-color: transparent;\n border: none;\n`\n\nconst Input = ({\n id,\n name,\n isMail,\n hasSubmit,\n label,\n error,\n success,\n description,\n submitDisabled,\n left,\n ...props\n}: React.InputHTMLAttributes & InputProps & Props) => {\n const identifier = id || name\n const descIdentifier = identifier ? `${identifier}-description` : undefined\n return (\n \n {label && {label}}\n \n {(isMail || left) && {isMail ? : left}}\n \n {(success || error) && !isMail && (\n \n \n \n )}\n {hasSubmit && (\n \n \n \n \n \n )}\n \n {error && {error}}\n {description && {description}}\n \n )\n}\n\nexport default Input\n"],"sourceRoot":""}