1import{r as n,D as j,o as f,j as e,g as i,M as b,G as N,L as o,C as r,t as k}from"./index-Coid6E-g.js";import{F as v}from"./PlusCircleIcon-BzW7PsDY.js";import{F as w}from"./ArrowsRightLeftIcon-DTiwLetW.js";function C({title:s,titleId:l,...c},x){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:x,"aria-labelledby":l},c),s?n.createElement("title",{id:l},s):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const _=n.forwardRef(C),S={necessary:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200",functional:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-200",analytics:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200",advertising:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-200",marketing:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-200",unclassified:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-200",unknown:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-200"},m=s=>S[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-200",$=()=>{const{domainId:s}=j(),[l]=f(),c=l.get("a")||"",x=l.get("b")||"",[a,p]=n.useState(null),[u,g]=n.useState(!0),[y,h]=n.useState(null);return n.useEffect(()=>{if(!s||!c||!x)return;(async()=>{g(!0),h(null);try{const d=await k.compareScans(s,c,x);p(d)}catch{h("Failed to load scan comparison")}finally{g(!1)}})()},[s,c,x]),u?e.jsx(i,{children:e.jsx(b,{})}):y||!a?e.jsx(i,{children:e.jsx(N,{message:y||"Missing scan IDs"})}):e.jsxs(i,{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("nav",{className:"flex mb-4","aria-label":"Breadcrumb",children:e.jsxs("ol",{className:"flex items-center space-x-2",children:[e.jsx("li",{children:e.jsx(o,{to:"/domains",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Domains"})}),e.jsx("li",{children:e.jsx("span",{className:"text-gray-400 mx-2",children:"/"})}),e.jsx("li",{children:e.jsx(o,{to:`/domains/${s}`,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Domain"})}),e.jsx("li",{children:e.jsx("span",{className:"text-gray-400 mx-2",children:"/"})}),e.jsx("li",{children:e.jsx(o,{to:`/domains/${s}/scans`,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Scans"})}),e.jsx("li",{children:e.jsx("span",{className:"text-gray-400 mx-2",children:"/"})}),e.jsx("li",{className:"text-gray-900 dark:text-gray-100 font-medium",children:"Compare"})]})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-gray-100",children:"Scan Comparison"}),e.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:"Differences between two scans"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[e.jsxs(r,{className:"!p-4 text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-600",children:a.summary.added_count}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Added"})]}),e.jsxs(r,{className:"!p-4 text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-red-600",children:a.summary.removed_count}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Removed"})]}),e.jsxs(r,{className:"!p-4 text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-amber-600",children:a.summary.recategorized_count}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Recategorized"})]}),e.jsxs(r,{className:"!p-4 text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-gray-600 dark:text-gray-300",children:a.summary.unchanged_count}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Unchanged"})]})]}),a.added.length>0&&e.jsxs(r,{className:"mb-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center",children:[e.jsx(v,{className:"w-5 h-5 text-green-500 mr-2"}),"New Cookies (",a.added.length,")"]}),e.jsx("div",{className:"space-y-2",children:a.added.map((t,d)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/10 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:t.name}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 ml-2",children:t.domain})]}),e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${m(t.category)}`,children:t.category})]},d))})]}),a.removed.length>0&&e.jsxs(r,{className:"mb-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center",children:[e.jsx(_,{className:"w-5 h-5 text-red-500 mr-2"}),"Removed Cookies (",a.removed.length,")"]}),e.jsx("div",{className:"space-y-2",children:a.removed.map((t,d)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-red-50 dark:bg-red-900/10 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:t.name}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 ml-2",children:t.domain})]}),e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${m(t.category)}`,children:t.category})]},d))})]}),a.recategorized.length>0&&e.jsxs(r,{className:"mb-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center",children:[e.jsx(w,{className:"w-5 h-5 text-amber-500 mr-2"}),"Recategorized Cookies (",a.recategorized.length,")"]}),e.jsx("div",{className:"space-y-2",children:a.recategorized.map((t,d)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-amber-50 dark:bg-amber-900/10 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:t.name}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 ml-2",children:t.domain})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${m(t.old_category)}`,children:t.old_category}),e.jsx("span",{className:"text-gray-400",children:"â"}),e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${m(t.new_category)}`,children:t.new_category})]})]},d))})]}),a.summary.added_count===0&&a.summary.removed_count===0&&a.summary.recategorized_count===0&&e.jsxs(r,{className:"text-center py-8",children:[e.jsx("p",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:"No differences found"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"Both scans detected the same cookies with the same categories."})]})]})};export{$ 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.