8 lines
29 KiB
Plaintext
8 lines
29 KiB
Plaintext
{
|
|
"version": 3,
|
|
"sources": ["lib/hooks/useDebouncedCallback.ts", "components/Checkbox.tsx", "components/Rating.tsx", "components/Image.tsx", "components/Emoji.tsx", "islands/Search.tsx"],
|
|
"sourcesContent": ["import { useEffect, useMemo, useRef } from \"preact/hooks\";\n\nexport interface CallOptions {\n /**\n * Controls if the function should be invoked on the leading edge of the timeout.\n */\n leading?: boolean;\n /**\n * Controls if the function should be invoked on the trailing edge of the timeout.\n */\n trailing?: boolean;\n}\n\nexport interface Options extends CallOptions {\n /**\n * The maximum time the given function is allowed to be delayed before it's invoked.\n */\n maxWait?: number;\n}\n\nexport interface ControlFunctions {\n /**\n * Cancel pending function invocations\n */\n cancel: () => void;\n /**\n * Immediately invoke pending function invocations\n */\n flush: () => void;\n /**\n * Returns `true` if there are any pending function invocations\n */\n isPending: () => boolean;\n}\n\n/**\n * Subsequent calls to the debounced function `debounced.callback` return the result of the last func invocation.\n * Note, that if there are no previous invocations it's mean you will get undefined. You should check it in your code properly.\n */\nexport interface DebouncedState<T extends (...args: any) => ReturnType<T>>\n extends ControlFunctions {\n (...args: Parameters<T>): ReturnType<T> | undefined;\n}\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked, or until the next browser frame is drawn.\n *\n * The debounced function comes with a `cancel` method to cancel delayed `func`\n * invocations and a `flush` method to immediately invoke them.\n *\n * Provide `options` to indicate whether `func` should be invoked on the leading\n * and/or trailing edge of the `wait` timeout. The `func` is invoked with the\n * last arguments provided to the debounced function.\n *\n * Subsequent calls to the debounced function return the result of the last\n * `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * If `wait` is omitted in an environment with `requestAnimationFrame`, `func`\n * invocation will be deferred until the next frame is drawn (typically about\n * 16ms).\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `debounce` and `throttle`.\n *\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0]\n * The number of milliseconds to delay; if omitted, `requestAnimationFrame` is\n * used (if available, otherwise it will be setTimeout(...,0)).\n * @param {Object} [options={}] The options object.\n * Controls if `func` should be invoked on the leading edge of the timeout.\n * @param {boolean} [options.leading=false]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {number} [options.maxWait]\n * Controls if `func` should be invoked the trailing edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * const resizeHandler = useDebouncedCallback(calculateLayout, 150);\n * window.addEventListener('resize', resizeHandler)\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * const clickHandler = useDebouncedCallback(sendMail, 300, {\n * leading: true,\n * trailing: false,\n * })\n * <button onClick={clickHandler}>click me</button>\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * const debounced = useDebouncedCallback(batchLog, 250, { 'maxWait': 1000 })\n * const source = new EventSource('/stream')\n * source.addEventListener('message', debounced)\n *\n * // Cancel the trailing debounced invocation.\n * window.addEventListener('popstate', debounced.cancel)\n *\n * // Check for pending invocations.\n * const status = debounced.pending() ? \"Pending...\" : \"Ready\"\n */\nexport default function useDebouncedCallback<\n T extends (...args: any) => ReturnType<T>,\n>(\n func: T,\n wait?: number,\n options?: Options,\n): DebouncedState<T> {\n const lastCallTime = useRef(null);\n const lastInvokeTime = useRef(0);\n const timerId = useRef(null);\n const lastArgs = useRef<unknown[]>([]);\n const lastThis = useRef<unknown>();\n const result = useRef<ReturnType<T>>();\n const funcRef = useRef(func);\n const mounted = useRef(true);\n\n useEffect(() => {\n funcRef.current = func;\n }, [func]);\n\n // Bypass `requestAnimationFrame` by explicitly setting `wait=0`.\n const useRAF = !wait && wait !== 0 && typeof window !== \"undefined\";\n\n if (typeof func !== \"function\") {\n throw new TypeError(\"Expected a function\");\n }\n\n wait = +wait || 0;\n options = options || {};\n\n const leading = !!options.leading;\n const trailing = \"trailing\" in options ? !!options.trailing : true; // `true` by default\n const maxing = \"maxWait\" in options;\n const maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : null;\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n // You may have a question, why we have so many code under the useMemo definition.\n //\n // This was made as we want to escape from useCallback hell and\n // not to initialize a number of functions each time useDebouncedCallback is called.\n //\n // It means that we have less garbage for our GC calls which improves performance.\n // Also, it makes this library smaller.\n //\n // And the last reason, that the code without lots of useCallback with deps is easier to read.\n // You have only one place for that.\n const debounced = useMemo(() => {\n const invokeFunc = (time: number) => {\n const args = lastArgs.current;\n const thisArg = lastThis.current;\n\n lastArgs.current = lastThis.current = null;\n lastInvokeTime.current = time;\n return (result.current = funcRef.current.apply(thisArg, args));\n };\n\n const startTimer = (pendingFunc: () => void, wait: number) => {\n if (useRAF) cancelAnimationFrame(timerId.current);\n timerId.current = useRAF\n ? requestAnimationFrame(pendingFunc)\n : setTimeout(pendingFunc, wait);\n };\n\n const shouldInvoke = (time: number) => {\n if (!mounted.current) return false;\n\n const timeSinceLastCall = time - lastCallTime.current;\n const timeSinceLastInvoke = time - lastInvokeTime.current;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (\n !lastCallTime.current ||\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxing && timeSinceLastInvoke >= maxWait)\n );\n };\n\n const trailingEdge = (time: number) => {\n timerId.current = null;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs.current) {\n return invokeFunc(time);\n }\n lastArgs.current = lastThis.current = null;\n return result.current;\n };\n\n const timerExpired = () => {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // https://github.com/xnimorz/use-debounce/issues/97\n if (!mounted.current) {\n return;\n }\n // Remaining wait calculation\n const timeSinceLastCall = time - lastCallTime.current;\n const timeSinceLastInvoke = time - lastInvokeTime.current;\n const timeWaiting = wait - timeSinceLastCall;\n const remainingWait = maxing\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n\n // Restart the timer\n startTimer(timerExpired, remainingWait);\n };\n\n const func: DebouncedState<T> = (...args: Parameters<T>): ReturnType<T> => {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs.current = args;\n lastThis.current = this;\n lastCallTime.current = time;\n\n if (isInvoking) {\n if (!timerId.current && mounted.current) {\n // Reset any `maxWait` timer.\n lastInvokeTime.current = lastCallTime.current;\n // Start the timer for the trailing edge.\n startTimer(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(lastCallTime.current) : result.current;\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n startTimer(timerExpired, wait);\n return invokeFunc(lastCallTime.current);\n }\n }\n if (!timerId.current) {\n startTimer(timerExpired, wait);\n }\n return result.current;\n };\n\n func.cancel = () => {\n if (timerId.current) {\n useRAF\n ? cancelAnimationFrame(timerId.current)\n : clearTimeout(timerId.current);\n }\n lastInvokeTime.current = 0;\n lastArgs.current =\n lastCallTime.current =\n lastThis.current =\n timerId.current =\n null;\n };\n\n func.isPending = () => {\n return !!timerId.current;\n };\n\n func.flush = () => {\n return !timerId.current ? result.current : trailingEdge(Date.now());\n };\n\n return func;\n }, [leading, maxing, wait, maxWait, trailing, useRAF]);\n\n return debounced;\n}\n\n", "import { Signal, useSignal } from \"@preact/signals\";\nimport { useId, useState } from \"preact/hooks\";\n\ninterface CheckboxProps {\n label: string;\n isChecked?: boolean;\n onChange: (isChecked: boolean) => void;\n}\n\nconst Checkbox2: preact.FunctionalComponent<CheckboxProps> = (\n { label, isChecked = false, onChange },\n) => {\n const [checked, setChecked] = useState(isChecked);\n\n const toggleCheckbox = () => {\n const newChecked = !checked;\n setChecked(newChecked);\n onChange(newChecked);\n };\n\n return (\n <div\n class=\"flex items-center rounded-xl p-1 pl-4\"\n style={{ background: \"var(--background)\", color: \"var(--foreground)\" }}\n >\n <span>\n {label}\n </span>\n <label\n class=\"relative flex cursor-pointer items-center rounded-full p-3\"\n for=\"checkbox\"\n data-ripple-dark=\"true\"\n >\n <input\n type=\"checkbox\"\n class=\"before:content[''] peer relative h-5 w-5 cursor-pointer appearance-none rounded-md border border-blue-gray-200 transition-all before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10\"\n id=\"checkbox\"\n checked\n />\n <div\n class={`pointer-events-none absolute top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-${\n checked ? 100 : 0\n } transition-opacity`}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-3.5 w-3.5\"\n viewBox=\"0 0 20 20\"\n fill=\"white\"\n stroke=\"currentColor\"\n stroke-width=\"1\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clip-rule=\"evenodd\"\n >\n </path>\n </svg>\n </div>\n </label>\n </div>\n );\n};\n\nconst Checkbox = (\n { label, checked = useSignal(false) }: {\n label: string;\n checked?: Signal<boolean>;\n },\n) => {\n const _id = useId();\n const id = `checkbox-${_id}`;\n return (\n <label\n className=\"flex items-center py-3 px-4 rounded-xl\"\n style={{ color: \"var(--foreground)\", background: \"var(--background)\" }}\n >\n <input\n type=\"checkbox\"\n checked={checked.value}\n name=\"checkbox-one\"\n id={id}\n onChange={(ev) => {\n checked.value = ev.currentTarget.checked;\n }}\n class=\"bg-gray-200 hover:bg-gray-300 cursor-pointer \n w-5 h-5 border-3 border-amber-500 focus:outline-none rounded-lg\"\n />\n <span class=\"ml-3\">{label}</span>\n </label>\n );\n};\n\nexport default Checkbox;\n", "import { IconStar, IconStarFilled } from \"@components/icons.tsx\";\nimport { useSignal } from \"@preact/signals\";\nimport { useState } from \"preact/hooks\";\n\nexport const SmallRating = (\n { max = 5, rating }: { max?: number; rating: number },\n) => {\n return (\n <div\n class=\"flex gap-1 rounded\"\n style={{ filter: \"drop-shadow(0px 3px 3px black)\" }}\n >\n {Array.from({ length: max }).map((_, i) => {\n return (\n <span>\n {(i + 1) <= rating\n ? <IconStarFilled class=\"w-3 h-3\" />\n : <IconStar class=\"w-3 h-3\" />}\n </span>\n );\n })}\n </div>\n );\n};\n\nexport const Rating = (\n props: { max?: number; rating: number },\n) => {\n const [rating, setRating] = useState(props.rating);\n const [hover, setHover] = useState(0);\n const max = useSignal(props.max || 5);\n\n return (\n <div\n class=\"flex gap-2 px-5 rounded-2xl bg-gray-200 z-10\"\n style={{ color: \"var(--foreground)\", background: \"var(--background)\" }}\n >\n {Array.from({ length: max.value }).map((_, i) => {\n return (\n <span\n class={`my-5 cursor-pointer opacity-${\n (i + 1) <= rating ? 100 : (i + 1) <= hover ? 20 : 100\n }`}\n onMouseOver={() => setHover(i + 1)}\n onClick={() => setRating(i + 1)}\n >\n {(i + 1) <= rating || (i + 1) <= hover\n ? <IconStarFilled class=\"w-4 h-4\" />\n : <IconStar class=\"w-4 h-4\" />}\n </span>\n );\n })}\n </div>\n );\n};\n", "import { asset } from \"$fresh/runtime.ts\";\nimport * as CSS from \"https://esm.sh/csstype@3.1.2\";\nimport { isLocalImage } from \"@lib/string.ts\";\n\ninterface ResponsiveAttributes {\n srcset: string;\n sizes: string;\n}\n\nfunction generateResponsiveAttributes(\n imageUrl: string,\n widths: number[],\n baseApiUrl: string,\n sizes = \"100vw\",\n): ResponsiveAttributes {\n const srcsets: string[] = [];\n\n for (const width of widths) {\n const apiUrl = `${baseApiUrl}?image=${imageUrl}&width=${width}`;\n srcsets.push(`${apiUrl} ${width}w`);\n }\n\n const srcset = srcsets.join(\", \");\n\n return {\n srcset,\n sizes,\n };\n}\n\nconst widths = [320, 640, 960, 1280]; // List of widths for srcset\n\nconst Image = (\n props: {\n class: string;\n src: string;\n alt?: string;\n thumbnail?: string;\n fill?: boolean;\n width?: number | string;\n height?: number | string;\n style?: CSS.HtmlAttributes;\n },\n) => {\n const responsiveAttributes: ResponsiveAttributes = isLocalImage(props.src)\n ? generateResponsiveAttributes(props.src, widths, \"/api/images\")\n : { srcset: \"\", sizes: \"\" };\n\n return (\n <span\n style={{\n position: props.fill ? \"absolute\" : \"\",\n width: props.fill ? \"100%\" : \"\",\n height: props.fill ? \"100%\" : \"\",\n zIndex: props.fill ? -1 : \"\",\n }}\n data-thumb={props.thumbnail}\n >\n <img\n data-thumb={props.thumbnail}\n data-thumb-img\n loading=\"lazy\"\n alt={props.alt}\n style={props.style}\n srcset={responsiveAttributes.srcset}\n sizes={responsiveAttributes.sizes}\n src={asset(props.src)}\n width={props.width}\n height={props.height}\n class={props.class}\n />\n </span>\n );\n};\n\nexport default Image;\n", "import { asset } from \"$fresh/runtime.ts\";\n\nexport const Emoji = (props: { class?: string; name: string }) => {\n return props.name\n ? props.name.endsWith(\".png\")\n ? (\n <img\n class={`${props?.class || \"\"}`}\n src={asset(`/emojis/${props.name}`)}\n />\n )\n : <span>{props.name}</span>\n : <></>;\n};\n", "import { useEffect, useRef } from \"preact/hooks\";\nimport useDebouncedCallback from \"@lib/hooks/useDebouncedCallback.ts\";\nimport { IconLoader2, IconSearch } from \"@components/icons.tsx\";\nimport { useEventListener } from \"@lib/hooks/useEventListener.ts\";\nimport { SearchResult } from \"@lib/types.ts\";\nimport { resources } from \"@lib/resources.ts\";\nimport { getCookie, isLocalImage } from \"@lib/string.ts\";\nimport { IS_BROWSER } from \"$fresh/runtime.ts\";\nimport Checkbox from \"@components/Checkbox.tsx\";\nimport { Rating } from \"@components/Rating.tsx\";\nimport { useSignal } from \"@preact/signals\";\nimport Image from \"@components/Image.tsx\";\nimport { Emoji } from \"@components/Emoji.tsx\";\n\nexport async function fetchQueryResource(url: URL, type = \"\") {\n const query = url.searchParams.get(\"q\");\n const status = url.searchParams.get(\"status\");\n\n try {\n url.pathname = \"/api/resources\";\n url.searchParams.set(\"q\", encodeURIComponent(query || \"*\"));\n if (status) {\n url.searchParams.set(\"status\", \"not-seen\");\n }\n if (type) {\n url.searchParams.set(\"type\", type);\n }\n const response = await fetch(url);\n const jsonData = await response.json();\n return jsonData;\n } catch (error) {\n console.error(\"Error fetching data:\", error);\n }\n}\n\nexport const RedirectSearchHandler = () => {\n if (getCookie(\"session_cookie\")) {\n useEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e?.target?.nodeName == \"INPUT\") return;\n if (\n e.key === \"?\" &&\n window.location.search === \"\"\n ) {\n window.location.href += \"?q=*\";\n }\n }, IS_BROWSER ? document?.body : undefined);\n }\n\n return <></>;\n};\n\nconst SearchResultImage = ({ src }: { src: string }) => {\n const imageSrc = isLocalImage(src)\n ? `/api/images?image=${src}&width=50&height=50`\n : src;\n\n return (\n <Image\n class=\"object-cover w-12 h-12 rounded-full\"\n src={imageSrc}\n alt=\"preview image\"\n />\n );\n};\n\nexport const SearchResultItem = (\n { item, showEmoji = false }: {\n item: NonNullable<SearchResult[\"hits\"]>[number];\n showEmoji?: boolean;\n },\n) => {\n const doc = item.document;\n const resourceType = resources[doc.type];\n const href = (resourceType) ? `${resourceType.link}/${doc.id}` : \"\";\n return (\n <a\n href={href}\n class=\"p-2 text-white flex gap-4 items-center rounded-2xl hover:bg-gray-700\"\n >\n {showEmoji && resourceType\n ? <Emoji class=\"w-7 h-7\" name={resourceType.emoji} />\n : \"\"}\n {doc?.image && <SearchResultImage src={doc.image} />}\n {doc?.name}\n </a>\n );\n};\n\nexport const SearchResultList = (\n { result, showEmoji }: { result: SearchResult; showEmoji?: boolean },\n) => {\n return (\n <div class=\"mt-4\">\n {result?.hits\n ? (\n <div class=\"flex flex-col gap-4\">\n {result.hits.map((hit) => (\n <SearchResultItem item={hit} showEmoji={showEmoji} />\n ))}\n </div>\n )\n : <div style={{ color: \"#818181\" }}>No Results</div>}\n </div>\n );\n};\n\nconst Search = (\n { q = \"*\", type, results }: {\n q: string;\n type?: string;\n results?: SearchResult;\n },\n) => {\n const searchQuery = useSignal(q);\n const data = useSignal<SearchResult | undefined>(results);\n const isLoading = useSignal(false);\n const showSeenStatus = useSignal(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n if (\"history\" in globalThis) {\n const u = new URL(window.location.href);\n if (u.searchParams.get(\"q\") !== searchQuery.value) {\n u.searchParams.set(\"q\", searchQuery.value);\n }\n if (showSeenStatus.value) {\n u.searchParams.set(\"rating\", \"0\");\n } else {\n u.searchParams.delete(\"rating\");\n }\n\n window.history.replaceState({}, \"\", u);\n }\n\n const fetchData = async () => {\n try {\n isLoading.value = true;\n const jsonData = await fetchQueryResource(\n new URL(window?.location.href),\n type,\n );\n data.value = jsonData;\n isLoading.value = false;\n } catch (error) {\n console.error(\"Error fetching data:\", error);\n isLoading.value = false;\n }\n };\n const debouncedFetchData = useDebouncedCallback(fetchData, 500); // Debounce the fetchData function with a delay of 500ms\n\n useEffect(() => {\n if (inputRef.current && searchQuery?.value.length === 0) {\n inputRef.current?.focus();\n }\n }, [inputRef.current, searchQuery]);\n\n const handleInputChange = (event: Event) => {\n const target = event.target as HTMLInputElement;\n if (target.value !== searchQuery.value) {\n searchQuery.value = target.value;\n }\n };\n\n useEffect(() => {\n debouncedFetchData(); // Call the debounced fetch function with the updated search query\n }, [searchQuery.value, showSeenStatus.value]);\n\n useEffect(() => {\n debouncedFetchData();\n }, []);\n\n return (\n <div class=\"mt-2\">\n <header class=\"flex items-center gap-4\">\n <div\n class=\"flex items-center gap-1 rounded-xl w-full shadow-2xl\"\n style={{ background: \"#2B2930\", color: \"#818181\" }}\n >\n {isLoading.value && searchQuery.value\n ? <IconLoader2 class=\"w-4 h-4 ml-4 mr-2 animate-spin\" />\n : <IconSearch class=\"w-4 h-4 ml-4 mr-2\" />}\n <input\n type=\"text\"\n style={{ fontSize: \"1.2em\" }}\n class=\"bg-transparent py-3 w-full\"\n ref={inputRef}\n value={searchQuery.value}\n onInput={handleInputChange}\n />\n </div>\n <Checkbox label=\"not-seen\" checked={showSeenStatus} />\n <Rating rating={4} />\n </header>\n {data?.value?.hits?.length && !isLoading.value\n ? <SearchResultList showEmoji={!type} result={data.value} />\n : isLoading.value\n ? <div />\n : (\n <div\n class=\"flex items-center gap-2 p-2 my-4 mx-3\"\n style={{ color: \"#818181\" }}\n >\n <Emoji class=\"w-8 h-8\" name=\"Ghost.png\" />\n No Results\n </div>\n )}\n </div>\n );\n};\n\nexport default Search;\n"],
|
|
"mappings": "iYA8Ge,SAAR,qBAGL,KACA,KACA,QACmB,CACnB,IAAM,aAAe,EAAO,IAAI,EAC1B,eAAiB,EAAO,CAAC,EACzB,QAAU,EAAO,IAAI,EACrB,SAAW,EAAkB,CAAC,CAAC,EAC/B,SAAW,EAAgB,EAC3B,OAAS,EAAsB,EAC/B,QAAU,EAAO,IAAI,EACrB,QAAU,EAAO,EAAI,EAE3B,EAAU,IAAM,CACd,QAAQ,QAAU,IACpB,EAAG,CAAC,IAAI,CAAC,EAGT,IAAM,OAAS,CAAC,MAAQ,OAAS,GAAK,OAAO,OAAW,IAExD,GAAI,OAAO,MAAS,WAClB,MAAM,IAAI,UAAU,qBAAqB,EAG3C,KAAO,CAAC,MAAQ,EAChB,QAAU,SAAW,CAAC,EAEtB,IAAM,QAAU,CAAC,CAAC,QAAQ,QACpB,SAAW,aAAc,QAAU,CAAC,CAAC,QAAQ,SAAW,GACxD,OAAS,YAAa,QACtB,QAAU,OAAS,KAAK,IAAI,CAAC,QAAQ,SAAW,EAAG,IAAI,EAAI,KAEjE,SAAU,KACR,QAAQ,QAAU,GACX,IAAM,CACX,QA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