1import{d as _,e as o,a as t,F as g,r as x,t as d,n as $,o as a,q as B,h,c as W,w as V,b as f,u as F,i as A,P as E,f as m,g as v,k as w,V as M,v as T,l as L,N as U}from"./wct-app-zVoOyqoJ.js";import{F as D}from"./FullLayout-BBdw16bv.js";import"./auth.store-DGjXzvfG.js";import"./common.store-CaiisVSK.js";import"./auth.service-DT1Z-eBl.js";import"./Header-CVlVgCk3.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DynamicHeroIcon-RtlqcllT.js";import"./ShieldCheckIcon-DX5I4eE8.js";import"./ExclamationCircleIcon-D3seTqzk.js";import"./FunnelIcon-NuGtbFHR.js";import"./CheckCircleIcon-tJp7k4qQ.js";import"./ChevronDownIcon-CZfG2Avm.js";import"./ChevronRightIcon-i1AkBnM5.js";import"./LinkIcon-D5VYdLA3.js";import"./CogIcon-BkQy7RXp.js";import"./DocumentTextIcon-CINr7rjU.js";import"./ExclamationTriangleIcon-fzphjkuy.js";import"./InformationCircleIcon-DEU9wywc.js";import"./MagnifyingGlassIcon-CX-_6uQF.js";import"./PlusIcon-C88m3W7y.js";import"./WrenchScrewdriverIcon-DFrP9z1h.js";import"./TableCellsIcon-DAD8p38B.js";import"./UserGroupIcon-B-pr3QHb.js";import"./XMarkIcon-CGg_meYD.js";import"./format-Grfp2_uY.js";import"./Loading-B8sjktwd.js";import"./ModalBlank-AAGEETCW.js";const j={class:"overflow-x-auto"},K={class:"min-w-full text-sm"},q={class:"text-left text-xs uppercase tracking-wide text-gray-400 dark:text-gray-500 border-b border-gray-200 dark:border-gray-700"},O={class:"py-2 pr-4 font-mono text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap"},z={class:"py-2 text-right tabular-nums text-gray-700 dark:text-gray-300"},N=_({__name:"StatusMatrix",props:{statuses:{},rows:{}},setup(s){function y(p){switch(p){case"valid":return"text-green-600 dark:text-green-400 font-medium";case"missing":case"invalid":return"text-red-600 dark:text-red-400";case"no_proof":case"proof_mismatch":case"expired":return"text-yellow-600 dark:text-yellow-500";default:return"text-gray-600 dark:text-gray-400"}}function i(p){const l=Object.values(p.counts).reduce((n,c)=>n+c,0);return l===0?"â":`${(100*(p.counts.valid??0)/l).toFixed(1)}%`}return(p,l)=>(a(),o("div",j,[t("table",K,[t("thead",null,[t("tr",q,[l[0]||(l[0]=t("th",{class:"py-2 pr-4 font-medium"},"Date",-1)),(a(!0),o(g,null,x(s.statuses,n=>(a(),o("th",{key:n,class:"py-2 pr-4 font-medium text-right"},d(n),1))),128)),l[1]||(l[1]=t("th",{class:"py-2 font-medium text-right"},"valid %",-1))])]),t("tbody",null,[(a(!0),o(g,null,x(s.rows,n=>(a(),o("tr",{key:n.date,class:"border-b border-gray-100 dark:border-gray-700/60"},[t("td",O,d(n.date),1),(a(!0),o(g,null,x(s.statuses,c=>(a(),o("td",{key:c,class:$(["py-2 pr-4 text-right tabular-nums",n.counts[c]>0?y(c):"text-gray-300 dark:text-gray-600"])},d(n.counts[c]>0?n.counts[c].toLocaleString():"·"),3))),128)),t("td",z,d(i(n)),1)]))),128))])])]))}}),G=_({__name:"StatusBadge",props:{status:{}},setup(s){const y=s,i=B(()=>{switch(y.status){case"valid":return"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300";case"missing":case"invalid":return"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300";case"no_proof":case"proof_mismatch":case"expired":return"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-300";default:return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}});return(p,l)=>(a(),o("span",{class:$(["inline-block rounded-full px-2.5 py-0.5 text-xs font-mono",i.value])},d(s.status),3))}}),H={class:"min-h-screen bg-gray-50 dark:bg-gray-900"},J={class:"bg-white dark:bg-gray-800 shadow-sm"},X={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6"},Q={class:"flex items-center gap-3"},R={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6"},Y={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 p-6"},Z={key:0,class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 p-6"},tt={class:"overflow-x-auto"},et={class:"min-w-full text-sm"},rt={class:"py-2 pr-6 font-mono text-xs"},st=["onClick"],at={class:"py-2 pr-6"},ot={class:"py-2 pr-6"},dt={class:"py-2 whitespace-nowrap"},nt={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 p-6"},lt={class:"flex flex-wrap items-center gap-3 mb-4"},it=["disabled"],pt={key:0},ut={class:"text-sm text-gray-500 dark:text-gray-400 mb-3"},ct={class:"font-mono text-xs"},yt={key:1,class:"text-sm text-gray-400 dark:text-gray-500"},gt={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 p-6"},xt={class:"flex flex-wrap items-baseline justify-between gap-2 mb-1"},mt={class:"text-sm text-gray-500 dark:text-gray-400"},bt={key:0,class:"rounded-lg border border-yellow-200 dark:border-yellow-800 bg-yellow-50 dark:bg-yellow-900/20 px-4 py-3 text-sm text-yellow-800 dark:text-yellow-300 mb-4"},kt={class:"flex flex-wrap items-center gap-3 mb-4"},ht=["value"],ft=["disabled"],vt={class:"overflow-x-auto"},wt={class:"min-w-full text-sm"},_t={class:"py-2 pr-4 whitespace-nowrap font-mono text-xs text-gray-500 dark:text-gray-400"},St={class:"py-2 pr-4"},Ct={class:"py-2 pr-4 font-mono text-xs text-gray-700 dark:text-gray-300"},Pt={class:"py-2 pr-4 font-mono text-xs text-gray-700 dark:text-gray-300"},Vt={class:"py-2 pr-4 font-mono text-xs text-gray-700 dark:text-gray-300"},Ft={class:"py-2 pr-4 font-mono text-xs whitespace-nowrap text-gray-700 dark:text-gray-300"},Et=["title"],Mt={key:0},oe=_({__name:"ScriptTokenStatus",props:{statuses:{},globalMatrix:{},propertyId:{},propertyMatrix:{},evidence:{},evidenceEnabled:{type:Boolean},cacheFlaggedWebsites:{}},setup(s){const y=s,i=h(y.propertyId??""),p=h(""),l=h(""),n=h(!1),c=B(()=>y.statuses.filter(u=>u!=="valid"&&u!=="unconfigured"));function b(u){n.value=!0,U.get(E("admin-user.script_token_status.index"),u,{preserveScroll:!0,onFinish:()=>{n.value=!1}})}function k(){const u={};return i.value&&(u.property_id=i.value.trim()),p.value&&(u.evidence_status=p.value),l.value&&(u.evidence_property=l.value.trim()),u}function S(){b(k())}function I(){i.value="",b(k())}function C(){b(k())}return(u,e)=>(a(),W(D,{title:"Admin ⺠Script Token Status"},{default:V(()=>[t("div",H,[t("div",J,[t("div",X,[t("div",Q,[f(F(A),{href:F(E)("admin-user.dashboard"),
1class:"p-2 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Back to Admin"},{default:V(()=>[...e[3]||(e[3]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1},8,["href"]),e[4]||(e[4]=t("div",null,[t("h1",{class:"text-2xl font-semibold text-gray-900 dark:text-white"},"Script Token Status"),t("p",{class:"mt-1 text-sm text-gray-600 dark:text-gray-400"}," Proof-of-JS-execution token classification on tracking requests. Observation only â nothing is blocked. ")],-1))])])]),t("div",R,[t("div",Y,[e[5]||(e[5]=t("h3",{class:"text-lg font-semibold text-gray-900 dark:text-white mb-1"},"All traffic, last 14 days",-1)),e[6]||(e[6]=t("p",{class:"text-sm text-gray-600 dark:text-gray-400 mb-4"},[m(" Counts start when the middleware is deployed. Until scripts are regenerated, expect almost everything under "),t("span",{class:"font-mono text-xs"},"missing"),m(". ")],-1)),f(N,{statuses:s.statuses,rows:s.globalMatrix},null,8,["statuses","rows"])]),s.cacheFlaggedWebsites.length>0?(a(),o("div",Z,[e[8]||(e[8]=t("h3",{class:"text-lg font-semibold text-gray-900 dark:text-white mb-1"},"Cached-copy flags",-1)),e[9]||(e[9]=t("p",{class:"text-sm text-gray-600 dark:text-gray-400 mb-4"},[m(" Websites currently serving a frozen cached copy of wct.js (expired-dominated token stats, stamped nightly by "),t("span",{class:"font-mono text-xs"},"wct-script:detect-cached"),m("). Candidates for a proactive support nudge. ")],-1)),t("div",tt,[t("table",et,[e[7]||(e[7]=t("thead",null,[t("tr",{class:"text-left text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700"},[t("th",{class:"py-2 pr-6"},"Property"),t("th",{class:"py-2 pr-6"},"Website"),t("th",{class:"py-2 pr-6"},"User"),t("th",{class:"py-2"},"Flagged at")])],-1)),t("tbody",null,[(a(!0),o(g,null,x(s.cacheFlaggedWebsites,r=>(a(),o("tr",{key:r.property_id,class:"border-b border-gray-100 dark:border-gray-700/50 text-gray-700 dark:text-gray-300"},[t("td",rt,[t("button",{type:"button",class:"hover:underline",onClick:P=>{i.value=r.property_id,b(k())}},d(r.property_id),9,st)]),t("td",at,d(r.url),1),t("td",ot,"#"+d(r.user_id),1),t("td",dt,d(r.detected_at),1)]))),128))])])])])):v("",!0),t("div",nt,[e[11]||(e[11]=t("h3",{class:"text-lg font-semibold text-gray-900 dark:text-white mb-1"},"Per-property lookup",-1)),e[12]||(e[12]=t("p",{class:"text-sm text-gray-600 dark:text-gray-400 mb-4"}," Same matrix scoped to one website. Valid/no_proof/proof_mismatch/expired attribute from the signed token; missing/invalid from client-supplied ids â cross-check surprising properties before acting. ",-1)),t("div",lt,[w(t("input",{id:"property_id","onUpdate:modelValue":e[0]||(e[0]=r=>i.value=r),type:"text",class:"form-input w-56 rounded-lg border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white focus:border-yellow-400 focus:ring-yellow-400 font-mono text-sm",placeholder:"e.g. W-CD8PGVTW",onKeyup:M(S,["enter"])},null,544),[[T,i.value]]),t("button",{type:"button",class:"btn bg-slate-900 hover:bg-slate-800 text-white dark:bg-white dark:text-slate-900 dark:hover:bg-slate-100",disabled:!i.value||n.value,onClick:S}," Look up ",8,it),s.propertyId?(a(),o("button",{key:0,type:"button",class:"text-sm text-gray-500 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",onClick:I}," Clear ")):v("",!0)]),s.propertyMatrix?(a(),o("div",pt,[t("p",ut,[e[10]||(e[10]=m(" Showing ",-1)),t("span",ct,d(s.propertyId),1)]),f(N,{statuses:s.statuses,rows:s.propertyMatrix},null,8,["statuses","rows"])])):(a(),o("p",yt,"Enter a property id to see its daily breakdown."))]),t("div",gt,[t("div",xt,[e[13]||(e[13]=t("h3",{class:"text-lg font-semibold text-gray-900 dark:text-white"},"Token evidence",-1)),t("span",mt,d(s.evidence.total.toLocaleString())+" records buffered · newest "+d(s.evidence.scanned.toLocaleString())+" searchable here ",1)]),e[17]||(e[17]=t("p",{class:"text-sm text-gray-600 dark:text-gray-400 mb-4"}," Per-request detail for every non-valid classification â the false-positive audit trail. A cluster of real browser user agents usually means a
1snippet problem; curl/python from datacenter IPs means bots. ",-1)),s.evidenceEnabled?v("",!0):(a(),o("div",bt," Evidence recording is disabled (WCT_TOKEN_EVIDENCE_MAX=0). ")),t("div",kt,[w(t("select",{"onUpdate:modelValue":e[1]||(e[1]=r=>p.value=r),class:"form-select rounded-lg border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white focus:border-yellow-400 focus:ring-yellow-400 text-sm"},[e[14]||(e[14]=t("option",{value:""},"All statuses",-1)),(a(!0),o(g,null,x(c.value,r=>(a(),o("option",{key:r,value:r},d(r),9,ht))),128))],512),[[L,p.value]]),w(t("input",{"onUpdate:modelValue":e[2]||(e[2]=r=>l.value=r),type:"text",class:"form-input w-56 rounded-lg border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white focus:border-yellow-400 focus:ring-yellow-400 font-mono text-sm",placeholder:"Property id (optional)",onKeyup:M(C,["enter"])},null,544),[[T,l.value]]),t("button",{type:"button",class:"btn bg-slate-900 hover:bg-slate-800 text-white dark:bg-white dark:text-slate-900 dark:hover:bg-slate-100",disabled:n.value,onClick:C}," Filter ",8,ft)]),t("div",vt,[t("table",wt,[e[16]||(e[16]=t("thead",null,[t("tr",{class:"text-left text-xs uppercase tracking-wide text-gray-400 dark:text-gray-500 border-b border-gray-200 dark:border-gray-700"},[t("th",{class:"py-2 pr-4 font-medium"},"Time"),t("th",{class:"py-2 pr-4 font-medium"},"Status"),t("th",{class:"py-2 pr-4 font-medium"},"Host"),t("th",{class:"py-2 pr-4 font-medium"},"Path"),t("th",{class:"py-2 pr-4 font-medium"},"Property"),t("th",{class:"py-2 pr-4 font-medium"},"IP"),t("th",{class:"py-2 font-medium"},"User agent")])],-1)),t("tbody",null,[(a(!0),o(g,null,x(s.evidence.records,(r,P)=>(a(),o("tr",{key:P,class:"border-b border-gray-100 dark:border-gray-700/60 align-top"},[t("td",_t,d(r.t),1),t("td",St,[f(G,{status:r.s},null,8,["status"])]),t("td",Ct,d(r.host),1),t("td",Pt,d(r.path),1),t("td",Vt,d(r.pid??"â"),1),t("td",Ft,d(r.ip),1),t("td",{class:"py-2 text-xs text-gray-500 dark:text-gray-400 max-w-md truncate",title:r.ua},d(r.ua),9,Et)]))),128)),s.evidence.records.length===0?(a(),o("tr",Mt,[...e[15]||(e[15]=[t("td",{colspan:"7",class:"py-6 text-center text-sm text-gray-400 dark:text-gray-500"}," No evidence records match. ",-1)])])):v("",!0)])])])])])])]),_:1}))}});export{oe 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.