{"version":3,"sources":["ColorModeSwitcher.tsx","useStickyState.ts","SourcesModal.tsx","App.tsx","serviceWorker.ts","index.tsx"],"names":["ColorModeSwitcher","props","toggleColorMode","useColorMode","text","useColorModeValue","SwitchIcon","FaMoon","FaSun","size","fontSize","variant","color","marginLeft","onClick","icon","aria-label","useStickyState","defaultValue","key","useState","stickyValue","localStorage","getItem","JSON","parse","value","setValue","useEffect","setItem","stringify","checkIfUsableSource","source","Array","isArray","intros","insults","oneoffs","SourcesModal","isOpen","onClose","sources","setSources","isTryingToFetch","setIsTryingToFetch","toAdd","setToAdd","justifyContent","alignItems","p","length","map","index","px","replace","newSrc","slice","splice","spacing","onChange","event","target","placeholder","fetch","then","res","json","src","ok","Error","cur","alert","catch","err","fixToAdd","str","test","mt","colorScheme","leftIcon","as","href","makeInsult","getInt","max","Math","floor","random","a","b","c","App","isLoading","setIsLoading","insult","setInsult","undefined","setInsults","useDisclosure","onOpen","Promise","allSettled","url","x","ins","status","reduce","acc","theme","textAlign","m","minH","encodeURI","Boolean","window","location","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister","error","console","message"],"mappings":"8RAWaA,EAAsD,SAACC,GAAW,IACrEC,EAAoBC,cAApBD,gBACFE,EAAOC,YAAkB,OAAQ,SACjCC,EAAaD,YAAkBE,IAAQC,KAE7C,OACE,cAAC,IAAD,aACEC,KAAK,KACLC,SAAS,KACTC,QAAQ,QACRC,MAAM,UACNC,WAAW,IACXC,QAASZ,EACTa,KAAM,cAACT,EAAD,IACNU,aAAA,oBAAyBZ,EAAzB,UACIH,KCAKgB,EAhBQ,SACrBC,EACAC,GAC4C,IAAD,EACjBC,oBAAS,WACjC,IAAMC,EAAcC,aAAaC,QAAQJ,GACzC,OAAuB,OAAhBE,EAAuBG,KAAKC,MAAMJ,GAAeH,KAHf,mBACpCQ,EADoC,KAC7BC,EAD6B,KAU3C,OAJAC,qBAAU,WACRN,aAAaO,QAAQV,EAAKK,KAAKM,UAAUJ,MACx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C,IAAD,IACA,cAAC,EAAD,OAEFC,SAASC,eAAe,SD6HpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB5D,MAAK,SAAC6D,GACLA,EAAaC,gBAEdtD,OAAM,SAACuD,GACNC,QAAQD,MAAMA,EAAME,c","file":"static/js/main.d2d47412.chunk.js","sourcesContent":["import * as React from \"react\";\nimport {\n useColorMode,\n useColorModeValue,\n IconButton,\n IconButtonProps,\n} from \"@chakra-ui/react\";\nimport { FaMoon, FaSun } from \"react-icons/fa\";\n\ntype ColorModeSwitcherProps = Omit;\n\nexport const ColorModeSwitcher: React.FC = (props) => {\n const { toggleColorMode } = useColorMode();\n const text = useColorModeValue(\"dark\", \"light\");\n const SwitchIcon = useColorModeValue(FaMoon, FaSun);\n\n return (\n }\n aria-label={`Switch to ${text} mode`}\n {...props}\n />\n );\n};\n","import { SetStateAction, useEffect, useState } from \"react\";\n\n/* Original JS code: \nhttps://www.joshwcomeau.com/react/persisting-react-state-in-localstorage/ */\n\n/**\n * Returns a stateful value, based on localStorage, and a function to update it.\n * @param defaultValue Default value for the value\n * @param key Key used to get/set inside localStorage\n */\nconst useStickyState = (\n defaultValue: T,\n key: string\n): [T, React.Dispatch>] => {\n const [value, setValue] = useState(() => {\n const stickyValue = localStorage.getItem(key);\n return stickyValue !== null ? JSON.parse(stickyValue) : defaultValue;\n });\n\n useEffect(() => {\n localStorage.setItem(key, JSON.stringify(value));\n }, [key, value]);\n\n return [value, setValue];\n};\n\nexport default useStickyState;\n","import {\n Modal,\n ModalOverlay,\n ModalContent,\n Text,\n ModalHeader,\n Flex,\n Heading,\n IconButton,\n ModalBody,\n HStack,\n Spinner,\n Input,\n ModalFooter,\n Button,\n Code,\n VStack,\n} from \"@chakra-ui/react\";\nimport React, { useState } from \"react\";\nimport {\n FaTimes,\n FaTrash,\n FaPlus,\n FaGithub,\n FaHtml5,\n FaTrashRestore,\n} from \"react-icons/fa\";\n\ninterface SourcesModalProps {\n isOpen: boolean;\n onClose: () => void;\n sources: string[];\n setSources: React.Dispatch>;\n}\n\nconst checkIfUsableSource = (source: any) => {\n try {\n if (\n Array.isArray(source.intros) &&\n Array.isArray(source.insults) &&\n Array.isArray(source.oneoffs)\n )\n return true;\n else return false;\n } catch {\n return false;\n }\n};\n\nexport const SourcesModal = ({\n isOpen,\n onClose,\n sources,\n setSources,\n}: SourcesModalProps) => {\n const [isTryingToFetch, setIsTryingToFetch] = useState(false);\n const [toAdd, setToAdd] = useState(\"\");\n\n return (\n \n \n \n \n \n Settings\n }\n p={0}\n />\n \n \n\n \n \n \n You can add more external sources (in JSON format) to generate\n even more messages. For example: add{\" \"}\n cmp.neocities.org/ted.json Note that the more sources\n you add, the longer the page will load for.\n \n\n Current sources:\n \n\n {sources.length === 0 ? (\n \n You don't have any sources.\n \n ) : (\n sources.map((source, index) => (\n \n \n {source.replace(\"https://thingproxy.freeboard.io/fetch/\", \"\")}\n \n }\n aria-label={`Delete ${source}`}\n variant=\"outline\"\n onClick={() => {\n const newSrc = sources.slice();\n newSrc.splice(index, 1);\n setSources(newSrc);\n }}\n />\n \n ))\n )}\n {isTryingToFetch && (\n \n \n Loading...\n \n )}\n \n \n setToAdd((event.target as HTMLInputElement).value)\n }\n placeholder=\"Add source...\"\n />\n }\n aria-label=\"Add source\"\n onClick={() => {\n setIsTryingToFetch(true);\n fetch(toAdd)\n .then((res) =>\n res.json().then((src) => {\n if (!res.ok) throw new Error();\n if (checkIfUsableSource(src)) {\n setSources((cur) => [...cur, toAdd]);\n } else {\n alert(\"Unusable source\");\n }\n })\n )\n .catch((err) => {\n const fixToAdd = (str: string) =>\n !/^((http|https):\\/\\/)/.test(str)\n ? `https://${str}`\n : str;\n fetch(\n `https://thingproxy.freeboard.io/fetch/${fixToAdd(toAdd)}`\n )\n .then((res) =>\n res.json().then((src) => {\n if (!res.ok) throw new Error();\n if (checkIfUsableSource(src)) {\n setSources((cur) => [\n ...cur,\n `https://thingproxy.freeboard.io/fetch/${fixToAdd(\n toAdd\n )}`,\n ]);\n } else {\n alert(\"Unusable source\");\n }\n })\n )\n .catch((err) => {\n alert(\"Wrong URL.\");\n });\n });\n setIsTryingToFetch(false);\n\n setToAdd(\"\");\n }}\n />\n \n \n }\n onClick={() => {\n setSources([\"./main.json\"]);\n }}\n >\n Reset defaults\n \n \n \n \n \n \n }\n >\n Source\n \n \n \n \n \n \n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport {\n ChakraProvider,\n Box,\n Text,\n VStack,\n theme,\n Button,\n Heading,\n HStack,\n IconButton,\n Center,\n useDisclosure,\n Spinner,\n} from \"@chakra-ui/react\";\nimport { ColorModeSwitcher } from \"./ColorModeSwitcher\";\nimport { FaTwitter, FaCog, FaWrench } from \"react-icons/fa\";\nimport useStickyState from \"./useStickyState\";\nimport { SourcesModal } from \"./SourcesModal\";\n\ninterface InsultFile {\n intros: string[];\n insults: string[];\n oneoffs: string[];\n}\n\nconst makeInsult = (insults: any) => {\n const getInt = (max: number) => Math.floor(Math.random() * Math.floor(max));\n\n const a = getInt(insults.intros.length),\n b = getInt(insults.insults.length),\n c = getInt(insults.oneoffs.length),\n d = getInt(3);\n\n if (d <= 1) {\n return `@tedcruz ${insults.intros[a]} ${insults.insults[b]}`;\n } else {\n return `@tedcruz ${insults.oneoffs[c]}`;\n }\n};\n\nexport const App: React.FC = () => {\n const [isLoading, setIsLoading] = useState(true);\n const [insult, setInsult] = useState(\"\");\n const [insults, setInsults] = useState(undefined);\n const { isOpen, onOpen, onClose } = useDisclosure();\n const [sources, setSources] = useStickyState(\n [\"./main.json\"],\n \"insultSources\"\n );\n\n useEffect(() => {\n Promise.allSettled(\n sources.map((url: string) => fetch(url).then((x) => x.json()))\n )\n .then((res) => {\n const insultSources = res.map(\n (c) => c.status === \"fulfilled\" && c.value\n );\n const ins = insultSources.reduce(\n (acc, cur) => ({\n intros: [...acc.intros, ...cur.intros],\n insults: [...acc.insults, ...cur.insults],\n oneoffs: [...acc.oneoffs, ...cur.oneoffs],\n }),\n {\n intros: [],\n insults: [],\n oneoffs: [],\n }\n );\n setInsults(ins);\n setInsult(makeInsult(ins));\n setIsLoading(false);\n })\n .catch((err) => {\n setIsLoading(false);\n setInsult(\n \"Wrong configuration. Try editing settings from the top right.\"\n );\n });\n }, [sources]);\n\n return (\n \n \n \n \n }\n aria-label={`Settings`}\n />\n \n
\n \n \n Ted Cruz Tweet Generator\n Tell him what you think of him, with 0 effort!\n \n\n {isLoading ? (\n \n \n Loading...\n \n ) : (\n <>\n \n {\n setInsult(makeInsult(insults));\n }}\n leftIcon={}\n colorScheme=\"blue\"\n >\n Generate\n \n\n }\n colorScheme=\"blue\"\n >\n Tweet\n \n \n\n {insult}\n \n )}\n \n
\n
\n\n \n
\n );\n};\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://cra.link/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\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: 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://cra.link/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: string, config?: 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://cra.link/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 is 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: string, config?: 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 { ColorModeScript } from \"@chakra-ui/react\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { App } from \"./App\";\nimport * as serviceWorker from \"./serviceWorker\";\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://cra.link/PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}