{"version":3,"sources":["components/TaxLine.js","service/AtoTaxService.js","components/TaxTable.js","App.js","serviceWorker.js","index.js"],"names":["TaxLine","className","value","this","props","income","displayType","thousandSeparator","prefix","decimalScale","fixedDecimalScale","tax","incomeAfterTax","marginalTaxRate","Component","getTax","taxableIncome","category","init","TaxTable","state","taxRecords","loadTaxTableData","amt","taxInfo","push","setState","map","taxRecord","key","App","Boolean","window","location","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"0PA2BeA,E,iLAtBP,OACI,yBAAKC,UAAU,YACX,yBAAKA,UAAU,UACX,kBAAC,IAAD,CAAcC,MAAOC,KAAKC,MAAMC,OAAQC,YAAa,OAAQC,mBAAmB,EAAMC,OAAQ,IAAKC,aAAa,IAAKC,kBAAkB,UAE3I,yBAAKT,UAAU,OACX,kBAAC,IAAD,CAAcC,MAAOC,KAAKC,MAAMO,IAAKL,YAAa,OAAQC,mBAAmB,EAAMC,OAAQ,IAC3FC,aAAa,IAAKC,kBAAkB,UAExC,yBAAKT,UAAU,aACX,kBAAC,IAAD,CAAcC,MAAOC,KAAKC,MAAMQ,eAAgBN,YAAa,OAAQC,mBAAmB,EAAMC,OAAQ,IACtGC,aAAa,IAAIC,kBAAkB,UAEvC,yBAAKT,UAAU,qBACX,kBAAC,IAAD,CAAcC,MAAOC,KAAKC,MAAMS,gBAAiBP,YAAa,OAAQC,mBAAmB,EACzFE,aAAa,IAAIC,kBAAkB,SAFvC,U,GAfMI,aCwDPC,MA3Df,SAAgBC,GACZ,OAAIA,GAAiB,MACV,CACHX,OAAQW,EACRL,IAAK,EACLM,SAAU,EACVJ,gBAAiB,EACjBK,KAAM,WAEF,OADAf,KAAKS,eAAiBT,KAAKE,OAASF,KAAKQ,IAClCR,OAEbe,OACGF,GAAiB,KACf,CACHX,OAAQW,EACRL,IAA+B,KAAzBK,EAAgB,OACtBC,SAAU,EACVJ,gBAAiB,GACjBK,KAAM,WAEF,OADAf,KAAKS,eAAiBT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AD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,iB","file":"static/js/main.62807ced.chunk.js","sourcesContent":["import React, { Component } from 'react';\r\nimport NumberFormat from 'react-number-format';\r\n\r\nclass TaxLine extends Component {\r\n render() {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n %\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default TaxLine;\r\n","function getTax(taxableIncome) {\r\n if (taxableIncome <= 18200)\r\n return {\r\n income: taxableIncome,\r\n tax: 0,\r\n category: 1,\r\n marginalTaxRate: 0,\r\n init: function () {\r\n this.incomeAfterTax = this.income - this.tax;\r\n return this;\r\n }\r\n }.init();\r\n else if (taxableIncome <= 37000)\r\n return {\r\n income: taxableIncome,\r\n tax: (taxableIncome - 18200) * 0.19,\r\n category: 1,\r\n marginalTaxRate: 19,\r\n init: function () {\r\n this.incomeAfterTax = this.income - this.tax;\r\n return this;\r\n }\r\n }.init();\r\n\r\n else if (taxableIncome <= 90000)\r\n return {\r\n income: taxableIncome,\r\n tax: 3572 + (taxableIncome - 37000) * 0.325,\r\n category: 2,\r\n marginalTaxRate: 32.5,\r\n init: function () {\r\n this.incomeAfterTax = this.income - this.tax;\r\n return this;\r\n }\r\n }.init();\r\n else if (taxableIncome <= 180000)\r\n return {\r\n income: taxableIncome,\r\n tax: 20797 + (taxableIncome - 90000) * 0.37,\r\n category: 3,\r\n marginalTaxRate: 37,\r\n init: function () {\r\n this.incomeAfterTax = this.income - this.tax;\r\n return this;\r\n }\r\n }.init();\r\n else\r\n return {\r\n income: taxableIncome,\r\n tax: 54097 + (taxableIncome - 180000) * 0.45,\r\n category: 4,\r\n marginalTaxRate: 45,\r\n init: function () {\r\n this.incomeAfterTax = this.income - this.tax;\r\n return this;\r\n }\r\n }.init();\r\n}\r\n\r\nexport default getTax;\r\n","import React, { Component } from 'react';\r\nimport TaxLine from './TaxLine';\r\nimport getTax from '../service/AtoTaxService';\r\nimport \"./TaxTable.scss\";\r\n\r\nclass TaxTable extends Component {\r\n constructor() {\r\n super();\r\n\r\n this.state = {\r\n taxRecords:[]\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.loadTaxTableData();\r\n }\r\n\r\n loadTaxTableData() {\r\n var taxRecords = [];\r\n for (var amt = 10000; amt <= 200000; amt += 1000) {\r\n var taxInfo = getTax(amt);\r\n\r\n taxRecords.push(taxInfo);\r\n\r\n // taxRecords.push({\r\n // amount: amt,\r\n // tax: taxInfo.tax,\r\n // real: amt - taxInfo.tax,\r\n // category: taxInfo.category,\r\n // marginalTaxRate: taxInfo.marginalTaxRate \r\n // });\r\n }\r\n this.setState({ taxRecords : taxRecords });\r\n }\r\n\r\n // var listItems = this.taxRecords.map((item) => {\r\n // // console.log(item)\r\n //
abc
\r\n // });\r\n\r\n render() {\r\n return (\r\n
\r\n
\r\n
Annual Taxable Income
\r\n
Tax
\r\n
Income after Tax
\r\n
Marginal Tax Rate
\r\n
\r\n {this.state.taxRecords.map((taxRecord) => (\r\n \r\n ))}\r\n
\r\n );\r\n }\r\n\r\n}\r\n\r\nexport default TaxTable;\r\n","import React from 'react';\nimport TaxTable from './components/TaxTable';\n\n// \n\nfunction App() {\n\n return (\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.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 ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\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":""}