PageSourceSearch

https://www.etecplus.ai/_next/static/chunks/5554-4140048c058fab3f.js

js etecplus.ai collected 2026-10-05 14:25:24 UTC 16,280 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5554],{1777:(e,a,t)=>{t.d(a,{U:()=>c});var s=t(95155),n=t(51900),r=t(36999),l=t(92972),i=t(40980),o=t(8946);let d=[{value:"light",label:"Light",Icon:n.A},{value:"dark",label:"Dark",Icon:r.A},{value:"system",label:"System",Icon:l.A}];function c({className:e}){let{theme:a,setTheme:t}=(0,o.D)();return(0,s.jsx)("div",{role:"radiogroup","aria-label":"Colour theme",className:(0,i.cn)("flex items-center gap-0.5 rounded-full border bg-card p-0.5",e),children:d.map(({value:e,label:n,Icon:r})=>(0,s.jsx)("button",{type:"button",role:"radio","aria-checked":a===e,"aria-label":n,title:n,onClick:()=>t(e),className:(0,i.cn)("flex h-6 w-6 items-center justify-center rounded-full transition-colors",a===e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,s.jsx)(r,{className:"h-3.5 w-3.5"})},e))})}},27529:(e,a,t)=>{async function s(e,a){let t=await fetch(e,{...a,headers:{"Content-Type":"application/json",...a?.headers||{}}}),s=await t.text(),r={};if(s)try{r=JSON.parse(s)}catch{r={}}if(!t.ok){let e=r?.error,a="string"==typeof e?e:e?.message,l="object"==typeof e?e?.code:void 0;throw new n(a||(s&&!s.startsWith("<")?s:`Request failed (${t.status})`),l,t.status)}return r}t.d(a,{E6:()=>n,nr:()=>s,tR:()=>r});class n extends Error{code;status;constructor(e,a,t){super(e),this.name="ApiClientError",this.code=a,this.status=t}}async function r(e,a){let t=await e.json().catch(()=>null);return t?.error?.message||`${a} (${e.status})`}},28713:(e,a,t)=>{t.d(a,{U:()=>n});var s=t(93734);function n(){return(0,s.createBrowserClient)("https://zathjeurxmitlqiyzgdu.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InphdGhqZXVyeG1pdGxxaXl6Z2R1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODM5ODMxMzQsImV4cCI6MjA5OTU1OTEzNH0.PFA-mEZ8HnSYa6HVk30I6UTGV-f1Wa9W4o0z4jMow6Y")}},55554:(e,a,t)=>{t.d(a,{CH:()=>J,wc:()=>W,AdminShell:()=>T,T_:()=>q});var s=t(95155),n=t(12115),r=t(98500),l=t.n(r),i=t(73321),o=t(98401),d=t(50049),c=t(7810),u=t(49619),m=t(30971),p=t(62032),h=t(52530),x=t(15282),f=t(1806),g=t(4903),b=t(997),j=t(89363),y=t(61878),v=t(42268),w=t(41313),N=t(29857),C=t(25783),k=t(1777),A=t(89239),z=t(99412),S=t(88
1641),$=t(43146),I=t(42869),E=t(6296),F=t(96544),L=t(27529),M=t(89440),O=t(77977),P=t(40980);let R={workspaces:[],users:[],agents:[],partners:[]};function U({open:e,onOpenChange:a}){let t=(0,i.useRouter)(),[r,l]=(0,n.useState)(""),[o,c]=(0,n.useState)(R),[m,p]=(0,n.useState)(!1),[h,x]=(0,n.useState)(0),f=(0,n.useRef)(null);(0,n.useEffect)(()=>{e||(l(""),c(R),x(0))},[e]),(0,n.useEffect)(()=>{let e=r.trim();if(e.length<2){c(R),p(!1);return}p(!0);let a=new AbortController,t=setTimeout(()=>{(0,L.nr)(`/api/admin/search?q=${encodeURIComponent(e)}`,{signal:a.signal}).then(c).catch(()=>{}).finally(()=>p(!1))},160);return()=>{clearTimeout(t),a.abort()}},[r]);let b=(0,n.useMemo)(()=>{let e=r.trim().toLowerCase();return[...J.flatMap(e=>e.items).filter(a=>!e||a.label.toLowerCase().includes(e)).map(e=>({key:`page-${e.href}`,group:"Go to",label:e.label,href:e.href,icon:e.icon})),...o.workspaces.map(e=>({key:`ws-${e.id}`,group:"Workspaces",label:e.name,sub:e.ownerEmail,href:`/admin/workspaces/${e.id}`,icon:d.A})),...o.users.map(e=>({key:`user-${e.id}`,group:"People",label:e.name||e.email,sub:e.name?e.email:void 0,href:`/admin/users?q=${encodeURIComponent(e.email)}`,icon:I.A})),...o.agents.map(e=>({key:`agent-${e.id}`,group:"Agents",label:e.name||e.id,sub:[(0,M.x7)(e.template),e.id].filter(Boolean).join(" \xb7 "),href:`/admin/agents/${e.id}`,icon:u.A})),...(o.partners??[]).map(e=>({key:`partner-${e.id}`,group:"Partners",label:e.name,sub:[e.name===e.email?null:e.email,e.handle?`/partner/${e.handle}`:null,O.R8[e.status]??e.status].filter(Boolean).join(" \xb7 "),href:`/admin/partners/${e.id}`,icon:g.A}))]},[r,o]);function j(e){e&&(a(!1),t.push(e.href))}(0,n.useEffect)(()=>x(0),[b.length]),(0,n.useEffect)(()=>{f.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({block:"nearest"})},[h]);let v="";return(0,s.jsx)($.bL,{open:e,onOpenChange:a,children:(0,s.jsxs)($.ZL,{children:[(0,s.jsx)($.hJ,{className:"fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0"}),(0,s.jsxs)($.UC,{className:"fixed left-1/2 top-[14vh] z-50 w-[calc(100%-2rem)] max-w-xl -translate-x-1/2 overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-2xl shadow-black/20 duration-150 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-[0.98] data-[state=closed]:animate-out data-[state=closed]:fade-out-0","aria-describedby":void 0,children:[(0,s.jsx)($.hE,{className:"sr-only",children:"Find anything"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b px-4",children:[m?(0,s.jsx)(E.A,{className:"size-4 shrink-0 animate-spin text-muted-foreground","aria-hidden":!0}):(0,s.jsx)(y.A,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,s.jsx)("input",{autoFocus:!0,value:r,onChange:e=>l(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),x(e=>Math.min(b.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),x(e=>Math.max(0,e-1))):"Enter"===e.key&&(e.preventDefault(),j(b[h]))},placeholder:"Search workspaces, people, agents, partners, or pages",className:"h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground",role:"combobox","aria-expanded":!0,"aria-controls":"admin-palette-list","aria-activedescendant":b[h]?`palette-${b[h].key}`:void 0})]}),(0,s.jsxs)("ul",{ref:f,id:"admin-palette-list",role:"listbox",className:"max-h-[50vh] overflow-y-auto p-2",children:[b.map((e,a)=>{let t=e.group!==v?e.group:null;v=e.group;let n=e.icon;return(0,s.jsxs)("li",{role:"presentation",children:[t&&(0,s.jsx)("p",{className:"px-2 pb-1 pt-2 text-[11px] font-medium text-muted-foreground",children:t}),(0,s.jsxs)("div",{id:`palette-${e.key}`,role:"option","aria-selected":a===h,"data-index":a,onMouseMove:()=>x(a),onClick:()=>j(e),className:(0,P.cn)("flex cursor-pointer items-center gap-3 rounded-md px-2 py-2 text-sm",a===h&&"bg-accent text-accent-foreground"),children:[(0,s.jsx)(n,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block truncate font-medium",children:e.label}),e.sub&&(0,s.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.sub})]}
1),a===h&&(0,s.jsx)(F.A,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":!0})]})]},e.key)}),!b.length&&!m&&(0,s.jsxs)("li",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:["Nothing matches “",r.trim(),"”"]})]})]})]})})}var D=t(28713);let J=[{group:"",items:[{href:"/admin",label:"Overview",icon:o.A,exact:!0}]},{group:"Customers",items:[{href:"/admin/workspaces",label:"Workspaces",icon:d.A},{href:"/admin/users",label:"People",icon:c.A},{href:"/admin/agents",label:"Agents",icon:u.A},{href:"/admin/flow",label:"Flow+",icon:m.A}]},{group:"Money",items:[{href:"/admin/billing",label:"Billing risk",icon:p.A},{href:"/admin/pricing",label:"Pricing",icon:h.A}]},{group:"Pipeline",items:[{href:"/admin/requests",label:"Requests",icon:x.A,badge:"requests"},{href:"/admin/demo",label:"Demo leads",icon:f.A,badge:"demo"}]},{group:"Partner program",items:[{href:"/admin/partners",label:"Partners",icon:g.A,badge:"partners"}]},{group:"Platform",items:[{href:"/admin/audit",label:"Audit log",icon:b.A},{href:"/admin/settings",label:"Settings",icon:j.A}]}],_=(0,n.createContext)({abrConfigured:null,counts:{requests:0,demo:0,partners:0},setCount:()=>{},partnerWork:null,refreshPartnerWork:()=>{}});function q(){return(0,n.useContext)(_)}function T({email:e,children:a}){let t=(0,i.usePathname)(),[r,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)({requests:0,demo:0,partners:0}),p=(0,n.useCallback)((e,a)=>m(t=>t[e]===a?t:{...t,[e]:a}),[]),[h,x]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),b=(0,n.useCallback)(()=>{(0,L.nr)("/api/admin/partners?count=1").then(e=>{p("partners",e.pendingCount),"boolean"==typeof e.abrConfigured&&g(e.abrConfigured);let a=e.counts??{};x({applications:a.applications??0,allocation:a.allocation??0,approval:a.approval??0,reviews:a.reviews??0,bonuses:a.bonuses??0,claims:a.claims??0})}).catch(()=>{})},[p]);async function j(){await (0,D.U)().auth.signOut(),window.location.href="/login"}(0,n.useEffect)(()=>{(0,L.nr)("/api/admin/custom-solutions").then(e=>p("requests",e.newCount)).catch(()=>{}),(0,L.nr)("/api/admin/demo-sessions?filter=leads").then(e=>p("demo",e.newLeads)).catch(()=>{}),b()},[p,b]),(0,n.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),c(e=>!e))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let $=e=>e.exact?t===e.href:t.startsWith(e.href),I=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 px-2 py-1",children:[(0,s.jsx)(l(),{href:"/admin",onClick:()=>o(!1),"aria-label":"Admin overview",children:(0,s.jsx)(C.Logo,{})}),(0,s.jsx)("span",{className:"rounded-md border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Admin"})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>{o(!1),c(!0)},className:"mt-5 flex w-full items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,s.jsx)(y.A,{className:"size-4","aria-hidden":!0}),"Find anything",(0,s.jsx)("kbd",{className:"ml-auto rounded border bg-muted px-1.5 font-sans text-[10px]",children:"⌘K"})]}),(0,s.jsx)("nav",{className:"mt-4 flex flex-col gap-4","aria-label":"Admin",children:J.map(e=>(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[e.group&&(0,s.jsx)("p",{className:"px-3 pb-1 text-[11px] font-medium text-muted-foreground/80",children:e.group}),e.items.map(e=>{let a=e.icon,t=e.badge?u[e.badge]:0;return(0,s.jsxs)(l(),{href:e.href,onClick:()=>o(!1),"aria-current":$(e)?"page":void 0,className:(0,S.H)($(e)),children:[(0,s.jsx)(a,{className:"size-4","aria-hidden":!0}),e.label,t>0&&(0,s.jsx)("span",{className:"ml-auto rounded-full bg-brand px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-brand-foreground",children:t})]},e.href)})]},e.group||"top"))}),(0,s.jsxs)("div",{className:"mt-auto space-y-1 border-t pt-3",children:[(0,s.jsxs)(l(),{href:"/dashboard",className:(0,S.H)(!1),children:[(0,s.jsx)(v.A,{className:"size-4","aria-hidden":!0}),"My dashboard"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2",children:[(0,s.jsx)("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",title:e,children:e}),(0,s.jsx)(A.$,{variant:"ghost",size:"icon",className:"size-7",onClick:j,"aria-label":"Sign out",children:(0,s.jsx)(w.A,{className:"size-3.5"})})]})]})]});return(0,s.jsxs)(_.Provider,{value:{counts:u,setCount:p,partnerWork:h,refreshPartnerWork:b,abrConfigured:f},children:[(0,s.jsxs)("div",{className:"flex h-screen flex-col bg-background lg:flex-row",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between border-b bg-card p-3 lg:hidden",children:[(0,s.jsx)(l(),{href:"/admin","aria-label":"Admin overview",children:(0,s.jsx)(C.Logo,{})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(A.$,{variant:"outline",size:"icon","aria-label":"Find anything",onClick:()=>c(!0),children:(0,s.jsx)(y.A,{className:"size-4"})}),(0,s.jsxs)(z.cj,{open:r,onOpenChange:o,children:[(0,s.jsx)(z.CG,{asChild:!0,children:(0,s.jsx)(A.$,{variant:"outline",size:"icon","aria-label":"Open menu",children:(0,s.jsx)(N.A,{className:"size-4"})})}),(0,s.jsx)(z.h,{title:"Admin navigation",children:(0,s.jsx)("div",{className:"flex flex-1 flex-col p-4",children:I})})]})]})]}),(0,s.jsx)("aside",{className:"hidden w-60 shrink-0 flex-col border-r bg-card p-4 lg:flex",children:I}),(0,s.jsxs)("main",{className:"min-w-0 flex-1 overflow-y-auto",children:[(0,s.jsx)("div",{className:"hidden h-12 items-center justify-end gap-3 border-b bg-background px-6 lg:flex",children:(0,s.jsx)(k.U,{})}),(0,s.jsx)("div",{className:"mx-auto w-full max-w-7xl p-4 sm:p-6 md:p-8",children:a})]})]}),(0,s.jsx)(U,{open:d,onOpenChange:c})]})}function W({title:e,description:a,actions:t,className:n}){return(0,s.jsxs)("div",{className:(0,P.cn)("mb-6 flex flex-wrap items-end justify-between gap-4",n),children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e}),a&&(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),t&&(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:t})]})}}
1,77977:(e,a,t)=>{t.d(a,{$k:()=>l,Fx:()=>r,J4:()=>d,J5:()=>f,NW:()=>j,PM:()=>m,R8:()=>o,Rc:()=>s,Uo:()=>i,W0:()=>x,Xk:()=>b,n:()=>c,re:()=>p,wb:()=>n,ym:()=>u,zc:()=>g});let s=["trial","full"],n=["full_cycle","setter","closer"],r=["auto","approval","hold"],l=["sole_trader","company","partnership","trust"],i=["NSW","VIC","QLD","WA","SA","TAS","ACT","NT"],o={applying:"Application in progress",submitted:"Awaiting review",approved:"Approved",rejected:"Declined",suspended:"Suspended",terminated:"Ended"},d={trial:"Trial partner",full:"Full partner"},c={full_cycle:"Full cycle",setter:"Setter",closer:"Closer"},u={sole_trader:"Sole trader",company:"Company",partnership:"Partnership",trust:"Trust"},m={auto:"Automatic",approval:"Needs approval",hold:"On hold"},p=7776e3,h=/^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/,x=["login","apply","agreement","dashboard","onboarding","earnings","payouts","statements","resources","settings","deals","clients","api","admin","new","me","partner","partners","terms","privacy","support","help","etecplus","etec"];function f(e){return h.test(e)&&!e.includes("--")&&!x.includes(e)}function g(e){let a=e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);if(a.length>=2){let e=`${a[0].slice(0,30)}-${a[a.length-1][0]}`;if(f(e))return e}let t=a.join("-").slice(0,32).replace(/-+$/,"");return f(t)?t:""}let b={gold_plus:{name:"Gold+",monthlyFeeCents:89900,commissionBps:2500,bonusFullCycleCents:1e5,bonusSplitCents:5e4},platinum_plus:{name:"Platinum+",monthlyFeeCents:149900,commissionBps:2500,bonusFullCycleCents:1e5,bonusSplitCents:5e4},ruby_plus:{name:"Ruby+",monthlyFeeCents:279900,commissionBps:2500,bonusFullCycleCents:1e5,bonusSplitCents:5e4},ultimax_plus:{name:"Ultimax+",monthlyFeeCents:5e5,commissionBps:1500,bonusFullCycleCents:16e4,bonusSplitCents:5e4}},j={demos:10,days:14}},88641:(e,a,t)=>{t.d(a,{H:()=>n});var s=t(40980);function n(e,a){return(0,s.cn)("flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm font-medium transition-colors",e?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground",a)}},99412:(e,a,t)=>{t.d(a,{CG:()=>d,cj:()=>o,h:()=>m});var s=t(95155),n=t(12115),r=t(43146),l=t(33210),i=t(40980);let o=r.bL,d=r.l9,c=r.ZL;r.bm;let u=n.forwardRef(({className:e,...a},t)=>(0,s.jsx)(r.hJ,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a}));u.displayName=r.hJ.displayName;let m=n.forwardRef(({className:e,children:a,title:t,...n},o)=>(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsxs)(r.UC,{ref:o,className:(0,i.cn)("fixed inset-y-0 left-0 z-50 flex h-full w-72 max-w-[85vw] flex-col border-r bg-card shadow-lg outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",e),...n,children:[(0,s.jsx)(r.hE,{className:"sr-only",children:t}),a,(0,s.jsxs)(r.bm,{className:"absolute right-3 top-3 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:[(0,s.jsx)(l.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=r.UC.displayName}}]);

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.