PageSourceSearch

https://www.chemcalc.org/assets/text-DjIajk5c.js

js chemcalc.org collected 2026-10-03 17:34:21 UTC 2,553 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t}from"./jsx-runtime-D3F0h15I.js";import{Nr as n,c as r,r as i}from"./icon-C6cFjsJs.js";import{n as a}from"./refs-8jk7Ngkz.js";var o=e(t());function s(){return typeof window<`u`&&window.document!=null}function c(e,t){return e===t||e.contains(t)}function l(e){if(e==null||e.closest==null)return!1;let t=e.closest(`input, textarea, [contenteditable=true]`);if(t==null)return!1;if(t.tagName.toLowerCase()===`input`){let e=t.type;if(e===`checkbox`||e===`radio`)return!1}return!t.readOnly}function u(e,t){let n=(e?.getRootNode(t)??document).activeElement;return n instanceof HTMLElement?n:null}function d(e){return t=>{e.some(e=>t.key===e)&&(l(t.target)||t.preventDefault(),t.target.dispatchEvent(new MouseEvent(`click`,{...t,view:void 0})))}}var f=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`details:not([tabindex="-1"])`,`input:not([disabled]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function p(e){return Array.from(e.querySelectorAll(f))}function m(e){return e.key===`Enter`||e.key===` `}var h=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`];function g(e){return h.includes(e.key)}function _(e,t,n){if(t.includes(e.key))return-1;if(n.includes(e.key))return 1}var v={defaultTabIndex:void 0,disabledTabIndex:-1};function y(e,t,n,r=v){let{defaultTabIndex:i,disabledTabIndex:s}=r,{active:c,onClick:l,onFocus:u,onKeyDown:d,onKeyUp:f,onBlur:p,tabIndex:h=i}=t,[g,_]=(0,o.useState)(),[y,b]=(0,o.useState)(!1),x=(0,o.useRef)(null),S=(0,o.useCallback)(e=>{y&&b(!1),p?.(e)},[y,p]),C=(0,o.useCallback)(e=>{m(e)&&(e.preventDefault(),e.key!==g&&b(!0)),_(e.key),d?.(e)},[g,d]),w=(0,o.useCallback)(e=>{m(e)&&(b(!1),x.current?.click()),_(void 0),f?.(e)},[f,x]);return[e&&(c||y),{onBlur:S,onClick:e?l:void 0,onFocus:e?u:void 0,onKeyDown:C,onKeyUp:w,ref:a(x,n),tabIndex:e?h:s}]}var b=e(i()),x=s()?o.useLayoutEffect:o.useEffect,S=(0,o.forwardRef)(({children:e,tagName:t=`div`,title:r,className:i,ellipsize:s=!1,...c},l)=>{let u=(0,o.useRef)(),d=(0,o.useMemo)(()=>a(u,l),[l]),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)();return x(()=>{u.current?.textContent!=null&&(h(s&&u.current.scrollWidth>u.current.clientWidth),p(u.current.textContent))},[u,e,s]),(0,o.createElement)(t,{...c,className:(0,b.default)({[n]:s},i),ref:d,title:r??(m?f:void 0)},e)});S.displayName=`${r}.Text`;export{m as a,u as c,g as i,p as l,y as n,d as o,_ as r,c as s,S as t,s as u};

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.