{"version":3,"sources":["public/images/gjensidige_logo.svg","serviceWorker.js","layout-components/Header.js","services/Endpoints.js","mocks/privateOption.js","mocks/companyOption.js","mocks/sendFormData.js","services/Api.js","components/Popup/SuccessPopup.js","Contact/Contact.js","ContactForm.js","index.js"],"names":["module","exports","__webpack_require__","p","Boolean","window","location","hostname","match","Header","react_default","a","createElement","core_grid_lib","xs","span","offset","sm","md","lg","xl","className","style","margin","src","logo","alt","Endpoints","getPrivateOptions","getCompanyOptions","SendForm","privateOption","mock","onGet","Private","reply","config","require","companyOption","Company","sendFormData","onPost","console","log","axios","defaults","baseURL","process","instance","create","headers","Content-Type","Accept","Accept-Language","apiClient","callback","url","get","data","post","put","delete","SuccessPopup","_ref","content","onClose","modal","visible","strict","onClick","textAlign","check_circle","size","color","lib_text","primary_button","borderColor","Contact","_this","Object","classCallCheck","this","possibleConstructorReturn","getPrototypeOf","call","handleRadio","event","validations","objectSpread","state","typeOfCustomer","target","value","setState","handleChange","name","phoneValid","isMobilePhone","phoneNumber","emailAddress","isEmail","length","defineProperty","formData","removeActiveFile","file","newState","toConsumableArray","files","index","findIndex","splice","progress","Math","round","total","updateAcceptedFiles","acceptedFiles","updateFiles","prevState","concat","fileSizeAddition","totalSize","forEach","el","fileSizeInKB","deleteItem","newAccepted","bytesToSize","bytes","sizes","i","parseInt","floor","pow","toFixed","stateFormData","FormData","append","subject","reason","description","Api","then","response","submitted","catch","formError","closeModal","reload","contactReasons","textareaLength","maxSize","fileTypeError","companyMock","privateMock","sendFormMock","document","title","results","DropDownOptions","uploadExceeded","formValidation","values","every","item","tag","input_group_simple","centered","header","type","id","onChange","options","label","invalid","errorText","input","labelText","placeholder","dropdown","disabled","map","Text","Value","lib_textarea","maxLength","fileuploader","updateAccepted","enableDescription","showImage","showFileTypes","acceptedMimeTypes","maxNumberOfFiles","headerText","instructionText","fileTypesText","deleteText","errorTextIllegal","flexible","Popup_SuccessPopup","core_alerts_lib_default","alertType","text","closable","Component","ContactForm","layout_components_Header","src_Contact_Contact","ReactDOM","render","src_ContactForm","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"6EAAAA,EAAAC,QAAiBC,EAAAC,EAAuB,qjCCYpBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,mICESC,EAhBA,WACb,OACEC,EAAAC,EAAAC,cAACC,EAAA,UAAD,KACEH,EAAAC,EAAAC,cAACC,EAAA,IAAD,KACEH,EAAAC,EAAAC,cAACC,EAAA,IAAD,CAAKC,GAAI,CAAEC,KAAM,EAAGC,OAAQ,GAAKC,GAAI,EAAGC,GAAI,EAAGC,GAAI,CAAEJ,KAAM,EAAGC,OAAQ,GAAKI,GAAI,CAAEL,KAAM,EAAGC,OAAQ,IAChGN,EAAAC,EAAAC,cAAA,OAAKS,UAAU,gBAAgBC,MAAO,CAAEC,OAAQ,sBAC9Cb,EAAAC,EAAAC,cAAA,KAAGS,UAAU,gBACXX,EAAAC,EAAAC,cAAA,OAAKY,IAAKC,IAAMC,IAAI,uFCPrBC,EAAY,CACrBC,kBAL6B,qBAM7BC,kBAL6B,qBAM7BC,SALoB,eCDTC,EAAA,SAACC,GACZA,EAAKC,MAAMN,EAAUO,SAASC,MAAM,SAACC,GACjC,MAAO,CAAC,IAAKC,EAAQ,SCFdC,EAAA,SAACN,GACZA,EAAKC,MAAMN,EAAUY,SAASJ,MAAM,SAACC,GACjC,MAAO,CAAC,IAAKC,EAAQ,SCFdG,EAAA,SAACR,GACZA,EAAKS,OAAOd,EAAUG,UAAUK,MAAM,SAACC,GAEnC,OADAM,QAAQC,IAAI,qBAAsBP,GAC3B,CAAC,gCCGhBQ,IAAMC,SAASC,QAHJC,2CAKX,IAQaC,EAAWJ,IAAMK,OARX,CACfC,QAAS,CACPC,eAAgB,mBAChBC,OAAU,mBACVC,kBAAmB,WAazB,IAgDeC,EADG,iGA5CVC,GAVeR,sEA+BVS,EAAKpB,4FACPY,EAASS,IAAID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LAXX,OACEpM,EAAAC,EAAAC,cAAA,OAAK+J,GAAG,YACNjK,EAAAC,EAAAC,cAACmM,EAAD,MACArM,EAAAC,EAAAC,cAAA,OAAKS,UAAU,mBACbX,EAAAC,EAAAC,cAACoM,EAAD,eANgBH,aCG1BI,IAASC,OAAOxM,EAAAC,EAAAC,cAACuM,EAAD,MAAiBtD,SAASuD,eAAe,SV0HnD,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMxE,KAAK,SAAAyE,GACjCA,EAAaC","file":"static/js/main.b2c72f90.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/gjensidige_logo.e1be0833.svg\";","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react'\nimport logo from '../../src/public/images/gjensidige_logo.svg'\nimport { Container, Row, Col } from '@gjensidige/core-grid'\n\nconst Header = () => {\n return (\n \n \n \n
\n \n Gjensidige Forsikring logo\n \n
\n \n
\n
\n )\n}\n\nexport default Header\n","export const getPrivateOptions = 'api/contact?type=1'\nexport const getCompanyOptions = 'api/contact?type=2'\nexport const sendForm = 'api/contact'\n\nexport const Endpoints = {\n getPrivateOptions: getPrivateOptions,\n getCompanyOptions: getCompanyOptions,\n SendForm: sendForm\n}\n","import { Endpoints } from '../services/Endpoints'\nexport default (mock) => {\n mock.onGet(Endpoints.Private).reply((config) => {\n return [200, require('../mocks/private.json')]\n })\n}","import { Endpoints } from '../services/Endpoints'\nexport default (mock) => {\n mock.onGet(Endpoints.Company).reply((config) => {\n return [200, require('../mocks/company.json')]\n })\n}","import { Endpoints } from '../services/Endpoints'\nexport default (mock) => {\n mock.onPost(Endpoints.SendForm).reply((config) => {\n console.log('Formdata mock post', config)\n return [200]\n })\n}","import axios from 'axios'\nimport MockAdapter from 'axios-mock-adapter'\n\nconst apiSettings = {\n baseUrl: process.env.REACT_APP_API_BASE_URL\n}\n\naxios.defaults.baseURL = apiSettings.baseUrl\n\nconst baseConfig = {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Accept-Language': 'da-DK'\n }\n }\n\nexport const instance = axios.create(baseConfig)\n\nconst ENABLE_MOCKING = process.env.REACT_APP_API_ENABLE_MOCKING === 'true'\n\nif (ENABLE_MOCKING) {\n console.log('MOCKING API CALLS')\n}\n\nvar mock\nvar mockedResponseInterceptor = null\n\nclass ApiClient {\n mock (callback) {\n if (ENABLE_MOCKING) {\n if (mockedResponseInterceptor) {\n instance.interceptors.response.eject(mockedResponseInterceptor)\n }\n if (!mock) {\n mock = new MockAdapter(instance, { delayResponse: Math.random() >= 0.5 ? 1000 : 0 })\n }\n\n mockedResponseInterceptor = instance.interceptors.response.use(null, async (error) => {\n if (error.response) {\n console.log(`${error.config.url} \\r\\nMock returned a failed response: ${error.response.status}`, error.response, error.config)\n }\n\n return Promise.reject(error)\n })\n\n callback(mock)\n }\n }\n\n async get (url, config) {\n return instance.get(url, config)\n }\n\n async post (url, data, config) {\n return instance.post(url, data, config)\n }\n\n async put (url, data, config) {\n return instance.put(url, data, config)\n }\n\n async delete (url, data, config) {\n if (!config) {\n config = { }\n }\n\n config.data = data\n\n return instance.delete(url, config)\n }\n}\n\nconst apiClient = new ApiClient()\nexport default apiClient\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { Modal } from '@gjensidige/core-modal/lib/modal'\nimport { Text } from '@gjensidige/core-typography/lib/text'\nimport { PrimaryButton } from '@gjensidige/core-buttons/lib/primary-button'\nimport { CheckCircle } from '@gjensidige/core-icons/lib/check-circle'\n\nconst SuccessPopup = ({ content, onClose }) => (\n onClose()}\n >\n
\n \n
\n {content}\n
\n onClose()} borderColor='green'>Luk\n
\n \n)\n\nSuccessPopup.propTypes = {\n content: PropTypes.string.isRequired,\n onClose: PropTypes.func.isRequired\n}\n\nexport default SuccessPopup\n","import React, { Component } from 'react'\nimport privateMock from '../mocks/privateOption'\nimport companyMock from '../mocks/companyOption'\nimport sendFormMock from '../mocks/sendFormData'\nimport Api from '../services/Api'\nimport { Endpoints } from '../services/Endpoints'\nimport isEmail from 'validator/lib/isEmail'\nimport isMobilePhone from 'validator/lib/isMobilePhone'\nimport SuccessPopup from '../components/Popup/SuccessPopup'\n// gje import\nimport { Container, Row, Col } from '@gjensidige/core-grid'\nimport { Input } from '@gjensidige/core-forms/lib/input'\nimport { InputGroupSimple } from '@gjensidige/core-forms/lib/input-group-simple'\nimport { Dropdown } from '@gjensidige/core-forms/lib/dropdown'\nimport { TextArea } from '@gjensidige/core-forms/lib/textarea'\nimport { FileUploader } from '@gjensidige/core-fileuploader/lib/fileuploader'\nimport { PrimaryButton } from '@gjensidige/core-buttons/lib/primary-button'\nimport { Alert } from '@gjensidige/core-alerts/lib/default'\nimport { Title } from '@gjensidige/core-typography/lib/title'\nimport { Text } from '@gjensidige/core-typography/lib/text'\n\nclass Contact extends Component {\n constructor() {\n super()\n this.state = {\n typeOfCustomer: '',\n contactReasons: [],\n textareaLength: 0,\n formData: {\n emailAddress: '',\n phoneNumber: '',\n subject: '',\n reason: '3',\n description: '',\n },\n validations: {\n typeOfCustomer: false,\n emailAddress: null,\n phoneNumber: null,\n subject: false,\n reason: false,\n description: false\n },\n acceptedFiles: [],\n maxSize: 10000,\n totalSize: 0,\n fileTypeError: false,\n formError: false,\n submitted: false\n }\n }\n\n componentDidMount() {\n Api.mock(companyMock)\n Api.mock(privateMock)\n Api.mock(sendFormMock)\n document.title = 'Kontakt - Gjensidige Forsikring'\n }\n\n async getPrivateOptions() {\n const results = await Api.get(Endpoints.getPrivateOptions)\n this.setState({ contactReasons: results.data.DropDownOptions })\n }\n\n async getCompanyOptions() {\n const results = await Api.get(Endpoints.getCompanyOptions)\n this.setState({ contactReasons: results.data.DropDownOptions })\n }\n\n handleRadio = (event) => {\n const validations = { ...this.state.validations }\n validations.typeOfCustomer = true\n if (event.target.value === 'Private') {\n this.getPrivateOptions()\n } else {\n this.getCompanyOptions()\n }\n this.setState({ typeOfCustomer: event.target.value, validations })\n }\n\n handleChange = (event) => {\n const target = event.target\n let value = target.value\n const name = target.name\n\n if (name === 'phoneNumber') {\n const phoneValid = isMobilePhone(value, 'da-DK') || isMobilePhone(value, 'fo-FO')\n this.setState({ validations: { ...this.state.validations, phoneNumber: phoneValid } })\n }\n if (name === 'emailAddress') {\n this.setState({ validations: { ...this.state.validations, emailAddress: isEmail(value) } })\n } else if (name === 'subject' || name === 'reason' || name === 'description') {\n if (value.length > 0) {\n this.setState({ validations: { ...this.state.validations, [name]: true } })\n } else if (value.length === 0) {\n this.setState({ validations: { ...this.state.validations, [name]: false } })\n }\n }\n\n this.setState({\n formData: { ...this.state.formData, [name]: value }\n })\n }\n\n removeActiveFile = (file, name) => {\n const newState = [...this.state.files]\n const index = newState.findIndex(file => file.name === name)\n newState.splice(index, 1)\n this.setState({\n files: newState,\n progress: this.state.progress - Math.round(file.size * 100 / this.state.total)\n })\n }\n\n updateAcceptedFiles = (acceptedFiles) => {\n this.setState({ acceptedFiles })\n };\n\n updateFiles = (acceptedFiles) => {\n this.setState(prevState => ({\n acceptedFiles: [...prevState.acceptedFiles, ...acceptedFiles]\n }), () => this.fileSizeAddition())\n }\n\n fileSizeAddition = () => {\n let totalSize = 0\n this.state.acceptedFiles.forEach(el => {\n const fileSizeInKB = el.file.size / 1024\n totalSize += Math.round(fileSizeInKB)\n })\n this.setState({ totalSize })\n }\n\n deleteItem = (newAccepted) => {\n this.setState({ acceptedFiles: newAccepted }, () => this.fileSizeAddition())\n }\n\n bytesToSize = (bytes) => {\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n if (bytes === 0) return 'n/a'\n const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10)\n if (i === 0) return `${bytes} ${sizes[i]})`\n return `${(bytes / (1024 ** i)).toFixed(1)} ${sizes[i]}`\n }\n\n sendFormData = () => {\n let stateFormData = this.state.formData\n var formData = new FormData()\n this.state.acceptedFiles.forEach(file => {\n formData.append('File', file.file)\n })\n formData.append('emailAddress', stateFormData.emailAddress)\n formData.append('phoneNumber', stateFormData.phoneNumber)\n formData.append('title', stateFormData.subject)\n formData.append('subject', stateFormData.reason)\n formData.append('content', stateFormData.description)\n\n Api.post(Endpoints.SendForm, formData).then((response) => {\n this.setState({\n submitted: true\n })\n }).catch(() => {\n this.setState({ formError: true })\n })\n }\n\n closeModal = () => {\n window.location.reload();\n }\n\n render() {\n const uploadExceeded = this.state.totalSize > this.state.maxSize\n let formValidation = Object.values(this.state.validations).every(item => item === true)\n return (\n \n \n \n
\n Kontakt Gjensidige Forsikring\n Indtast oplysninger og kontakt herved\n
\n \n
\n \n \n
\n
\n Hvad drejer din henvendelse sig om? *
}\n size='p'\n type='radio'\n className='type-of-customer'\n id='type-of-customer-radio'\n value={this.state.typeOfCustomer}\n onChange={this.handleRadio}\n options={[\n { label: 'Mig som kunde', value: 'Private' },\n { label: 'En virksomhed/forening', value: 'Company' }\n ]}\n invalid={this.state.validations.typeOfCustomer && this.state.submitted}\n errorText='Dette felt er obligatorisk'\n />\n
\n \n
\n
\n Email *
}\n value={this.state.formData.emailAddress}\n onChange={this.handleChange}\n placeholder='Indtast gyldig emailadresse'\n name='emailAddress'\n invalid={this.state.validations.emailAddress && this.state.submitted}\n errorText='Dette felt er obligatorisk'\n />\n {this.state.validations.emailAddress === false &&\n
\n {this.state.formData.emailAddress} er ikke en gyldig email\n
\n }\n
\n
\n Telefonnummer *
}\n value={this.state.formData.phoneNumber}\n onChange={this.handleChange}\n placeholder='Indtast dit telefonnummer'\n name='phoneNumber'\n invalid={this.state.validations.phoneNumber && this.state.submitted}\n errorText='Dette felt er obligatorisk'\n />\n {this.state.validations.phoneNumber === false &&\n
\n {this.state.formData.phoneNumber} er ikke et gyldigt telefonnummer\n
\n }\n \n \n
\n
\n Emne *
}\n value={this.state.formData.subject}\n onChange={this.handleChange}\n placeholder='Angiv et emne, som beskriver din henvendelse'\n name='subject'\n invalid={this.state.validations.subject && this.state.submitted}\n errorText='Dette felt er obligatorisk'\n />\n
\n
\n Årsag til kontakt *
}\n placeholder='Vælg'\n value={this.state.formData.reason}\n onChange={this.handleChange}\n name='reason'\n disabled={this.state.typeOfCustomer === ''}\n options={this.state.contactReasons.map((reason) => {\n return { labelText: reason.Text, value: reason.Value }\n })}\n invalid={this.state.validations.reason && this.state.submitted}\n />\n \n \n
\n
\n Beskriv, hvad din henvendelse drejer sig om *
}\n name='description'\n value={this.state.formData.description}\n onChange={this.handleChange}\n maxLength={200}\n />\n
\n \n
\n
\n \n
\n
\n
\n
\n Send Formular\n
\n
\n {this.state.submitted &&\n \n }\n {this.state.formError &&\n \n }\n \n
\n
\n\n )\n }\n}\n\nexport default Contact","import React, { Component } from 'react'\nimport Header from './layout-components/Header'\nimport Contact from './Contact/Contact'\n\nclass ContactForm extends Component {\n render () {\n return (\n
\n
\n
\n \n
\n
\n )\n }\n}\n\nexport default ContactForm\n","import '@babel/polyfill'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.scss'\nimport * as serviceWorker from './serviceWorker'\nimport ContactForm from './ContactForm'\n\nReactDOM.render(, document.getElementById('root'))\nserviceWorker.unregister()\n"],"sourceRoot":""}