1import{bK as w,bL as N,bM as b,t as o,aI as I,bN as E,aj as j,bO as T}from"./index-BDz9Ot1x.js";import{r as h,j as e}from"./vendor-react-q2zF07hT.js";import{I as S,b as A,X as R}from"./vendor-icons-1fnEs_cQ.js";async function B(t){const{data:i,storagePath:r,contentType:n,attempts:s=3,onProgress:a,waitForPropagation:l=!0,watch:u}=t;try{await w(r,i,{contentType:n,attempts:s,onProgress:a,watch:u})}catch(c){return{ok:!1,path:r,error:c,abandoned:c instanceof N}}return l&&(await b(r,{intervalMs:2e3,timeoutMs:9e4})||console.warn("[evidence] storage propagation timed out for",r)),{ok:!0,path:r}}async function G(t,i){const r=[];for(let n=0;n<t.length;n++){const s=t[n],a=await B({data:s.data,storagePath:s.storagePath,contentType:s.contentType,waitForPropagation:!1,onProgress:l=>i==null?void 0:i((n+l)/t.length,n,t.length)});if(!a.ok)return{ok:!1,paths:r,error:a.error};r.push(a.path)}return r.length>0&&await b(r[r.length-1],{intervalMs:2e3,timeoutMs:9e4}),{ok:!0,paths:r}}const L=()=>[o("evidence.thinking.reviewingReason"),o("evidence.thinking.comparingInstructions"),o("evidence.thinking.lookingUpHistory"),o("evidence.thinking.weighingVerdict"),o("evidence.thinking.almostDone")],K=()=>[o("evidence.thinking.submittingAppeal"),o("evidence.thinking.sendingToTeam"),o("evidence.thinking.gettingInFront"),o("evidence.thinking.almostThere")],V=2e3,_=12;function U({phase:t,approved:i,explanation:r,onDone:n,onHumanReview:s,approvedHeading:a,deniedHeading:l,neutral:u=!1,badgeIcon:c,badgeTint:f,thinkingMessages:d,holdOnLastThinkingMessage:x=!1,humanReview:p=!1,subCopy:m,summaryRows:v}){const g=h.useMemo(()=>d!=null&&d.length?d:L(),[d]);return t==="thinking"?e.jsx(C,{messages:g,holdOnLast:x,humanReview:p,subCopy:m}):e.jsx(O,{approved:i,explanation:r,onDone:n,onHumanReview:s,approvedHeading:a,deniedHeading:l,neutral:u,badgeIcon:c,badgeTint:f,summaryRows:v})}function C({messages:t,holdOnLast:i,humanReview:r,subCopy:n}){const[s,a]=h.useState(0);h.useEffect(()=>{a(0);const u=setInterval(()=>{a(c=>i&&c>=t.length-1?c:(c+1)%t.length)},V);return()=>clearInterval(u)},[t,i]);const l=r?"var(--system-blue)":"var(--overlord-fg)";return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-8 text-center",children:[e.jsxs("svg",{width:"46",height:"46",viewBox:"0 0 24 24",className:"animate-spin",role:"progressbar","aria-label":t[s],children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"var(--overlord-fg)",strokeOpacity:"0.12",strokeWidth:"3",fill:"none"}),e.jsx("path",{d:"M22 12a10 10 0 0 0-10-10",stroke:l,strokeWidth:"3",strokeLinecap:"round",fill:"none"})]}),e.jsx("p",{className:"mt-[26px] font-figtree-semibold text-[17px]",style:{color:"var(--overlord-fg)",letterSpacing:-.2},children:t[s]}),e.jsx("p",{className:"mt-2.5 max-w-[260px] font-figtree text-[14px] leading-[1.4]",style:{color:"var(--overlord-muted)"},children:n??o("evidence.resultView.subCopy")})]})}function F(t){const[i,r]=h.useState(""),n=h.useRef(null);return h.useEffect(()=>{const s=Array.from(t);r("");let a=0;return n.current=setInterval(()=>{a+=1,r(s.slice(0,a).join("")),a>=s.length&&n.current&&(clearInterval(n.current),n.current=null)},_),()=>{n.current&&clearInterval(n.current)}},[t]),i}function O({approved:t,explanation:i,onDone:r,onHumanReview:n,approvedHeading:s,deniedHeading:a,neutral:l,badgeIcon:u,badgeTint:c,summaryRows:f}){const[d,x]=h.useState(!1),p=F(i),v=T(c??(l?"amber":t?"green":"red")),g=u??(l?e.jsx(S,{size:32}):t?e.jsx(A,{size:32}):e.jsx(R,{size:32})),y=t?s??o("evidence.resultView.approved"):a??o("evidence.resultView.denied"),k=async()=>{if(!(d||!n)){x(!0);try{await n()}finally{x(!1)}}};return e.jsx("div",{className:"flex h-full flex-col",children:e.jsxs(I,{scrollClassName:"px-5 pt-10",barClassName:"px-5",bar:e.jsxs(e.Fragment,{children:[n&&!t&&!l&&e.jsx("div",{className:"mb-2.5",children:e.jsx(j,{label:o("evidence.resultView.submitToHumanReview"),variant:"ghost",borderRadius:27,isLoading:d,onClick:()=>void k()})}),e.jsx(j,{label:o("common.done"),borderRadius:27,onClick:r})]}),children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("span",{className:"flex items-center justify-center rounded-full",style:{width:64,height:64,background:`color-mix(in srgb, ${v} 12%, transparent)`,color:v},children:g})}),e.jsx("h1",{className:"mt-5 text-center font-figtree-bold text-[24px]",style:{color:"var(--overlord-fg)",letterSpacing:-.4},children:y}),e.jsx("p",{className:"mt-3.5 text-center font-figtree text-[15px] leading-[1.45]",style:{color:"var(--overlord-muted)"},children:p}),f&&f.length>0&&e.jsx("div",{className:"mt-7",children:e.jsx(E,{rows:f})}),e.jsx("div",{style:{height:24}})]})})}function z({onBack:t,hidden:i}){return e.jsx("div",{className:"pt-safe shrink-0",children:e.jsx("div",{className:"flex items-center",style:{height:56},children:!i&&e.jsx(H,{onBack:t})})})}function H({onBack:t}){return e.jsx("div",{style:{margin:6},children:e.jsx("button",{type:"button","aria-label":o("common.back"),onClick:t,className:"glass flex items-center justify-center rounded-full transition-transform active:scale-95",style:{width:44,height:44},children:e.jsx("svg",{width:"19",height:"19",viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M15 6l-6 6 6 6",stroke:"var(--overlord-fg)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})})}export{z as A,K as H,U as O,B as a,G as u};
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.