1 line
No EOL
19 KiB
Text
1 line
No EOL
19 KiB
Text
{"version":3,"sources":["logo.svg","SignIn.js","serviceWorker.js","ChecksumResolver.js","index.js"],"names":["module","exports","makeStyles","theme","paper","marginTop","spacing","display","flexDirection","alignItems","avatar","margin","backgroundColor","palette","secondary","main","form","width","withStyles","root","marginRight","color","TextField","Boolean","window","location","hostname","match","Copyright","Typography","variant","align","Link","href","Date","getFullYear","ChecksumResolver","props","DarkerDisabledTextField","setChecksum","value","length","setState","checksum","isChecksumValid","state","RegExp","test","requestActivationBytes","fetch","then","res","json","result","success","activationBytes","error","classes","this","Container","component","maxWidth","CssBaseline","className","Avatar","noValidate","required","fullWidth","id","label","name","autoComplete","autoFocus","onChange","x","target","Button","onClick","disabled","aria-readonly","InputProps","readOnly","Box","mt","React","Component","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","console","message"],"mappings":"mKAAAA,EAAOC,QAAU,IAA0B,kC,kOC2BzBC,aAAW,SAACC,GAAD,MAAY,CACvCC,MAAO,CACLC,UAAWF,EAAMG,QAAQ,GACzBC,QAAS,OACTC,cAAe,SACfC,WAAY,UAEdC,OAAQ,CACNC,OAAQR,EAAMG,QAAQ,GACtBM,gBAAiBT,EAAMU,QAAQC,UAAUC,MAE3CC,KAAM,CACJC,MAAO,OACPZ,UAAWF,EAAMG,QAAQ,QAKGY,YAAW,CACzCC,KAAM,CACJC,YAAa,EACb,oCAAqC,CACnCC,MAAO,wBAJmBH,CAO7BI,KCxCiBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,oCCaN,SAASC,IACL,OACI,kBAACC,EAAA,EAAD,CAAYC,QAAQ,QAAQT,MAAM,gBAAgBU,MAAM,UACnD,kBACD,kBAACC,EAAA,EAAD,CAAMX,MAAM,UAAUY,KAAK,4BAA3B,gBAEI,KACH,IAAIC,MAAOC,cACX,K,IAKPC,E,kDACF,WAAYC,G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A,MAAOG,IAGX,kBAACiC,EAAA,EAAD,CACIT,WAAS,EACTrC,QAAQ,YACR+C,QAAS,WACL,EAAK7B,0BAET8B,UAAWpB,KAAKd,mBANpB,4BAWA,uBAAMN,wBAAN,CACIE,MAAOe,EACPuB,UAAQ,EACRhD,QAAQ,WACRnB,OAAO,SACPwD,WAAS,EACTC,GAAG,kBACHC,MAAOd,EAAgB,GAAG,mBAC1Be,KAAK,kBACLC,aAAa,kBACbQ,iBAAA,EAEAC,WAAY,CACRC,UAAU,OAO1B,kBAACC,EAAA,EAAD,CAAKC,GAAI,GACL,kBAAC,EAAD,Y,GAxHWC,IAAMC,WA+HtBnE,eA9JG,SAAAf,GAAK,MAAK,CACxBC,MAAO,CACHC,UAAWF,EAAMG,QAAQ,GACzBC,QAAS,OACTC,cAAe,SACfC,WAAY,UAEhBC,OAAQ,CACJC,OAAQR,EAAMG,QAAQ,GACtBM,gBAAiBT,EAAMU,QAAQC,UAAUC,MAE7CC,KAAM,CACFC,MAAO,OACPZ,UAAWF,EAAMG,QAAQ,OAiJlBY,CAAsBkB,GCpKrCkD,IAASC,OACP,kBAAC,EAAD,MACAC,SAASC,eAAe,SF0HpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB1C,MAAK,SAAA2C,GACJA,EAAaC,gBAEdC,OAAM,SAAAvC,GACLwC,QAAQxC,MAAMA,EAAMyC,c","file":"static/js/main.dd06e156.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.5d5d9eef.svg\";","import React, { useState } from 'react';\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport Button from '@material-ui/core/Button';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport TextField from '@material-ui/core/TextField';\r\n\r\nimport Link from '@material-ui/core/Link';\r\nimport Box from '@material-ui/core/Box';\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\n\r\nfunction Copyright() {\r\n return (\r\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\r\n {'Copyright © '}\r\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\r\n Your Website\r\n </Link>{' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n </Typography>\r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n }\r\n\r\n}));\r\n\r\nconst DarkerDisabledTextField = withStyles({\r\n root: {\r\n marginRight: 8,\r\n \"& .MuiInputBase-root.Mui-disabled\": {\r\n color: \"rgba(0, 0, 0, 0.6)\" // (default alpha is 0.38)\r\n }\r\n }\r\n})(TextField);\r\n\r\nexport default function SignIn() {\r\n const classes = useStyles();\r\n\r\n const [checksumValue, setChecksumValue] = useState(\"\");\r\n\r\n return (\r\n <Container component=\"main\" maxWidth=\"xs\">\r\n {/* <div>\r\n <p>You clicked {count} times</p>\r\n <button onClick={() => setCount(count + 1)}>\r\n Click me\r\n </button>\r\n </div> */}\r\n <CssBaseline />\r\n <div className={classes.paper}>\r\n <Avatar className={classes.avatar}>\r\n <LockOutlinedIcon />\r\n </Avatar>\r\n <Typography component=\"h1\" variant=\"h5\">\r\n AAX Checksum Resolver\r\n </Typography>\r\n <form className={classes.form} noValidate>\r\n <TextField\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n required\r\n fullWidth\r\n id=\"checksum\"\r\n label=\"AAX Checksum\"\r\n name=\"checksum\"\r\n autoComplete=\"checksum\"\r\n autoFocus\r\n onChange={(x) => setChecksumValue(x.target.value)}\r\n />\r\n\r\n <Button\r\n fullWidth\r\n variant=\"contained\"\r\n // className={classes.submit}\r\n onClick={() => { alert(checksumValue) }}\r\n >\r\n Request Activation Bytes\r\n </Button>\r\n\r\n <DarkerDisabledTextField\r\n disabled\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n fullWidth\r\n id=\"activationBytes\"\r\n label=\"Activation Bytes\"\r\n name=\"activationBytes\"\r\n autoComplete=\"activationBytes\"\r\n aria-readonly\r\n\r\n InputProps={{\r\n readOnly: true\r\n }}\r\n\r\n />\r\n\r\n </form>\r\n </div>\r\n <Box mt={8}>\r\n <Copyright />\r\n </Box>\r\n </Container>\r\n );\r\n}\r\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\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React, { useState } from 'react';\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport Button from '@material-ui/core/Button';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport TextField from '@material-ui/core/TextField';\r\n\r\nimport Link from '@material-ui/core/Link';\r\nimport Box from '@material-ui/core/Box';\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Container from '@material-ui/core/Container';\r\n\r\nconst useStyles = theme => ({\r\n paper: {\r\n marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n }\r\n});\r\n\r\n\r\nfunction Copyright() {\r\n return (\r\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\r\n {'Copyright © '}\r\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\r\n Your Website\r\n </Link>{' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n </Typography>\r\n );\r\n}\r\n\r\nclass ChecksumResolver extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n checksum: \"\"\r\n }\r\n }\r\n\r\n\r\n DarkerDisabledTextField = withStyles({\r\n root: {\r\n marginRight: 8,\r\n \"& .MuiInputBase-root.Mui-disabled\": {\r\n color: \"rgba(0, 0, 0, 0.6)\" // (default alpha is 0.38)\r\n }\r\n }\r\n })(TextField);\r\n\r\n setChecksum = (value) => {\r\n if (value.length > 40) {\r\n return;\r\n }\r\n this.setState({ checksum: value })\r\n }\r\n\r\n isChecksumValid = () => {\r\n const { checksum } = this.state;\r\n const regex = RegExp('[a-f0-9]{40}');\r\n const testResults = regex.test(checksum);\r\n\r\n return testResults;\r\n }\r\n\r\n requestActivationBytes = () => {\r\n const { checksum } = this.state;\r\n\r\n fetch(\"https://aaxactivationserviceapi.azurewebsites.net/api/v2/activation/\" + checksum)\r\n .then(res => res.json())\r\n .then(\r\n (result) => {\r\n const { success, activationBytes } = result;\r\n if (success === true) {\r\n this.setState({ activationBytes: result.activationBytes })\r\n }\r\n\r\n\r\n },\r\n (error) => {\r\n // this.setState({\r\n // isLoaded: true,\r\n // error\r\n // });\r\n }\r\n )\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const { checksum, activationBytes } = this.state;\r\n\r\n return (\r\n <Container component=\"main\" maxWidth=\"xs\">\r\n\r\n <CssBaseline />\r\n <div className={classes.paper}>\r\n <Avatar className={classes.avatar}>\r\n <LockOutlinedIcon />\r\n </Avatar>\r\n <Typography component=\"h1\" variant=\"h5\">\r\n AAX Checksum Resolver\r\n </Typography>\r\n\r\n <form className={classes.form} noValidate>\r\n <TextField\r\n error={!this.isChecksumValid()}\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n required\r\n fullWidth\r\n id=\"checksum\"\r\n label=\"AAX Checksum\"\r\n name=\"checksum\"\r\n autoComplete=\"checksum\"\r\n autoFocus\r\n onChange={(x) => this.setChecksum(x.target.value)}\r\n value={checksum}\r\n />\r\n\r\n <Button\r\n fullWidth\r\n variant=\"contained\"\r\n onClick={() => {\r\n this.requestActivationBytes();\r\n }}\r\n disabled={!this.isChecksumValid()}\r\n >\r\n Request Activation Bytes\r\n </Button>\r\n\r\n <this.DarkerDisabledTextField\r\n value={activationBytes}\r\n disabled\r\n variant=\"outlined\"\r\n margin=\"normal\"\r\n fullWidth\r\n id=\"activationBytes\"\r\n label={activationBytes?'':\"Activation Bytes\"}\r\n name=\"activationBytes\"\r\n autoComplete=\"activationBytes\"\r\n aria-readonly\r\n\r\n InputProps={{\r\n readOnly: true\r\n }}\r\n\r\n />\r\n\r\n </form>\r\n </div>\r\n <Box mt={8}>\r\n <Copyright />\r\n </Box>\r\n </Container>\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(useStyles)(ChecksumResolver);","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\nimport ChecksumResolver from './ChecksumResolver';\n\nReactDOM.render(\n <ChecksumResolver />,\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"],"sourceRoot":""} |