PageSourceSearch

https://panews.io/assets/ShareMenu-C_ANfSh6.js

js panews.io collected 2026-10-03 23:26:15 UTC 4,209 bytes, 1 lines download raw bytes

1import{r as i,o as e}from"./chunk-4N6VE7H7-DzH4tAf6.js";import{C as g}from"./check-BC9K7OM6.js";import{L as v}from"./link-2-CNzt33IS.js";const y=({className:t})=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:t,"aria-hidden":"true",children:e.jsx("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})}),b=({className:t})=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:t,"aria-hidden":"true",children:e.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})});function j(t){return/^https?:\/\//.test(t)||typeof window>"u"?t:new URL(t,window.location.origin).toString()}function c(t){typeof window>"u"||window.open(t,"_blank","noopener,noreferrer")}function k({title:t,url:u,children:h,align:l="right"}){const[p,s]=i.useState(!1),a=i.useRef(void 0),n=j(u);i.useEffect(()=>()=>{a.current&&window.clearTimeout(a.current)},[]);const d=()=>{const r=new URL("https://twitter.com/intent/tweet");r.searchParams.set("text",t),r.searchParams.set("url",n),c(r.toString())},x=()=>{const r=new URL("https://t.me/share/url");r.searchParams.set("url",n),r.searchParams.set("text",`${t} ${n}`),c(r.toString())},m=async()=>{var r;try{if(typeof navigator<"u"&&((r=navigator.clipboard)!=null&&r.writeText))await navigator.clipboard.writeText(n);else if(typeof document<"u"){const o=document.createElement("textarea");o.value=n,o.setAttribute("readonly",""),o.style.position="absolute",o.style.left="-9999px",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}s(!0),a.current=window.setTimeout(()=>s(!1),1800)}catch{s(!1)}},f=l==="left"?"left-full top-1/2 ml-3 -translate-y-1/2":"right-0 top-full mt-2",w=l==="left"?"group-hover/share-menu:pointer-events-auto group-hover/share-menu:opacity-100 group-focus-within/share-menu:pointer-events-auto group-focus-within/share-menu:opacity-100":"translate-y-1 group-hover/share-menu:pointer-events-auto group-hover/share-menu:translate-y-0 group-hover/share-menu:opacity-100 group-focus-within/share-menu:pointer-events-auto group-focus-within/share-menu:translate-y-0 group-focus-within/share-menu:opacity-100";return e.jsxs("div",{className:"group/share-menu relative",children:[h,e.jsxs("div",{className:`pointer-events-none absolute z-20 w-[220px] rounded-[10px] border border-slate-100 bg-white p-2 opacity-0 shadow-[0_14px_32px_rgba(15,23,42,0.12)] transition-all duration-150 ${f} ${w}`,children:[e.jsxs("button",{type:"button",onClick:d,className:"flex w-full items-center gap-3 rounded-[8px] px-3 py-2.5 text-left text-[14px] font-medium text-slate-700 transition-colors hover:bg-slate-50 hover:text-primary",children:[e.jsx(y,{className:"h-[16px] w-[16px]"}),e.jsx("span",{children:"Share to Twitter"})]}),e.jsxs("button",{type:"button",onClick:x,className:"flex w-full items-center gap-3 rounded-[8px] px-3 py-2.5 text-left text-[14px] font-medium text-slate-700 transition-colors hover:bg-slate-50 hover:text-primary",children:[e.jsx(b,{className:"h-[16px] w-[16px]"}),e.jsx("span",{children:"Share to Telegram"})]}),e.jsxs("button",{type:"button",onClick:()=>void m(),className:"flex w-full items-center gap-3 rounded-[8px] px-3 py-2.5 text-left text-[14px] font-medium text-slate-700 transition-colors hover:bg-slate-50 hover:text-primary",children:[p?e.jsx(g,{className:"h-[16px] w-[16px]",strokeWidth:2.5}):e.jsx(v,{className:"h-[16px] w-[16px]",strokeWidth:2.5}),e.jsx("span",{children:p?"Link copied":"Copy link"})]})]})]})}export{k as S};

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.