1import{d as U,u as G,r as u,e as a,b as r,k as S,l as j,m as O,p as Q,g as e,c as D,f as n,v as X,L as Y,x as B,h as i,t as l,F as g,y as k,z as $,T as z,E as F,B as J,s as L}from"./app-D0fs7bu7.js";import{_ as W}from"./AppLayout.vue_vue_type_script_setup_true_lang-CLnk0tKS.js";/* empty css */import"./Primitive-B-7kMMzx.js";import"./VisuallyHidden-OUinVFht.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./createLucideIcon-CAMkqPlT.js";const Z={class:"mx-auto w-full max-w-3xl px-4 sm:px-6 py-8 space-y-6"},ee={class:"relative"},te={class:"flex items-center bg-[var(--card)] rounded-2xl shadow-lg ring-1 ring-black/5 dark:ring-white/8 focus-within:ring-2 focus-within:ring-[var(--primary)]/40 transition-all duration-200 overflow-hidden"},se=["disabled"],re={key:0,class:"fa-solid fa-circle-notch fa-spin text-xs"},ae={key:1,class:"fa-solid fa-magnifying-glass text-xs"},oe={key:0,class:"mt-2 text-xs text-red-500 font-medium flex items-center gap-1.5 px-1"},le={key:0},ne={key:0,class:"text-center py-16"},ie={key:1,class:"space-y-4"},de={class:"flex items-center gap-2"},ue={class:"inline-flex items-center gap-2 px-3 py-1.5 rounded-xl bg-red-500/10 text-red-500 text-xs font-bold"},ce={class:"p-5"},fe={class:"flex items-start justify-between gap-3 mb-3"},xe={class:"flex items-center gap-3"},pe={class:"flex items-center gap-2 flex-wrap"},me={class:"font-bold text-[var(--foreground)] text-base leading-none"},ve={class:"flex items-center gap-2 mt-1"},ge={class:"text-xs text-[var(--muted-foreground)] font-mono"},be={class:"text-[11px] text-[var(--muted-foreground)]"},he={class:"inline-flex items-center gap-1 text-[11px] text-[var(--muted-foreground)] font-medium shrink-0 mt-1"},ye={class:"text-sm text-[var(--foreground)]/80 leading-relaxed mb-3"},ke={key:0,class:"flex flex-wrap gap-1.5 mb-3"},_e={key:1,class:"flex gap-2 overflow-x-auto pb-1 mb-3"},we=["onClick"],Ce=["src"],Se={key:2,class:"flex flex-wrap items-center gap-2"},je={key:1,class:"px-2.5 py-1 bg-[var(--surface-2)] text-[var(--muted-foreground)] rounded-lg text-[11px] font-mono"},De={class:"px-5 py-3 flex items-center gap-2"},Xe=["onClick"],Be={key:0,class:"ml-0.5 opacity-70"},$e=["onClick"],ze={key:0,class:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-bold bg-blue-500/10 text-blue-500"},Fe={key:1,class:"text-center py-12"},Le={class:"bg-[var(--card)] w-full max-w-md rounded-3xl shadow-2xl overflow-hidden"},Re={class:"p-6"},Ie={class:"flex items-center justify-between mb-5"},Te={class:"space-y-4"},Pe={class:"flex gap-2.5"},Ve={class:"relative bg-[var(--card)] rounded-2xl shadow-2xl overflow-hidden max-w-lg w-full"},Ee={key:0,class:"absolute top-3 left-3 px-2.5 py-1 rounded-lg bg-black/40 text-white text-[11px] font-bold z-10"},Me=["src"],Ne={key:1,class:"flex items-center justify-center gap-3 p-3"},Ae=["disabled"],qe=["disabled"],et=U({__name:"Search",setup(He){const R=G().props.auth?.business?.id,b=u(""),f=u(null),x=u(!1),h=u(""),I={Pathao:"bg-orange-500/10 text-orange-500",RedX:"bg-red-500/10 text-red-500",Steadfast:"bg-blue-500/10 text-blue-500",eCourier:"bg-sky-500/10 text-sky-500",Paperfly:"bg-yellow-500/10 text-yellow-600","Delivery Tiger":"bg-amber-500/10 text-amber-500",Bahok:"bg-violet-500/10 text-violet-500",Parceldex:"bg-pink-500/10 text-pink-500",Others:"bg-gray-500/10 text-gray-500"},_=async()=>{if(!b.value||b.value.length<3){h.value="At least 3 characters required.";return}h.value="",x.value=!0,f.value=null;try{const o=await J.get("/api/fraud-reports/search",{params:{query:b.value}});f.value=o.data}catch(o){h.value=o?.response?.data?.message||"Search failed. Please try again."}finally{x.value=!1}},T=o=>{window.confirm("Are you sure you had a similar experience and want to confirm this fraud report?")&&L.post(`/fraud-reports/${o}/confirm`,{},{preserveScroll:!0})},p=u(!1),y=u({report_id:0,reason:""}),P=o=>{y.value={report_id:o,reason:""},p.value=!0},V=()=>{L.post(`/fraud-reports/${y.value.report_id}/dispute`,{reason:y.value.reason},{preserveScroll:!0,onSuccess:()=>{p.value=!1}})},E=[{id:"product_not_returned",label:"পণà§à¦¯ ফà§à¦°à¦¤ দà§à¦¯à¦¼à¦¨à¦¿"},{id:"fake_address",label:"à¦à§à¦¯à¦¼à¦¾ ঠিà¦à¦¾à¦¨à¦¾"},{id:"cash_on_delivery_fraud",label:"পণà§à¦¯ নিয়ৠপালিয়à§à¦à§"},{id:"return_damaged_product",label:"নষà§à¦ à¦à¦¿à¦¨à¦¿à¦¸ রিà¦à¦¾à¦°à§à¦¨"},{id:"refused_delivery",label:"ডà§à¦²à¦¿à¦à¦¾à¦°à¦¿ নিতৠà¦
সà§à¦¬à§à¦à¦¾à¦°"},{id:"abusive_behavior",label:"à¦à¦¾à¦°à¦¾à¦ª à¦à¦à¦°à¦£"}],M=o=>E.find(t=>
1t.id===o)?.label||o,N={Low:"bg-emerald-500/10 text-emerald-500",Medium:"bg-amber-500/10 text-amber-500",High:"bg-rose-500/10 text-rose-500",Blacklisted:"bg-red-600 text-white"},A=o=>o?new Intl.DateTimeFormat("en-GB",{day:"2-digit",month:"short",year:"numeric"}).format(new Date(o)):"",m=u(null),c=u([]),d=u(0),q=(o,t)=>{c.value=o,d.value=t,m.value=o[t]},w=()=>{m.value=null},H=()=>{d.value>0&&(d.value--,m.value=c.value[d.value])},K=()=>{d.value<c.value.length-1&&(d.value++,m.value=c.value[d.value])};return(o,t)=>(r(),a(g,null,[S(j(O),{title:"Search Fraud Reports"}),S(W,{breadcrumbs:[{title:"Fraud Reports",href:"/fraud-reports/browse"},{title:"Search",href:"/fraud-reports/search"}]},{default:Q(()=>[e("div",Z,[t[19]||(t[19]=e("div",{class:"text-center mb-2"},[e("h1",{class:"text-2xl font-bold text-[var(--foreground)] mb-1"},"Search Fraud Database"),e("p",{class:"text-sm text-[var(--muted-foreground)]"},"Search by phone, customer name, or complaint details")],-1)),e("div",ee,[e("div",te,[t[5]||(t[5]=e("div",{class:"pl-5 text-[var(--muted-foreground)]"},[e("i",{class:"fa-solid fa-magnifying-glass"})],-1)),X(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>b.value=s),onKeydown:Y(_,["enter"]),type:"text",class:"flex-1 bg-transparent border-none py-4 px-4 text-base font-semibold text-[var(--foreground)] focus:ring-0 placeholder:font-normal placeholder:text-[var(--muted-foreground)]/50 outline-none",placeholder:"01XXXXXXXXX or customer name..."},null,544),[[B,b.value]]),e("button",{onClick:_,disabled:x.value,class:"m-1.5 px-6 py-2.5 rounded-xl font-bold text-sm text-white bg-[var(--primary)] hover:opacity-90 transition-all disabled:opacity-60 flex items-center gap-2 shrink-0"},[x.value?(r(),a("i",re)):(r(),a("i",ae)),i(" "+l(x.value?"Searchingâ¦":"Search"),1)],8,se)]),h.value?(r(),a("p",oe,[t[6]||(t[6]=e("i",{class:"fa-solid fa-triangle-exclamation"},null,-1)),i(" "+l(h.value),1)])):n("",!0)]),f.value?(r(),a("div",le,[f.value.count===0?(r(),a("div",ne,[...t[7]||(t[7]=[e("div",{class:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-emerald-500/10 mb-4"},[e("i",{class:"fa-solid fa-shield-check text-2xl text-emerald-500"})],-1),e("h3",{class:"text-lg font-bold text-[var(--foreground)] mb-1"},"No Matches Found",-1),e("p",{class:"text-sm text-[var(--muted-foreground)]"},"This customer has no fraud reports on record.",-1)])])):(r(),a("div",ie,[e("div",de,[e("span",ue,[t[8]||(t[8]=e("i",{class:"fa-solid fa-circle-exclamation"},null,-1)),i(" "+l(f.value.count)+" fraud report"+l(f.value.count>1?"s":"")+" found ",1)])]),(r(!0),a(g,null,k(f.value.reports,s=>(r(),a("div",{key:s.id,class:"bg-[var(--card)] rounded-2xl overflow-hidden transition-all duration-200 border-l-4 border-red-500/70 shadow-sm hover:shadow-md"},[e("div",ce,[e("div",fe,[e("div",xe,[t[10]||(t[10]=e("div",{class:"w-11 h-11 rounded-2xl bg-gradient-to-br from-red-500/20 to-red-500/5 flex items-center justify-center shrink-0"},[e("i",{class:"fa-solid fa-user-slash text-red-500 text-sm"})],-1)),e("div",null,[e("div",pe,[e("h4",me,l(s.contact_name),1),s.risk_profile?(r(),a("span",{key:0,class:$(["px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wide",N[s.risk_profile.level]||"bg-gray-100 text-gray-500"])},l(s.risk_profile.level),3)):n("",!0)]),e("div",ve,[e("p",ge,l(s.contact_number),1),t[9]||(t[9]=e("span",{class:"text-[var(--muted-foreground)] opacity-30"},"·",-1)),e("span",be,l(A(s.created_at)),1)])])]),e("span",he,[t[11]||(t[11]=e("i",{class:"fa-solid fa-building text-[9px] opacity-50"},null,-1)),i(" "+l(s.business?.name||"Anonymous"),1)])]),e("p",ye,l(s.complain_details),1),s.categories&&s.categories.length?(r(),a("div",ke,[(r(!0),a(g,null,k(s.categories,v=>(r(),a("span",{key:v,class:"px-2.5 py-1 rounded-full text-[11px] font-semibold bg-[var(--surface-2)] text-[var(--muted-foreground)]"},l(M(v)),1))),128))])):n("",!0),s.evidences&&s.evidences.length?(r(),a("div",_e,[(r(!0),a(g,null,k(s.evidences,(v,C)=>(r(),a("button",{key:C,onClick:Ue=>q(s.evidences,C),class:"shrink-0 w-20 h-20 rounded-xl overflow-hidden bg-[var(--surface-2)] block hover:ring-2 hover:ring-[var(--primary)]/40 transition-all cursor-pointer group"},[e("img",{src:v,class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"},null,8,Ce)],8,we))),128))])):n("",!0),s.courier_name||s.parcel_id?(r(),a("div",Se,[s.courier_name?(r(),a("span",{key:0,class:$(["px-2.5 py-1 rounded-lg text-[11px] font-bold uppercase tracking-wide",I[s.courier_name]||"bg-gray-500/10 text-gray-500"])},[t[12]||(t[12]=e("i",{class:"fa-solid fa-truck-fast mr-1 text-[9px]"},null,-1)),i(l(s.courier_name),1)],2)):n("",!0),s.parcel_id?(r(),a("span",je,"#"+l(s.parcel_id),1)):n("",!0)])):n("",!0)]),e("div",De,[s.business_id!==j(R)?(r(),a(g,{key:0},[e("button",{onClick:v=>T(s.id),class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold bg-[var(--primary)]/10 text-[var(--primary)] hover:bg-[var(--primary)]/20 transition-colors"},[t[13]||(t[13]=e("i",{class:"fa-solid fa-hand text-[10px]"},null,-1)),t[14]||(t[14]=i(" I Had Same Experience ",-1)),s.confirmations_count>0?(r(),a("span",Be,"("+l(s.confirmations_count)+")",1)):n("",!0)],8,Xe),e("button",{onClick:v=>P(s.id),class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold text-[var(--muted-foreground)] hover:text-amber-500 hover:bg-amber-500/10 transition-colors"},[...t[15]||(t[15]=[e("i",{class:"fa-solid fa-flag text-[10px]"},null,-1),i(" Dispute ",-1)])],8,$e)],64)):(r(),a(g,{key:1},[t[17]||(t[17]=e("span",{class:"inline-flex items-center gap-1.5 text-xs text-[var(--muted-foreground)] font-medium"},[e("i",{class:"fa-solid fa-shield-halved text-[10px] text-[var(--primary)]"}),i(" You reported this ")],-1)),s.confirmations_count>0?(r(),a("span",ze,[t[16]||(t[16]=e("i",{class:"fa-solid fa-users text-[10px]"},null,-1)),i(" "+l(s.confirmations_count)+" others experienced this ",1)])):n("",!0)],64))])]))),128))]))])):x.value?n("",!0):(r(),a("div",Fe,[...t[18]||(t[18]=[e("div",{class:"inline-flex items-center justify-center w-14 h-14 roun
1ded-2xl bg-[var(--surface-2)] mb-3"},[e("i",{class:"fa-solid fa-shield-halved text-xl text-[var(--muted-foreground)] opacity-40"})],-1),e("p",{class:"text-sm text-[var(--muted-foreground)]"},"Search to check if a customer has been reported",-1)])]))]),(r(),D(z,{to:"body"},[p.value?(r(),a("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-md",onClick:t[4]||(t[4]=F(s=>p.value=!1,["self"]))},[e("div",Le,[e("div",Re,[e("div",Ie,[t[21]||(t[21]=e("div",{class:"flex items-center gap-3"},[e("div",{class:"w-9 h-9 rounded-2xl bg-amber-500/10 flex items-center justify-center"},[e("i",{class:"fa-solid fa-flag text-amber-500 text-sm"})]),e("div",null,[e("h3",{class:"text-base font-bold text-[var(--foreground)]"},"Dispute Report"),e("p",{class:"text-[10px] text-[var(--muted-foreground)]"},"Report incorrect information to admins")])],-1)),e("button",{onClick:t[1]||(t[1]=s=>p.value=!1),class:"w-7 h-7 flex items-center justify-center rounded-xl text-[var(--muted-foreground)] hover:bg-[var(--surface-2)] transition-colors"},[...t[20]||(t[20]=[e("i",{class:"fa-solid fa-xmark text-sm"},null,-1)])])]),e("div",Te,[t[24]||(t[24]=e("div",{class:"p-3 bg-amber-500/8 border border-amber-500/20 rounded-xl text-amber-600 dark:text-amber-400 text-xs leading-relaxed"},[e("i",{class:"fa-solid fa-circle-info mr-1"}),i(" Please provide clear evidence why this report is incorrect. Admins will review your dispute. ")],-1)),e("div",null,[t[22]||(t[22]=e("label",{class:"block text-[9px] font-black text-[var(--muted-foreground)] uppercase tracking-widest mb-1.5"},"Reason *",-1)),X(e("textarea",{"onUpdate:modelValue":t[2]||(t[2]=s=>y.value.reason=s),class:"w-full bg-[var(--surface-2)] border-none rounded-xl p-3 text-sm focus:ring-2 focus:ring-amber-500/30 min-h-[100px] resize-none placeholder:text-[var(--muted-foreground)]/40 outline-none transition-all",placeholder:"Explain why this report is false or invalid..."},null,512),[[B,y.value.reason]])]),e("div",Pe,[e("button",{onClick:t[3]||(t[3]=s=>p.value=!1),class:"flex-1 py-2.5 rounded-2xl font-bold text-sm text-[var(--muted-foreground)] bg-[var(--surface-2)] hover:opacity-80 transition-all"}," Cancel "),e("button",{onClick:V,class:"flex-[2] py-2.5 bg-amber-500 hover:bg-amber-600 text-white rounded-2xl font-bold text-sm shadow-md shadow-amber-500/20 transition-all flex items-center justify-center gap-2"},[...t[23]||(t[23]=[e("i",{class:"fa-solid fa-paper-plane text-xs"},null,-1),i(" Submit Dispute ",-1)])])])])])])])):n("",!0)])),(r(),D(z,{to:"body"},[m.value?(r(),a("div",{key:0,class:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",onClick:F(w,["self"])},[e("div",Ve,[e("button",{onClick:w,class:"absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-xl bg-black/40 text-white hover:bg-black/60 transition-colors z-10"},[...t[25]||(t[25]=[e("i",{class:"fa-solid fa-xmark text-sm"},null,-1)])]),c.value.length>1?(r(),a("div",Ee,l(d.value+1)+" / "+l(c.value.length),1)):n("",!0),e("img",{src:m.value,class:"w-full max-h-[70vh] object-contain bg-black/5"},null,8,Me),c.value.length>1?(r(),a("div",Ne,[e("button",{onClick:H,disabled:d.value===0,class:"w-9 h-9 flex items-center justify-center rounded-xl bg-[var(--surface-2)] text-[var(--foreground)] hover:bg-[var(--primary)]/10 transition-colors disabled:opacity-30"},[...t[26]||(t[26]=[e("i",{class:"fa-solid fa-chevron-left text-sm"},null,-1)])],8,Ae),e("button",{onClick:K,disabled:d.value>=c.value.length-1,class:"w-9 h-9 flex items-center justify-center rounded-xl bg-[var(--surface-2)] text-[var(--foreground)] hover:bg-[var(--primary)]/10 transition-colors disabled:opacity-30"},[...t[27]||(t[27]=[e("i",{class:"fa-solid fa-chevron-right text-sm"},null,-1)])],8,qe)])):n("",!0)])])):n("",!0)]))]),_:1})],64))}});export{et 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.