tokentracker-cli 0.48.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +3 -1
- package/README.ko.md +3 -1
- package/README.md +3 -1
- package/README.zh-CN.md +3 -1
- package/dashboard/dist/assets/{ActivityHeatmap-BW7r63JV.js → ActivityHeatmap-CdSIa7qF.js} +1 -1
- package/dashboard/dist/assets/{Card-BWgji0yz.js → Card-Ds-oKKa8.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-fwmRrxV3.js → DashboardPage-DlSGoNwE.js} +1 -1
- package/dashboard/dist/assets/DevicePage-BmuuVq8P.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-ltZ7viR5.js → DialogTitle-DvcD6xbM.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-DkGtOY3l.js → FadeIn-DVysFsQD.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-CUKVYH9j.js → HeaderGithubStar-DfFuzPIQ.js} +1 -1
- package/dashboard/dist/assets/IpCheckPage-Cx201GiV.js +20 -0
- package/dashboard/dist/assets/{LandingPage-Y2ovBPVG.js → LandingPage-CwVgEDkV.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-DSGfEE93.js → LeaderboardAvatar-ziBbRVvs.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-BX4cvtg7.js → LeaderboardPage-Biqvdo4g.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfileModal-CJfefuSR.js → LeaderboardProfileModal-DqPL0kqy.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-Xy0K-ppJ.js → LeaderboardProfilePage-DmRnMtr0.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-utdNxAg_.js → LimitsPage-Cp5h_6V-.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-CwGk0Fn3.js → LocalOnlyNotice-C0NrEMPx.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-BHlX2ZHJ.js → LoginPage-MPkEezJe.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-BC4rHujH.js → PopoverPopup-tas7bWDM.js} +1 -1
- package/dashboard/dist/assets/{Select-BpDJKpfl.js → Select-C1XPo279.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-D1_H3hHS.js → SelectItemText-BXdfdMoI.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-DCVw-3Cv.js → SettingsPage-uCq1kQJB.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-B-9_Ufpw.js → SkillsPage-BBK1FZHz.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-DJ4i97QU.js → WidgetsPage-B4vqrcSC.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-W8pPcYr2.js → WrappedPage-BKjocXbt.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-yJi-7lhN.js → agent-logos-aCP1gjjY.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-BXhFthH9.js → arrow-up-right-CKicCc9n.js} +1 -1
- package/dashboard/dist/assets/{download-D32KO7Ua.js → download-CyWoylMR.js} +1 -1
- package/dashboard/dist/assets/{info-C8QLdyUg.js → info-Eoucvx_Y.js} +1 -1
- package/dashboard/dist/assets/main-Br5SsufY.css +1 -0
- package/dashboard/dist/assets/{main-BmTIgbZL.js → main-D3YoNdym.js} +17 -17
- package/dashboard/dist/assets/{use-limits-display-prefs-DcmWcNeA.js → use-limits-display-prefs-CXcRsYJQ.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-BLZi1heD.js → use-native-settings-zPoh9XtP.js} +1 -1
- package/dashboard/dist/assets/use-usage-limits-C3UnLp-v.js +1 -0
- package/dashboard/dist/assets/{useCurrency-ERbWumqM.js → useCurrency-Bh791muK.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-PJWfD6AS.js → useScrollLock-CQdlrFZs.js} +1 -1
- package/dashboard/dist/brand-logos/hermes.svg +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/commands/device-login.js +19 -3
- package/src/commands/sync.js +538 -348
- package/src/lib/local-api.js +11 -2
- package/src/lib/pricing/curated-overrides.json +2 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +98 -16
- package/src/lib/runtime-config.js +7 -4
- package/src/lib/usage-limits.js +118 -25
- package/src/lib/wrapped-aggregator.js +12 -1
- package/dashboard/dist/assets/DevicePage-rxxuM-iC.js +0 -1
- package/dashboard/dist/assets/IpCheckPage-DqrupqCq.js +0 -15
- package/dashboard/dist/assets/main-BfK9LoKV.css +0 -1
- package/dashboard/dist/assets/use-usage-limits-BIJk3Nmb.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y as p,r as c,j as e,aK as b}from"./main-D3YoNdym.js";const f={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"0.49.1",VITE_INSFORGE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC0xMjM0LTU2NzgtOTBhYi1jZGVmMTIzNDU2NzgiLCJlbWFpbCI6ImFub25AaW5zZm9yZ2UuY29tIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODExNDU5NDd9.T0auta_IrVIh0uXW1bob5QSnzvsnJmN28r5XkSGEuQY",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function x(){return b(),`${(f&&"https://srctyff5.us-east.insforge.app"||"https://srctyff5.us-east.insforge.app").replace(/\/$/,"")}/functions/tokentracker-device-flow-grant`}function l(a){return(a||"").toUpperCase().replace(/\s+/g,"").replace(/[^A-Z0-9-]/g,"")}function k(){const a=p(),[m,u]=c.useState(""),[t,r]=c.useState({kind:"idle",message:""});c.useEffect(()=>{try{const i=new URLSearchParams(window.location.search).get("user_code");i&&u(l(i))}catch{}},[]);async function g(d){if(d?.preventDefault?.(),!a?.signedIn){r({kind:"error",message:"Please sign in first."});return}const i=l(m);if(!/^[A-HJKMNP-Z2-9]{4}-[A-HJKMNP-Z2-9]{4}$/.test(i)){r({kind:"error",message:"Invalid code format. Expected XXXX-XXXX."});return}r({kind:"working",message:"Approving…"});try{const n=await a.getAccessToken?.();if(!n){r({kind:"error",message:"No access token — please sign in again."});return}const s=await fetch(x(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({user_code:i})}),o=await s.json().catch(()=>({}));s.ok?r({kind:"success",message:o.status==="already_approved"?`Already approved earlier${o.client_info?" ("+o.client_info+")":""}.`:`Approved${o.client_info?" for "+o.client_info:""}. You can close this tab — your CLI will pick it up within a few seconds.`}):s.status===404?r({kind:"error",message:"Code not found. Double-check what your CLI printed."}):s.status===410?r({kind:"error",message:"Code expired. Re-run `tracker device-login` and try again."}):s.status===401?r({kind:"error",message:"Session expired. Sign out, sign in, and try again."}):r({kind:"error",message:o?.error||`Server error (HTTP ${s.status}).`})}catch(n){r({kind:"error",message:`Network error: ${n?.message||n}`})}}return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-oai-gray-950 px-6 py-12",children:e.jsxs("div",{className:"w-full max-w-md rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-oai-gray-900 dark:text-white mb-2",children:"Approve your CLI"}),e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mb-6",children:"Type the code your CLI showed you. We'll link it to your account so token usage from that machine flows into your leaderboard profile."}),a?.signedIn?null:e.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 dark:bg-amber-900/20 dark:border-amber-800 p-4 mb-4",children:e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Sign in first, then return to this page."})}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400 mb-1",children:"CLI code"}),e.jsx("input",{type:"text",value:m,onChange:d=>u(l(d.target.value)),placeholder:"XXXX-XXXX",spellCheck:!1,autoCapitalize:"characters",maxLength:9,className:"w-full font-mono text-xl tracking-widest text-center rounded-md border border-oai-gray-300 dark:border-oai-gray-700 bg-white dark:bg-oai-gray-900 text-oai-gray-900 dark:text-white px-4 py-3 focus:outline-none focus:ring-inset focus:ring-2 focus:ring-emerald-600"})]}),e.jsx("button",{type:"submit",disabled:t.kind==="working"||!a?.signedIn,className:"w-full rounded-md bg-emerald-600 hover:bg-emerald-500 disabled:bg-oai-gray-300 disabled:cursor-not-allowed text-white font-medium py-3 transition-colors",children:t.kind==="working"?"Approving…":"Approve"})]}),t.kind==="success"&&e.jsx("div",{className:"mt-4 rounded-md border border-emerald-200 bg-emerald-50 dark:bg-emerald-900/20 dark:border-emerald-800 p-4",children:e.jsx("p",{className:"text-sm text-emerald-700 dark:text-emerald-300",children:t.message})}),t.kind==="error"&&e.jsx("div",{className:"mt-4 rounded-md border border-red-200 bg-red-50 dark:bg-red-900/20 dark:border-red-800 p-4",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:t.message})})]})})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bQ as s,b9 as T,r as i,b4 as W,a as k,bf as K,be as ee,j as I,bY as te,b$ as ne,b as oe,bR as se,bG as re,bJ as ae,b8 as ie,bL as le}from"./main-BmTIgbZL.js";import{x as z,P as G,w as L,A as x,l as H,v as ue,r as de,I as pe,h as ce,i as ge,j as fe,k as me,z as Se,m as Ce,s as Pe,e as Oe,f as Re,u as xe}from"./useScrollLock-PJWfD6AS.js";function Ee(){return new z({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new G,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function he(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ee(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:T,inactiveTriggerProps:T,popupProps:T}}function Ie(e,t,o=!1){return new z({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0})}const w=s(e=>e.triggerIdProp??e.activeTriggerId),Y=s(e=>e.openProp??e.open),$=s(e=>(e.popupElement?.id??e.floatingId)||void 0);function Q(e,t){return t!==void 0&&Y(e)&&w(e)===t}function ve(e,t){return Q(e,t)?!0:t!==void 0&&Y(e)&&w(e)==null&&e.triggerCount===1}const ye={open:Y,mounted:s(e=>e.mounted),transitionStatus:s(e=>e.transitionStatus),floatingRootContext:s(e=>e.floatingRootContext),triggerCount:s(e=>e.triggerCount),preventUnmountingOnClose:s(e=>e.preventUnmountingOnClose),payload:s(e=>e.payload),activeTriggerId:w,activeTriggerElement:s(e=>e.mounted?e.activeTriggerElement:null),popupId:$,isTriggerActive:s((e,t)=>t!==void 0&&w(e)===t),isOpenedByTrigger:s((e,t)=>Q(e,t)),isMountedByTrigger:s((e,t)=>t!==void 0&&w(e)===t&&e.mounted),triggerProps:s((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:s((e,t)=>ve(e,t)?$(e):void 0),popupProps:s(e=>e.popupProps),popupElement:s(e=>e.popupElement),positionerElement:s(e=>e.positionerElement)},q=i.createContext(!1),X=i.createContext(void 0);function b(e){const t=i.useContext(X);if(e===!1&&t===void 0)throw new Error(W(27));return t}const be={...L,...K},Ye=i.forwardRef(function(t,o){const{render:r,className:a,style:l,forceRender:u=!1,...d}=t,{store:p}=b(),n=p.useState("open"),C=p.useState("nested"),m=p.useState("mounted"),S=p.useState("transitionStatus");return k("div",t,{state:{open:n,transitionStatus:S},ref:[p.context.backdropRef,o],stateAttributesMapping:be,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:u||!C})});let Te=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),we=(function(e){return e[e.open=x.open]="open",e[e.closed=x.closed]="closed",e[e.startingStyle=x.startingStyle]="startingStyle",e[e.endingStyle=x.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Z=i.createContext(void 0);function V(){const e=i.useContext(Z);if(e===void 0)throw new Error(W(26));return e}const De={...L,...K,nestedDialogOpen(e){return e?{[we.nestedDialogOpen]:""}:null}},_e=i.forwardRef(function(t,o){const{render:r,className:a,style:l,finalFocus:u,initialFocus:d,...p}=t,{store:n}=b(),C=n.useState("descriptionElementId"),m=n.useState("disablePointerDismissal"),S=n.useState("floatingRootContext"),O=n.useState("popupProps"),f=n.useState("modal"),R=n.useState("mounted"),E=n.useState("nested"),h=n.useState("nestedOpenDialogCount"),g=n.useState("open"),v=n.useState("openMethod"),P=n.useState("titleElementId"),c=n.useState("transitionStatus"),M=n.useState("role"),N=S.useState("floatingId"),F=p.id??N;V(),ee({open:g,ref:n.context.popupRef,onComplete(){g&&n.context.onOpenChangeComplete?.(!0)}});function B(D){return D==="touch"?n.context.popupRef.current:!0}const j=d===void 0?B:d,U=h>0,y=n.useStateSetter("popupElement"),A=k("div",t,{state:{open:g,nested:E,transitionStatus:c,nestedDialogOpen:U},props:[O,{id:F,"aria-labelledby":P??void 0,"aria-describedby":C??void 0,role:M,...H,hidden:!R,onKeyDown(D){ue.has(D.key)&&D.stopPropagation()},style:{[Te.nestedDialogs]:h}},p],ref:[o,n.context.popupRef,y],stateAttributesMapping:De});return I.jsx(de,{context:S,openInteractionType:v,disabled:!R,closeOnFocusOut:!m,initialFocus:j,returnFocus:u,modal:f!==!1,restoreFocus:"popup",children:A})}),$e=i.forwardRef(function(t,o){const{keepMounted:r=!1,...a}=t,{store:l}=b(),u=l.useState("mounted"),d=l.useState("modal"),p=l.useState("open");return u||r?I.jsx(Z.Provider,{value:r,children:I.jsxs(te,{ref:o,...a,children:[u&&d===!0&&I.jsx(pe,{ref:l.context.internalBackdropRef,inert:ne(!p)}),t.children]})}):null});function ke(e){const{store:t,parentContext:o,actionsRef:r,isDrawer:a}=e,l=t.useState("open");ce(t,l),ge(t);const{forceUnmount:u}=fe(l,t),d=i.useCallback(()=>{t.setOpen(!1,oe(se))},[t]);return i.useImperativeHandle(r,()=>({unmount:u,close:d}),[u,d]),{parentContext:o,isDrawer:a}}function Me({store:e,dialogRoot:t}){const{parentContext:o,isDrawer:r}=t,a=e.useState("open"),l=e.useState("disablePointerDismissal"),u=e.useState("modal"),d=e.useState("popupElement"),p=e.useState("floatingRootContext"),[n,C]=i.useState(0),[m,S]=i.useState(0),O=n===0,f=me(p,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0||"touches"in g&&g.touches.length!==1)return!1;const v=re(g);if(O&&!l){const P=v;return u&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===P||e.context.backdropRef.current===P||ae(P,d)&&!P?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:O});Se(a&&u===!0,d),e.useContextCallback("onNestedDialogOpen",(g,v)=>{C(g),S(v)}),e.useContextCallback("onNestedDialogClose",()=>{C(0),S(0)}),i.useEffect(()=>(o?.onNestedDialogOpen&&a&&o.onNestedDialogOpen(n+1,m+(r?1:0)),o?.onNestedDialogClose&&!a&&o.onNestedDialogClose(),()=>{o?.onNestedDialogClose&&a&&o.onNestedDialogClose()}),[r,a,n,m,o]);const R=f.reference??T,E=f.trigger??T,h=i.useMemo(()=>ie(H,f.floating),[f.floating]);return Ce(e,{activeTriggerProps:R,inactiveTriggerProps:E,popupProps:h,nestedOpenDialogCount:n,nestedOpenDrawerCount:m}),null}const Ne={...ye,modal:s(e=>e.modal),nested:s(e=>e.nested),nestedOpenDialogCount:s(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:s(e=>e.nestedOpenDrawerCount),disablePointerDismissal:s(e=>e.disablePointerDismissal),openMethod:s(e=>e.openMethod),descriptionElementId:s(e=>e.descriptionElementId),titleElementId:s(e=>e.titleElementId),viewportElement:s(e=>e.viewportElement),role:s(e=>e.role)};class _ extends le{constructor(t,o,r=!1){const a=new G,l=Fe(t);l.floatingRootContext=Ie(a,o,r),super(l,{popupRef:i.createRef(),backdropRef:i.createRef(),internalBackdropRef:i.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:a,onOpenChange:void 0,onOpenChangeComplete:void 0},Ne)}setOpen=(t,o)=>{if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,o);const r={open:t};Pe(r,t,o.trigger),this.update(r)};static useStore(t,o){return Oe(t,(a,l)=>new _(o,a,l),!0).store}}function Fe(e={}){return{...he(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function Be(e,t="dialog"){const{children:o,open:r,defaultOpen:a=!1,onOpenChange:l,onOpenChangeComplete:u,disablePointerDismissal:d=!1,modal:p=!0,actionsRef:n,handle:C,triggerId:m,defaultTriggerId:S=null}=e,O=t==="drawer",f=t==="alert-dialog",R=f?!0:p,E=f||d,h=f?"alertdialog":"dialog",g=b(!0),P={modal:R,disablePointerDismissal:E,nested:!!g,role:h},c=_.useStore(C?.store,{open:a,openProp:r,activeTriggerId:S,triggerIdProp:m,...P});Re(()=>{const y=r===void 0&&c.state.open===!1&&a===!0?{open:!0,activeTriggerId:S}:null;f?c.update(y?{...P,...y}:P):y&&c.update(y)}),c.useControlledProp("openProp",r),c.useControlledProp("triggerIdProp",m),c.useSyncedValues(P),c.useContextCallback("onOpenChange",l),c.useContextCallback("onOpenChangeComplete",u);const M=c.useState("open"),N=c.useState("mounted"),F=c.useState("payload"),B=ke({store:c,actionsRef:n,parentContext:g?.store.context,isDrawer:O}),j=M||N,U=i.useMemo(()=>({store:c}),[c]);return I.jsx(q.Provider,{value:!1,children:I.jsxs(X.Provider,{value:U,children:[j&&I.jsx(Me,{store:c,dialogRoot:B}),typeof o=="function"?o({payload:F}):o]})})}function Je(e){const t=i.useContext(q)?"drawer":"dialog";return Be(e,t)}let J=(function(e){return e[e.open=x.open]="open",e[e.closed=x.closed]="closed",e[e.startingStyle=x.startingStyle]="startingStyle",e[e.endingStyle=x.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const je={...L,...K,nested(e){return e?{[J.nested]:""}:null},nestedDialogOpen(e){return e?{[J.nestedDialogOpen]:""}:null}},We=i.forwardRef(function(t,o){const{render:r,className:a,style:l,children:u,...d}=t,p=V(),{store:n}=b(),C=n.useState("open"),m=n.useState("nested"),S=n.useState("transitionStatus"),O=n.useState("nestedOpenDialogCount"),f=n.useState("mounted"),R=n.useStateSetter("viewportElement"),E=O>0;return k("div",t,{enabled:p||f,state:{open:C,nested:m,transitionStatus:S,nestedDialogOpen:E},ref:[o,R],stateAttributesMapping:je,props:[{role:"presentation",hidden:!f,style:{pointerEvents:C?void 0:"none"},children:u},d]})}),ze=i.forwardRef(function(t,o){const{render:r,className:a,style:l,id:u,...d}=t,{store:p}=b(),n=xe(u);return p.useSyncedValueWithCleanup("titleElementId",n),k("h2",t,{ref:o,props:[{id:n},d]})});export{Je as D,$e as a,Ye as b,We as c,_e as d,ze as e,Ie as f,he as g,ye as p,b as u};
|
|
1
|
+
import{bQ as s,b9 as T,r as i,b4 as W,a as k,bf as K,be as ee,j as I,bY as te,b$ as ne,b as oe,bR as se,bG as re,bJ as ae,b8 as ie,bL as le}from"./main-D3YoNdym.js";import{x as z,P as G,w as L,A as x,l as H,v as ue,r as de,I as pe,h as ce,i as ge,j as fe,k as me,z as Se,m as Ce,s as Pe,e as Oe,f as Re,u as xe}from"./useScrollLock-CQdlrFZs.js";function Ee(){return new z({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new G,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function he(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ee(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:T,inactiveTriggerProps:T,popupProps:T}}function Ie(e,t,o=!1){return new z({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0})}const w=s(e=>e.triggerIdProp??e.activeTriggerId),Y=s(e=>e.openProp??e.open),$=s(e=>(e.popupElement?.id??e.floatingId)||void 0);function Q(e,t){return t!==void 0&&Y(e)&&w(e)===t}function ve(e,t){return Q(e,t)?!0:t!==void 0&&Y(e)&&w(e)==null&&e.triggerCount===1}const ye={open:Y,mounted:s(e=>e.mounted),transitionStatus:s(e=>e.transitionStatus),floatingRootContext:s(e=>e.floatingRootContext),triggerCount:s(e=>e.triggerCount),preventUnmountingOnClose:s(e=>e.preventUnmountingOnClose),payload:s(e=>e.payload),activeTriggerId:w,activeTriggerElement:s(e=>e.mounted?e.activeTriggerElement:null),popupId:$,isTriggerActive:s((e,t)=>t!==void 0&&w(e)===t),isOpenedByTrigger:s((e,t)=>Q(e,t)),isMountedByTrigger:s((e,t)=>t!==void 0&&w(e)===t&&e.mounted),triggerProps:s((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:s((e,t)=>ve(e,t)?$(e):void 0),popupProps:s(e=>e.popupProps),popupElement:s(e=>e.popupElement),positionerElement:s(e=>e.positionerElement)},q=i.createContext(!1),X=i.createContext(void 0);function b(e){const t=i.useContext(X);if(e===!1&&t===void 0)throw new Error(W(27));return t}const be={...L,...K},Ye=i.forwardRef(function(t,o){const{render:r,className:a,style:l,forceRender:u=!1,...d}=t,{store:p}=b(),n=p.useState("open"),C=p.useState("nested"),m=p.useState("mounted"),S=p.useState("transitionStatus");return k("div",t,{state:{open:n,transitionStatus:S},ref:[p.context.backdropRef,o],stateAttributesMapping:be,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:u||!C})});let Te=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),we=(function(e){return e[e.open=x.open]="open",e[e.closed=x.closed]="closed",e[e.startingStyle=x.startingStyle]="startingStyle",e[e.endingStyle=x.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Z=i.createContext(void 0);function V(){const e=i.useContext(Z);if(e===void 0)throw new Error(W(26));return e}const De={...L,...K,nestedDialogOpen(e){return e?{[we.nestedDialogOpen]:""}:null}},_e=i.forwardRef(function(t,o){const{render:r,className:a,style:l,finalFocus:u,initialFocus:d,...p}=t,{store:n}=b(),C=n.useState("descriptionElementId"),m=n.useState("disablePointerDismissal"),S=n.useState("floatingRootContext"),O=n.useState("popupProps"),f=n.useState("modal"),R=n.useState("mounted"),E=n.useState("nested"),h=n.useState("nestedOpenDialogCount"),g=n.useState("open"),v=n.useState("openMethod"),P=n.useState("titleElementId"),c=n.useState("transitionStatus"),M=n.useState("role"),N=S.useState("floatingId"),F=p.id??N;V(),ee({open:g,ref:n.context.popupRef,onComplete(){g&&n.context.onOpenChangeComplete?.(!0)}});function B(D){return D==="touch"?n.context.popupRef.current:!0}const j=d===void 0?B:d,U=h>0,y=n.useStateSetter("popupElement"),A=k("div",t,{state:{open:g,nested:E,transitionStatus:c,nestedDialogOpen:U},props:[O,{id:F,"aria-labelledby":P??void 0,"aria-describedby":C??void 0,role:M,...H,hidden:!R,onKeyDown(D){ue.has(D.key)&&D.stopPropagation()},style:{[Te.nestedDialogs]:h}},p],ref:[o,n.context.popupRef,y],stateAttributesMapping:De});return I.jsx(de,{context:S,openInteractionType:v,disabled:!R,closeOnFocusOut:!m,initialFocus:j,returnFocus:u,modal:f!==!1,restoreFocus:"popup",children:A})}),$e=i.forwardRef(function(t,o){const{keepMounted:r=!1,...a}=t,{store:l}=b(),u=l.useState("mounted"),d=l.useState("modal"),p=l.useState("open");return u||r?I.jsx(Z.Provider,{value:r,children:I.jsxs(te,{ref:o,...a,children:[u&&d===!0&&I.jsx(pe,{ref:l.context.internalBackdropRef,inert:ne(!p)}),t.children]})}):null});function ke(e){const{store:t,parentContext:o,actionsRef:r,isDrawer:a}=e,l=t.useState("open");ce(t,l),ge(t);const{forceUnmount:u}=fe(l,t),d=i.useCallback(()=>{t.setOpen(!1,oe(se))},[t]);return i.useImperativeHandle(r,()=>({unmount:u,close:d}),[u,d]),{parentContext:o,isDrawer:a}}function Me({store:e,dialogRoot:t}){const{parentContext:o,isDrawer:r}=t,a=e.useState("open"),l=e.useState("disablePointerDismissal"),u=e.useState("modal"),d=e.useState("popupElement"),p=e.useState("floatingRootContext"),[n,C]=i.useState(0),[m,S]=i.useState(0),O=n===0,f=me(p,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0||"touches"in g&&g.touches.length!==1)return!1;const v=re(g);if(O&&!l){const P=v;return u&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===P||e.context.backdropRef.current===P||ae(P,d)&&!P?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:O});Se(a&&u===!0,d),e.useContextCallback("onNestedDialogOpen",(g,v)=>{C(g),S(v)}),e.useContextCallback("onNestedDialogClose",()=>{C(0),S(0)}),i.useEffect(()=>(o?.onNestedDialogOpen&&a&&o.onNestedDialogOpen(n+1,m+(r?1:0)),o?.onNestedDialogClose&&!a&&o.onNestedDialogClose(),()=>{o?.onNestedDialogClose&&a&&o.onNestedDialogClose()}),[r,a,n,m,o]);const R=f.reference??T,E=f.trigger??T,h=i.useMemo(()=>ie(H,f.floating),[f.floating]);return Ce(e,{activeTriggerProps:R,inactiveTriggerProps:E,popupProps:h,nestedOpenDialogCount:n,nestedOpenDrawerCount:m}),null}const Ne={...ye,modal:s(e=>e.modal),nested:s(e=>e.nested),nestedOpenDialogCount:s(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:s(e=>e.nestedOpenDrawerCount),disablePointerDismissal:s(e=>e.disablePointerDismissal),openMethod:s(e=>e.openMethod),descriptionElementId:s(e=>e.descriptionElementId),titleElementId:s(e=>e.titleElementId),viewportElement:s(e=>e.viewportElement),role:s(e=>e.role)};class _ extends le{constructor(t,o,r=!1){const a=new G,l=Fe(t);l.floatingRootContext=Ie(a,o,r),super(l,{popupRef:i.createRef(),backdropRef:i.createRef(),internalBackdropRef:i.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:a,onOpenChange:void 0,onOpenChangeComplete:void 0},Ne)}setOpen=(t,o)=>{if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,o);const r={open:t};Pe(r,t,o.trigger),this.update(r)};static useStore(t,o){return Oe(t,(a,l)=>new _(o,a,l),!0).store}}function Fe(e={}){return{...he(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function Be(e,t="dialog"){const{children:o,open:r,defaultOpen:a=!1,onOpenChange:l,onOpenChangeComplete:u,disablePointerDismissal:d=!1,modal:p=!0,actionsRef:n,handle:C,triggerId:m,defaultTriggerId:S=null}=e,O=t==="drawer",f=t==="alert-dialog",R=f?!0:p,E=f||d,h=f?"alertdialog":"dialog",g=b(!0),P={modal:R,disablePointerDismissal:E,nested:!!g,role:h},c=_.useStore(C?.store,{open:a,openProp:r,activeTriggerId:S,triggerIdProp:m,...P});Re(()=>{const y=r===void 0&&c.state.open===!1&&a===!0?{open:!0,activeTriggerId:S}:null;f?c.update(y?{...P,...y}:P):y&&c.update(y)}),c.useControlledProp("openProp",r),c.useControlledProp("triggerIdProp",m),c.useSyncedValues(P),c.useContextCallback("onOpenChange",l),c.useContextCallback("onOpenChangeComplete",u);const M=c.useState("open"),N=c.useState("mounted"),F=c.useState("payload"),B=ke({store:c,actionsRef:n,parentContext:g?.store.context,isDrawer:O}),j=M||N,U=i.useMemo(()=>({store:c}),[c]);return I.jsx(q.Provider,{value:!1,children:I.jsxs(X.Provider,{value:U,children:[j&&I.jsx(Me,{store:c,dialogRoot:B}),typeof o=="function"?o({payload:F}):o]})})}function Je(e){const t=i.useContext(q)?"drawer":"dialog";return Be(e,t)}let J=(function(e){return e[e.open=x.open]="open",e[e.closed=x.closed]="closed",e[e.startingStyle=x.startingStyle]="startingStyle",e[e.endingStyle=x.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const je={...L,...K,nested(e){return e?{[J.nested]:""}:null},nestedDialogOpen(e){return e?{[J.nestedDialogOpen]:""}:null}},We=i.forwardRef(function(t,o){const{render:r,className:a,style:l,children:u,...d}=t,p=V(),{store:n}=b(),C=n.useState("open"),m=n.useState("nested"),S=n.useState("transitionStatus"),O=n.useState("nestedOpenDialogCount"),f=n.useState("mounted"),R=n.useStateSetter("viewportElement"),E=O>0;return k("div",t,{enabled:p||f,state:{open:C,nested:m,transitionStatus:S,nestedDialogOpen:E},ref:[o,R],stateAttributesMapping:je,props:[{role:"presentation",hidden:!f,style:{pointerEvents:C?void 0:"none"},children:u},d]})}),ze=i.forwardRef(function(t,o){const{render:r,className:a,style:l,id:u,...d}=t,{store:p}=b(),n=xe(u);return p.useSyncedValueWithCleanup("titleElementId",n),k("h2",t,{ref:o,props:[{id:n},d]})});export{Je as D,$e as a,Ye as b,We as c,_e as d,ze as e,Ie as f,he as g,ye as p,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,j as n,m as a}from"./main-
|
|
1
|
+
import{e as d,j as n,m as a}from"./main-D3YoNdym.js";function v({children:i,delay:t=0,duration:o=.35,y:e=12,className:s="",once:r=!0}){return d()?n.jsx("div",{className:s,children:i}):n.jsx(a.div,{initial:{opacity:0,y:e},animate:{opacity:1,y:0},transition:{duration:o,delay:t,ease:[.16,1,.3,1]},className:s,children:i})}function x({children:i,staggerDelay:t=.1,initialDelay:o=0,className:e=""}){return d()?n.jsx("div",{className:e,children:i}):n.jsx(a.div,{initial:"hidden",animate:"visible",variants:{hidden:{},visible:{transition:{staggerChildren:t,delayChildren:o}}},className:e,children:i})}function h({children:i,className:t="",y:o=12}){return d()?n.jsx("div",{className:t,children:i}):n.jsx(a.div,{variants:{hidden:{opacity:0,y:o},visible:{opacity:1,y:0,transition:{duration:.35,ease:[.16,1,.3,1]}}},className:t,children:i})}export{v as F,x as S,h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,aF as c,j as t}from"./main-
|
|
1
|
+
import{r as s,aF as c,j as t}from"./main-D3YoNdym.js";function u({repo:r="mm7894215/TokenTracker"}){const[a,o]=s.useState(null);return s.useEffect(()=>{if(typeof window>"u")return;const n=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,i=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));c({prefersReducedMotion:n,screenshotCapture:i})&&fetch(`https://api.github.com/repos/${r}`).then(e=>e.json()).then(e=>{e&&typeof e.stargazers_count=="number"&&o(e.stargazers_count)}).catch(()=>{})},[r]),t.jsxs("a",{href:`https://github.com/${r}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[t.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",children:t.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),t.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),a!==null&&t.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:a})]})}export{u as H};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{r as ge,G as t,j as n}from"./main-D3YoNdym.js";const Ge=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),j=Ge?"/proxy/ipcheck":"https://ip.net.coffee",fe="claude_ip_history",Se=6,Ue=["CN","HK","MO","RU","KP","IR","SY","CU","BY","VE"],ze={CN:"Asia/Shanghai",TW:"Asia/Taipei",HK:"Asia/Hong_Kong",MO:"Asia/Macau",JP:"Asia/Tokyo",KR:"Asia/Seoul",SG:"Asia/Singapore",MY:"Asia/Kuala_Lumpur",TH:"Asia/Bangkok",VN:"Asia/Ho_Chi_Minh",ID:"Asia/Jakarta",PH:"Asia/Manila",IN:"Asia/Kolkata",PK:"Asia/Karachi",BD:"Asia/Dhaka",IR:"Asia/Tehran",IL:"Asia/Jerusalem",AE:"Asia/Dubai",SA:"Asia/Riyadh",TR:"Europe/Istanbul",RU:"Europe/Moscow",UA:"Europe/Kyiv",GB:"Europe/London",IE:"Europe/Dublin",FR:"Europe/Paris",DE:"Europe/Berlin",IT:"Europe/Rome",ES:"Europe/Madrid",PT:"Europe/Lisbon",NL:"Europe/Amsterdam",BE:"Europe/Brussels",CH:"Europe/Zurich",AT:"Europe/Vienna",SE:"Europe/Stockholm",NO:"Europe/Oslo",DK:"Europe/Copenhagen",FI:"Europe/Helsinki",PL:"Europe/Warsaw",CZ:"Europe/Prague",GR:"Europe/Athens",RO:"Europe/Bucharest",US:"America/Los_Angeles",CA:"America/Toronto",MX:"America/Mexico_City",BR:"America/Sao_Paulo",AR:"America/Argentina/Buenos_Aires",CL:"America/Santiago",AU:"Australia/Sydney",NZ:"Pacific/Auckland",ZA:"Africa/Johannesburg",EG:"Africa/Cairo",NG:"Africa/Lagos",KE:"Africa/Nairobi"},We={CN:["zh"],TW:["zh"],HK:["zh","en"],MO:["zh","en"],JP:["ja"],KR:["ko"],TH:["th"],VN:["vi"],SG:["en","zh","ms","ta"],MY:["ms","en","zh","ta"],ID:["id","en"],PH:["en","tl","fil"],IN:["en","hi"],PK:["ur","en"],BD:["bn","en"],LK:["si","ta","en"],NP:["ne","en"],US:["en"],GB:["en"],IE:["en","ga"],AU:["en"],NZ:["en","mi"],CA:["en","fr"],DE:["de"],AT:["de"],CH:["de","fr","it","rm"],BE:["nl","fr","de"],FR:["fr"],IT:["it"],ES:["es","ca","gl","eu"],PT:["pt"],NL:["nl","fy"],LU:["lb","fr","de"],SE:["sv"],NO:["no","nb","nn"],DK:["da"],FI:["fi","sv"],IS:["is","en"],PL:["pl"],CZ:["cs"],SK:["sk"],HU:["hu"],RO:["ro"],BG:["bg"],GR:["el"],RU:["ru"],UA:["uk","ru"],BY:["be","ru"],TR:["tr"],IL:["he","ar","en"],SA:["ar"],AE:["ar","en"],EG:["ar"],IR:["fa"],IQ:["ar","ku"],ZA:["en","af","zu","xh"],KE:["en","sw"],NG:["en"],ET:["am","en"],BR:["pt"],AR:["es"],MX:["es"],CL:["es"],CO:["es"],PE:["es"],VE:["es"]},Be={jp:"Japan",tw:"Taiwan",hk:"Hong Kong",sg:"Singapore",us:"United States",de:"Germany",kr:"South Korea",fr:"France",nl:"Netherlands",gb:"United Kingdom",au:"Australia",ca:"Canada",br:"Brazil",in:"India"};function Z(p){return!!p&&p.includes(":")}function Ke(p){return!Z(p)||p.length<=20?p:p.substring(0,18)+"..."}function w(p){return p==null?"":String(p).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function B(p){if(!p||!/^[a-zA-Z]{2}$/.test(p))return"";const b=p.toLowerCase();return`<img src="${b==="cn"?`${j}/favicons/cn.png`:b==="tw"?`${j}/favicons/flags/tw.png`:`${j}/favicons/flags/${b}.png`}" alt="${b}" class="inline-block h-4 w-auto align-[-2px]" onerror="this.onerror=null;this.style.display='none'">`}function Fe(p){if(!p)return"";const b=String(p).trim();if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(b)){const S=b.split(".");return S[0]+"."+S[1]+".*.*"}if(b.includes("…")){const S=b.lastIndexOf("…");return b.substring(0,S+1)+"*"}if(b.includes(":")){const S=b.split(":");if(S.length>=2)return S[0]+":"+S[1]+":*"}return b}function Ve(p){if(!p)return null;try{const S=new Intl.DateTimeFormat("en-US",{timeZone:p,timeZoneName:"longOffset"}).formatToParts(new Date).find(q=>q.type==="timeZoneName");if(!S)return null;if(S.value==="GMT"||S.value==="UTC")return 0;const M=S.value.match(/GMT([+-])(\d{1,2}):?(\d{0,2})/);return M?(M[1]==="+"?1:-1)*(parseInt(M[2],10)*60+parseInt(M[3]||"0",10)):null}catch{return null}}function Ye(p){if(p==null)return"";const b=p>=0?"+":"-",S=Math.abs(p),M=Math.floor(S/60),D=S%60;return"UTC"+b+M+(D?":"+String(D).padStart(2,"0"):"")}const Te={safe:"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300",warn:"bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300",danger:"bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300",info:"bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-300",neutral:"bg-oai-gray-100 text-oai-gray-600 dark:bg-oai-gray-800 dark:text-oai-gray-400"};function Je(){const p=ge.useRef(null),[b,S]=ge.useState(!1);ge.useEffect(()=>{const _=p.current;if(!_)return;const C=a=>_.querySelector(`#${a}`);let se=!1;const e={unknown:t("ipcheck.common.unknown"),failed:t("ipcheck.ip.failed"),regionAccessible:t("ipcheck.trust.region.accessible"),regionWarnTitle:a=>t("ipcheck.trust.region_warn.title",{region:a}),regionWarnBody:t("ipcheck.trust.region_warn.body"),regionRestrictedText:t("ipcheck.trust.text.restricted"),noData:t("ipcheck.trust.no_data"),noIp:t("ipcheck.trust.no_ip"),noScore:t("ipcheck.trust.no_score"),score:{pristine:t("ipcheck.trust.label.pristine"),clean:t("ipcheck.trust.label.clean"),good:t("ipcheck.trust.label.good"),neutral:t("ipcheck.trust.label.neutral"),suspicious:t("ipcheck.trust.label.suspicious"),unreachable:t("ipcheck.trust.label.unreachable")},scoreText:{excellent:t("ipcheck.trust.text.excellent"),great:t("ipcheck.trust.text.great"),minor:t("ipcheck.trust.text.minor"),moderate:t("ipcheck.trust.text.moderate"),severe:t("ipcheck.trust.text.severe")},propsRegion:t("ipcheck.props.region"),propsCity:t("ipcheck.props.city"),propsType:t("ipcheck.props.type"),propsAsn:t("ipcheck.props.asn"),propsOrg:t("ipcheck.props.org"),propsResidential:t("ipcheck.props.residential"),propsDatacenter:t("ipcheck.props.datacenter"),secVpn:t("ipcheck.security.vpn"),secProxy:t("ipcheck.security.proxy"),secTor:t("ipcheck.security.tor"),secCrawler:t("ipcheck.security.crawler"),secAbuser:t("ipcheck.security.abuser"),secProxyFlag:t("ipcheck.security.proxy_flag"),secCrawlerYes:t("ipcheck.security.crawler_yes"),secCrawlerNo:t("ipcheck.security.crawler_no"),secAbuserYes:t("ipcheck.security.abuser_yes"),secAbuserNo:t("ipcheck.security.abuser_no"),secClean:t("ipcheck.security.clean"),availSvc:t("ipcheck.avail.svc_row"),availLat:{normal:t("ipcheck.avail.latency.normal"),good:t("ipcheck.avail.latency.good"),slow:t("ipcheck.avail.latency.slow"),unreachable:t("ipcheck.avail.latency.unreachable")},availSvcStatus:{none:t("ipcheck.avail.svc.none"),minor:t("ipcheck.avail.svc.minor"),major:t("ipcheck.avail.svc.major"),critical:t("ipcheck.avail.svc.critical"),maintenance:t("ipcheck.avail.svc.maintenance"),other:t("ipcheck.avail.svc.other")},dnsStatus:t("ipcheck.dns.status"),dnsOutlet:t("ipcheck.dns.outlet"),dnsOutletIp:t("ipcheck.dns.outlet_ip"),dnsIsp:t("ipcheck.dns.isp"),dnsLeaked:t("ipcheck.dns.leaked"),dnsNoLeak:t("ipcheck.dns.no_leak"),dnsEncrypted:t("ipcheck.dns.encrypted"),dnsCnTag:t("ipcheck.dns.cn_tag"),udpStatus:t("ipcheck.udp.status"),udpOutlet:t("ipcheck.udp.outlet"),udpOutletIp:t("ipcheck.udp.outlet_ip"),udpOrigin:t("ipcheck.udp.origin"),udpDisabled:t("ipcheck.udp.disabled"),udpNoLeak:t("ipcheck.udp.no_leak"),udpLeaked:t("ipcheck.udp.leaked"),udpAnomaly:t("ipcheck.udp.anomaly"),devTz:t("ipcheck.device.tz"),devLang:t("ipcheck.device.lang"),devOs:t("ipcheck.device.os"),devTouch:t("ipcheck.device.touch"),devNet:t("ipcheck.device.net"),devDnt:t("ipcheck.device.dnt"),devWebglRender:t("ipcheck.device.webgl_render"),devCanvasFp:t("ipcheck.device.canvas_fp"),devWebglFp:t("ipcheck.device.webgl_fp"),devMatch:t("ipcheck.device.match"),devMismatch:t("ipcheck.device.mismatch"),devLocal:t("ipcheck.device.local"),devEstSuffix:t("ipcheck.device.estimate_suffix"),devDiffEqual:t("ipcheck.device.diff_equal"),devDiffAhead:a=>t("ipcheck.device.diff_ahead",{h:a}),devDiffBehind:a=>t("ipcheck.device.diff_behind",{h:a}),devLangExpected:t("ipcheck.device.lang_expected"),devTouchYes:t("ipcheck.device.touch_yes"),devTouchNo:t("ipcheck.device.touch_no"),devDntOn:t("ipcheck.device.dnt_on"),devDntOff:t("ipcheck.device.dnt_off"),devDntUnset:t("ipcheck.device.dnt_unset"),devNetUnsupported:t("ipcheck.device.net_unsupported"),devUnsupported:t("ipcheck.device.unsupported"),histEmpty:t("ipcheck.history.empty"),histCurrent:t("ipcheck.history.current"),histLoading:t("ipcheck.ip.loading")};function f(a,i="neutral"){return`<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${Te[i]||Te.neutral}">${a}</span>`}function J(a,i,r){return a===!0?f(i,"danger"):a===!1?f(r,"safe"):f(e.unknown,"neutral")}function he(a){if(!a)return`<span class="text-oai-gray-400 dark:text-oai-gray-500">${w(e.failed)}</span>`;const i=w(a);return Z(a)?`<span class="ip-mask-target truncate" title="${i}">${w(Ke(a))}</span>`:`<span class="ip-mask-target">${i}</span>`}function K(a){return a?`<span class="ip-link">${he(a)}</span>`:`<span class="text-oai-gray-400 dark:text-oai-gray-500">${w(e.failed)}</span>`}function d(a,i,r=!1){let u=i;return i===void 0?r?u=`<div class="inline-flex items-center gap-1.5 text-xs text-oai-gray-400">
|
|
2
|
+
<svg class="animate-spin-subtle h-3.5 w-3.5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
3
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="3"></circle>
|
|
4
|
+
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
5
|
+
</svg>
|
|
6
|
+
</div>`:u='<span class="block h-3 w-20 rounded bg-oai-gray-100 dark:bg-oai-gray-800 shimmer"></span>':u=`<div class="animate-scale-up-fade">${i}</div>`,`<div class="flex items-center justify-between py-2.5 gap-3">
|
|
7
|
+
<span class="text-sm text-oai-gray-500 dark:text-oai-gray-400 shrink-0">${a}</span>
|
|
8
|
+
<span class="text-sm font-medium text-oai-black dark:text-white text-right min-w-0">${u}</span>
|
|
9
|
+
</div>`}function re(a){return a.map(i=>d(i,void 0)).join("")}function oe(){return'<div class="h-7 w-44 rounded bg-oai-gray-100 dark:bg-oai-gray-800 shimmer"></div>'}function ce(){return'<div class="h-3 w-52 mt-2 rounded bg-oai-gray-100 dark:bg-oai-gray-800 shimmer"></div>'}function _e(a){return a>=95?{text:e.score.pristine,variant:"safe"}:a>=80?{text:e.score.clean,variant:"safe"}:a>=50?{text:e.score.good,variant:"info"}:a>=25?{text:e.score.neutral,variant:"warn"}:{text:e.score.suspicious,variant:"danger"}}const m={ip:null,ippure:null,ipapis:null,claudeGeo:null,claudeRisk:null,cfGeo:"",scoreAnimId:null,lastScore:0};function xe(){const a=(m.claudeRisk?.countryCode||"").toUpperCase();return!a||!Ue.includes(a)?null:t(`ipcheck.region.${a}`)}function le(){const a=C("ipv6Warn");a&&a.classList.remove("hidden")}function te(a,i){const r=C(a);r&&(r.textContent=i||"",r.classList.remove("animate-pulse","bg-oai-gray-200","dark:bg-oai-gray-800","w-52","h-3","mt-2","rounded"))}const Le={gaugeScore:'<span class="block h-8 w-16 rounded bg-oai-gray-100 dark:bg-oai-gray-800 shimmer"></span>',ipAddrCN:oe(),ipGeoCN:ce(),ipAddr:oe(),ipGeo:ce(),ipAddrClaude:oe(),ipGeoClaude:ce(),propsContent:re([e.propsRegion,e.propsCity,e.propsType,e.propsAsn,e.propsOrg]),securityContent:re([e.secVpn,e.secProxy,e.secTor,e.secCrawler,e.secAbuser]),claudeAvailContent:d("claude.ai",void 0,!0)+d("anthropic.com",void 0,!0),dnsLeakContent:d(e.dnsStatus,void 0,!0)+d(e.dnsOutletIp,void 0,!0),udpLeakContent:d(e.udpStatus,void 0,!0)+d(e.udpOutletIp,void 0,!0),deviceContent:re([e.devTz,e.devLang,e.devOs,e.devTouch,e.devNet,e.devDnt,e.devWebglRender,e.devCanvasFp]),ipHistoryContent:`<span class="text-sm text-oai-gray-400 dark:text-oai-gray-500">${e.histLoading}</span>`};Object.entries(Le).forEach(([a,i])=>{const r=C(a);r&&(r.innerHTML=i)});let ye=!1;function Ne(a){if(!a)return;a.dataset.realText||(a.dataset.realText=(a.textContent||"").trim());const i=a.dataset.realText,r=ye?Fe(i):i;a.textContent!==r&&(a.textContent=r)}function ke(){_.querySelectorAll(".ip-link, .ip-mask-target").forEach(Ne)}const ve=new MutationObserver(()=>requestAnimationFrame(ke));["ipHeroCN","ipHero","ipHeroClaude","ipHistoryContent","dnsLeakContent","udpLeakContent"].forEach(a=>{const i=C(a);i&&ve.observe(i,{childList:!0,subtree:!0})}),_.__setMaskOn=a=>{ye=!!a,ke()};async function $e(){try{const r=(await(await fetch("https://1.1.1.1/cdn-cgi/trace",{signal:AbortSignal.timeout(5e3)})).text()).match(/ip=([^\n]+)/);r&&(m.ip=r[1].trim())}catch{}}async function je(){try{const i=await(await fetch("https://claude.ai/cdn-cgi/trace",{cache:"no-store",signal:AbortSignal.timeout(8e3)})).text(),r=Object.fromEntries(i.trim().split(`
|
|
10
|
+
`).map(u=>u.split("=")));return{ip:r.ip||null,loc:r.loc?.toLowerCase()||null}}catch{return null}}async function Me(){try{const r=(await(await fetch("https://2026.ip138.com/",{signal:AbortSignal.timeout(5e3)})).text()).match(/(\d+\.\d+\.\d+\.\d+)/);if(r)return{ip:r[1]}}catch{}try{const r=(await(await fetch("https://my.ip.cn/",{signal:AbortSignal.timeout(5e3)})).text()).match(/(\d+\.\d+\.\d+\.\d+)/);if(r)return{ip:r[1]}}catch{}return null}async function Ee(a,i,r,u){const g=C(a),o=C(i);if(!(!g||!o)){if(!r){g.innerHTML=`<span class="text-oai-gray-400 dark:text-oai-gray-500">${e.failed}</span>`,o.textContent="";return}Z(r)&&le(),g.innerHTML=`${B(u)+" "}${K(r)}`;try{const l=await fetch(`${j}/api/geoip/${r}`,{signal:AbortSignal.timeout(5e3)});if(l.ok){const h=await l.json(),s=[h.country,h.region,h.city,h.isp].filter(Boolean).join(" · "),x=h.country_code||u||"";g.innerHTML=`${B(x)} ${K(r)}`,te(i,s)}}catch{}}}function Ie(){const a=m.ippure,i=m.claudeRisk,r=m.claudeGeo,u=m.ipapis,g=i?.asn||a?.asn||"",o=i?.asOrganization||a?.asOrganization||u?.company?.name||"",l=xe(),h=!!(i&&i.ip);let s,x=null;h?l?(s=0,x=e.regionRestrictedText):s=typeof i.trust_score=="number"?i.trust_score:null:s=null;const v=C("gaugePointer"),c=C("gaugeScore"),P=C("gaugeText");if(s===null)c.innerHTML=`<span class="text-4xl font-bold tracking-tight tabular-nums text-oai-gray-400 dark:text-oai-gray-500">—</span> ${f(e.noData,"neutral")}`,v.style.left="0%",v.style.opacity="0.3",v.style.borderColor="",v.style.boxShadow="",P.textContent=h?e.noScore:e.noIp;else{const A=l?{text:e.score.unreachable,variant:"danger"}:_e(s),L=s>=50?"text-emerald-500":s>=25?"text-amber-500":"text-red-500",X=s>=50?"#10b981":s>=25?"#f59e0b":"#ef4444";if(m.lastScore!==s){m.scoreAnimId&&cancelAnimationFrame(m.scoreAnimId);const Q=m.lastScore||0;m.lastScore=s;const de=performance.now(),ee=800,ne=ue=>{const N=ue-de,k=Math.min(N/ee,1),$=k*(2-k),I=Math.round(Q+(s-Q)*$),Y=I>=50?"text-emerald-500":I>=25?"text-amber-500":"text-red-500";c&&(c.innerHTML=`<span class="text-4xl font-bold tracking-tight tabular-nums ${Y}">${I}</span> ${f(A.text,A.variant)}`),k<1?m.scoreAnimId=requestAnimationFrame(ne):m.scoreAnimId=null};m.scoreAnimId=requestAnimationFrame(ne)}else c.innerHTML=`<span class="text-4xl font-bold tracking-tight tabular-nums ${L}">${s}</span> ${f(A.text,A.variant)}`;requestAnimationFrame(()=>{requestAnimationFrame(()=>{v&&(v.style.left=Math.min(s,100)+"%",v.style.opacity="1",v.style.borderColor=X,v.style.boxShadow=`0 0 10px ${X}80, 0 2px 6px rgba(0,0,0,0.15)`)})}),P.textContent=x||(s>=95?e.scoreText.excellent:s>=80?e.scoreText.great:s>=50?e.scoreText.minor:s>=25?e.scoreText.moderate:e.scoreText.severe)}const y=C("statusDotClaude");if(y){let A,L;s===null?(A="animate-ping absolute inline-flex h-full w-full rounded-full bg-oai-gray-300 dark:bg-oai-gray-600 opacity-75",L="relative inline-flex h-2 w-2 rounded-full bg-oai-gray-400 dark:bg-oai-gray-500"):l||s<25?(A="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75",L="relative inline-flex h-2 w-2 rounded-full bg-red-500"):s<50?(A="animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75",L="relative inline-flex h-2 w-2 rounded-full bg-amber-500"):(A="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75",L="relative inline-flex h-2 w-2 rounded-full bg-emerald-500"),y.innerHTML=`<span class="${A}"></span><span class="${L}"></span>`}const H=C("regionWarn");H&&(l?(H.innerHTML=`<span class="font-medium">⚠️ ${e.regionWarnTitle(l)}</span><br><span class="text-[13px] font-normal mt-1 block opacity-90">${e.regionWarnBody}</span>`,H.classList.remove("hidden")):H.classList.add("hidden"));const G=C("claudeRegionSupportRow"),F=C("claudeRegionSupport");if(G&&F)if(l)G.classList.add("hidden");else{const A=!!(i&&i.ip),L=!!(i&&i.countryCode);F.innerHTML=!A||!L?f(e.unknown,"neutral"):f(e.regionAccessible,"safe"),G.classList.remove("hidden")}const U=i?.isResidential??(u?!u.is_datacenter:null),O=u?.company?.type||"",z=r?.country||i?.country||"",W=r?.city||i?.city||"";let T;if(U===!0?T=f(e.propsResidential,"safe"):U===!1?T=f(e.propsDatacenter,"warn"):T=f(e.unknown,"neutral"),O){const L={hosting:"Hosting",isp:"ISP",business:"Business",education:"Education"}[O]||w(O);T+=` <span class="text-xs text-oai-gray-500 dark:text-oai-gray-400">${L}</span>`}C("propsContent").innerHTML=d(e.propsRegion,z?w(z):f(e.unknown,"neutral"))+d(e.propsCity,W?w(W):f(e.unknown,"neutral"))+d(e.propsType,T)+d(e.propsAsn,g?`<span class="font-mono tabular-nums">AS${w(g)}</span>`:f(e.unknown,"neutral"))+d(e.propsOrg,o?w(o):f(e.unknown,"neutral"));const E=u||{};C("securityContent").innerHTML=d(e.secVpn,J(E.is_vpn,e.secVpn,e.secClean))+d(e.secProxy,J(E.is_proxy,e.secProxyFlag,e.secClean))+d(e.secTor,J(E.is_tor,e.secTor,e.secClean))+d(e.secCrawler,J(E.is_crawler,e.secCrawlerYes,e.secCrawlerNo))+d(e.secAbuser,J(E.is_abuser,e.secAbuserYes,e.secAbuserNo))}async function Re(){const a=C("dnsLeakContent");if(!a)return;a.innerHTML=d(e.dnsStatus,void 0,!0)+d(e.dnsOutletIp,void 0,!0);const i=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2);for(let s=1;s<=2;s++)await new Promise(x=>{const v=new Image,c=setTimeout(x,2e3);v.onload=v.onerror=()=>{clearTimeout(c),x()},v.src=`http://${i}-${s}.d.ip.net.coffee/pixel.gif?_=${Date.now()}`});await new Promise(s=>setTimeout(s,1500));let r=[];for(let s=0;s<2;s++){try{const x=await fetch(`${j}/api/dns/result/${i}`,{signal:AbortSignal.timeout(3e3)});if(x.ok&&(r=(await x.json()).dns_servers||[],r.length>0))break}catch{}s===0&&await new Promise(x=>setTimeout(x,1500))}if(r.length===0){a.innerHTML=d(e.dnsStatus,f(e.dnsEncrypted,"safe"));return}const u=(m.claudeRisk?.country||"").toLowerCase(),g=u.includes("china")||u.includes("中国");let o=null,l=!1;for(const s of r){let x=null;try{const y=await fetch(`${j}/api/geoip/${s}`,{signal:AbortSignal.timeout(3e3)});y.ok&&(x=await y.json())}catch{}const v=x?.country_code||"",c=x?.isp||"";if(v==="cn"&&!g){o={ip:s,cc:v,isp:c,leaked:!0},l=!0;break}o||(o={ip:s,cc:v,isp:c,leaked:!1})}let h=d(e.dnsStatus,l?f(e.dnsLeaked,"warn"):f(e.dnsNoLeak,"safe"));if(o){const s=`${B(o.cc)} <span class="ip-mask-target ${o.leaked?"text-amber-600 dark:text-amber-400 font-medium":""}">${w(o.ip)}</span>${o.leaked?" "+f(e.dnsCnTag,"warn"):""}`;h+=d(e.dnsOutlet,s),o.isp&&(h+=d(e.dnsIsp,`<span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal truncate inline-block max-w-[12rem] align-bottom">${w(o.isp)}</span>`))}a.innerHTML=h}async function He(){const a=C("udpLeakContent");if(!a)return;a.innerHTML=d(e.udpStatus,void 0,!0)+d(e.udpOutletIp,void 0,!0);const i=new Set;try{const y=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun.cloudflare.com:3478"}]});y.createDataChannel("");const H=await y.createOffer();await y.setLocalDescription(H),await new Promise(G=>{const F=setTimeout(()=>{y.close(),G()},5e3);y.onicecandidate=U=>{if(!U.candidate){clearTimeout(F),y.close(),G();return}const O=U.candidate.candidate.match(/([0-9]{1,3}\.){3}[0-9]{1,3}/);if(O){const W=O[0];!W.startsWith("0.")&&!W.startsWith("127.")&&W!=="0.0.0.0"&&i.add(W)}const z=U.candidate.candidate.match(/([a-f0-9]{1,4}:){2,7}[a-f0-9]{1,4}/i);z&&i.add(z[0])}})}catch{}const r=m.claudeRisk?.ip||"",u=[...i],g=u.filter(y=>!Z(y)&&!y.startsWith("192.168.")&&!y.startsWith("10.")&&!y.startsWith("172.")&&!y.startsWith("198.18.")&&!y.startsWith("198.19.")&&!y.startsWith("100.64.")&&!y.startsWith("127.")&&!y.startsWith("0."));if(g.length===0&&u.length===0){a.innerHTML=d(e.udpStatus,f(e.udpDisabled,"safe"));return}if(g.length===0){a.innerHTML=d(e.udpStatus,f(e.udpNoLeak,"safe"));return}let o=g.find(y=>y===r)||g[0];const l=new Set(g).size>1,h=o===r,s=l&&!h;let x=d(e.udpStatus,s?f(e.udpLeaked,"warn"):f(e.udpNoLeak,"safe")),v="",c="";try{const y=await fetch(`${j}/api/geoip/${o}`,{signal:AbortSignal.timeout(5e3)});if(y.ok){const H=await y.json();v=H.country_code||"",c=H.country||""}}catch{}const P=`${B(v)} <span class="${s?"text-amber-600 dark:text-amber-400 font-medium":""}">${he(o)}</span>${h?"":s?" "+f(e.udpAnomaly,"warn"):""}`;x+=d(e.udpOutlet,P),c&&(x+=d(e.udpOrigin,`<span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal">${w(c)}</span>`)),a.innerHTML=x}async function be(){const a=C("claudeAvailContent");if(!a)return;a.innerHTML=d("claude.ai",void 0,!0)+d("anthropic.com",void 0,!0);const i=[{name:"claude.ai",url:"https://claude.ai/cdn-cgi/trace"},{name:"anthropic.com",url:"https://www.anthropic.com/favicon.ico"}],r=await Promise.allSettled(i.map(async o=>{const l=performance.now();try{return await fetch(o.url,{mode:"no-cors",signal:AbortSignal.timeout(6e3)}),{name:o.name,ms:Math.round(performance.now()-l),ok:!0}}catch{return{name:o.name,ms:-1,ok:!1}}})),u=xe();let g="";r.forEach(o=>{const l=o.value;if(u)g+=d(l.name,f(e.availLat.unreachable,"danger"));else if(l.ok){const h=l.ms<250?"safe":l.ms<500?"info":"warn",s=l.ms<250?e.availLat.normal:l.ms<500?e.availLat.good:e.availLat.slow;g+=d(l.name,`${f(s,h)} <span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal">${l.ms}ms</span>`)}else g+=d(l.name,f(e.availLat.unreachable,"danger"))});try{const o=await fetch(`${j}/claude/status.json`,{signal:AbortSignal.timeout(3e3)});if(o.ok){const h=(await o.json()).overall_indicator||"none",s=e.availSvcStatus[h]||e.availSvcStatus.other,x={none:"safe",minor:"warn",major:"danger",critical:"danger",maintenance:"warn"};g+=d(e.availSvc,f(s,x[h]||"warn"))}}catch{}a.innerHTML=g}_.__detectClaudeAvail=be;function Oe(){const a=Intl.DateTimeFormat().resolvedOptions().timeZone||e.unknown,i=-(new Date().getTimezoneOffset()/60),r="UTC"+(i>=0?"+":"")+i,u=m.claudeRisk,g=(u?.countryCode||"").toUpperCase(),o=u?.timezone||ze[g]||"",l=!!u?.timezone,h=Ve(o),s=-new Date().getTimezoneOffset();let x=null;o&&h!=null&&(x=Math.abs(h-s)<=60);let v;const c=w(a),P=w(o);if(x===!0)v=`${f(e.devMatch,"safe")} <span class="text-xs text-oai-gray-500 dark:text-oai-gray-400">${c} (${r})</span>`;else if(x===!1){const N=Ye(h),k=Math.round((h-s)/60),$=k===0?e.devDiffEqual:k>0?e.devDiffAhead(k):e.devDiffBehind(-k),I=l?P:`${P} ${e.devEstSuffix}`;v=`${f(e.devMismatch,"warn")}<br><span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal">${e.devLocal} ${c} (${r})<br>Claude ${I} (${N}) · ${$}</span>`}else v=`<span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal">${c} (${r})</span>`;const y=navigator.languages||[navigator.language],H=y.join(", ")||e.unknown,G=(y[0]||"").split("-")[0].toLowerCase(),F=We[g]||[],U=G&&F.length?F.includes(G):null;let O;const z=w(H),W=w(F.join(" / "));U===!0?O=`${f(e.devMatch,"safe")} <span class="text-xs text-oai-gray-500 dark:text-oai-gray-400">${z}</span>`:U===!1?O=`${f(e.devMismatch,"warn")}<br><span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal">${e.devLocal} ${z}<br>${e.devLangExpected} ${W}</span>`:O=`<span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal">${z}</span>`;const T=navigator.userAgent;let E=e.unknown,A=e.unknown;T.includes("Windows")?E="Windows":T.includes("Mac OS")?E="macOS":T.includes("iPhone")||T.includes("iPad")?E="iOS":T.includes("Android")?E="Android":T.includes("Linux")&&(E="Linux"),T.includes("Edg/")?A="Edge "+(T.match(/Edg\/([\d.]+)/)||[])[1]:T.includes("Chrome/")?A="Chrome "+(T.match(/Chrome\/([\d.]+)/)||[])[1]:T.includes("Firefox/")?A="Firefox "+(T.match(/Firefox\/([\d.]+)/)||[])[1]:T.includes("Safari/")&&!T.includes("Chrome")&&(A="Safari "+(T.match(/Version\/([\d.]+)/)||[])[1]);let L=e.devUnsupported;try{const N=document.createElement("canvas"),k=N.getContext("webgl")||N.getContext("experimental-webgl");if(k){const $=k.getExtension("WEBGL_debug_renderer_info");$&&(L=k.getParameter($.UNMASKED_RENDERER_WEBGL))}}catch{}let X=e.devUnsupported;try{const N=document.createElement("canvas"),k=N.getContext("webgl")||N.getContext("experimental-webgl");if(k){const $=k.getExtension("WEBGL_debug_renderer_info"),I=$?k.getParameter($.UNMASKED_VENDOR_WEBGL):"",Y=$?k.getParameter($.UNMASKED_RENDERER_WEBGL):"",Ce=I+"~"+Y+"~"+k.getParameter(k.VERSION)+"~"+k.getParameter(k.SHADING_LANGUAGE_VERSION);let ie=0;for(let pe=0;pe<Ce.length;pe++)ie=(ie<<5)-ie+Ce.charCodeAt(pe)|0;X=(ie>>>0).toString(16).toUpperCase()}}catch{}let Q=e.devUnsupported;try{const N=document.createElement("canvas");N.width=200,N.height=50;const k=N.getContext("2d");k.textBaseline="top",k.font="14px Arial",k.fillStyle="#f60",k.fillRect(50,0,100,50),k.fillStyle="#069",k.fillText("net.coffee",2,15),k.fillStyle="rgba(102,204,0,0.7)",k.fillText("canvas fp",4,30);const $=N.toDataURL();let I=0;for(let Y=0;Y<$.length;Y++)I=(I<<5)-I+$.charCodeAt(Y)|0;Q=(I>>>0).toString(16).toUpperCase()}catch{}const de=navigator.maxTouchPoints>0,ee=navigator.connection||navigator.mozConnection||navigator.webkitConnection,ne=ee?ee.effectiveType||ee.type||e.unknown:e.devNetUnsupported,ue=navigator.doNotTrack==="1"?e.devDntOn:navigator.doNotTrack==="0"?e.devDntOff:e.devDntUnset;C("deviceContent").innerHTML=d(e.devTz,v)+d(e.devLang,O)+d(e.devOs,`${w(E)} <span class="text-oai-gray-400 dark:text-oai-gray-500">/</span> ${w(A)}`)+d(e.devTouch,de?f(e.devTouchYes,"info"):f(e.devTouchNo,"neutral"))+d(e.devNet,`<span class="font-mono uppercase">${w(ne)}</span>`)+d(e.devDnt,w(ue))+d(e.devWebglRender,`<span class="text-xs font-normal text-oai-gray-600 dark:text-oai-gray-400 break-all">${w(L)}</span>`)+d(e.devCanvasFp,`<span class="font-mono text-oai-gray-700 dark:text-oai-gray-300">${w(Q)}</span>`)+d(e.devWebglFp,`<span class="font-mono text-oai-gray-700 dark:text-oai-gray-300">${w(X)}</span>`)}function we(){try{return JSON.parse(localStorage.getItem(fe))||[]}catch{return[]}}function Pe(){const a=m.claudeRisk?.ip||"",i=(m.claudeRisk?.countryCode||"").toLowerCase(),r=m.claudeRisk?.city||"";if(!a){ae();return}const u=we(),g=new Date,o={ip:a,cc:i,geo:r,time:g.toISOString()};if(u.length>0){const l=u[0],h=(g-new Date(l.time))/(1e3*60*60);if(l.ip===a&&h<24){ae();return}}u.unshift(o),u.length>Se&&(u.length=Se),localStorage.setItem(fe,JSON.stringify(u)),ae()}function ae(){const a=C("ipHistoryContent");if(!a)return;const i=we();if(i.length===0){a.innerHTML=`<span class="text-sm text-oai-gray-500 dark:text-oai-gray-400">${e.histEmpty}</span>`;return}a.innerHTML=`<ul class="divide-y divide-oai-gray-100 dark:divide-oai-gray-800">${i.map((r,u)=>{const g=new Date(r.time),o=`${g.getMonth()+1}-${g.getDate()} ${String(g.getHours()).padStart(2,"0")}:${String(g.getMinutes()).padStart(2,"0")}`,l=u===0;return`<li class="flex items-center justify-between py-3 gap-4">
|
|
11
|
+
<div class="flex items-center gap-2 min-w-0">
|
|
12
|
+
<span class="text-sm ${l?"text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400"}">${o}</span>
|
|
13
|
+
${l?`<span class="inline-flex items-center rounded-full bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300 px-1.5 py-0.5 text-[10px] font-medium">${w(e.histCurrent)}</span>`:""}
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex items-center gap-2 text-sm font-medium text-oai-black dark:text-white min-w-0">
|
|
16
|
+
${B(r.cc)}
|
|
17
|
+
${K(r.ip)}
|
|
18
|
+
${r.geo?`<span class="text-xs text-oai-gray-500 dark:text-oai-gray-400 font-normal truncate">${w(r.geo)}</span>`:""}
|
|
19
|
+
</div>
|
|
20
|
+
</li>`}).join("")}</ul>`}_.__clearIPHistory=()=>{localStorage.removeItem(fe),ae()};async function De(){const[,a,i]=await Promise.allSettled([$e(),Me(),je()]);if(se)return;const r=a.status==="fulfilled"?a.value:null,u=i.status==="fulfilled"?i.value:null,g=[];g.push(Ee("ipAddrCN","ipGeoCN",r?.ip,"cn")),g.push((async()=>{const o=C("ipAddr"),l=C("ipGeo");if(!m.ip){o&&(o.innerHTML=`<span class="text-oai-gray-400 dark:text-oai-gray-500">${e.failed}</span>`),l&&(l.textContent="");return}Z(m.ip)&&le(),o&&(o.innerHTML=K(m.ip));try{const h=await fetch(`${j}/api/geoip/${m.ip}`,{signal:AbortSignal.timeout(5e3)});if(h.ok){const s=await h.json(),x=(s.country_code||"").toLowerCase();m.ippure={ip:m.ip,country:s.country,countryCode:(s.country_code||"").toUpperCase(),region:s.region,city:s.city},m.cfGeo=[s.country,s.region,s.city,s.isp].filter(Boolean).join(" · "),o&&(o.innerHTML=`${B(x)} ${K(m.ip)}`),te("ipGeo",m.cfGeo)}}catch{}})()),g.push((async()=>{const o=u?.ip,l=C("ipAddrClaude"),h=C("ipGeoClaude");if(!o){l&&(l.innerHTML=`<span class="text-oai-gray-400 dark:text-oai-gray-500">${e.failed}</span>`),h&&(h.textContent="");return}Z(o)&&le(),l&&(l.innerHTML=`${B(u.loc||"")} ${K(o)}`);const[s,x]=await Promise.allSettled([fetch(`${j}/api/iprisk/${o}`,{signal:AbortSignal.timeout(1e4)}),fetch(`${j}/api/geoip/${o}`,{signal:AbortSignal.timeout(5e3)})]);let v=!1;if(x.status==="fulfilled"&&x.value.ok)try{const c=await x.value.json();if(c.country){m.claudeGeo={country:c.country,region:c.region,city:c.city,isp:c.isp,country_code:c.country_code};const P=[c.country,c.region,c.city,c.isp].filter(Boolean).join(" · ");l&&(l.innerHTML=`${B(c.country_code||u.loc||"")} ${K(o)}`),te("ipGeoClaude",P),v=!0}}catch{}if(!v&&u.loc&&(l&&(l.innerHTML=`${B(u.loc)} ${K(o)}`),te("ipGeoClaude",Be[u.loc]||u.loc.toUpperCase())),s.status==="fulfilled"&&s.value.ok){const c=await s.value.json();m.ipapis={is_datacenter:c.is_datacenter,is_vpn:c.is_vpn,is_proxy:c.is_proxy,is_tor:c.is_tor,is_crawler:c.is_crawler,is_abuser:c.is_abuser,is_mobile:c.is_mobile,company:{type:c.company_type,name:c.company_name},abuser_score:c.abuser_score,datacenter_name:c.datacenter_name},m.claudeRisk={ip:o,asn:c.asn,asOrganization:c.asOrganization,country:c.country,countryCode:c.countryCode,region:c.region,city:c.city,isResidential:c.isResidential,isBroadcast:c.isBroadcast,trust_score:c.trust_score,timezone:c.timezone}}})()),await Promise.allSettled(g),!se&&(Ie(),Promise.allSettled([Re(),He(),be()]),Oe(),Pe())}return De(),()=>{se=!0,ve.disconnect(),m.scoreAnimId&&cancelAnimationFrame(m.scoreAnimId),delete _.__setMaskOn,delete _.__clearIPHistory,delete _.__detectClaudeAvail}},[]);const M=_=>{S(_),p.current?.__setMaskOn?.(_)},D=()=>p.current?.__clearIPHistory?.(),q=()=>p.current?.__detectClaudeAvail?.(),R={__html:""};return n.jsx("div",{ref:p,className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:n.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:n.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4 mb-8",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:t("ipcheck.page.title")}),n.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base max-w-2xl",children:t("ipcheck.page.subtitle")})]}),n.jsxs("label",{className:"shrink-0 inline-flex items-center gap-2.5 cursor-pointer select-none group",children:[n.jsx("div",{className:"text-oai-gray-400 group-hover:text-oai-gray-600 dark:text-oai-gray-500 dark:group-hover:text-oai-gray-300 transition-colors duration-200",children:b?n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4.5 w-4.5 animate-scale-up-fade",children:[n.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),n.jsx("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),n.jsx("path",{d:"M6.61 6.61A13.52 13.52 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),n.jsx("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}):n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4.5 w-4.5 animate-scale-up-fade",children:[n.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),n.jsx("span",{className:"text-xs font-medium text-oai-gray-500 group-hover:text-oai-gray-700 dark:text-oai-gray-400 dark:group-hover:text-oai-gray-200 transition-colors duration-200",children:t("ipcheck.mask.toggle")}),n.jsxs("span",{className:"relative inline-block w-9 h-5",children:[n.jsx("input",{type:"checkbox",checked:b,onChange:_=>M(_.target.checked),className:"peer sr-only"}),n.jsx("span",{className:"absolute inset-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 peer-checked:bg-oai-brand-500 transition-colors duration-200"}),n.jsx("span",{className:"absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200 peer-checked:translate-x-4"})]})]})]}),n.jsx("div",{id:"ipv6Warn",className:"hidden mb-4 rounded-lg border border-amber-200 bg-amber-50 dark:border-amber-500/30 dark:bg-amber-500/10 px-4 py-3 text-sm text-amber-800 dark:text-amber-200",children:t("ipcheck.ipv6.warn")}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsx(me,{id:"CN",label:t("ipcheck.ip.cn"),icon:null,className:"animate-fade-in-up stagger-1"}),n.jsx(me,{id:"",label:t("ipcheck.ip.cloudflare"),icon:n.jsx("img",{src:`${j}/favicons/cloudflare.webp`,alt:"",className:"h-4 w-4"}),className:"animate-fade-in-up stagger-2"}),n.jsx(me,{id:"Claude",label:t("ipcheck.ip.claude"),icon:n.jsx("img",{src:`${j}/favicons/claude.webp`,alt:"",className:"h-4 w-4"}),statusDot:!0,className:"animate-fade-in-up stagger-3"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[n.jsx(V,{title:t("ipcheck.trust.title"),subtitle:t("ipcheck.trust.subtitle"),className:"animate-fade-in-up stagger-4",children:n.jsxs("div",{className:"px-1 py-2",children:[n.jsx("div",{className:"flex items-baseline justify-between mb-2 gap-3",children:n.jsx("div",{id:"gaugeScore",className:"flex items-baseline gap-2 min-h-[2.5rem]",dangerouslySetInnerHTML:R})}),n.jsx("div",{id:"gaugeText",className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mb-4 min-h-[1rem]"}),n.jsxs("div",{children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"h-1.5 rounded-full",style:{background:"linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%)"}}),n.jsx("span",{id:"gaugePointer",className:"absolute top-1/2 -translate-y-1/2 h-3.5 w-3.5 rounded-full bg-white dark:bg-oai-gray-900 border-2 border-oai-gray-300 dark:border-oai-gray-700 shadow-[0_2px_6px_rgba(0,0,0,0.15)] dark:shadow-[0_2px_6px_rgba(0,0,0,0.4)] -translate-x-1/2 transition-[left,border-color] duration-700 ease-out",style:{left:"0%"}})]}),n.jsxs("div",{className:"mt-2 flex justify-between text-[10px] uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 font-medium",children:[n.jsx("span",{children:t("ipcheck.trust.gauge.low")}),n.jsx("span",{className:"tracking-normal",children:"25"}),n.jsx("span",{className:"tracking-normal",children:"50"}),n.jsx("span",{className:"tracking-normal",children:"75"}),n.jsx("span",{children:t("ipcheck.trust.gauge.high")})]})]}),n.jsx("div",{id:"regionWarn",className:"hidden mt-4 rounded-lg border border-red-200 bg-red-50 dark:border-red-500/30 dark:bg-red-500/10 px-3 py-2 text-xs text-red-800 dark:text-red-300"}),n.jsxs("div",{id:"claudeRegionSupportRow",className:"hidden mt-4 pt-4 border-t border-oai-gray-100 dark:border-oai-gray-800 flex items-center justify-between",children:[n.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:t("ipcheck.trust.region_support")}),n.jsx("span",{id:"claudeRegionSupport",className:"text-sm font-medium text-oai-black dark:text-white",dangerouslySetInnerHTML:R})]})]})}),n.jsx(V,{title:t("ipcheck.props.title"),className:"animate-fade-in-up stagger-4",children:n.jsx("div",{id:"propsContent",className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800 pt-1",dangerouslySetInnerHTML:R})}),n.jsx(V,{title:t("ipcheck.security.title"),className:"animate-fade-in-up stagger-4",children:n.jsx("div",{id:"securityContent",className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800 pt-1",dangerouslySetInnerHTML:R})})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[n.jsx(V,{title:n.jsxs("span",{className:"flex items-center gap-1.5",children:[t("ipcheck.avail.title"),n.jsx(Ze,{text:t("ipcheck.avail.tooltip")})]}),action:n.jsx(Ae,{label:t("ipcheck.avail.refresh"),onClick:q}),className:"animate-fade-in-up stagger-5",children:n.jsx("div",{id:"claudeAvailContent",className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800 pt-1",dangerouslySetInnerHTML:R})}),n.jsx(V,{title:t("ipcheck.dns.title"),className:"animate-fade-in-up stagger-5",children:n.jsx("div",{id:"dnsLeakContent",className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800 pt-1",dangerouslySetInnerHTML:R})}),n.jsx(V,{title:t("ipcheck.udp.title"),className:"animate-fade-in-up stagger-5",children:n.jsx("div",{id:"udpLeakContent",className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800 pt-1",dangerouslySetInnerHTML:R})})]}),n.jsx(V,{title:t("ipcheck.device.title"),className:"animate-fade-in-up stagger-6",children:n.jsx("div",{id:"deviceContent",className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800 pt-1",dangerouslySetInnerHTML:R})}),n.jsx(V,{title:t("ipcheck.history.title"),subtitle:t("ipcheck.history.subtitle"),action:n.jsx(Ae,{label:t("ipcheck.history.clear"),onClick:D}),className:"animate-fade-in-up stagger-6",children:n.jsx("div",{id:"ipHistoryContent",dangerouslySetInnerHTML:R})})]})]})})})}function V({title:p,subtitle:b,action:S,children:M,className:D=""}){return n.jsxs("section",{className:`rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5 sm:p-6 transition-colors duration-200 ${D}`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:p}),b?n.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:b}):null]}),S]}),M]})}function Ae({label:p,onClick:b}){return n.jsx("button",{type:"button",onClick:b,className:"shrink-0 inline-flex h-7 items-center px-2.5 rounded-md text-xs font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-200 dark:border-oai-gray-700 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:p})}function Ze({text:p}){return n.jsxs("span",{className:"relative inline-flex items-center group",children:[n.jsx("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 text-oai-gray-400 dark:text-oai-gray-500",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM7.25 6.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-1.5 0V6.75zM8 4a.85.85 0 1 1 0 1.7A.85.85 0 0 1 8 4z"})}),n.jsx("span",{className:"pointer-events-none absolute left-1/2 top-full z-10 mt-1.5 -translate-x-1/2 w-56 rounded-md bg-oai-gray-900 dark:bg-oai-gray-800 px-2.5 py-2 text-[11px] font-normal text-white opacity-0 scale-95 translate-y-1 group-hover:opacity-100 group-hover:scale-100 group-hover:translate-y-0 transition-all duration-200 cubic-bezier(0.16, 1, 0.3, 1) leading-relaxed shadow-lg origin-top",children:p})]})}function me({id:p,label:b,icon:S,statusDot:M,className:D=""}){const q=`ipAddr${p}`,R=`ipGeo${p}`;return n.jsxs("article",{id:`ipHero${p}`,className:`rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5 sm:p-6 cursor-default transition-colors duration-200 ${D}`,children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] uppercase tracking-wider font-medium text-oai-gray-500 dark:text-oai-gray-400 mb-2",children:[S,n.jsx("span",{children:b}),M?n.jsxs("span",{id:`statusDot${p}`,className:"relative inline-flex h-2 w-2 ml-1.5","aria-hidden":!0,children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-oai-gray-300 dark:bg-oai-gray-600 opacity-75"}),n.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-oai-gray-400 dark:bg-oai-gray-500"})]}):null]}),n.jsx("div",{id:q,className:"text-xl sm:text-2xl font-semibold text-oai-black dark:text-white flex items-center gap-2 min-h-[2rem]",dangerouslySetInnerHTML:{__html:""}}),n.jsx("div",{id:R,className:"mt-1 text-xs text-oai-gray-500 dark:text-oai-gray-400 truncate min-h-[1rem]"})]})}export{Je as default};
|