[
  {
    "path": ".eslintrc.cjs",
    "content": "module.exports = {\n  root: true,\n  env: { browser: true, es2020: true },\n  extends: [\n    'eslint:recommended',\n    'plugin:@typescript-eslint/recommended',\n    'plugin:react-hooks/recommended',\n  ],\n  ignorePatterns: ['dist', '.eslintrc.cjs'],\n  parser: '@typescript-eslint/parser',\n  plugins: ['react-refresh'],\n  rules: {\n    'react-refresh/only-export-components': [\n      'warn',\n      { allowConstantExport: true },\n    ],\n  },\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional stylelint cache\n.stylelintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variable files\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n.temp\n.cache\n\n# Docusaurus cache and generated files\n.docusaurus\n\n# Serverless directories\n.serverless/\n\n# FuseBox cache\n.fusebox/\n\n# DynamoDB Local files\n.dynamodb/\n\n# TernJS port file\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*\n\n# MacOS\n.DS_Store\n\n# 3D models\nmodels\n"
  },
  {
    "path": "LICENSE",
    "content": "Attribution-NonCommercial-ShareAlike 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n     Considerations for licensors: Our public licenses are\n     intended for use by those authorized to give the public\n     permission to use material in ways otherwise restricted by\n     copyright and certain other rights. Our licenses are\n     irrevocable. Licensors should read and understand the terms\n     and conditions of the license they choose before applying it.\n     Licensors should also secure all rights necessary before\n     applying our licenses so that the public can reuse the\n     material as expected. Licensors should clearly mark any\n     material not subject to the license. This includes other CC-\n     licensed material, or material used under an exception or\n     limitation to copyright. More considerations for licensors:\n    wiki.creativecommons.org/Considerations_for_licensors\n\n     Considerations for the public: By using one of our public\n     licenses, a licensor grants the public permission to use the\n     licensed material under specified terms and conditions. If\n     the licensor's permission is not necessary for any reason--for\n     example, because of any applicable exception or limitation to\n     copyright--then that use is not regulated by the license. Our\n     licenses grant only permissions under copyright and certain\n     other rights that a licensor has authority to grant. Use of\n     the licensed material may still be restricted for other\n     reasons, including because others have copyright or other\n     rights in the material. A licensor may make special requests,\n     such as asking that all changes be marked or described.\n     Although not required by our licenses, you are encouraged to\n     respect those requests where reasonable. More considerations\n     for the public:\n    wiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International\nPublic License\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution-NonCommercial-ShareAlike 4.0 International Public License\n(\"Public License\"). To the extent this Public License may be\ninterpreted as a contract, You are granted the Licensed Rights in\nconsideration of Your acceptance of these terms and conditions, and the\nLicensor grants You such rights in consideration of benefits the\nLicensor receives from making the Licensed Material available under\nthese terms and conditions.\n\nSection 1 -- Definitions.\n\na. Adapted Material means material subject to Copyright and Similar\nRights that is derived from or based upon the Licensed Material\nand in which the Licensed Material is translated, altered,\narranged, transformed, or otherwise modified in a manner requiring\npermission under the Copyright and Similar Rights held by the\nLicensor. For purposes of this Public License, where the Licensed\nMaterial is a musical work, performance, or sound recording,\nAdapted Material is always produced where the Licensed Material is\nsynched in timed relation with a moving image.\n\nb. Adapter's License means the license You apply to Your Copyright\nand Similar Rights in Your contributions to Adapted Material in\naccordance with the terms and conditions of this Public License.\n\nc. BY-NC-SA Compatible License means a license listed at\ncreativecommons.org/compatiblelicenses, approved by Creative\nCommons as essentially the equivalent of this Public License.\n\nd. Copyright and Similar Rights means copyright and/or similar rights\nclosely related to copyright including, without limitation,\nperformance, broadcast, sound recording, and Sui Generis Database\nRights, without regard to how the rights are labeled or\ncategorized. For purposes of this Public License, the rights\nspecified in Section 2(b)(1)-(2) are not Copyright and Similar\nRights.\n\ne. Effective Technological Measures means those measures that, in the\nabsence of proper authority, may not be circumvented under laws\nfulfilling obligations under Article 11 of the WIPO Copyright\nTreaty adopted on December 20, 1996, and/or similar international\nagreements.\n\nf. Exceptions and Limitations means fair use, fair dealing, and/or\nany other exception or limitation to Copyright and Similar Rights\nthat applies to Your use of the Licensed Material.\n\ng. License Elements means the license attributes listed in the name\nof a Creative Commons Public License. The License Elements of this\nPublic License are Attribution, NonCommercial, and ShareAlike.\n\nh. Licensed Material means the artistic or literary work, database,\nor other material to which the Licensor applied this Public\nLicense.\n\ni. Licensed Rights means the rights granted to You subject to the\nterms and conditions of this Public License, which are limited to\nall Copyright and Similar Rights that apply to Your use of the\nLicensed Material and that the Licensor has authority to license.\n\nj. Licensor means the individual(s) or entity(ies) granting rights\nunder this Public License.\n\nk. NonCommercial means not primarily intended for or directed towards\ncommercial advantage or monetary compensation. For purposes of\nthis Public License, the exchange of the Licensed Material for\nother material subject to Copyright and Similar Rights by digital\nfile-sharing or similar means is NonCommercial provided there is\nno payment of monetary compensation in connection with the\nexchange.\n\nl. Share means to provide material to the public by any means or\nprocess that requires permission under the Licensed Rights, such\nas reproduction, public display, public performance, distribution,\ndissemination, communication, or importation, and to make material\navailable to the public including in ways that members of the\npublic may access the material from a place and at a time\nindividually chosen by them.\n\nm. Sui Generis Database Rights means rights other than copyright\nresulting from Directive 96/9/EC of the European Parliament and of\nthe Council of 11 March 1996 on the legal protection of databases,\nas amended and/or succeeded, as well as other essentially\nequivalent rights anywhere in the world.\n\nn. You means the individual or entity exercising the Licensed Rights\nunder this Public License. Your has a corresponding meaning.\n\nSection 2 -- Scope.\n\na. License grant.\n\n       1. Subject to the terms and conditions of this Public License,\n          the Licensor hereby grants You a worldwide, royalty-free,\n          non-sublicensable, non-exclusive, irrevocable license to\n          exercise the Licensed Rights in the Licensed Material to:\n\n            a. reproduce and Share the Licensed Material, in whole or\n               in part, for NonCommercial purposes only; and\n\n            b. produce, reproduce, and Share Adapted Material for\n               NonCommercial purposes only.\n\n       2. Exceptions and Limitations. For the avoidance of doubt, where\n          Exceptions and Limitations apply to Your use, this Public\n          License does not apply, and You do not need to comply with\n          its terms and conditions.\n\n       3. Term. The term of this Public License is specified in Section\n          6(a).\n\n       4. Media and formats; technical modifications allowed. The\n          Licensor authorizes You to exercise the Licensed Rights in\n          all media and formats whether now known or hereafter created,\n          and to make technical modifications necessary to do so. The\n          Licensor waives and/or agrees not to assert any right or\n          authority to forbid You from making technical modifications\n          necessary to exercise the Licensed Rights, including\n          technical modifications necessary to circumvent Effective\n          Technological Measures. For purposes of this Public License,\n          simply making modifications authorized by this Section 2(a)\n          (4) never produces Adapted Material.\n\n       5. Downstream recipients.\n\n            a. Offer from the Licensor -- Licensed Material. Every\n               recipient of the Licensed Material automatically\n               receives an offer from the Licensor to exercise the\n               Licensed Rights under the terms and conditions of this\n               Public License.\n\n            b. Additional offer from the Licensor -- Adapted Material.\n               Every recipient of Adapted Material from You\n               automatically receives an offer from the Licensor to\n               exercise the Licensed Rights in the Adapted Material\n               under the conditions of the Adapter's License You apply.\n\n            c. No downstream restrictions. You may not offer or impose\n               any additional or different terms or conditions on, or\n               apply any Effective Technological Measures to, the\n               Licensed Material if doing so restricts exercise of the\n               Licensed Rights by any recipient of the Licensed\n               Material.\n\n       6. No endorsement. Nothing in this Public License constitutes or\n          may be construed as permission to assert or imply that You\n          are, or that Your use of the Licensed Material is, connected\n          with, or sponsored, endorsed, or granted official status by,\n          the Licensor or others designated to receive attribution as\n          provided in Section 3(a)(1)(A)(i).\n\nb. Other rights.\n\n       1. Moral rights, such as the right of integrity, are not\n          licensed under this Public License, nor are publicity,\n          privacy, and/or other similar personality rights; however, to\n          the extent possible, the Licensor waives and/or agrees not to\n          assert any such rights held by the Licensor to the limited\n          extent necessary to allow You to exercise the Licensed\n          Rights, but not otherwise.\n\n       2. Patent and trademark rights are not licensed under this\n          Public License.\n\n       3. To the extent possible, the Licensor waives any right to\n          collect royalties from You for the exercise of the Licensed\n          Rights, whether directly or through a collecting society\n          under any voluntary or waivable statutory or compulsory\n          licensing scheme. In all other cases the Licensor expressly\n          reserves any right to collect such royalties, including when\n          the Licensed Material is used other than for NonCommercial\n          purposes.\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\na. Attribution.\n\n       1. If You Share the Licensed Material (including in modified\n          form), You must:\n\n            a. retain the following if it is supplied by the Licensor\n               with the Licensed Material:\n\n                 i. identification of the creator(s) of the Licensed\n                    Material and any others designated to receive\n                    attribution, in any reasonable manner requested by\n                    the Licensor (including by pseudonym if\n                    designated);\n\n                ii. a copyright notice;\n\n               iii. a notice that refers to this Public License;\n\n                iv. a notice that refers to the disclaimer of\n                    warranties;\n\n                 v. a URI or hyperlink to the Licensed Material to the\n                    extent reasonably practicable;\n\n            b. indicate if You modified the Licensed Material and\n               retain an indication of any previous modifications; and\n\n            c. indicate the Licensed Material is licensed under this\n               Public License, and include the text of, or the URI or\n               hyperlink to, this Public License.\n\n       2. You may satisfy the conditions in Section 3(a)(1) in any\n          reasonable manner based on the medium, means, and context in\n          which You Share the Licensed Material. For example, it may be\n          reasonable to satisfy the conditions by providing a URI or\n          hyperlink to a resource that includes the required\n          information.\n       3. If requested by the Licensor, You must remove any of the\n          information required by Section 3(a)(1)(A) to the extent\n          reasonably practicable.\n\nb. ShareAlike.\n\n     In addition to the conditions in Section 3(a), if You Share\n     Adapted Material You produce, the following conditions also apply.\n\n       1. The Adapter's License You apply must be a Creative Commons\n          license with the same License Elements, this version or\n          later, or a BY-NC-SA Compatible License.\n\n       2. You must include the text of, or the URI or hyperlink to, the\n          Adapter's License You apply. You may satisfy this condition\n          in any reasonable manner based on the medium, means, and\n          context in which You Share Adapted Material.\n\n       3. You may not offer or impose any additional or different terms\n          or conditions on, or apply any Effective Technological\n          Measures to, Adapted Material that restrict exercise of the\n          rights granted under the Adapter's License You apply.\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\na. for the avoidance of doubt, Section 2(a)(1) grants You the right\nto extract, reuse, reproduce, and Share all or a substantial\nportion of the contents of the database for NonCommercial purposes\nonly;\n\nb. if You include all or a substantial portion of the database\ncontents in a database in which You have Sui Generis Database\nRights, then the database in which You have Sui Generis Database\nRights (but not its individual contents) is Adapted Material,\nincluding for purposes of Section 3(b); and\n\nc. You must comply with the conditions in Section 3(a) if You Share\nall or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\na. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\nEXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\nAND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\nANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\nIMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\nWARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\nPURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\nACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\nKNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\nALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\nb. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\nTO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\nNEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\nINCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\nCOSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\nUSE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\nADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\nDAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\nIN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\nc. The disclaimer of warranties and limitation of liability provided\nabove shall be interpreted in a manner that, to the extent\npossible, most closely approximates an absolute disclaimer and\nwaiver of all liability.\n\nSection 6 -- Term and Termination.\n\na. This Public License applies for the term of the Copyright and\nSimilar Rights licensed here. However, if You fail to comply with\nthis Public License, then Your rights under this Public License\nterminate automatically.\n\nb. Where Your right to use the Licensed Material has terminated under\nSection 6(a), it reinstates:\n\n       1. automatically as of the date the violation is cured, provided\n          it is cured within 30 days of Your discovery of the\n          violation; or\n\n       2. upon express reinstatement by the Licensor.\n\n     For the avoidance of doubt, this Section 6(b) does not affect any\n     right the Licensor may have to seek remedies for Your violations\n     of this Public License.\n\nc. For the avoidance of doubt, the Licensor may also offer the\nLicensed Material under separate terms or conditions or stop\ndistributing the Licensed Material at any time; however, doing so\nwill not terminate this Public License.\n\nd. Sections 1, 5, 6, 7, and 8 survive termination of this Public\nLicense.\n\nSection 7 -- Other Terms and Conditions.\n\na. The Licensor shall not be bound by any additional or different\nterms or conditions communicated by You unless expressly agreed.\n\nb. Any arrangements, understandings, or agreements regarding the\nLicensed Material not stated herein are separate from and\nindependent of the terms and conditions of this Public License.\n\nSection 8 -- Interpretation.\n\na. For the avoidance of doubt, this Public License does not, and\nshall not be interpreted to, reduce, limit, restrict, or impose\nconditions on any use of the Licensed Material that could lawfully\nbe made without permission under this Public License.\n\nb. To the extent possible, if any provision of this Public License is\ndeemed unenforceable, it shall be automatically reformed to the\nminimum extent necessary to make it enforceable. If the provision\ncannot be reformed, it shall be severed from this Public License\nwithout affecting the enforceability of the remaining terms and\nconditions.\n\nc. No term or condition of this Public License will be waived and no\nfailure to comply consented to unless expressly agreed to by the\nLicensor.\n\nd. Nothing in this Public License constitutes or may be interpreted\nas a limitation upon, or waiver of, any privileges and immunities\nthat apply to the Licensor or You, including from the legal\nprocesses of any jurisdiction or authority.\n\n=======================================================================\n\nCreative Commons is not a party to its public\nlicenses. Notwithstanding, Creative Commons may elect to apply one of\nits public licenses to material it publishes and in those instances\nwill be considered the “Licensor.” The text of the Creative Commons\npublic licenses is dedicated to the public domain under the CC0 Public\nDomain Dedication. Except for the limited purpose of indicating that\nmaterial is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the\npublic licenses.\n\nCreative Commons may be contacted at creativecommons.org."
  },
  {
    "path": "README.md",
    "content": "# 🌊 Volume Rendering\n\nVolume rendering is a common technique used to render 3D medical imaging data like MRIs or CT scans. This repo contains the code for my implementation in Three.js and GLSL. Here's a 30-second demo on [Twitter](https://x.com/SuboptimalEng/status/1781808470985003035) and [Reddit](https://www.reddit.com/r/GraphicsProgramming/comments/1c9ke0p/volume_rendering_in_threejs_and_glsl/).\n\nHuge thanks to Will Usher for his blog post on [Volume Rendering in WebGL](https://www.willusher.io/webgl/2019/01/13/volume-rendering-with-webgl).\n\n<img src=\"/_demos/foot-01.png\" width=\"100%\">\n<img src=\"/_demos/foot-02.png\" width=\"100%\">\n<img src=\"/_demos/bonsai-01.png\" width=\"100%\">\n\n## Setup\n\n```\ngit clone https://github.com/SuboptimalEng/volume-rendering.git\ncd volume-rendering/\nnpm install\nnpm run dev\n```\n\nBut wait, there's more! After running these commands, you will be able to open the project in localhost. However, there will be no image rendered on screen. Why, you may ask? Simple, I did not want to upload multiple 16MB data files to GitHub. To see the demo in action, you will need to download one of these files and upload them via the UI.\n\n- Foot - https://klacansky.com/open-scivis-datasets/foot/foot_256x256x256_uint8.raw\n- Skull - https://klacansky.com/open-scivis-datasets/skull/skull_256x256x256_uint8.raw\n- Bonsai - https://klacansky.com/open-scivis-datasets/bonsai/bonsai_256x256x256_uint8.raw\n\nNote: The website I linked has tons of models, but not all of them will work. I've hard-coded this project to work with `256x256x256 uint8` files that are scaled `1x1x1`.\n\n## References\n\n- Will Usher's Blog Post - https://www.willusher.io/webgl/2019/01/13/volume-rendering-with-webgl\n- Open Scientific Visualization Datasets - https://klacansky.com/open-scivis-datasets\n- The Art of Code - https://www.youtube.com/watch?v=S8AWd66hoCo\n- Inigo Quilez - https://iquilezles.org/articles/palettes/\n\n## License\n\nShield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]\n\nThis work is licensed under a\n[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].\n\n[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]\n\n[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/\n[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png\n[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg\n"
  },
  {
    "path": "index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Vite + React + TS</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/src/main.tsx\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"volume-rendering\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"tsc && vite build\",\n    \"lint\": \"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0\",\n    \"preview\": \"vite preview\"\n  },\n  \"dependencies\": {\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"three\": \"^0.163.0\"\n  },\n  \"devDependencies\": {\n    \"@types/dat.gui\": \"^0.7.13\",\n    \"@types/react\": \"^18.2.66\",\n    \"@types/react-dom\": \"^18.2.22\",\n    \"@types/three\": \"^0.163.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^7.2.0\",\n    \"@typescript-eslint/parser\": \"^7.2.0\",\n    \"@vitejs/plugin-react\": \"^4.2.1\",\n    \"autoprefixer\": \"^10.4.19\",\n    \"dat.gui\": \"^0.7.9\",\n    \"eslint\": \"^8.57.0\",\n    \"eslint-plugin-react-hooks\": \"^4.6.0\",\n    \"eslint-plugin-react-refresh\": \"^0.4.6\",\n    \"postcss\": \"^8.4.38\",\n    \"tailwindcss\": \"^3.4.3\",\n    \"typescript\": \"^5.2.2\",\n    \"vite\": \"^5.2.0\"\n  }\n}\n"
  },
  {
    "path": "postcss.config.js",
    "content": "export default {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n}\n"
  },
  {
    "path": "src/App.tsx",
    "content": "import { ThreeSceneV1 } from './ThreeSceneV1';\nimport { ThreeSceneV2 } from './ThreeSceneV2';\n\nfunction App() {\n  const version = 'v2';\n  const map = {\n    v1: <ThreeSceneV1 />,\n    v2: <ThreeSceneV2 />,\n  }[version];\n\n  return (\n    <>\n      <div>{map}</div>\n    </>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "src/ThreeSceneV1.tsx",
    "content": "import { useEffect, useRef } from 'react';\nimport * as Three from 'three';\nimport { OrbitControls } from 'three/examples/jsm/Addons.js';\nimport vertexV1 from './shaders/vertexV1.glsl?raw';\nimport fragmentV1 from './shaders/fragmentV1.glsl?raw';\n\nconst generateCube = (p: Three.Vector3 = new Three.Vector3(0, 0, 0)) => {\n  const geo1 = new Three.BoxGeometry(1, 1, 1);\n  const mat1 = new Three.MeshBasicMaterial({ color: 0x00ff00 });\n  const cube = new Three.Mesh(geo1, mat1);\n  cube.position.set(p.x, p.y, p.z);\n  return cube;\n};\n\nexport const ThreeSceneV1 = () => {\n  const canvasRef = useRef(null);\n\n  useEffect(() => {\n    if (canvasRef.current === null) {\n      return;\n    }\n\n    const width = window.innerWidth;\n    const height = window.innerHeight;\n    const renderer = new Three.WebGLRenderer({ canvas: canvasRef.current });\n    renderer.setSize(width, height);\n\n    const myCamera = new Three.PerspectiveCamera(75, width / height, 0.1, 1000);\n    myCamera.position.set(0, 0, -5);\n    myCamera.lookAt(new Three.Vector3(0, 0, 0));\n    myCamera.up.set(0, 1, 0);\n\n    const scene = new Three.Scene();\n    const cube1 = generateCube(new Three.Vector3(-2, 0, 0));\n    const cube2 = generateCube(new Three.Vector3(2, 0, 0));\n    scene.add(cube1);\n    scene.add(cube2);\n\n    // const geo1 = new Three.PlaneGeometry(2, 2, 2);\n    const geo1 = new Three.BoxGeometry(2, 2, 2);\n    const mat1 = new Three.ShaderMaterial({\n      uniforms: {\n        u_camera: {\n          value: myCamera.position,\n        },\n        u_resolution: {\n          value: new Three.Vector3(width, height, 1),\n        },\n      },\n      vertexShader: vertexV1,\n      fragmentShader: fragmentV1,\n    });\n    const m1 = new Three.Mesh(geo1, mat1);\n    // Changing this position will change world space coords of the mesh.\n    // Since transform camera coordinates to object space, this will\n    // also work on the ray march. Same for rotataion + scale.\n    // m1.position.x = 2;\n    // m1.rotation.x = 10;\n    // m1.scale.x = 2;\n    scene.add(m1);\n\n    const controls = new OrbitControls(myCamera, renderer.domElement);\n\n    const animate = () => {\n      controls.update();\n      renderer.render(scene, myCamera);\n      requestAnimationFrame(animate);\n    };\n    animate();\n  }, []);\n\n  return (\n    <>\n      <canvas ref={canvasRef}></canvas>\n    </>\n  );\n};\n"
  },
  {
    "path": "src/ThreeSceneV2.tsx",
    "content": "import { useEffect, useRef, useState } from 'react';\nimport * as Three from 'three';\nimport { GUI } from 'dat.gui';\nimport { OrbitControls } from 'three/examples/jsm/Addons.js';\nimport Stats from 'three/addons/libs/stats.module.js';\nimport vertexV2 from './shaders/vertexV2.glsl?raw';\nimport fragmentV2 from './shaders/fragmentV2.glsl?raw';\n\nconst handleVolumeFileUpload = (event: any, dim: number, setDataFn: any) => {\n  const file = event.target.files[0];\n  const reader = new FileReader();\n  reader.onload = (e: any) => {\n    const arrayBuffer = e.target.result;\n\n    const uint8Array = new Uint8Array(arrayBuffer);\n    // Assuming the raw file contains 256x256x256 uint8 values\n    const data = new Uint8Array(dim * dim * dim);\n    for (let i = 0; i < uint8Array.length; i++) {\n      data[i] = uint8Array[i];\n    }\n    setDataFn(data);\n  };\n  reader.readAsArrayBuffer(file);\n};\n\nconst initData = (canvasRef: any, volumeData: any, dim: number) => {\n  const width = window.innerWidth;\n  const height = window.innerHeight;\n\n  const camera = new Three.PerspectiveCamera(75, width / height, 0.1, 1000);\n  camera.position.set(0, 0, -2);\n  camera.lookAt(new Three.Vector3(0, 0, 0));\n  camera.up.set(0, 1, 0);\n\n  const renderer = new Three.WebGLRenderer({ canvas: canvasRef.current });\n  const stats = new Stats();\n  const clock = new Three.Clock();\n  const controls = new OrbitControls(camera, renderer.domElement);\n\n  renderer.setSize(width, height);\n  clock.start();\n  document.body.appendChild(stats.dom);\n\n  const gui = new GUI();\n  const folder = gui.addFolder('Display Settings');\n  folder.open();\n\n  const crossFolder = folder.addFolder('Cross Section Settings');\n  const crossSectionSize = new Three.Vector3(0.5, 0.5, 0.5);\n  crossFolder.add(crossSectionSize, 'x', 0.02, 0.5, 0.02);\n  crossFolder.add(crossSectionSize, 'y', 0.02, 0.5, 0.02);\n  crossFolder.add(crossSectionSize, 'z', 0.02, 0.5, 0.02);\n  crossFolder.open();\n\n  const volumeDataTexture = new Three.Data3DTexture(volumeData, dim, dim, dim);\n  volumeDataTexture.format = Three.RedFormat;\n  // volumeDataTexture.type = Three.UnsignedByteType;\n  volumeDataTexture.minFilter = Three.LinearFilter;\n  volumeDataTexture.magFilter = Three.LinearFilter;\n  // volumeDataTexture.wrapS = Three.RepeatWrapping;\n  volumeDataTexture.wrapT = Three.RepeatWrapping;\n  // volumeDataTexture.wrapR = Three.RepeatWrapping;\n  volumeDataTexture.needsUpdate = true;\n  console.log(volumeDataTexture);\n\n  const uniforms = {\n    u_camera: {\n      value: camera.position,\n    },\n    u_resolution: {\n      value: new Three.Vector3(width, height, 1),\n    },\n    u_dt: {\n      value: 0.01,\n    },\n    u_time: {\n      value: 0.0,\n    },\n    u_crossSectionSize: {\n      value: crossSectionSize,\n    },\n    u_color: {\n      value: 1,\n    },\n    u_volume: {\n      value: volumeDataTexture,\n    },\n    u_isoValue: {\n      value: 1,\n    },\n    u_alphaVal: {\n      value: 0.2,\n    },\n  };\n\n  const algoFolder = folder.addFolder('Algorithm Settings');\n  algoFolder.add(uniforms.u_dt, 'value', 0.004, 0.016, 0.002).name('step size');\n  algoFolder.add(uniforms.u_color, 'value', 1, 3, 1).name('color');\n  const alphaSetting = algoFolder\n    .add(uniforms.u_alphaVal, 'value', 0.01, 0.4, 0.01)\n    .name('alpha val');\n  algoFolder.add(uniforms.u_isoValue, 'value', 0, 1, 0.04).name('iso value');\n  algoFolder.open();\n\n  return {\n    camera,\n    stats,\n    clock,\n    uniforms,\n    gui,\n    renderer,\n    controls,\n    alphaSetting,\n  };\n};\n\nexport const ThreeSceneV2 = () => {\n  const dim = 256;\n  const canvasRef = useRef(null);\n  const [volumeData, setVolumeData] = useState<Uint8Array | null>(null);\n\n  useEffect(() => {\n    if (canvasRef.current === null) {\n      console.log('No canvas!');\n      return;\n    }\n\n    if (volumeData === null) {\n      console.log('No volume data!');\n      return;\n    }\n\n    // todo: I should clean this up...\n    const { camera, stats, clock, uniforms, gui, renderer, controls } =\n      initData(canvasRef, volumeData, dim);\n\n    // Note: Plane works, but looks very weird...\n    // const geo1 = new Three.PlaneGeometry(2, 2, 2);\n    const scene = new Three.Scene();\n    const geo1 = new Three.BoxGeometry(2, 2, 2);\n    const mat1 = new Three.ShaderMaterial({\n      uniforms: { ...uniforms },\n      vertexShader: vertexV2,\n      fragmentShader: fragmentV2,\n    });\n    const mesh1 = new Three.Mesh(geo1, mat1);\n    mesh1.rotateY(Math.PI / 2);\n    scene.add(mesh1);\n\n    const animate = () => {\n      controls.update();\n      stats.update();\n      renderer.render(scene, camera);\n      uniforms.u_time.value = clock.getElapsedTime();\n      requestAnimationFrame(animate);\n    };\n\n    animate();\n\n    return () => {\n      document.body.removeChild(stats.dom);\n      stats.end();\n      gui.destroy();\n    };\n  }, [volumeData]);\n\n  return (\n    <>\n      <div className=\"absolute top-16\">\n        <input\n          type=\"file\"\n          onChange={(e) => handleVolumeFileUpload(e, dim, setVolumeData)}\n        />\n      </div>\n      <canvas ref={canvasRef}></canvas>\n    </>\n  );\n};\n"
  },
  {
    "path": "src/index.css",
    "content": ":root {\n  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;\n  line-height: 1.5;\n  font-weight: 400;\n\n  color-scheme: light dark;\n  color: rgba(255, 255, 255, 0.87);\n  background-color: #242424;\n\n  font-synthesis: none;\n  text-rendering: optimizeLegibility;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\na {\n  font-weight: 500;\n  color: #646cff;\n  text-decoration: inherit;\n}\na:hover {\n  color: #535bf2;\n}\n\nbody {\n  margin: 0;\n  display: flex;\n  place-items: center;\n  min-width: 320px;\n  min-height: 100vh;\n}\n\nh1 {\n  font-size: 3.2em;\n  line-height: 1.1;\n}\n\nbutton {\n  border-radius: 8px;\n  border: 1px solid transparent;\n  padding: 0.6em 1.2em;\n  font-size: 1em;\n  font-weight: 500;\n  font-family: inherit;\n  background-color: #1a1a1a;\n  cursor: pointer;\n  transition: border-color 0.25s;\n}\nbutton:hover {\n  border-color: #646cff;\n}\nbutton:focus,\nbutton:focus-visible {\n  outline: 4px auto -webkit-focus-ring-color;\n}\n\n@media (prefers-color-scheme: light) {\n  :root {\n    color: #213547;\n    background-color: #ffffff;\n  }\n  a:hover {\n    color: #747bff;\n  }\n  button {\n    background-color: #f9f9f9;\n  }\n}\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"
  },
  {
    "path": "src/main.tsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App.tsx';\nimport './index.css';\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n);\n"
  },
  {
    "path": "src/shaders/fragmentV1.glsl",
    "content": "uniform vec3 u_camera;\nuniform vec3 u_resolution;\n\nvarying vec3 v_hitPos;\nvarying vec3 v_hitPosWorldSpace;\nvarying vec3 v_cameraObjectSpace;\n\nfloat sdCircle(vec3 p, float r) {\n  return length(p) - r;\n}\n\nfloat sdTorus(vec3 p, vec2 t) {\n  vec2 q = vec2(length(p.xz) - t.x, p.y);\n  return length(q) - t.y;\n}\n\nfloat map(vec3 p) {\n  // return sdCircle(p, 0.5);\n  return sdTorus(p, vec2(0.5, 0.2));\n}\n\nvoid main() {\n  vec3 rayOrigin = vec3(0.0, 0.0, -3.0);\n  // rayOrigin = u_camera;\n  rayOrigin = v_cameraObjectSpace;\n\n  vec2 uv = 2.0 * gl_FragCoord.xy / u_resolution.xy - 1.0;\n  vec3 rayDir = normalize(vec3(uv, 1.0));\n  // rayDir = normalize(vec3(uv, 1.0) - rayOrigin);\n  rayDir = normalize(v_hitPos - rayOrigin);\n  // rayDir = normalize(v_hitPosWorldSpace - rayOrigin);\n\n  float totalDistance = 0.0;\n  bool discardCheck = true;\n\n  for (int i = 0; i < 32; i++) {\n    vec3 p = rayOrigin + rayDir * totalDistance;\n\n    float d = map(p);\n\n    totalDistance += d;\n\n    if (d < 0.001) {\n      discardCheck = false;\n      break;\n    }\n\n    if (totalDistance >= 100.0) {\n      // If you want to truly discard, set discardCheck to true here.\n      // discardCheck = true;\n      discardCheck = false;\n      break;\n    }\n  }\n\n  if (discardCheck) {\n    discard;\n  }\n\n  gl_FragColor = vec4(1.0);\n  gl_FragColor.xyz = rayDir;\n  gl_FragColor.xyz = vec3(totalDistance * 0.1);\n}"
  },
  {
    "path": "src/shaders/fragmentV2.glsl",
    "content": "precision mediump int;\nprecision mediump float;\n\nuniform vec3 u_camera;\nuniform vec3 u_resolution;\nuniform mediump sampler3D u_volume;\nuniform vec3 u_crossSectionSize;\nuniform float u_dt;\nuniform float u_time;\nuniform float u_color;\nuniform float u_isoValue;\nuniform float u_alphaVal;\n\n// Inigo Quilez - https://iquilezles.org/articles/palettes/\nvec3 palette(in float t) {\n  vec3 a = vec3(0.5, 0.5, 0.5);\n  vec3 b = vec3(0.5, 0.5, 0.5);\n  vec3 c = vec3(1.0, 1.0, 1.0);\n  vec3 d = vec3(0.00, 0.33, 0.67);\n\n  return a + b * cos(6.28318 * (c * t + d));\n}\n\nvarying vec3 v_hitPos;\nvarying vec3 v_hitPosWorldSpace;\nvarying vec3 v_cameraObjectSpace;\n\n// Will Usher - https://www.willusher.io/webgl/2019/01/13/volume-rendering-with-webgl\nvec2 intersect_box(vec3 orig, vec3 dir) {\n  // note: used this for testing purposes\n  // const float halfBoxSize = 0.5;\n  // const vec3 box_min = vec3(-halfBoxSize);\n  // const vec3 box_max = vec3(halfBoxSize);\n\n  vec3 box_min = vec3(-u_crossSectionSize);\n  vec3 box_max = vec3(u_crossSectionSize);\n  vec3 inv_dir = 1.0 / dir;\n  vec3 tmin_tmp = (box_min - orig) * inv_dir;\n  vec3 tmax_tmp = (box_max - orig) * inv_dir;\n  vec3 tmin = min(tmin_tmp, tmax_tmp);\n  vec3 tmax = max(tmin_tmp, tmax_tmp);\n  float t0 = max(tmin.x, max(tmin.y, tmin.z));\n  float t1 = min(tmax.x, min(tmax.y, tmax.z));\n  return vec2(t0, t1);\n}\n\nvoid main() {\n  vec3 rayOrigin = vec3(0.0, 0.0, -3.0);\n  // rayOrigin = u_camera;\n  rayOrigin = v_cameraObjectSpace;\n\n  vec2 uv = 2.0 * gl_FragCoord.xy / u_resolution.xy - 1.0;\n  vec3 rayDir = normalize(vec3(uv, 1.0));\n  // rayDir = normalize(vec3(uv, 1.0) - rayOrigin);\n  rayDir = normalize(v_hitPos - rayOrigin);\n  // rayDir = normalize(v_hitPosWorldSpace - rayOrigin);\n\n  // Step 2: Intersect the ray with the volume bounds to find the interval\n  // along the ray overlapped by the volume.\n  vec2 t_hit = intersect_box(rayOrigin, rayDir);\n  if (t_hit.x > t_hit.y) {\n    discard;\n  }\n\n  // We don't want to sample voxels behind the eye if it's\n  // inside the volume, so keep the starting point at or in front\n  // of the eye\n  t_hit.x = max(t_hit.x, 0.0);\n\n  // Step 3: Compute the step size to march through the volume grid\n  // vec3 dt_vec = 1.0 / (vec3(20.0) * abs(rayDir));\n\n  // float dt = min(dt_vec.x, min(dt_vec.y, dt_vec.z));\n  // float dt = 0.002;\n  float dt = u_dt;\n\n  vec4 color = vec4(0.0);\n\n  // note: 0.5 offset centers on cube\n  vec3 p = rayOrigin + t_hit.x * rayDir + 0.5;\n  for (float t = t_hit.x; t < t_hit.y; t += dt) {\n    // note: used this for testing purposes\n    // float textureVal = texture(u_volume, vec3(0.4, 0.2, 0.4)).r;\n\n    float textureVal = texture(u_volume, p).r;\n\n    vec4 val_color = vec4(0.0);\n    float val_color_alpha = textureVal * 0.1;\n\n    // looks a little nicer when using this alpha\n    // val_color_alpha = smoothstep(0.0, 0.25, textureVal * 0.1);\n\n    // looks even nicer\n    val_color_alpha = smoothstep(0.0, u_alphaVal, val_color_alpha);\n\n    vec3 red = vec3(1.0, 0.0, 0.0);\n    vec3 white = vec3(1.0);\n    if (abs(u_color - 1.0) <= 0.01) {\n      val_color = vec4(white, val_color_alpha);\n    } else if (abs(u_color - 2.0) <= 0.01) {\n      val_color = vec4(mix(red, white, val_color_alpha), val_color_alpha);\n    } else {\n      val_color = vec4(palette(textureVal), val_color_alpha);\n    }\n\n    // Step 4.2: Accumulate the color and opacity using the front-to-back\n    // compositing equation\n    color.rgb += (1.0 - color.a) * val_color.a * val_color.rgb;\n    color.a += (1.0 - color.a) * val_color.a;\n\n    // todo: Add blinn-phong lighting? (done, kinda)\n    // todo: Iso value slider? (done, kinda)\n    // todo: Clean this up? (Is this even the right approach?)\n    if (textureVal > u_isoValue) {\n      // calculate normal at point by central differences method\n      float gxLess = texture(u_volume, vec3(p.x - rayDir.x * u_dt, p.y, p.z)).r;\n      float gxMore = texture(u_volume, vec3(p.x + rayDir.x * u_dt, p.y, p.z)).r;\n      float dgx = gxMore - gxLess;\n\n      float gyLess = texture(u_volume, vec3(p.x, p.y - rayDir.y * u_dt, p.z)).r;\n      float gyMore = texture(u_volume, vec3(p.x, p.y + rayDir.y * u_dt, p.z)).r;\n      float dgy = gyMore - gyLess;\n\n      float gzLess = texture(u_volume, vec3(p.x, p.y, p.z - rayDir.z * u_dt)).r;\n      float gzMore = texture(u_volume, vec3(p.x, p.y, p.z + rayDir.z * u_dt)).r;\n      float dgz = gzMore - gzLess;\n      vec3 n = normalize(vec3(dgx, dgy, dgz));\n\n      // calculate diffuse lighting\n      vec3 lightSource = vec3(1.0);\n      vec3 lightDir = normalize(lightSource);\n      float diffuseStrength = max(dot(n, lightDir), 0.0);\n\n      // calculate specular lighting\n      vec3 viewSource = normalize(rayOrigin);\n      vec3 reflectSource = normalize(reflect(-lightSource, n));\n      float specularStrength = max(0.0, dot(viewSource, reflectSource));\n      specularStrength = pow(specularStrength, 64.0);\n\n      // add lighting\n      color.rgb = diffuseStrength * val_color.rgb + specularStrength * val_color.rgb;\n      color.rgb *= val_color.rgb;\n      color.a = 0.95;\n      break;\n    }\n\n    // Optimization: break out of the loop when the color is near opaque\n    if (color.a >= 0.95) {\n      break;\n    }\n\n    p += rayDir * dt;\n  }\n\n  gl_FragColor = color;\n}"
  },
  {
    "path": "src/shaders/vertexV1.glsl",
    "content": "uniform vec3 u_camera; // default in world space\nuniform vec3 u_resolution;\n\n// The Art of Code: https://www.youtube.com/watch?v=S8AWd66hoCo\n// It is important to keep camera + (vertex) position in same space.\n// We can either move (vertex) position to world space, or the camera\n// to object space. In this example, we transform camera to object\n// space and use that as the rayOrigin in the fragment shader.\n\nvarying vec3 v_hitPos; // default in object space\nvarying vec3 v_hitPosWorldSpace;\nvarying vec3 v_cameraObjectSpace;\n\nvoid main() {\n  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n\n  v_hitPos = position.xyz;\n\n  // In this case, we move the (vertex) position to world space.\n  // Notice we multiply by modelMatrix, not modelViewMatrix.\n  v_hitPosWorldSpace = (modelMatrix * vec4(position, 1.0)).xyz;\n\n  // In this case, we move the camera to object space.\n  // Notice we use inverse(modelMatrix) + put camera in homogeneous coords.\n  v_cameraObjectSpace = (inverse(modelMatrix) * vec4(u_camera, 1.0)).xyz;\n}"
  },
  {
    "path": "src/shaders/vertexV2.glsl",
    "content": "precision mediump float;\n\nuniform vec3 u_camera; // default in world space\nuniform vec3 u_resolution;\nuniform float u_time;\n\n// The Art of Code - https://www.youtube.com/watch?v=S8AWd66hoCo\n// It is important to keep camera + (vertex) position in same space.\n// We can either move (vertex) position to world space, or the camera\n// to object space. In this example, we transform camera to object\n// space and use that as the rayOrigin in the fragment shader.\n\nvarying vec3 v_hitPos; // default in object space\nvarying vec3 v_hitPosWorldSpace;\nvarying vec3 v_cameraObjectSpace;\n\nvoid main() {\n  // Three.js variables: position, projectionMatrix, modelViewMatrix, modelMatrix\n  vec3 pos = position;\n\n  gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n  v_hitPos = position.xyz;\n\n  // In this case, we move the (vertex) position to world space.\n  // Notice we multiply by modelMatrix, not modelViewMatrix.\n  v_hitPosWorldSpace = (modelMatrix * vec4(position, 1.0)).xyz;\n\n  // In this case, we move the camera to object space.\n  // Notice we use inverse(modelMatrix) + put camera in homogeneous coords.\n  v_cameraObjectSpace = (inverse(modelMatrix) * vec4(u_camera, 1.0)).xyz;\n}"
  },
  {
    "path": "src/vite-env.d.ts",
    "content": "/// <reference types=\"vite/client\" />\n"
  },
  {
    "path": "tailwind.config.js",
    "content": "/** @type {import('tailwindcss').Config} */\nexport default {\n  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n};\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"useDefineForClassFields\": true,\n    \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n    \"module\": \"ESNext\",\n    \"skipLibCheck\": true,\n\n    /* Bundler mode */\n    \"moduleResolution\": \"bundler\",\n    \"allowImportingTsExtensions\": true,\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"noEmit\": true,\n    \"jsx\": \"react-jsx\",\n\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"noFallthroughCasesInSwitch\": true\n  },\n  \"include\": [\"src\"],\n  \"references\": [{ \"path\": \"./tsconfig.node.json\" }]\n}\n"
  },
  {
    "path": "tsconfig.node.json",
    "content": "{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"allowSyntheticDefaultImports\": true,\n    \"strict\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n"
  },
  {
    "path": "vite.config.ts",
    "content": "import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\n\nexport default defineConfig({\n  plugins: [react()],\n});\n"
  }
]