PageSourceSearch

https://lifebooks.io/assets/RephraseContent-c51a6c66.js

js lifebooks.io collected 2026-10-04 07:23:19 UTC 1,435 bytes, 1 lines download raw bytes

1import{Y as N,j as u}from"./index-2ed27e87.js";import{r as e}from"./utils-40ed1a82.js";const y=({setAIOpen:g,aiOpen:h,setSelectedText:x,refresh:r})=>{const{t:E}=N("common"),C=e.useRef(),[c,v]=e.useState(!1),[i,R]=e.useState({top:0,left:0}),[S,o]=e.useState(!1),s=()=>{const n=window.getSelection();if(n.rangeCount>0){const t=n.getRangeAt(0),l=t.startContainer.parentNode.parentNode;if(l.classList&&l.classList.contains("PlaygroundEditorTheme__paragraph")){const d=t.toString().trim(),b=d.split(/\s+/);if(n&&n.anchorNode&&t&&b.length>5)if(n.anchorNode.parentElement.parentElement.parentElement.contains(t.commonAncestorContainer)){const p=t.startContainer,f=t.startOffset,a=document.createRange();a.setStart(p,f),a.setEnd(p,f),a.getBoundingClientRect();const m=t.getBoundingClientRect();R({top:m.top-40,left:m.left}),o(!0),x(d)}else o(!1);else o(!1)}}else o(!1)};return e.useEffect(()=>(r?document.addEventListener("selectionchange",s):document.removeEventListener("selectionchange",s),()=>{document.removeEventListener("selectionchange",s)}),[r]),e.useEffect(()=>{c&&C.current.scrollIntoView({behavior:"smooth",block:"center"})},[c]),u.jsx("div",{className:"pb-8 ",children:S&&u.jsx("button",{style:{position:"fixed",top:`${i.top}px`,left:`${i.left}px`,zIndex:1e3},className:"bg-secondary  text-primary font-EBGaramondSemibold text-xl px-5 py-2 rounded-lg",onClick:()=>{g(!h)},children:E("lifebooks_assist")})})};export{y as default};

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.