PageSourceSearch

https://app.hi.events/assets/index-DCyx7KLu.js

js hi.events collected 2026-10-01 10:21:41 UTC 6,636 bytes, 6 lines download raw bytes

1import{p as F,m as W,q as E,r as c,j as e,C as Y,S as h,R as Z,i as s,L as n,J as g,W as $,X as H,Y as ee}from"./index-H-7Mdjgq.js";import{A as f}from"./ActionIcon-BNTNX0_j.js";import{B as v}from"./Badge-C29QpBn8.js";import{P as ie}from"./Pagination-PYXMbajw.js";import{T as S}from"./Tooltip-BbNYwxJq.js";import{S as M}from"./Skeleton-DxmOCu5F.js";import{T as t}from"./Table-Bkck1WxA.js";import{T as se}from"./TextInput-DJngKYsH.js";import{u as ne}from"./use-disclosure-B6DxwJDq.js";import{a as T}from"./admin.client-DK6-JQQ4.js";import{u as N}from"./useMutation--MIpdzpW.js";import{r as te}from"./dates-8rjFi0lQ.js";import{c as q}from"./confirmationDialog-C7tBR8qg.js";import{I as re,a as G,b as P}from"./notifications-DPyM_svh.js";import{t as x}from"./admin-table.module-B-tFcM9Z.js";import{I as de}from"./IconSearch-DOvTLW64.js";import{I as ae}from"./IconCalendarEvent-DL1QIzwe.js";import{I as oe}from"./IconEye-DwpddlQe.js";import"./create-event-handler-C3eq9ghx.js";import"./get-auto-contrast-value-Da6zqqWm.js";import"./get-floating-position-7n5UPPCU.js";import"./InputBase-CV4iOMG7.js";import"./utc-C3EVnpqr.js";import"./dayjs.min-jhmS8Dw0.js";import"./timezone-CHvflEA8.js";import"./IconX-BeJ4A9dL.js";/**
2 * @license @tabler/icons-react v3.35.0 - MIT
3 *
4 * This source code is licensed under the MIT license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ce=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M5.7 5.7l12.6 12.6",key:"svg-1"}]],le=F("outline","ban","Ban",ce),y=["admin","spam-events"],me=(a={})=>W({queryKey:[...y,a],queryFn:()=>T.getAllAdminSpamEvents(a)}),he=()=>{const a=E();return N({mutationFn:o=>T.approveSpamEvent(o),onSuccess:()=>{a.invalidateQueries({queryKey:y})}})},xe=()=>{const a=E();return N({mutationFn:o=>T.confirmSpamEvent(o),onSuccess:()=>{a.invalidateQueries({queryKey:y})}})},Be=()=>{var b,w,I,A;const[a,o]=c.useState(1),[p,Q]=c.useState(""),[R,L]=c.useState(""),[r,B]=c.useState(null),[l,m]=c.useState(null),[D,{open:J,close:u}]=ne(!1),{data:d,isLoading:K}=me({page:a,per_page:20,search:R}),j=he(),_=xe();c.useEffect(()=>{const i=setTimeout(()=>
6{L(p),o(1)},500);return()=>clearTimeout(i)},[p]);const z=j.isPending||_.isPending,O=i=>{q(s._({id:"ywJqzT"}),()=>{m(i),j.mutate(i,{onSuccess:()=>{P(s._({id:"mUnu5U"})),u()},onError:()=>G(s._({id:"ITUPO1"})),onSettled:()=>m(null)})})},U=i=>{q(s._({id:"QueM1x"}),()=>{m(i),_.mutate(i,{onSuccess:()=>{P(s._({id:"sp5BIS"})),u()},onError:()=>G(s._({id:"RqdgCC"})),onSettled:()=>m(null)})})},V=i=>{B(i),J()},C=i=>`${Math.round(i*100)}%`,X=((b=d==null?void 0:d.meta)==null?void 0:b.total)||0;return e.jsxs(Y,{size:"xl",p:"xl",children:[e.jsxs(h,{gap:"lg",children:[e.jsxs("div",{children:[e.jsx(Z,{order:1,children:s._({id:"5dZvRt"})}),e.jsx(n,{c:"dimmed",size:"sm",children:s._({id:"1cnIT1"})})]}),e.jsx(se,{placeholder:s._({id:"fneVQg"}),leftSection:e.jsx(de,{size:16}),value:p,onChange:i=>Q(i.target.value),"data-testid":"spam-events-search-input"}),K?e.jsxs(h,{gap:"md",children:[e.jsx(M,{height:50,radius:"md"}),e.jsx(M,{height:400,radius:"md"})]}):X===0?e.jsx("div",{className:x.emptyState,children:e.jsx(n,{c:"dimmed",size:"lg",children:s._({id:"D6VGsg"})})}):e.jsx("div",{className:x.tableWrapper,children:e.jsx("div",{className:x.tableScroll,children:e.jsxs(t,{className:x.table,highlightOnHover:!0,children:[e.jsx(t.Thead,{children:e.jsxs(t.Tr,{children:[e.jsx(t.Th,{children:s._({id:"0pC/y6"})}),e.jsx(t.Th,{children:s._({id:"G5RhpL"})}),e.jsx(t.Th,{children:s._({id:"AeXO77"})}),e.jsx(t.Th,{children:s._({id:"Lek+XJ"})}),e.jsx(t.Th,{children:s._({id:"VSGGki"})}),e.jsx(t.Th,{style:{width:110}})]})}),e.jsx(t.Tbody,{children:(w=d==null?void 0:d.data)==null?void 0:w.map(i=>{var k;return e.jsxs(t.Tr,{children:[e.jsx(t.Td,{children:e.jsxs(g,{gap:"xs",children:[e.jsx(ae,{size:16,color:"gray"}),e.jsx(n,{size:"sm",fw:500,lineClamp:1,maw:250,children:i.event_title})]})}),e.jsx(t.Td,{children:e.jsx(n,{size:"sm",lineClamp:1,maw:150,children:i.organizer_name||"-"})}),e.jsx(t.Td,{children:e.jsx(n,{size:"sm",c:"dimmed",lineClamp:1,maw:180,children:i.account_email||i.account_name||"-"})}),e.jsx(t.Td,{children:e.jsx(v,{color:"orange",variant:"light",children:C(((k=i.verdict)==null?void 0:k.confidence)||0)})}),e.jsx(t.Td,{children:e.jsx(n,{size:"sm",children:te(i.checked_at)})}),e.jsx(t.Td,{children:e.jsxs(g,{gap:"xs",children:[e.jsx(S,{label:s._({id:"SZw9tS"}),children:e.jsx(f,{variant:"subtle",color:"gray","data-testid":"view-spam-event-button",onClick:()=>V(i),children:e.jsx(oe,{size:16})})}),e.jsx(S,{label:s._({id:"36bshf"}),children:e.jsx(f,{variant:"subtle",color:"green","data-testid":"approve-spam-event-button",onClick:()=>O(i.event_id),loading:j.isPending&&l===i.event_id,disabled:z&&l!==i.event_id,children:e.jsx(re,{size:16})})}),e.jsx(S,{label:s._({id:"JTGpmU"}),children:e.jsx(f,{variant:"subtle",color:"red","data-testid":"confirm-spam-event-button",onClick:()=>U(i.event_id),loading:_.isPending&&l===i.event_id,disabled:z&&l!==i.event_id,children:e.jsx(le,{size:16})})})]})})]},i.id)})})]})})}),(d==null?void 0:d.meta)&&d.meta.last_page>1&&e.jsx(ie,{total:d.meta.last_page,value:a,onChange:o,mt:"md"})]}),e.jsx($,{opened:D,onClose:u,title:s._({id:"FQID2D"}),size:"lg",children:r&&e.jsxs(h,{gap:"md",children:[e.jsxs("div",{children:[e.jsx(n,{size:"sm",fw:500,c:"dimmed",children:s._({id:"0pC/y6"})}),e.jsx(n,{fw:500,children:r.event_title})]}),r.event_description&&e.jsxs("div",{children:[e.jsx(n,{size:"sm",fw:500,c:"dimmed",children:s._({id:"Nu4oKW"})}),e.jsx(H.Autosize,{mah:200,children:e.jsx(n,{size:"sm",style:{whiteSpace:"pre-wrap"},children:r.event_description})})]}),e.jsxs(g,{children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(n,{size:"sm",fw:500,c:"dimmed",children:s._({id:"G5RhpL"})}),e.jsx(n,{size:"sm",children:r.organizer_name||"-"})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(n,{size:"sm",fw:500,c:"dimmed",children:s._({id:"AeXO77"})}),e.jsx(n,{size:"sm",component:ee,to:`/admin/accounts/${r.account_id}`,children:r.account_name||"-"}),e.jsx(n,{size:"sm",c:"dimmed",children:r.account_email})]})]}),e.jsxs("div",{children:[e.jsx(n,{size:"sm",fw:500,c:"dimmed",children:s._({id:"Lek+XJ"})}),e.jsx(v,{color:"orange",variant:"light",children:C(((I=r.verdict)==null?void 0:I.confidence)||0)})]}),((A=r.verdict)==null?void 0:A.reasons)&&r.verdict.reasons.length>0&&e.jsxs("div",{children:[e.jsx(n,{size:"sm",fw:500,c:"dimmed",mb:"xs",children:s._({id:"33+tw4"})}),e.jsx(h,{gap:"xs",children:r.verdict.reasons.map(i=>e.jsx(v,{color:"orange",variant:"light",style:{textTransform:"none"},children:i},i))})]})]})})]})};export{Be 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.