PageSourceSearch

https://global-stats.netlify.app/assets/EndpointExplorer-nw3nrTDw.js

js global-stats.netlify.app collected 2026-10-03 10:50:07 UTC 13,333 bytes, 1 lines download raw bytes

1import{j as e,I as E,e as Y,f as ee,E as se,n as k,k as R,a1 as T,a2 as L,Z as I,X as te,L as ae,b as O,R as re,S,m as oe}from"./vendor-ui-CkhwTbmt.js";import{r as o}from"./vendor-react-BuxP_W9V.js";import{c as m,C as $,d as q,B as y,f as v,g as ne,S as le,I as ie}from"./index-FbBeImHl.js";import{l as ce,L as z,m as D,n as M,o as de,O as B,p as V,q as me,r as F,D as H,s as xe}from"./vendor-radix-B_mbVdmy.js";const he=ce,P=o.forwardRef(({className:t,...r},n)=>e.jsx(z,{ref:n,className:m("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...r}));P.displayName=z.displayName;const A=o.forwardRef(({className:t,...r},n)=>e.jsx(D,{ref:n,className:m("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...r}));A.displayName=D.displayName;const ue=o.forwardRef(({className:t,...r},n)=>e.jsx(M,{ref:n,className:m("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r}));ue.displayName=M.displayName;function fe({endpoint:t,baseUrl:r,onOpenDetails:n}){const[j,x]=o.useState(!1),N=(()=>{const l=(t.example||"").trim();if(!l)return"";const b=l.indexOf("?");return b===-1?"":l.slice(b+1).replace(/^\?/,"")})(),i=`${r}/${t.name}${N?`?${N}`:""}`,w=()=>{navigator.clipboard.writeText(i),x(!0),setTimeout(()=>x(!1),2e3)},h=(l=>{switch(l){case"fun":return{gradient:"from-[hsl(var(--fun))]/10 to-[hsl(var(--fun))]/5",border:"border-[hsl(var(--fun))]/20 hover:border-[hsl(var(--fun))]/40",badge:"bg-[hsl(var(--fun))]/10 text-[hsl(var(--fun))] border-[hsl(var(--fun))]/20",icon:e.jsx(I,{className:"w-3 h-3"})};case"images":return{gradient:"from-[hsl(var(--images))]/10 to-[hsl(var(--images))]/5",border:"border-[hsl(var(--images))]/20 hover:border-[hsl(var(--images))]/40",badge:"bg-[hsl(var(--images))]/10 text-[hsl(var(--images))] border-[hsl(var(--images))]/20",icon:e.jsx(L,{className:"w-3 h-3"})};case"utils":return{gradient:"from-[hsl(var(--utils))]/10 to-[hsl(var(--utils))]/5",border:"border-[hsl(var(--utils))]/20 hover:border-[hsl(var(--utils))]/40",badge:"bg-[hsl(var(--utils))]/10 text-[hsl(var(--utils))] border-[hsl(var(--utils))]/20",icon:e.jsx(T,{className:"w-3 h-3"})};case"security":return{gradient:"from-[hsl(var(--security))]/10 to-[hsl(var(--security))]/5",border:"border-[hsl(var(--security))]/20 hover:border-[hsl(var(--security))]/40",badge:"bg-[hsl(var(--security))]/10 text-[hsl(var(--security))] border-[hsl(var(--security))]/20",icon:e.jsx(R,{className:"w-3 h-3"})};case"meta":return{gradient:"from-[hsl(var(--meta))]/10 to-[hsl(var(--meta))]/5",border:"border-[hsl(var(--meta))]/20 hover:border-[hsl(var(--meta))]/40",badge:"bg-[hsl(var(--meta))]/10 text-[hsl(var(--meta))] border-[hsl(var(--meta))]/20",icon:e.jsx(k,{className:"w-3 h-3"})};default:return{gradient:"from-muted/50 to-muted/30",border:"border-border/50",badge:"",icon:null}}})(t.category);return e.jsx($,{className:`bg-gradient-to-br ${h.gradient} backdrop-blur ${h.border} transition-all duration-200 group h-full`,children:e.jsxs(q,{className:"p-4 flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[e.jsx(y,{variant:"secondary",className:"font-mono text-xs px-2 shrink-0",children:t.method}),e.jsxs("span",{className:"font-mono font-medium text-sm truncate",children:["/",t.name]})]}),e.jsxs(y,{variant:"outline",className:`${h.badge} shrink-0 text-xs px-2 gap-1`,children:[h.icon,e.jsx("span",{className:"hidden sm:inline",children:t.category})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 flex-1 line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(v,{variant:"outline",size:"sm",className:"flex-1 text-xs h-9",onClick:()=>n?.(t.name),children:[e.jsx(E,{className:"w-3 h-3 mr-1.5"}),"Details"]}
1),e.jsx(v,{variant:"ghost",size:"sm",onClick:w,className:"h-9 w-9 p-0",children:j?e.jsx(Y,{className:"w-4 h-4 text-[hsl(var(--utils))]"}):e.jsx(ee,{className:"w-4 h-4"})}),e.jsx(v,{variant:"ghost",size:"sm",asChild:!0,className:"h-9 w-9 p-0",children:e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:e.jsx(se,{className:"w-4 h-4"})})})]})]})})}const ge=de,pe=xe,Q=o.forwardRef(({className:t,...r},n)=>e.jsx(B,{className:m("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r,ref:n}));Q.displayName=B.displayName;const je=ne("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),G=o.forwardRef(({side:t="right",className:r,children:n,...j},x)=>e.jsxs(pe,{children:[e.jsx(Q,{}),e.jsxs(V,{ref:x,className:m(je({side:t}),r),...j,children:[n,e.jsxs(me,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(te,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));G.displayName=V.displayName;const X=({className:t,...r})=>e.jsx("div",{className:m("flex flex-col space-y-2 text-center sm:text-left",t),...r});X.displayName="SheetHeader";const Z=o.forwardRef(({className:t,...r},n)=>e.jsx(F,{ref:n,className:m("text-lg font-semibold text-foreground",t),...r}));Z.displayName=F.displayName;const _=o.forwardRef(({className:t,...r},n)=>e.jsx(H,{ref:n,className:m("text-sm text-muted-foreground",t),...r}));_.displayName=H.displayName;const be=t=>{switch(t){case"security":return e.jsx(R,{className:"w-3.5 h-3.5"});case"meta":return e.jsx(k,{className:"w-3.5 h-3.5"});case"images":return e.jsx(L,{className:"w-3.5 h-3.5"});case"utils":return e.jsx(T,{className:"w-3.5 h-3.5"});case"fun":return e.jsx(I,{className:"w-3.5 h-3.5"});default:return e.jsx(O,{className:"w-3.5 h-3.5"})}};function Ce({baseUrl:t}){const[r,n]=o.useState(null),[j,x]=o.useState(!0),[f,N]=o.useState(""),[i,w]=o.useState("all"),[g,h]=o.use
1State(null),[l,b]=o.useState(48),C=async()=>{x(!0);try{const a=await(await fetch(`${t}/docs`)).json();a?.data?.endpoints&&n(a.data.endpoints)}catch(s){console.error("Failed to fetch docs:",s)}x(!1)};o.useEffect(()=>{C()},[t]);const c=o.useMemo(()=>r?Object.entries(r).map(([s,a])=>({name:s,description:a.description,method:"GET",category:a.category,example:a.example})):[],[r]),J=o.useMemo(()=>{const s=new Set(c.map(a=>a.category));return["all",...Array.from(s).sort()]},[c]),W=o.useMemo(()=>{const s={all:c.length};return c.forEach(a=>{s[a.category]=(s[a.category]||0)+1}),s},[c]),u=o.useMemo(()=>{let s=c;if(i!=="all"&&(s=s.filter(a=>a.category===i)),f.trim()){const a=f.toLowerCase();s=s.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.category.toLowerCase().includes(a))}return s},[c,i,f]);o.useEffect(()=>{b(48)},[f,i,r]);const K=o.useMemo(()=>u.slice(0,l),[u,l]),d=g&&r?r[g]:null;return j?e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ae,{className:"w-4 h-4 animate-spin"}),"Loading endpoint catalog and examples..."]}),e.jsx("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:8}).map((s,a)=>e.jsx(le,{className:"h-44 w-full"},a))})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-5 h-5 text-primary"}),e.jsxs("h2",{className:"text-2xl font-bold",children:["All Endpoints"," ",e.jsxs("span",{className:"text-muted-foreground text-lg font-normal",children:["(",c.length,")"]})]})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:C,className:"gap-1.5",children:[e.jsx(re,{className:"w-4 h-4"}),"Refresh"]})]}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(S,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ie,{placeholder:"Search endpoints...",value:f,onChange:s=>N(s.target.value),className:"pl-9 h-10"})]}),e.jsx(he,{value:i,onValueChange:w,children:e.jsx(P,{className:"flex flex-wrap h-auto gap-1 bg-muted/50 p-1",children:J.map(s=>e.jsxs(A,{value:s,className:"text-sm px-3 py-1.5 gap-1.5",children:[s!=="all"&&be(s),e.jsx("span",{className:"capitalize",children:s}),e.jsx(y,{variant:"secondary",className:"ml-1 text-[10px] px-1.5 py-0 h-4",children:W[s]||0})]},s))})})]}),u.length===0?e.jsx($,{className:"glass",children:e.jsxs(q,{className:"py-12 text-center",children:[e.jsx(S,{className:"w-10 h-10 mx-auto mb-3 text-muted-foreground/50"}),e.jsx("p",{className:"text-muted-foreground",children:"No endpoints match your current filters."}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Try clearing search or switching category."})]})}):e.jsxs("div",{className:"max-h-[72vh] overflow-y-auto pr-1",onScroll:s=>{const a=s.currentTarget;a.scrollHeight-a.scrollTop-a.clientHeight<240&&l<u.length&&b(U=>Math.min(U+48,u.length))},children:[e.jsx("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:K.map((s,a)=>e.jsx(oe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Math.min(a*.02,.5),duration:.3},children:e.jsx(fe,{endpoint:s,baseUrl:t,onOpenDetails:p=>h(p)})},s.name))}),l<u.length&&e.jsxs("div",{className:"py-4 text-center text-xs text-muted-foreground",children:["Showing ",l," of ",u.length," endpoints"]})]}),e.jsx(ge,{open:!!g,onOpenChange:s=>!s&&h(null),children:e.jsx(G,{side:"right",className:"sm:max-w-xl overflow-y-auto",children:g&&d?e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsxs(Z,{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-primary"}),"/",g]}),e.jsx(_,{children:d.description})]}),e.jsxs("div",{className:"mt-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Category"}),e.jsx(y,{variant:"outline",className:"capitalize",children:d.category})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Parameters"}),d.params&&Object.keys(d.params).length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(d.params).map(([s,a])=>e.jsxs("div",{className:"p-2 rounded-md border bg-muted/30",children:[e.jsx("div",{className:"font-mono text-xs text-foreground",children:s}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a})]},s))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No query parameters required."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Example Request"}),e.jsxs("code",{className:"block text-xs p-3 rounded-md border bg-muted/30 overflow-x-auto",children:["GET ",d.example]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Example Response Shape"}),e.jsx("pre",{className:"text-xs p-3 rounded-md border bg-muted/30 overflow-x-auto",children:JSON.stringify(d.response,null,2)})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Rate Limits"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["100 requests per minute per IP. ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-foreground font-mono text-xs",children:"429"})," when exceeded."]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Common Errors"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("li",{children:[e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-foreground font-mono text-xs",children:"400"})," Invalid or missing query parameters"]}),e.jsxs("li",{children:[e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-foreground font-mono text-xs",children:"429"})," Rate limit exceeded"]}),e.jsxs("li",{children:[e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-foreground font-mono text-xs",children:"500"})," Upstream dependency or internal error"]})]})]})]})]}):null})})]})}export{Ce 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.