{"version":3,"sources":["components/Loading.js","components/vendor/FormVendor.js","lib/initSentry.js","App.js","serviceWorker.js","index.js","config/index.js","lib/localSecure.js","lib/alertMessage.js","lib/apiCall.js"],"names":["Loading","_jsx","Grid","container","spacing","align","justifyContent","children","item","xs","sm","style","alignSelf","CircularProgress","replaceUndefinedOrNull","key","value","undefined","Generate","_ref","props","isEdit","match","params","id","loading","setLoading","useState","values","setValues","name","email","password","company","phone","user","get","history","useEffect","authService","getPartner","then","result","data","is_admin","push","handleChange","prop","event","target","Card","maxWidth","overflow","_jsxs","CardContent","Typography","variant","marginTop","marginBottom","ValidatorForm","onSubmit","e","preventDefault","body","JSON","parse","stringify","updatePartner","vendor","successMessage","catch","addPartner","onError","errors","console","log","TextValidator","label","onChange","validators","errorMessages","fullWidth","Button","color","type","disabled","size","onClick","goBack","createBrowserHistory","initSentry","DSN","version","environment","Boolean","Sentry","dsn","process","integrations","BrowserTracing","routingInstrumentation","tracesSampleRate","release","info","PrivateRoute","React","lazy","Verify","Login","Docs","Vendor","App","Component","componentDidMount","REACT_APP_ENV","REACT_APP_SENTRY_DSN","REACT_APP_VERSION","render","_Fragment","BrowserRouter","Suspense","fallback","Switch","Route","exact","path","component","VendorForm","ToastContainer","window","location","hostname","theme","createTheme","ReactDOM","ThemeProvider","CssBaseline","document","getElementById","navigator","serviceWorker","ready","registration","unregister","API_URL","JWT_TOKEN","LOCAL_STORAGE_CONTENT","LOCAL_STORAGE_TITLE","AUTH_SERVICE_API","REACT_APP_ACCOUNT_URL","REACT_APP_CLIENT_ID","REACT_APP_STAGE","AUTH_CALLBACK","origin","concat","ls","secureLS","set","rem","removeAll","isLogin","errorMessage","message","toast","error","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","progress","success","axios","Axios","create","baseURL","interceptors","request","use","config","token","headers","response","status","href","Promise","reject","docAPi","login","post","generate","getListDoc","getDoc","project","isDownload","arguments","length","responseType","mockSetting","sso","withCredentials","getOpenapiList","axiosAuth","verify","code","getProfile","listPartner","put","deletePartner","delete","axiosOpenapi","getOpenapiDoc","projectUrl","opt","isRetryAttempt","shouldIncludeAuthHeader"],"mappings":"wHAAA,mCAYeA,IAVCA,IAERC,cAACC,IAAI,CAACC,WAAS,EAACC,QAAS,EAAGC,MAAM,SAASC,eAAe,SAAQC,SAC9DN,cAACC,IAAI,CAACM,MAAI,EAACC,GAAI,GAAIC,GAAI,EAAGC,MAAO,CAAEC,UAAW,UAAWL,SACrDN,cAACY,IAAgB,O,8OCCjC,SAASC,EAAuBC,EAAKC,GACjC,GAAc,OAAVA,QAA4BC,IAAVD,GAAiC,KAAVA,EAI7C,OAAOA,CACX,CAyJeE,MAvJEC,IAAmB,OAAbC,GAAOD,EAC1B,MAAME,EAASD,EAAME,MAAMC,OAAOC,IAC3BC,EAASC,GAAcC,oBAAS,IAChCC,EAAQC,GAAaF,mBAAS,CACjCG,KAAM,GACNC,MAAO,GACPC,SAAU,GACVC,QAAS,GACTC,MAAO,KAGLC,EAAOC,YAAI,QACXC,EAAUjB,EAAMiB,QACtBC,qBAAU,KACFjB,GACAkB,IAAYC,WAAWnB,GAAQoB,MAAKC,IAChCb,EAAU,IAAKa,EAAOC,KAAMX,SAAU,IAAK,IAG9CG,EAAKS,UACNP,EAAQQ,KAAK,IACjB,GAED,CAACR,EAASF,EAAKS,SAAUvB,IAE5B,MAAMyB,EAAgBC,GAAUC,IAC5BnB,EAAU,IAAKD,EAAQ,CAACmB,GAAOC,EAAMC,OAAOjC,OAAQ,EAyBxD,OACIf,cAACC,IAAI,CAACC,WAAS,EAACC,QAAS,EAAGC,MAAM,SAASC,eAAe,SAAQC,SAC9DN,cAACC,IAAI,CAACM,MAAI,EAACC,GAAI,GAAIC,GAAI,EAAGC,MAAO,CAAEC,UAAW,UAAWL,SACrDN,cAACiD,IAAI,CAACvC,MAAO,CAAEwC,SAAU,MAAOC,SAAU,WAAY7C,SAClD8C,eAACC,IAAW,CAAA/C,SAAA,CACRN,cAACsD,IAAU,CACPC,QAAQ,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AAgB,UAAD5B,OAAY2B,MAGnC0B,YAAcxL,GAAWoL,EAAUvK,IAAI,GAADsH,OAAIN,IAAgB,YAAY,CAClE7H,OAAQA,IAEZiB,WAAahB,GAAOmL,EAAUvK,IAAI,GAADsH,OAAIN,IAAgB,oBAAAM,OAAmBlI,GAAM,CAC9E,GACA+C,WAAa5B,GAASgK,EAAUb,KAAK,GAADpC,OAAIN,IAAgB,YAAYzG,EAAM,CAC1E,GACAwB,cAAeA,CAAC3C,EAAGmB,IAASgK,EAAUK,IAAI,GAADtD,OAAIN,IAAgB,aAAAM,OAAYlI,GAAMmB,EAAM,CACrF,GACAsK,cAAgBzL,GAAOmL,EAAUO,OAAO,GAADxD,OAAIN,IAAgB,aAAAM,OAAYlI,GAAM,CAC7E,IAGS2L,EAAe,CACxBC,cAAe,SAACC,GAA0B,IAAdC,EAAGlB,UAAAC,OAAA,QAAApL,IAAAmL,UAAA,GAAAA,UAAA,GAAG,CAAC,EAC/B,MAAM,WACFD,GAAa,EAAK,eAClBoB,GAAiB,EAAK,wBACtBC,GAA0B,GAC1BF,EACEjC,EAAQjJ,YAAI,SACZkJ,EAAUkC,IAA4BD,EAAiB,CACzD,cAAetE,KACf,CACA,cAAgB,UAADS,OAAY2B,KAE/B,OAAOP,IAAM1I,IAAIiL,EAAY,CAAE/B,UAASgB,aAAcH,GAAc,QACxE,E","file":"static/js/main.b9d06cfc.chunk.js","sourcesContent":["import React from 'react';\nimport { Grid, CircularProgress } from '@material-ui/core'\nconst Loading = () => {\n return (\n \n \n \n \n \n )\n}\n\nexport default Loading\n","import React, { useEffect, useState } from 'react'\nimport { get } from 'lib/localSecure'\nimport { Card, CardContent, Grid, Typography, Button, CircularProgress } from '@material-ui/core'\nimport { authService } from 'lib/apiCall'\nimport { successMessage } from 'lib/alertMessage';\nimport { ValidatorForm, TextValidator } from 'react-material-ui-form-validator';\n\nfunction replaceUndefinedOrNull(key, value) {\n if (value === null || value === undefined || value === '') {\n return undefined;\n }\n\n return value;\n}\n\nconst Generate = ({ ...props }) => {\n const isEdit = props.match.params.id\n const [loading, setLoading] = useState(false);\n const [values, setValues] = useState({\n name: '',\n email: '',\n password: '',\n company: '',\n phone: ''\n });\n\n const user = get('user')\n const history = props.history\n useEffect(() => {\n if (isEdit) {\n authService.getPartner(isEdit).then(result => {\n setValues({ ...result.data, password: \"\" })\n })\n }\n if (!user.is_admin) {\n history.push('/')\n }\n\n }, [history, user.is_admin, isEdit])\n\n const handleChange = (prop) => (event) => {\n setValues({ ...values, [prop]: event.target.value });\n };\n\n const handleSubmit = (e) => {\n e.preventDefault();\n setLoading(true);\n const body = JSON.parse(JSON.stringify(values, replaceUndefinedOrNull));\n !isEdit ? authService.addPartner(body).then((vendor) => {\n setValues(vendor.data)\n setLoading(false);\n successMessage(\"Success\")\n history.push('/vendor')\n }).catch(() => {\n setLoading(false);\n }) : authService.updatePartner(isEdit, body).then((vendor) => {\n setValues(vendor.data)\n setLoading(false);\n successMessage(\"Update Success\")\n }).catch(() => {\n setLoading(false);\n })\n }\n\n\n\n return (\n \n \n \n \n \n {isEdit ? \"Update Vendor Account\" : \"Create Vendor Account\"}\n \n console.log(errors)}\n >\n \n \n \n \n \n \n {loading ? : isEdit ? \"Update\" : \"Create\"}\n \n {!isEdit && setValues({\n name: '',\n email: '',\n password: '',\n company: '',\n phone: ''\n })}\n >\n Reset\n }\n history.goBack()}\n >\n Back\n \n \n \n \n \n \n )\n}\n\nexport default Generate","import * as Sentry from '@sentry/react'\nimport { BrowserTracing } from '@sentry/tracing'\nimport { createBrowserHistory } from 'history'\n\nconst history = createBrowserHistory()\n\nconst initSentry = ({ DSN, version, environment }) => {\n const hasDSN = Boolean(DSN)\n if (hasDSN) {\n Sentry.init({\n dsn: process.env.REACT_APP_SENTRY_DSN,\n integrations: [new BrowserTracing()],\n\n routingInstrumentation: Sentry.reactRouterV5Instrumentation(history),\n\n // We recommend adjusting this value in production, or using tracesSampler\n // for finer control\n tracesSampleRate: 1.0,\n release: version,\n environment,\n })\n console.info('Sentry installed')\n }\n}\n\nexport default initSentry\n","import React, { Component } from 'react'\nimport 'react-toastify/dist/ReactToastify.min.css';\nimport { ToastContainer } from 'react-toastify';\nimport {\n BrowserRouter,\n Switch,\n Route\n} from 'react-router-dom'\nimport Loading from 'components/Loading'\nimport VendorForm from \"components/vendor/FormVendor\"\nimport initSentry from 'lib/initSentry'\n\nconst PrivateRoute = React.lazy(() => import('./components/PrivateRoute'));\nconst Verify = React.lazy(() => import('./pages/verify'));\nconst Login = React.lazy(() => import('./pages/login'));\nconst Docs = React.lazy(() => import('./pages/docs'));\n// const Generate = React.lazy(() => import('./pages/generate'));\nconst Vendor = React.lazy(() => import('./pages/vendor'))\n\nclass App extends Component {\n componentDidMount() {\n const {\n REACT_APP_ENV,\n REACT_APP_SENTRY_DSN,\n REACT_APP_VERSION,\n } = process.env\n\n \n initSentry({\n DSN: REACT_APP_SENTRY_DSN,\n version: REACT_APP_VERSION,\n environment: REACT_APP_ENV,\n })\n }\n\n render() {\n return (\n <>\n \n }>\n \n \n \n {/* */}\n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default App;\n","// 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.0/8 are 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 headers: { 'Service-Worker': 'script' }\n })\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 ReactDOM from 'react-dom'\nimport App from './App'\nimport 'assets/style/index.css'\nimport * as serviceWorker from './serviceWorker'\nimport { ThemeProvider, createTheme } from '@material-ui/core/styles'\nimport CssBaseline from '@material-ui/core/CssBaseline'\n\nconst theme = createTheme()\n\nReactDOM.render(\n \n \n \n ,\n document.getElementById('root')\n)\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister()\n","export const API_URL = process.env.REACT_APP_API_URL\nexport const JWT_TOKEN = process.env.REACT_APP_JWT_TOKEN\nexport const LOCAL_STORAGE_CONTENT = process.env.REACT_APP_LOCAL_STORAGE_CONTENT\nexport const LOCAL_STORAGE_TITLE = process.env.REACT_APP_LOCAL_STORAGE_TITLE\nexport const AUTH_SERVICE_API = process.env.REACT_APP_AUTH_SERVICE\n\nexport const REACT_APP_ACCOUNT_URL = process.env.REACT_APP_ACCOUNT_URL\nexport const REACT_APP_CLIENT_ID = process.env.REACT_APP_CLIENT_ID\nexport const REACT_APP_STAGE = process.env.REACT_APP_ENV\n\n\nexport const AUTH_CALLBACK = window.location.origin + '/verify'\nexport const AUTH_SERVICE_GOOGLE_URL =\n `${AUTH_SERVICE_API}/sso`\nexport const AUTH_SERVICE_GOOGLE_REDIRECT =\n AUTH_SERVICE_GOOGLE_URL + '?redirect_url=' + AUTH_CALLBACK\n","import secureLS from 'secure-ls'\n\nconst ls = new secureLS()\nexport const get = (key) => ls.get(key)\nexport const set = (key, data) => ls.set(key, data)\nexport const rem = () => ls.removeAll()\n\nexport const isLogin = () => (ls.get('token') ? true : false);","import { toast } from 'react-toastify';\n\n\nexport const errorMessage = (message) => toast.error(message, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n});\n\nexport const successMessage = (message) => toast.success(message, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n});\n\nexport const warningMessage = (message) => toast.warning(message, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n});","import Axios from 'axios';\nimport { get, rem } from './localSecure';\nimport {\n API_URL,\n JWT_TOKEN,\n AUTH_SERVICE_API\n} from 'config'\n\nimport { errorMessage } from './alertMessage';\n\nconst axios = Axios.create({\n baseURL: API_URL,\n});\n\naxios.interceptors.request.use((config) => {\n // Read token for anywhere, in this case directly from localStorage\n const token = get('token') || JWT_TOKEN;\n if (token) {\n config.headers = {\n 'X-App-Token': token\n };\n }\n return config;\n});\n\naxios.interceptors.response.use(\n (response) => {\n return response.data;\n },\n (error) => {\n errorMessage(error.response ? error.response.data.message : error.message);\n if (error.response && error.response.data) {\n if (error.response.status === 401) {\n rem();\n window.location.href = '/';\n }\n return Promise.reject(error.response.data);\n }\n return Promise.reject(error.message);\n }\n);\n\nexport const docAPi = {\n login: (data) => axios.post(`/login`, data),\n generate: (data) => axios.post(`/generate`, data),\n getListDoc: () => axios.get('/docs'),\n getDoc: (project, isDownload = false) =>\n axios.get(`/docs/${project}`, { responseType: isDownload && 'blob' }),\n status: () => axios.get('/mock/status'),\n mockSetting: (status, project) => axios.post(`/mock/${status}/${project}`),\n sso: () => axios.get(`/sso`,{ withCredentials:true }),\n getOpenapiList: () => axios.get('/openapi')\n};\n\nconst axiosAuth = Axios.create({\n baseURL: API_URL,\n});\n\naxiosAuth.interceptors.request.use((config) => {\n // Read token for anywhere, in this case directly from localStorage\n const user = get('user') || JWT_TOKEN;\n if (user) {\n config.headers = {\n 'Authorization': `Bearer ${user.token}`\n };\n }\n return config;\n});\n\naxiosAuth.interceptors.response.use(\n (response) => {\n return response.data;\n },\n (error) => {\n errorMessage(error.response ? error.response.data.message : error.message);\n if (error.response && error.response.data) {\n if (error.response.status === 401) {\n rem();\n window.location.href = '/';\n }\n return Promise.reject(error.response.data);\n }\n return Promise.reject(error.message);\n }\n);\n\nexport const authService = {\n verify: (code) => Axios.post(`${AUTH_SERVICE_API}/google/verify`, { code }),\n login: (body) => Axios.post(`${AUTH_SERVICE_API}/partner/login`, body),\n getProfile: (token) => Axios.get(`${AUTH_SERVICE_API}/user/profile`, {\n headers: {\n 'Authorization': `Bearer ${token}`\n }\n }),\n listPartner: (params) => axiosAuth.get(`${AUTH_SERVICE_API}/partner`, {\n params: params,\n }),\n getPartner: (id) => axiosAuth.get(`${AUTH_SERVICE_API}/partner/detail/${id}`, {\n }),\n addPartner: (data) => axiosAuth.post(`${AUTH_SERVICE_API}/partner`, data, {\n }),\n updatePartner: (id,data) => axiosAuth.put(`${AUTH_SERVICE_API}/partner/${id}`, data, {\n }),\n deletePartner: (id) => axiosAuth.delete(`${AUTH_SERVICE_API}/partner/${id}`, {\n })\n}\n\nexport const axiosOpenapi = {\n getOpenapiDoc: (projectUrl, opt = {}) => {\n const {\n isDownload = false,\n isRetryAttempt = false,\n shouldIncludeAuthHeader = false\n } = opt\n const token = get('token')\n const headers = shouldIncludeAuthHeader && (isRetryAttempt ? {\n 'X-App-Token': JWT_TOKEN\n } : {\n 'Authorization': `Bearer ${token}`\n })\n return Axios.get(projectUrl, { headers, responseType: isDownload && 'blob' })\n }\n}\n\nexport default axios;\n"],"sourceRoot":""}