import{j as s,u as x,r as m,Y as S,X as j,t as n,Q as p,Z as f}from"./index-iQt3bUih.js";import{c as h}from"./clipboard-t_-sNjVI.js";function d(e){const t=e.replace(/^steam_/,"");return t.length<=8?t:`${t.slice(0,4)}${"•".repeat(6)}${t.slice(-4)}`}function u(e){return/^7656119\d{10}$/.test(e.replace(/^steam_/i,"").trim())}const I=e=>/^(?:version|message|user\s*id|steam\s*id(?:64)?|unknown|null|undefined)$/i.test(e.trim());function D(e){return e.replace(/(?:steam_\d+|[a-z]+_\d{8,}|\d{15,20})/gi,t=>d(t))}function b({userId:e}){x();const[t,i]=m.useState(!1),[c,r]=m.useState(!1),a=e.replace(/^steam_/,""),l=async()=>{await h(a)&&(r(!0),setTimeout(()=>r(!1),1500))};return u(e)?s.jsxs("span",{className:"steam-id-value",children:[s.jsx("code",{children:t?a:d(e)}),s.jsx("button",{type:"button",onClick:()=>i(o=>!o),className:"steam-id-action","aria-label":t?n("隱藏 Steam ID"):n("顯示 Steam ID"),title:t?n("隱藏"):n("顯示完整 Steam ID"),children:t?s.jsx(S,{className:"size-3.5"}):s.jsx(j,{className:"size-3.5"})}),s.jsx("button",{type:"button",onClick:l,className:"steam-id-action","aria-label":n("複製 Steam ID"),title:n("複製"),children:c?s.jsx(p,{className:"size-3.5 text-grass"}):s.jsx(f,{className:"size-3.5"})})]}):s.jsx("span",{className:"steam-id-unavailable",title:"這筆來源資料不是有效的 SteamID64",children:I(a)?`來源資料異常（${a}）`:a||"尚未讀取"})}function E(e){return e.replace(/^steam_/i,"")}function $({gameName:e,steamName:t,playerUid:i,userId:c,compact:r=!1}){const a=(i==null?void 0:i.trim())||"尚未讀取",l=(t==null?void 0:t.trim())||"尚未讀取",o=u(c);return s.jsxs("span",{className:`player-identity-summary ${r?"is-compact":""}`,children:[e&&s.jsx("strong",{children:e}),s.jsxs("span",{children:[s.jsx("b",{children:"遊戲 UID"}),s.jsx("code",{children:a})]}),s.jsxs("span",{children:[s.jsx("b",{children:"Steam 名稱"}),s.jsx("em",{children:l})]}),s.jsxs("span",{children:[s.jsx("b",{children:o?"SteamID64":"平台 UserId"}),s.jsx(b,{userId:c})]})]})}const k=!1,N=!0;export{$ as P,k as S,N as a,d as b,D as m,E as s};
