import{u as X,j as e,A as E,c as U,T as m,h as z,t as de,r as o,F as me,d as $,f as xe,D as G,g as he,H as fe,B as F,i as ge,k as ue,P as pe,l as we,L as be}from"./index-07cf9bbc.js";import{g as je,s as Ne}from"./backgroundcheck-b5227907.js";import{e as J}from"./extractTextFromHtml-bc264aa5.js";var H=(l=>(l.Social_Bureau="Social Bureau",l.Virus_Total="Virus Total",l))(H||{}),Y=(l=>(l.WEBSITE="WEBSITE",l.IP="IP",l))(Y||{});const ye=({searchKeyword:l,accordionTopic:t,accordionDescription:N,topicList:h,resultCrimeReports:a,resultPosts:u,totalPosts:f,type:r})=>{var y;const i=X(),T=s=>z(s).format("D/M/YYYY HH:mm"),p=s=>{const n=J(s.content.text).boldText,b=J(s.content.text).paragraphText.replace(/<[^>]*>/g,"");let k;return b.length>1&&(b.length>30?k=de(b,30,0):k=b),{title:n,description:b.length>1?k:"-",link:`/forum/${s.id}`,date:T(s.createdAt)}},S=s=>{if(s.platform===H.Social_Bureau){const g=`/background-check/details?keyword=${encodeURIComponent(l)}`;return e.jsx("div",{className:"text-blue-400 cursor-pointer",onClick:()=>i(g),children:s.platform})}else if(s.platform===H.Virus_Total){let n;switch(s.type){case Y.WEBSITE:n="domain";break;case Y.IP:n="ip-address";break}const g=`https://www.virustotal.com/gui/${n}/${s.data.data.id}`;return e.jsxs("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 flex items-center gap-x-[0.5rem]",children:[s.platform,e.jsx(U,{})]})}},W=()=>{const s="Regardless of these findings, you have the option to conduct a more thorough investigation using the wallet's network-specific scanners below: ",n="Please click at the link for the results : ";return e.jsxs("div",{className:(r==="Wallet Address"?"flex-col ":(r==="Website"||r==="IP Address")&&a&&(a==null?void 0:a.length)>1?"":" ")+"flex flex-wrap gap-[0.5rem] text-sm mt-3 text-red-500 cursor-default",children:[e.jsx("span",{children:r==="Wallet Address"?s:n}),r==="Wallet Address"?e.jsxs(e.Fragment,{children:[e.jsxs("a",{href:`https://blockexplorer.one/?q=${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 cursor-pointer w-fit",children:["• ",e.jsx("span",{className:"underline",children:"Blockexplorer.one"})]}),e.jsxs("a",{href:`https://www.blockchain.com/explorer/search?search=${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 cursor-pointer w-fit",children:["• ",e.jsx("span",{className:"underline",children:"Blockchain.com"})]}),e.jsxs("a",{href:`https://blockchair.com/search?q=${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 cursor-pointer w-fit",children:["• ",e.jsx("span",{className:"underline",children:"Blockchair.com"})]})]}):e.jsxs("a",{href:`https://www.virustotal.com/gui/${r==="Website"?"domain":"ip-address"}/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 cursor-pointer w-fit",children:[a&&(a==null?void 0:a.length)>1&&"•"," ",e.jsx("span",{className:"underline",children:"Virustotal.com"})]})]})},B=s=>{i(s)};return e.jsx("div",{className:"wrapper-scam-alert-table max-sm:mt-5",children:e.jsx(E,{className:"bg-white border-0 px-3 py-3 rounded-none sm:rounded-lg",children:e.jsxs(E.Panel,{children:[e.jsxs(E.Title,{className:"bg-white hover:bg-white max-md:px-0 max-md:pt-0",children:[e.jsx("div",{className:"text-gray-900 text-lg md:text-xl font-bold leading-8",children:t}),e.jsx("div",{className:"text-gray-500 text-sm md:text-base leading-6 self-start whitespace-nowrap",children:N})]}),e.jsxs(E.Content,{className:"bg-white border-none pt-0 max-md:px-0 max-md:pt-0",children:[e.jsxs("div",{className:"mb-5 text-sm text-gray-600 font-normal flex items-center gap-[1rem] justify-between flex-wrap",children:[e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsx(U,{className:"text-lg min-w-[18px]"}),e.jsx("span",{className:"min-w-[70px]",children:"Keyword :"})," ",e.jsx("span",{className:"text-gray-800 font-bold",children:l})]}),(!!f||a&&!!a.length)&&e.jsxs("div",{children:["Results :"," ",e.jsxs("span",{className:"text-gray-800 font-bold ml-1",children:[f||(a==null?void 0:a.length)," ",f&&a&&(f>1||(a==null?void 0:a.length)>1)?"Rows":"Row"]})]})]}),e.jsxs("div",{className:"overflow-y-hidden overflow-x-auto max-md:left-[-12px] min-h-[90px] max-md:relative max-md:right-[-12px] max-md:w-[calc(100%+24px)]",children:[e.jsxs(m,{striped:!0,hoverable:!0,children:[e.jsx(m.Head,{children:h==null?void 0:h.map((s,n)=>e.jsx(m.HeadCell,{className:"bg-primary-700 text-white max-md:!rounded-none",children:s.label},n))}),e.jsxs(m.Body,{className:"divide-y",children:[u==null?void 0:u.map((s,n)=>e.jsxs(m.Row,{className:"bg-white",children:[e.jsx(m.Cell,{className:"whitespace-nowrap text-gray-900 max-w-[200px] md:max-w-[250px] truncate text-xs sm:text-sm font-medium leading-5",children:p(s).title}),e.jsx(m.Cell,{className:"whitespace-nowrap text-gray-900 max-w-[180px] truncate text-xs sm:text-sm font-medium leading-5",children:p(s).description}),e.jsx(m.Cell,{className:"whitespace-nowrap",onClick:()=>B(p(s).link),children:e.jsx("span",{className:"text-blue-400 cursor-pointer text-xs sm:text-sm",children:"View post"})}),e.jsx(m.Cell,{className:"whitespace-nowrap text-xs sm:text-sm",children:p(s).date})]},n)),a==null?void 0:a.map((s,n)=>{var g;if(!((g=s.error)!=null&&g.message))return e.jsxs(m.Row,{className:"bg-white ",children:[e.jsx(m.Cell,{className:"whitespace-nowrap text-gray-900 text-xs sm:text-sm font-medium leading-5 ",children:s.type}),e.jsxs(m.Cell,{className:"whitespace-nowrap text-gray-900 text-xs sm:text-sm font-medium leading-5 ",children:[s.count," Record"]}),e.jsx(m.Cell,{className:"whitespace-nowrap text-xs sm:text-sm",children:S(s)}),e.jsx(m.Cell,{className:"whitespace-nowrap text-xs sm:text-sm",children:z(s==null?void 0:s.updatedAt).format("D/M/YYYY HH:mm")})]},n)})]})]}),(r&&(r==="Wallet Address"||r==="Website"||r==="IP Address")?!0:(a==null?void 0:a.length)===1&&!!((y=a[0].error)!=null&&y.message))&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"pl-[1rem] pt-[1rem]",children:W()})})]})]})]})})})},Q=ye,L=/[^!1234567890@#$%^&*()_+={}[\]:;"'<>,.?/\\|`~-]*/g,ke=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ve=/^\d*$/,C=/[^!@#$%^&*()_+={}[\];"'<>,?/\\|`~-]*/g,v=/[^!@#$%^&*()_+={}[\]:;"'<>,.?/\\|`~-]*/g,_=/[^!@ #$%^&*()_+={}[\]:;"'<>,.?/\\|`~-]*/g,Te=(l,t)=>{var N,h,a,u,f;switch(l){case"Name":return t&&t.match(L)&&((N=t.match(L))!=null&&N.length)&&t.match(L).filter(r=>r==="").length>1?"Name format is incorrect.":"";case"Email":return t&&!ke.test(t)?"Email format is incorrect.":"";case"Telephone":return t&&!ve.test(t)?"Telephone format is incorrect.":t&&t.length<9?"Telephone must be at least 9 characters long.":"";case"Identification":return t&&t.match(_)&&((h=t.match(_))!=null&&h.length)&&t.match(_).filter(r=>r==="").length>1?"Identification format is incorrect.":"";case"Bank Transaction":return t&&t.match(v)&&((a=t.match(v))!=null&&a.length)&&t.match(v).filter(r=>r==="").length>1?"Bank Transaction format is incorrect":"";case"IP Address":return t&&t.match(C)&&((u=t.match(C))!=null&&u.length)&&t.match(C).filter(r=>r==="").length>1?"IP Address format is incorrect":"";case"Website":return t&&!t.startsWith("www.")&&!t.startsWith("http://")&&!t.startsWith("https://")?"Website format is incorrect, Example: https://www.google.com":"";case"Wallet Address":return t&&t.match(v)&&((f=t.match(v))!=null&&f.length)&&t.match(v).filter(r=>r==="").length>1?"Wallet address format is incorrect, Example: 0x12d...3456f":t&&t.length<15?"Wallet Address must be at least 15 characters long.":"";default:return""}},Se=l=>{switch(l){case"Name":return"NAME";case"Email":return"EMAIL";case"Telephone":return"PHONE";case"Identification":return"ID";case"Bank Transaction":return"TRANSACTION";case"IP Address":return"IP";case"Website":return"WEBSITE";case"Wallet Address":return"WALLET";default:return""}},A=new be("BackgroundCheck.tsx");function Ee(){const l=X(),t=()=>{l("/crime-report")},N=[{label:"SCAM TYPE"},{label:"FOUND"},{label:"PLATFORM"},{label:"DATE & TIME"}],h=["Name","Telephone","Email","Bank Transaction","Identification","Wallet Address","IP Address","Website"],a=[{label:"TITLE"},{label:"DESCRIPTION"},{label:"LINK"},{label:"DATE & TIME"}],u=10,[f,r]=o.useState(!1),[i,T]=o.useState(""),[p,S]=o.useState(""),[W,B]=o.useState(0),[y,s]=o.useState(!1),[n,g]=o.useState([]),[b,k]=o.useState([]),[M,K]=o.useState(!1),[O,Z]=o.useState(1),[R,ee]=o.useState(1),[te,se]=o.useState(0),[ae,re]=o.useState(0),[x,le]=o.useState("Name"),[D,q]=o.useState(""),ne=async d=>{const w={keyword:i,page:1,limit:u,type:Se(x)},P=await je(w),j=P==null?void 0:P.data;if(g(j==null?void 0:j.results),re((j==null?void 0:j.totalResults)||0),d)return j},V=async(d,c)=>{const P={keyword:i[0]==="+"?i.slice(1):i,page:d,limit:u},I=(await Ne(P)).data;if(k(I.results),se(I.totalResults),ee(I.totalPages),c)return I},ce=async d=>{if(d.preventDefault(),!i){r(!0),s(!1),S("");return}if(i){S(i);try{K(!0);const c=await ne(!0),w=await V(O,!0);B(((c==null?void 0:c.totalResults)||0)+((w==null?void 0:w.totalResults)||0)),c&&w&&(A.debug("dataCrime",c),A.debug("dataPost",w),c.totalResults>=1||w.totalResults>=1?(s(!0),A.debug("found")):(s(!1),A.debug("!found")))}catch(c){s(!1),A.error("Submit error",c)}finally{K(!1),r(!0)}}},ie=d=>{const c=d.target.value;q(Te(x,c)),T(c)},oe=async d=>{Z(d),i&&V(d)};return o.useEffect(()=>{i||(r(!1),S(""))},[i]),e.jsxs(e.Fragment,{children:[e.jsx(me,{items:[{label:"Crime"},{label:"Background Checks"}]}),e.jsx("h3",{className:"mb-2 text-xl sm:text-2xl md:text-3xl font-semibold text-gray-900 max-sm:px-3",children:"Background Checks"}),e.jsx("p",{className:"text-gray-500 font-normal text-xs sm:text-sm max-sm:px-3",children:"You can check the crime using your specific information such as mobile number, email, bank account etc."}),e.jsx("form",{className:"wrapper-background-check-form my-5 max-sm:mb-0",onSubmit:ce,children:e.jsxs("div",{className:"gap-4 flex max-lg:flex-col max-md:items-stretch w-full",children:[e.jsx("div",{className:"flex flex-col items-stretch w-8/12 max-lg:w-full",children:e.jsx("div",{className:"items-start bg-white flex grow flex-col w-full mx-auto max-md:px-3 max-md:py-4 px-8 py-8 rounded-none sm:rounded-lg",children:e.jsxs("div",{className:"self-stretch flex flex-col",children:[e.jsx("div",{className:"hidden md:block text-black text-lg font-semibold leading-7 self-start whitespace-nowrap",children:"Background Checks"}),e.jsxs("div",{className:"items-start flex w-full flex-col max-md:mt-0 mt-3.5 self-start",children:[e.jsx("div",{className:"text-gray-900 text-sm leading-5 block",children:e.jsx($,{value:"Type",className:"font-medium"})}),e.jsxs("div",{className:"flex w-full mt-1.5 bg-[#f3f4f6] h-[42px] rounded-lg pl-[12px] bgCheck-dropdown-type gap-2 items-center max-w-[330px]",children:[e.jsx(xe,{className:"text-[16px] text-gray-500 min-w-[16px]"}),e.jsx(G,{dismissOnClick:!0,size:"sm",color:"transparent",className:"pl-0",label:x,children:h==null?void 0:h.map((d,c)=>e.jsx(G.Item,{onClick:()=>{T(""),q(""),T(""),r(!1),k([]),g(void 0),le(d)},children:e.jsx("span",{className:`${x===d?"text-primary-700 ":" "}`,children:d})},c))})]})]}),e.jsxs("div",{className:"items-start flex w-full flex-col max-md:mt-0 mt-3.5 self-start",children:[e.jsx("div",{className:"text-gray-900 text-sm leading-5 block",children:e.jsx($,{value:"Keyword Information",className:"font-medium"})}),e.jsx("div",{className:"items-center flex w-full flex-col mt-1.5",children:e.jsx(he,{value:i,icon:fe,placeholder:"Enter a search keyword",className:"w-full",type:"text",style:{border:"none",height:"42px"},onChange:ie})}),D&&e.jsx($,{value:D,className:"font-medium text-xs text-red-500 mt-1"})]}),e.jsx("div",{className:"text-gray-500 text-xs leading-4 mt-3.5",children:"Please select and enter for check the crime using specific information such as mobile number, email, bank account etc."}),e.jsx(F,{type:"submit",disabled:!!D||!i,className:"justify-center items-center bg-blue-700 flex w-full max-w-full grow flex-col mt-3.5 px-5 py-2 rounded-lg self-start",style:{height:"38px"},children:e.jsx("div",{className:"text-white text-xs font-medium leading-5 self-center whitespace-nowrap",children:e.jsx("div",{children:"Search"})})}),f&&e.jsxs(e.Fragment,{children:[!y&&e.jsxs("div",{className:"items-start self-stretch bg-green-50 flex flex-col px-4 rounded-md mt-3.5",children:[e.jsxs("div",{className:"items-start flex w-full flex-col mt-4 self-start",children:[e.jsxs("div",{className:"items-start self-stretch flex gap-2",children:[e.jsx("span",{className:"flex items-center self-stretch",children:e.jsx(ge,{className:"text-green-500"})}),e.jsx("div",{className:"text-green-500 max-sm:text-sm text-base font-semibold flex items-center uppercase self-stretch",children:"Report not found"})]}),e.jsxs("div",{className:"text-gary-700 max-sm:text-xs text-sm mt-1.5",children:["This"," ",e.jsxs("b",{className:"text-green-500",children:['"',p,'"']})," ",x!=="Wallet Address"?"has never been reported. You can try to search with a different method, or you can create a new report by clicking button below.":"are no community reports against this wallet."]})]}),e.jsx("div",{className:"items-start flex flex-wrap md:flex-unset mt-3.5 gap-3 mb-4 self-start max-sm:w-full",children:e.jsx(F,{onClick:t,className:"justify-center items-center bg-green-700 hover:bg-green-800 self-start max-sm:w-full",children:e.jsx("div",{className:"text-white max-sm:text-xs text-sm font-medium leading-5 self-center whitespace-nowrap",children:"Report a Crime"})})})]}),y&&e.jsxs("div",{className:"items-start self-stretch bg-red-50 flex flex-col px-4 rounded-md mt-3.5",children:[e.jsxs("div",{className:"items-start flex w-full flex-col mt-4 self-start",children:[e.jsxs("div",{className:"items-start self-stretch flex gap-2",children:[e.jsx("span",{className:"flex items-center self-stretch",children:e.jsx(ue,{className:"text-red-700"})}),e.jsx("div",{className:"text-red-700 text-base font-semibold flex items-center uppercase self-stretch",children:"SCAM ALERT"})]}),e.jsxs("div",{className:"text-red-700 text-sm leading-5 mt-1.5",children:[e.jsx("b",{children:p})," has been reported by the community ",W," times."]})]}),e.jsx(F,{onClick:t,className:"justify-center items-center bg-red-700 hover:bg-red-800 mt-3.5 mb-4 max-sm:w-full",children:e.jsx("div",{className:"text-white max-sm:text-xs text-sm font-medium leading-5 self-center whitespace-nowrap",children:"Report a Crime"})})]})]})]})})}),e.jsx("div",{className:"flex flex-col items-stretch w-4/12 max-lg:w-full max-lg:hidden",children:e.jsx("div",{className:"justify-center items-center self-stretch flex w-full grow flex-col mx-auto px-5 py-24 rounded-none sm:rounded-xl",style:{background:"linear-gradient(273deg, #001333 0%, #003DA7 69.41%, #1467C3 100.86%)"},children:e.jsxs("div",{className:"items-start self-center flex w-full flex-col",children:[e.jsx("div",{className:"text-white text-center text-2xl md:text-3xl font-family-sub self-center",children:"Check scammers before transferring money"}),e.jsx("div",{className:"text-white text-xs leading-5 mt-3 self-center text-center",children:"Find and investigate fraudsters from everywhere"})]})})})]})}),f&&e.jsx(e.Fragment,{children:(x==="Wallet Address"||x==="Website"||x==="IP Address"?!0:y)&&e.jsxs("div",{className:" flex flex-col max-sm:gap-y-0 gap-y-[1rem]",children:[(x==="Wallet Address"||x==="Website"||x==="IP Address"?!0:n&&n.length>=1)&&e.jsx(Q,{type:x,accordionTopic:"Scam alert",accordionDescription:"This is the list of report.",searchKeyword:p,topicList:N,resultCrimeReports:n,totalPosts:ae}),b.length>=1&&e.jsxs("div",{children:[e.jsx(Q,{type:x,accordionTopic:"Post",accordionDescription:"This is the list of post.",searchKeyword:p,topicList:a,resultPosts:b,totalPosts:te}),R>1&&e.jsx("div",{className:"w-full flex mt-[2rem] justify-center sm:justify-end",children:e.jsx(pe,{layout:"pagination",currentPage:O,totalPages:R,onPageChange:oe,previousLabel:" ",nextLabel:" ",showIcons:!0,className:"pagination-custom"})})]})]})}),e.jsx("div",{className:"flex flex-col items-stretch w-full lg:hidden mt-5",children:e.jsx("div",{className:"justify-center items-center self-stretch flex w-full grow flex-col mx-auto px-5 py-24 rounded-none sm:rounded-xl",style:{background:"linear-gradient(273deg, #001333 0%, #003DA7 69.41%, #1467C3 100.86%)"},children:e.jsxs("div",{className:"items-start self-center flex w-full flex-col",children:[e.jsx("div",{className:"text-white text-center text-2xl md:text-3xl font-family-sub self-center",children:"Check scammers before transferring money"}),e.jsx("div",{className:"text-white text-xs leading-5 mt-3 self-center text-center",children:"Find and investigate fraudsters from everywhere"})]})})}),M&&e.jsx(we,{})]})}export{Ee as default};