PageSourceSearch

https://sendunlimitedemail.com/sue/mod-Cn9IODhN.js

js sendunlimitedemail.com collected 2026-10-05 06:25:37 UTC 3,033 bytes, 1 lines download raw bytes

1import{k as N,e as i,r as d,t as g,j as e,V as h,G as C,S as w}from"./edge-BOITG1XR.js";import{C as S,a as _,b as k,d as A,c as M}from"./mod-DgQ0OFXm.js";import{S as E}from"./mod-By5M3Mkm.js";import{B as u}from"./mod-D625c86a.js";import{M as F}from"./mod-CL3oDg-g.js";import{D as B}from"./mod-ByZwUIgr.js";const D=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]],I=N("chart-no-axes-column-increasing",D),o={},L=300*1e3,m={getAll:async()=>(await i.get("/features")).data,getActive:async()=>(await i.get("/features/active")).data,isActive:async s=>{const a=Date.now();if(o[s]&&a-o[s].ts<L)return o[s].value;const l=!!(await i.get(`/features/${s}/is-active`)).data.is_active;return o[s]={value:l,ts:a},l},invalidate:s=>{delete o[s]},toggle:async s=>(await i.post(`/features/${s}/toggle`)).data,update:async(s,a)=>(await i.put(`/features/${s}`,a)).data},T={payment:B,product:w,communication:F,ux:C,admin:I,general:h},x={payment:"bg-green-100 text-green-800",product:"bg-blue-100 text-blue-800",communication:"bg-purple-100 text-purple-800",ux:"bg-orange-100 text-orange-800",admin:"bg-red-100 text-red-800",general:"bg-gray-100 text-gray-800"};function P(){const[s,a]=d.useState([]),[p,l]=d.useState({}),[v,j]=d.useState(!0);d.useEffect(()=>{f()},[]);const f=async()=>{try{const t=await m.getAll();a(t.features||[]),l(t.grouped||{})}catch{g.error("Failed to load features")}finally{j(!1)}},b=async t=>{try{const r=await m.toggle(t.id);g.success(r.message),m.invalidate(t.slug),a(s.map(c=>c.id===t.id?{...c,is_active:!c.is_active}:c))}catch{g.error("Failed to update feature")}};return v?e.jsx("div",{className:"p-8 text-center",children:"Loading features..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Feature Management"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Enable or disable platform features with a single click"})]}),Object.entries(p).map(([t,r])=>{const c=T[t]||h,y=x[t]||x.general;return e.jsxs(S,{children:[e.jsx(_,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(c,{className:"w-6 h-6"}),e.jsxs("div",{children:[e.jsxs(k,{className:"capitalize",children:[t," Features"]}),e.jsxs(A,{children:[r.length," feature",r.length!==1?"s":""," available"]})]})]})}),e.jsx(M,{children:e.jsx("div",{className:"space-y-4",children:r.map(n=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-gray-50 transition-colors",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"font-semibold",children:n.name}),e.jsx(u,{className:y,children:n.slug}),n.is_active&&e.jsx(u,{className:"bg-green-100 text-green-800",children:"Active"})]}),n.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:n.description})]}),e.jsx(E,{checked:n.is_active,onCheckedChange:()=>b(n)})]},n.id))})})]},t)})]})}export{P 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.