PageSourceSearch

https://inceptra.ai/assets/Admin-f2077553.js

js inceptra.ai collected 2026-10-05 12:04:21 UTC 7,477 bytes, 1 lines download raw bytes

1import{r as l,u as f,f as e,a8 as h,ci as b,ab as x,e9 as _,ea as g,eb as v,ec as j,ed as y,ee as A,ef as w,cA as N,eg as k,eh as C,d2 as E,ei as S,cW as O,ej as T,ek as W,el as L,em as I,cY as M,en as P,av as R,eo as D,cX as V,ce as F,ep as U,aA as B}from"./vendor-f55dc6a8.js";import{u as G}from"./useAdminAccess-99c3b667.js";import{a2 as Y,G as $,fw as q,s as z}from"./index-aaed6fd7.js";const u=[{id:"overview",label:"OVERVIEW",items:[{path:"/admin",end:!0,label:"Dashboard",icon:v,sub:"The platform at a glance: people, generations, money and trouble, live from the database."},{path:"/admin/activity",end:!1,label:"Activity",icon:j,sub:"Every action people take, named verb_object — explore trends, watch the stream, open any person."},{path:"/admin/analytics",end:!1,label:"Analytics",icon:y,sub:"Money per currency, paying versus granted plans, and usage — each number says what it counts.",superAdminOnly:!0},{path:"/admin/funnels",end:!1,label:"Funnels",icon:A,sub:"Where people drop out of the flows that matter."},{path:"/admin/tab-clicks",end:!1,label:"Tab clicks",icon:w,sub:"Which left-bar tabs people click."}]},{id:"people",label:"PEOPLE",items:[{path:"/admin/users",end:!1,label:"Users",icon:N,sub:"Every account, its roles, credits and membership. Open one to act on it."},{path:"/admin/user-activity",end:!1,label:"Credits & runs",icon:k,sub:"Every credit charge with what it paid for, and a read-only window onto Predictra runs."},{path:"/admin/grant-credits",end:!1,label:"Grant credits",icon:C,sub:"Add credits to an account, with a reason on the ledger."},{path:"/admin/invitation-codes",end:!1,label:"Invitation codes",icon:E,sub:"INV- codes: credits and membership handed out by invitation."}]},{id:"revenue",label:"REVENUE",items:[{path:"/admin/billing",end:!1,label:"Billing",icon:S,sub:"Every payment, with device and location."},{path:"/admin/coupons",end:!1,label:"Coupons",icon:O,sub:"Generate, track and export coupons."},{path:"/admin/campaigns",end:!1,label:"Campaigns",icon:T,sub:"Campaigns and how they convert."},{path:"/admin/campaign-discounts",end:!1,label:"Campaign discounts",icon:W,sub:"Discounts attached to campaigns."}]},{id:"ai",label:"AI & COSTS",items:[{path:"/admin/models",end:!1,label:"AI models",icon:L,sub:"Which models the product calls, and how often."},{path:"/admin/our-models",end:!1,label:"Our models",icon:I,sub:"The agents and models Inceptra runs itself."},{path:"/admin/costs",end:!1,label:"Model costs",icon:M,sub:"What each model costs us per call.",superAdminOnly:!0},{path:"/admin/feature-costs",end:!1,label:"Feature costs",icon:P,sub:"What each feature charges in credits.",superAdminOnly:!0}]},{id:"quality",label:"CONTENT & QUALITY",items:[{path:"/admin/content-insights",end:!1,label:"Content insights",icon:R,sub:"What people are making, read across accounts."},{path:"/admin/fleet-review",end:!1,label:"Fleet review",icon:D,sub:"Agent findings waiting for a human."},{path:"/admin/prd",end:!1,label:"PRD gate",icon:V,sub:"Feature requests scored against the product principles."},{path:"/admin/color-palette",end:!1,label:"Color palette",icon:F,sub:"The palettes offered in the product."}]},{id:"system",label:"SYSTEM",items:[{path:"/admin/logs",end:!1,label:"Raw logs",icon:U,sub:"The activity table as stored, with IP and device."}]}];function K(n){let a=null;for(const i of u)for(const s of i.items)(s.end?n===s.path:n===s.path||n.startsWith(`${s.path}/`))&&(!a||s.path.length>a.item.path.length)&&(a={item:s,group:i.label});return a}function Q({onNavigate:n}){const{isSuperAdmin:a}=Y();return e.jsx("nav",{className:"ix-nav ix-adm__nav","aria-label":"Admin sections",children:u.map(i=>{const s=i.items.filter(t=>!t.superAdminOnly||a);return s.length?e.jsxs("div",{className:"ix-nav__group ix-adm__group",children:[e.jsx("div",{className:"ix-adm__grouplabel",children:i.label}),s.map(({path:t,end:d,label:r,icon:c})=>e.jsxs(g,{to:t,end:d,className:"ix-nav__row",onClick:()=>n==null?void 0:n(),children:[e.jsx(c,{strokeWidth:1.7,"aria-hidden":"true"}),e.jsx("span",{className:"ix-nav__label",children:r})]},t))]},i.id):null})})}function X({email:n,clientIp:a,onSignOut:i}){const[s,t]=l.useState(!1),d=f(),r=l.useMemo(()=>K(d.pathname),[d.pathname]);return l.useEffect(()=>{t(!1)},[d.pathname]),l.useEffect(()=>{if(!s)return;const c=o=>{o.key==="Escape"&&t(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),l.useEffect(()=>(document.body.dataset.ixShell="admin",()=>{delete document.body.dataset.ixShell}),[]),e.jsxs("div",{className:"ix-shell ix-adm","data-section":"admin","data-drawer":s?"open":"closed",children:[e.jsxs("aside",{className:"ix-shell__sidebar ix-adm__side","aria-label":"Admin navigation",children:[e.jsxs(h,{to:"/admin",className:"ix-adm__brand",onClick:()=>t(!1),children:[e.jsx("span",{className:"ix-adm__mark","aria-hidden":"true",children:"i"}),e.jsxs("span",{className:"ix-adm__word",children:["inceptra",e.jsx("em",{children:"ai"})]}),e.jsx("span",{className:"ix-adm__tag",children:"ADMIN"})]}),e.jsx("hr",{className:"ix-rule"}),e.jsx(Q,{onNavigate:()=>t(!1)}),e.jsxs("div",{className:"ix-adm__foot",children:[e.jsxs("div",{className:"ix-adm__who",children:[e.jsx("span",{className:"ix-adm__avatar","aria-hidden":"true",children:(n??"?").charAt(0).toUpperCase()}),e.jsxs("span",{className:"ix-adm__whobody",children:[e.jsx("b",{children:n??"Admin"}),e.jsx("span",{title:a?`IP: ${a}`:void 0,children:a?`IP ${a}`:"Admin session"})]})]}),e.jsxs("div",{className:"ix-adm__footrow",children:[e.jsxs(h,{to:"/",className:"ix-adm__footbtn",children:[e.jsx(b,{size:13,strokeWidth:1.8})," Back to app"]}),e.jsxs("button",{type:"button",className:"ix-adm__footbtn",onClick:i,children:[e.jsx(x,{size:13,strokeWidth:1.8})," Sign out"]})]})]})]}),e.jsx("div",{className:"ix-shell__scrim",onClick:()=>t(!1),"aria-hidden":"true"}),e.jsx("main",{className:"ix-shell__main",children:e.jsxs("div",{className:"ix-shell__content ix-adm__content",children:[e.jsxs("button",{type:"button",className:"ix-shell__burger",onClick:()=>t(!0),"aria-expanded":s,children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})}),"Admin menu"]}
1),r?e.jsxs("header",{className:"ix-adm__head",children:[e.jsx("p",{className:"ix-adm__kicker",children:r.group}),e.jsx("h1",{children:r.item.label}),e.jsx("p",{className:"ix-adm__sub",children:r.item.sub})]}):null,e.jsx("div",{className:"ix-adm__body",children:e.jsx(_,{})})]})})]})}function ae(){const n=B(),{user:a}=$(),{hasAccess:i,loading:s,clientIp:t}=G(),{checkAdminSession:d,clearAdminSession:r,isAdminAuthenticated:c}=q(),o=l.useRef(!1),m=l.useRef(!1);l.useEffect(()=>{if(!s&&!a){n("/admin-login",{replace:!0});return}!s&&a&&i&&c&&!m.current&&(m.current=!0,z.rpc("log_activity",{_user_id:a.id,_event_type:"admin_page_access",_event_details:{page:"admin_panel"},_ip_address:null,_user_agent:navigator.userAgent}).then(()=>{},()=>{}))},[s,a,i,c,n]),l.useEffect(()=>{!s&&a&&!i&&n("/",{replace:!0})},[s,a,i,n]),l.useEffect(()=>{if(s||!a||!i)return;d()?o.current=!0:n("/admin-login",{replace:!0})},[s,a,i,d,n]);const p=o.current||!s&&i&&!!a&&c;return!s&&!a||!s&&a&&!i?null:p?e.jsx(X,{email:a==null?void 0:a.email,clientIp:t,onSignOut:()=>{r(),n("/admin-login")}}):e.jsx("div",{className:"ix-adm__checking",children:"Checking access…"})}export{ae 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.