PageSourceSearch

https://otoku.ai/assets/visits-CxeMyKX-.js

js otoku.ai collected 2026-10-05 13:35:52 UTC 796 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";var n=e(t(),1),r=`otoku:visits`,i=8,a={fav:[],recent:[]},o=null,s=new Set;function c(){if(o)return o;try{let e=JSON.parse(localStorage.getItem(r)??`{}`),t=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[];o={fav:t(e?.fav),recent:t(e?.recent)}}catch{o=a}return o}function l(e){o=e;try{localStorage.setItem(r,JSON.stringify(e))}catch{}for(let e of s)e()}function u(e){return s.add(e),()=>s.delete(e)}function d(){return(0,n.useSyncExternalStore)(u,c,()=>a)}function f(e){let t=c();l({...t,fav:t.fav.includes(e)?t.fav.filter(t=>t!==e):[e,...t.fav]})}function p(e){(0,n.useEffect)(()=>{let t=c();t.recent[0]!==e&&l({...t,recent:[e,...t.recent.filter(t=>t!==e)].slice(0,i)})},[e])}export{p as n,d as r,f as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.