PageSourceSearch

https://www.goglobal.to/assets/AdminLayout-CxW84GkW.js

js goglobal.to collected 2026-09-24 13:22:13 UTC 11,901 bytes, 6 lines download raw bytes

1import{d as a,j as e}from"./react-vendor-BYeqKmV6.js";import{$ as E,aF as M,aL as T,aK as D,M as U,a6 as H,l as B}from"./index-C5_t1zCf.js";import{A as O,a as _}from"./avatar-B-qpmBoH.js";import{D as W,d as z,a as $,b as j,c as F}from"./dropdown-menu-CtcDj4E-.js";import{k as K,u as q,S as V,c as Q,P as G,a as X,e as Y,g as y,f as k,b as J,d as Z,l as ee}from"./sidebar-DMDdxait.js";import{u as te}from"./useMobile-DCHcGhWR.js";import{S as ie}from"./shield-DvauR4Uu.js";import{K as se}from"./key-round-DHnA-xHk.js";import{S as ae}from"./search-CPQmojDe.js";import{T as oe}from"./truck-Ck_zI3gB.js";import{S as re}from"./shopping-cart-CqF_mv4Y.js";import{M as ne}from"./map-pin-DF0PP0La.js";import{C as le}from"./clipboard-check-_cKqUnnT.js";import{M as ce}from"./mouse-pointer-click-CKZn9uA5.js";import{S as de}from"./shield-check-Bk7cbA4h.js";import{C as me}from"./credit-card-DlzX5uLR.js";import{B as ue}from"./bot-Dj-lO3tQ.js";import{B as pe}from"./bell-Y7fGfACj.js";import{U as ge}from"./users-DwsufDoz.js";import{U as he}from"./user-plus-WmyR-mWw.js";import{H as fe}from"./history-TJSFa02C.js";import{T as xe}from"./ticket-BAE9PtO1.js";import{A as be}from"./activity-l37cELkw.js";import{L as ve}from"./layout-grid-BughfmLL.js";import{E as Ce}from"./eye-BZocqjwv.js";import{S as Re}from"./settings-BM7cMzDi.js";import{L as Pe}from"./log-out-BWbHLIqv.js";import"./ui-vendor-FeF8SYpf.js";import"./data-vendor-JFafzwTy.js";import"./sheet-CWc84FPG.js";import"./tooltip-Cp3oS7K4.js";/**
2 * @license lucide-react v0.542.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const je=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],ye=E("scroll-text",je),N="admin-sidebar-width",S="admin-sidebar-mode",ke=260,Ne=200,Se=400;function ct({children:x}){const[r,n]=a.useState(()=>{const u=localStorage.getItem(N);return u?parseInt(u,10):ke}),{loading:l,user:t}=M(),{openLoginModal:s}=T();return a.useEffect(()=>{localStorage.setItem(N,r.toString())},[r]),a.useEffect(()=>{!l&&!t&&s()},[l,t,s]),l||!t?null:!(t.isAdmin??t.role==="admin")?e.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ie,{className:"w-16 h-16 text-muted-foreground/30 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-muted-foreground",children:"This page is restricted to administrators."}),e.jsx("a",{href:"/agent",className:"mt-4 inline-block text-primary underline text-sm",children:"Back to App"})]})}):e.jsx(K,{style:{"--sidebar-width":`${r}px`},children:e.jsx(Ae,{setSidebarWidth:n,children:x})})}const A=["/adminPRC/invite-codes","/adminPRC/provider-lookup","/adminPRC/suppliers","/adminPRC/orders","/adminPRC/order-track","/adminPRC/review-queue"],w=["/adminPRC/attribution","/adminPRC/platform-access","/adminPRC/email"];function Ae({children:x,setSidebarWidth:r}){const{user:n,logout:l}=M(),[t,s]=D(),{state:C,toggleSidebar:u}=q(),p=C==="collapsed",[g,b]=a.useState(!1),R=a.useRef(null),I=te(),[c,h]=a.useState(()=>{const i=localStorage.getItem(S);return A.some(o=>t.startsWith(o))?"provider":w.some(o=>t.startsWith(o))?"campaign":i==="provider"||i==="campaign"?i:"user"}),v=i=>{h(i),localStorage.setItem(S,i)};a.useEffect(()=>{A.some(i=>t.startsWith(i))?h("provider"):w.some(i=>t.startsWith(i))?h("campaign"):h("user")},[t]);const P=c==="provider"?[{label:"Invite Codes",icon:se,path:"/adminPRC/invite-codes",isActive:t==="/adminPRC/invite-codes",tooltip:"Invite Codes — generate and manage supplier registration invite codes"},{label:"Order Lookup (User)",icon:ae,path:"/adminPRC/provider-lookup",isActive:t==="/adminPRC/provider-lookup",tooltip:"Order Lookup (User) — query user registrations and order stats"},{label:"Supply Router (Overview)",icon:oe,path:"/adminPRC/suppliers",isActive:t==="/adminPRC/suppliers",tooltip:"Supply Router (Overview) — routing overview, payout config, and supplier management"},{label:"Order manage",icon:re,path:"/adminPRC/orders",isActive:t==="/adminPRC/orders",tooltip:"Order manage — inspect routing layers, external submissions, and eligible recovery actions"},{label:"Order Track",icon:ne,path:"/adminPRC/order-track",isActive:t==="/adminPRC/order-track",tooltip:"Order Track — check when a Reddit post was removed"},{label:"Review Queue",icon:le,path:"/adminPRC/review-queue",isActive:t==="/adminPRC/review-queue",tooltip:"Review Queue — approve or reject supplier order payouts"}]:c==="campaign"?[{label:"Shortlinkplatform",icon:ce,path:"/adminPRC/attribution",isActive:t==="/adminPRC/attribution",tooltip:"Short Link Platform — links, QR codes, clicks, logins, and revenue attribution"},{label:"Short Link Platform Access",icon:de,path:"/adminPRC/platform-access",isActive:t==="/adminPRC/platform-access",tooltip:"Short Link Platform Access — email allowlist"},{label:"Mail Campaigns",icon:U,path:"/adminPRC/email",isActive:t==="/adminPRC/email",tooltip:"Mail Campaigns — send marketing emails to unpaid users"}]:[{label:"Credit Config",icon:me,path:"/adminPRC/credits",isActive:t==="/adminPRC/credits",tooltip:"
6Credit Config"},{label:"Model Config",icon:ue,path:"/adminPRC/models",isActive:t==="/adminPRC/models",tooltip:"Model Config"},{label:"Notification",icon:pe,path:"/adminPRC/notifications",isActive:t==="/adminPRC/notifications",tooltip:"Notification"},{label:"User Management",icon:ge,path:"/adminPRC/users",isActive:t==="/adminPRC/users",tooltip:"User Management"},{label:"Recent Signups",icon:he,path:"/adminPRC/recent-signups",isActive:t==="/adminPRC/recent-signups",tooltip:"Recent Signups — source, contact, and product details"},{label:"Report History",icon:fe,path:"/adminPRC/report-history",isActive:t==="/adminPRC/report-history",tooltip:"Report History"},{label:"Log Panel",icon:ye,path:"/adminPRC/logs",isActive:t==="/adminPRC/logs",tooltip:"Log Panel"},{label:"Coupons",icon:xe,path:"/adminPRC/coupons",isActive:t==="/adminPRC/coupons",tooltip:"Coupon Manager"},{label:"Concurrency Logs",icon:be,path:"/adminPRC/concurrency-logs",isActive:t==="/adminPRC/concurrency-logs",tooltip:"Concurrency Logs — events with more than 10 concurrent users"},{label:"Use Cases",icon:ve,path:"/adminPRC/use-cases",isActive:t==="/adminPRC/use-cases",tooltip:"Use Cases — showcase wall management"},{label:"功能可见性",icon:Ce,path:"/adminPRC/feature-visibility",isActive:t==="/adminPRC/feature-visibility",tooltip:"Feature Visibility — control whether selected features are shown in the app"}],L=P.find(i=>i.isActive)?.label??"Admin";return a.useEffect(()=>{(t==="/adminPRC"||t==="/adminPRC/")&&s("/adminPRC/credits")},[t,s]),a.useEffect(()=>{p&&b(!1)},[p]),a.useEffect(()=>{const i=f=>{if(!g)return;const d=R.current?.getBoundingClientRect().left??0,m=f.clientX-d;m>=Ne&&m<=Se&&r(m)},o=()=>b(!1);return g&&(document.addEventListener("mousemove",i),document.addEventListener("mouseup",o),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",o),document.body.style.cursor="",document.body.style.userSelect=""}},[g,r]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",ref:R,children:[e.jsxs(V,{collapsible:"icon",className:"border-r-0",disableTransition:g,children:[e.jsx(Q,{className:"h-14 justify-center",children:e.jsxs("div",{className:"flex items-center gap-2.5 px-2 transition-all w-full group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",children:[e.jsx("button",{onClick:u,className:"h-8 w-8 flex items-center justify-center hover:bg-accent rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring shrink-0","aria-label":"Toggle navigation",children:e.jsx(G,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 group-data-[collapsible=icon]:hidden",children:[e.jsx("img",{src:H(),alt:"Admin",className:"w-7 h-7 shrink-0"}),e.jsx("span",{className:"font-semibold tracking-tight truncate text-foreground",children:"Admin Panel"})]})]})}),e.jsxs(X,{className:"gap-0",children:[e.jsx("div",{className:"px-3 pt-2 pb-1 group-data-[collapsible=icon]:hidden",children:e.jsxs("div",{className:"flex rounded-lg bg-muted p-0.5 gap-0.5",children:[e.jsx("button",{onClick:()=>{v("user"),s("/adminPRC/credits")},className:`flex-1 text-xs font-medium rounded-md py-1.5 transition-all ${c==="user"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"User"}),e.jsx("button",{onClick:()=>{v("campaign"),s("/adminPRC/attribution")},className:`flex-1 text-xs font-medium rounded-md py-1.5 transition-all ${c==="campaign"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Campaign"}),e.jsx("button",{onClick:()=>{v("provider"),s("/adminPRC/invite-codes")},className:`flex-1 text-xs font-medium rounded-md py-1.5 transition-all ${c==="provider"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Provider"})]})}),e.jsxs(Y,{className:"px-2 py-1",children:[P.map(({label:i,icon:o,path:f,isActive:d,tooltip:m})=>e.jsx(y,{children:e.jsxs(k,{isActive:d,onClick:()=>s(f),tooltip:m,className:`h-10 transition-all font-normal ${d?"bg-primary/10 text-primary font-medium":""}`,children:[e.jsx(o,{className:`h-4 w-4 ${d?"text-primary":""}`}),e.jsx("span",{children:i})]})},f)),e.jsx("div",{className:"my-2 mx-2 border-t"}),e.jsx(y,{children:e.jsxs(k,{onClick:()=>s("/agent"),tooltip:"Back to App",className:"h-10 transition-all font-normal text-muted-foreground",children:[e.jsx(B,{className:"h-4 w-4"}),e.jsx("span",{children:"Back to App"})]})})]})]}),e.jsx(J,{className:"p-3",children:e.jsxs(W,{children:[e.jsx(z,{asChild:!0,children:e.jsxs("button",{className:"flex items-center gap-3 rounded-lg px-1 py-1 hover:bg-accent/50 transition-colors w-full text-left group-data-[collapsible=icon]:justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(O,{className:"h-9 w-9 border shrink-0 bg-primary/10",children:e.jsx(_,{className:"text-xs font-medium text-primary bg-primary/10",children:n?.name?.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:[e.jsx("p",{className:"text-sm font-medium truncate leading-none",children:n?.name||"-"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate mt-1.5",children:n?.email||"-"})]})]})}),e.jsxs($,{align:"end",className:"w-48",children:[e.jsxs(j,{onClick:()=>s("/settings"),className:"cursor-pointer",children:[e.jsx(Re,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Settings"})]}),e.jsx(F,{}),e.jsxs(j,{onClick:l,className:"cursor-pointer text-destructive focus:text-destructive",children:[e.jsx(Pe,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Sign out"})]})]})]})})]}),e.jsx("div",{className:`absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-primary/20 transition-colors ${p?"hidden":""}`,onMouseDown:()=>{p||b(!0)},style:{zIndex:50}})]}),e.jsxs(Z,{children:[I&&e.jsx("div",{className:"flex border-b h-14 items-center justify-between bg-background/95 px-2 backdrop-blur supports-[backdrop-filter]:backdrop-blur sticky top-0 z-40",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-9 w-9 rounded-lg bg-background"}),e.jsx("span",{className:"tracking-tight text-foreground",children:L})]})}),e.jsx("main",{className:"flex-1 overflow-auto p-4 md:p-6",children:x})]})]})}export{ct 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.