PageSourceSearch

https://daply.ai/assets/AgentProgressModal-DCEKBGrd.js

js daply.ai collected 2026-10-05 14:58:15 UTC 18,259 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-components-CrH3hhmI.js";import{r as o}from"./react-core-Df-1f7lZ.js";import{bs as F,L as $,bI as w,X as E,bJ as O,bK as L,bL as _,bM as R,f as p,bN as I,j as A,ab as U,Z as B,J as V,a3 as G}from"./index-baCrhAE7.js";import{D as K}from"./dollar-sign-J8bSMMfI.js";import"./utils-BZSOOpUI.js";import"./editor-wwdhYSyT.js";import"./charts-DACaTPEh.js";const Y=s=>s&&s.replace(/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu,"").trim(),T=o.memo(({analysis:s,isDarkMode:t,isReconnecting:h,onClose:r,onViewReport:b,onExpandFull:a,hasSubscription:c,onShowCheckout:i,skipWaitCtaLabel:j,priceLine:u})=>{const{domain:z,status:x,progress:v,message:y}=s,d=x==="completed",N=x==="failed"||x==="error",g=v||0;return e.jsxs("div",{className:`rounded-2xl overflow-hidden border ${t?"bg-zinc-900 border-zinc-800":"bg-white border-gray-200"}`,children:[e.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${t?"border-zinc-800":"border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx(F,{className:"w-5 h-5 text-green-500 animate-in fade-in duration-300"}):e.jsx($,{className:`w-5 h-5 animate-spin ${t?"text-zinc-400":"text-zinc-600"}`}),e.jsxs("div",{children:[e.jsx("h2",{className:`text-sm font-semibold ${t?"text-white":"text-gray-900"}`,children:d?"Complete":w.headline}),e.jsx("p",{className:`text-xs ${t?"text-zinc-500":"text-gray-500"}`,children:z})]})]}),e.jsx("button",{onClick:r,className:`p-2 rounded-lg transition-colors ${t?"hover:bg-zinc-800":"hover:bg-gray-100"}`,children:e.jsx(E,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[!d&&!N&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`text-xs ${t?"text-zinc-400":"text-gray-600"}`,children:w.bodyTemplate(z)}),e.jsx("div",{className:"space-y-2",children:O.map(n=>{const f=g>=n.doneAt;return e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f?e.jsx(F,{className:"w-4 h-4 text-green-500 shrink-0"}):e.jsx($,{className:`w-4 h-4 animate-spin shrink-0 ${t?"text-zinc-500":"text-gray-400"}`}),e.jsx("span",{className:f?t?"text-zinc-300":"text-gray-700":t?"text-zinc-500":"text-gray-500",children:n.label})]},n.id)})}),e.jsx("p",{className:`text-[10px] ${t?"text-zinc-500":"text-gray-500"}`,children:L}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1.5",children:[e.jsx("span",{className:t?"text-zinc-400":"text-gray-600",children:y||_.statusLine}),e.jsxs("span",{className:`font-semibold tabular-nums ${t?"text-zinc-300":"text-gray-700"}`,children:[g,"%"]})]}),e.jsx("div",{className:`h-1.5 rounded-full overflow-hidden ${t?"bg-zinc-800":"bg-gray-200"}`,children:e.jsx("div",{className:"h-full transition-all duration-500 ease-out bg-gradient-to-r from-zinc-500 to-zinc-400",style:{width:`${g}%`}})})]}),g<50&&e.jsx("p",{className:`text-[10px] ${t?"text-zinc-500":"text-gray-500"}`,children:_.trustCopy}),!c&&i&&e.jsxs("div",{className:"space-y-2 pt-2 border-t border-zinc-700",children:[e.jsx("p",{className:`text-xs font-semibold ${t?"text-zinc-300":"text-gray-800"}`,children:R.headline}),e.jsx("p",{className:`text-[10px] ${t?"text-zinc-500":"text-gray-500"}`,children:R.bodyTemplate(z)}),e.jsx(p,{onClick:i,className:"w-full h-10 font-semibold bg-zinc-700 hover:bg-zinc-600 text-white",children:j||I}),e.jsx("p",{className:`text-[10px] text-center ${t?"text-zinc-500":"text-gray-500"}`,children:u||w.priceLine}),e.jsx("p",{className:`text-[10px] text-center ${t?"text-zinc-600":"text-gray-400"}`,children:_.reassurance})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{className:t?"text-zinc-400":"text-gray-600",children:"Reconnecting..."})]})]}),d&&s.results&&e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:`grid grid-cols-2 gap-2 ${c?"":"blur-sm pointer-events-none"}`,children:[s.results.visibility?.overall_score!==void 0&&e.jsxs("div",{className:`p-3 rounded-lg border ${t?"bg-zinc-800/50 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsx("div",{className:`text-[10px] font-semibold uppercase tracking-wider ${t?"text-zinc-500":"text-gray-500"}`,children:"Visibility"}),e.jsxs("div",{className:`text-xl font-bold ${t?"text-white":"text-gray-900"}`,children:[s.results.visibility.overall_score.toFixed(0),"/100"]})]}),s.results.google_ads?.total_volume&&e.jsxs("div",{className:`p-3 rounded-lg border ${t?"bg-zinc-800/50 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsx("div",{className:`text-[10px] font-semibold uppercase tracking-wider ${t?"text-zinc-500":"text-gray-500"}`,children:"Volume"}),e.jsxs("div",{className:`text-xl font-bold ${t?"text-white":"text-gray-900"}`,children:[(s.results.google_ads.total_volume/1e3).toFixed(0),"K"]})]})]}),!c&&i&&e.jsxs("div",{onClick:i,className:`absolute inset-0 flex flex-col items-center justify-center rounded-lg cursor-pointer z-10 ${t?"bg-zinc-900/80":"bg-white/80"}`,children:[e.jsx(A,{className:`w-8 h-8 mb-2 ${t?"text-zinc-400":"text-gray-500"}`}),e.jsx("p",{className:`text-xs font-semibold mb-1 ${t?"text-white":"text-gray-900"}`,children:"Results locked"}),e.jsx("p",{className:`text-[10px] mb-2 ${t?"text-zinc-400":"text-gray-600"}`,children:"Subscribe to unlock"}),e.jsx(p,{onClick:n=>{n.stopPropagation(),i()},size:"sm",className:"h-8 text-xs font-semibold bg-blue-600 hover:bg-blue-700 text-white",children:"Unlock 
1with subscription"})]})]}),N&&e.jsx("p",{className:`text-sm ${t?"text-zinc-400":"text-gray-600"}`,children:y||"Analysis failed."}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[b&&s?.run_id&&d&&e.jsx(p,{onClick:()=>{!c&&i?(i(),r()):(b(s.run_id,s.domain),r())},className:"flex-1 h-10 text-sm font-semibold bg-zinc-700 hover:bg-zinc-600 text-white",children:c?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-4 h-4 mr-1.5"})," View Report"]}):e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"w-4 h-4 mr-1.5"})," Unlock full report"]})}),a&&!d&&e.jsx(p,{onClick:a,variant:"ghost",className:"h-10 text-xs font-medium shrink-0",children:"View details"}),e.jsx(p,{onClick:r,variant:"outline",className:"flex-1 h-10 text-sm font-semibold",children:"Close"})]})]})]})});T.displayName="MinimalView";const H=o.memo(({analysis:s,isDarkMode:t,isReconnecting:h,onClose:r,onViewReport:b,hasSubscription:a,onShowCheckout:c,skipWaitCtaLabel:i,priceLine:j})=>{const[u,z]=o.useState([]),x=o.useRef(null),v=o.useRef(!1),{domain:y,status:d,progress:N,message:g,results:n}=s,f=d==="completed",P=d==="failed"||d==="error";return o.useEffect(()=>{if(s?.status==="completed"&&!v.current){v.current=!0;const l=new(window.AudioContext||window.webkitAudioContext),m=l.createOscillator(),C=l.createGain();m.connect(C),C.connect(l.destination),m.frequency.value=800,C.gain.value=.1,m.start(l.currentTime),m.frequency.exponentialRampToValueAtTime(1200,l.currentTime+.1),C.gain.exponentialRampToValueAtTime(.01,l.currentTime+.5),m.stop(l.currentTime+.5)}else s?.status==="processing"&&(v.current=!1)},[s?.status]),o.useEffect(()=>{s?.message&&s.status==="processing"&&z(l=>{const m=Y(s.message);return[...l,{text:m,progress:s.progress,timestamp:Date.now()}].slice(-10)})},[s?.message,s?.status,s?.progress]),o.useEffect(()=>{x.current&&u.length>0&&x.current.scrollTo({top:x.current.scrollHeight,behavior:"smooth"})},[u]),e.jsxs("div",{className:`relative w-full max-w-6xl max-h-[90vh] overflow-hidden rounded-2xl ${t?"bg-zinc-900 border border-zinc-800":"bg-white border border-gray-200"}`,children:[e.jsxs("div",{className:`flex items-center justify-between p-5 border-b ${t?"border-zinc-800":"border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[f?e.jsx(F,{className:"w-6 h-6 text-green-500 animate-in fade-in duration-300"}):e.jsx(B,{className:`w-6 h-6 ${t?"text-zinc-400":"text-zinc-600"}`}),e.jsxs("div",{children:[e.jsx("h2",{className:`text-lg font-bold ${t?"text-white":"text-gray-900"}`,children:f?"Analysis Complete":"AI Agents Working"}),e.jsx("p",{className:`text-sm ${t?"text-zinc-500":"text-gray-500"}`,children:y})]})]}),e.jsx("button",{onClick:r,className:`p-2 rounded-lg transition-colors ${t?"hover:bg-zinc-800":"hover:bg-gray-100"}`,children:e.jsx(E,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-0 max-h-[calc(90vh-80px)] overflow-hidden",children:[e.jsxs("div",{className:`p-5 overflow-y-auto ${t?"bg-zinc-900":"bg-white"}`,children:[!f&&!P&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:`text-sm font-semibold mb-1 ${t?"text-white":"text-gray-900"}`,children:w.headline}),e.jsx("p",{className:`text-xs mb-4 ${t?"text-zinc-400":"text-gray-600"}`,children:w.bodyTemplate(y)})]}),e.jsx("div",{className:"space-y-2",children:O.map(l=>{const m=(N||0)>=l.doneAt;return e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[m?e.jsx(F,{className:"w-4 h-4 text-green-500 shrink-0"}):e.jsx($,{className:`w-4 h-4 animate-spin shrink-0 ${t?"text-zinc-500":"text-gray-400"}`}),e.jsx("span",{className:m?t?"text-zinc-300":"text-gray-700":t?"text-zinc-500":"text-gray-500",children:l.label})]},l.id)})}),e.jsx("p",{className:`text-[10px] ${t?"text-zinc-500":"text-gray-500"}`,children:L}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-2",children:[e.jsxs("span",{className:`text-lg font-bold ${t?"text-white":"text-gray-900"}`,children:[N||0,"%"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:`w-4 h-4 animate-spin ${t?"text-zinc-400":"text-zinc-600"}`}),e.jsx("span",{className:`text-xs font-medium ${t?"text-zinc-500":"text-gray-500"}`,children:_.statusLine})]})]}),e.jsx("div",{className:`h-2 rounded-full overflow-hidden ${t?"bg-zinc-800":"bg-gray-200"}`,children:e.jsx("div",{className:"h-full transition-all duration-500 ease-out bg-gradient-to-r from-zinc-500 to-zinc-400",style:{width:`${N||0}%`}})})]}),(N||0)<50&&e.jsx("p",{className:`text-[10px] ${t?"text-zinc-500":"text-gray-500"}`,children:_.trustCopy}),g&&e.jsxs("div",{className:`p-4 rounded-xl border ${t?"border-zinc-700 bg-zinc-800/50":"border-gray-200 bg-gray-50"}`,children:[e.jsx("div",{className:`text-[10px] font-semibold uppercase tracking-wider mb-1 ${t?"text-zinc-500":"text-gray-500"}`,children:"Current Task"}),e.jsx("p",{className:`text-sm ${t?"text-zinc-200":"text-gray-800"}`,children:g})]}),!a&&c&&e.jsxs("div",{className:"space-y-2 pt-4 border-t border-zinc-700",children:[e.jsx("p",{className:`text-xs font-semibold ${t?"text-zinc-300":"text-gray-800"}`,children:R.headline}),e.jsx("p",{className:`text-[10px] ${t?"text-zinc-500":"text-gray-500"}`,children:R.bodyTemplate(y)}),e.jsx(p,{onClick:c,className:"w-full h-11 font-semibold bg-zinc-700 hover:bg-zinc-600 text-white",children:i||I}),e.jsx("p",{className:`text-[10px] text-center ${t?"text-zinc-500":"text-gray-500"}`,children:j||w.priceLine}),e.jsx("p",{className:`text-[10px] text-center ${t?"text-zinc-600":"text-gray-400"}`,children:_.reassurance})]})]}),f&&n&&e.jsxs("div",{className:"space-y-4 relative",children:[e.jsxs("div",{className:`grid grid-cols-2 gap-3 ${a?"":"blur-sm pointer-events-none"}`,children:[n.visibility?.overall_score!==void 0&&e.jsxs("div",{className:`p-4 rounded-xl border ${t?"bg-zinc-800 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(V,{className:`w-4 h-4 ${t?"text-zinc-400":"text-gray-600"}`}),e.jsx("span",{className:`text-xs font-semibold uppercase ${t?"text-zinc-400":"text-gray-600"}`,children:"AI Visibility"})]}),e.jsxs("div",{className:`text-2xl font-bold ${t?"text-white":"text-gray-900"}`,children:[n.visibility.overall_score.toFixed(0),e.jsx("span",{className:"text-sm opacity-70",children:"/100"})]})]}),n.google_ads?.total_volume&&e.jsxs("div",{className:`p-4 rounded-xl border ${t?"bg-zinc-800 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(V,{className:`w-4 h-4 ${t?"text-zinc-400":"text-gray-600"}`}),e.jsx("span",{className:`text-xs font-semibold uppercase ${t?"text-zinc-400":"text-gray-600"}`,children:"Volume"})]}),e.jsxs("div",{className:`text-2xl font-bold ${t?"text-white":"text-gray-900"}`,children:[(n.google_ads.total_volume/1e3).toFixed(0),"K"]})]}),n.google_ads?.avg_cpc&&e.jsxs("div",{className:`p-4 rounded-xl border ${t?"bg-zinc-800 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(K,{className:`w-4 h-4 ${t?"text-zinc-400":"text-gray-600"}`}),e.jsx("span",{className:`text-xs font-semibold uppercase ${t?"text-zinc-400":"text-gray-600"}`,children:"Avg CPC"})]}),e.jsxs("div",{className:`text-2xl font-bold ${t?"text-white":"text-gray-900"}`,children:["$",n.google_ads.avg_cpc.toFixed(2)]})]}),n.reddit?.total_opportunities&&e.jsxs("div",{className:`p-4 rounded-xl border col-span-2 ${t?"bg-zinc-800 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(G,{className:`w-4 h-4 ${t?"text-zinc-400":"text-gray-600"}`}),e.jsx("span",{className:`text-xs font-semibold uppercase ${t?"text-zinc-400":"text-gray-600"}`,children:"Reddit"})]}),e.jsxs("div",{className:`text-xl font-bold ${t?"text-white":"text-gray-900"}`,children:[n.reddit.total_opportunities," opportunities"]})]})]}),!a&&c&&e.jsxs("div",{onClick:c,className:`absolute inset-0 flex flex-col items-center justify-center rounded-xl cursor-pointer z-10 ${t?"bg-zinc-900/85":"bg-white/85"}`,children:[e.jsx(A,{className:`w-12 h-12 mb-3 ${t?"text-zinc-400":"text-gray-500"}`}),e.jsx("p",{className:`text-sm font-semibold mb-1 ${t?"text-white":"text-gray-900"}`,children:"Results locked"}),e.jsx("p",{className:`text-xs mb-3 ${t?"text-zinc-400":"text-gray-600"}`,children:"Subscribe to unlock full results"}),e.jsx(p,{onClick:l=>{l.stopPropagation(),c()},className:"h-10 font-semibold bg-blue-600 hover:bg-blue-700 text-white",children:"Unlock 
1with subscription"})]}),e.jsxs("div",{className:"flex gap-3",children:[b&&s?.run_id&&e.jsx(p,{onClick:()=>{!a&&c?(c(),r()):(b(s.run_id,s.domain),r())},className:"flex-1 h-11 font-semibold bg-zinc-700 hover:bg-zinc-600 text-white",children:a?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-4 h-4 mr-2"})," View Report"]}):e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"w-4 h-4 mr-2"})," Unlock full report"]})}),e.jsx(p,{onClick:r,variant:"outline",className:"flex-1 h-11 font-semibold",children:"Close"})]})]}),P&&e.jsxs("div",{className:`p-4 rounded-xl border ${t?"bg-zinc-800 border-zinc-700":"bg-gray-50 border-gray-200"}`,children:[e.jsx("p",{className:`text-sm ${t?"text-zinc-400":"text-gray-600"}`,children:g||"Analysis failed."}),e.jsx(p,{onClick:r,className:"mt-3 w-full",children:"Close"})]})]}),e.jsxs("div",{className:`border-l overflow-hidden ${t?"bg-zinc-950 border-zinc-800":"bg-gray-50 border-gray-200"}`,children:[e.jsx("div",{className:`sticky top-0 z-10 p-3 border-b ${t?"bg-zinc-950/95 border-zinc-800":"bg-gray-50/95 border-gray-200"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider ${t?"text-zinc-500":"text-gray-500"}`,children:"Agent Activity"}),h?e.jsxs("span",{className:`flex items-center gap-1.5 text-xs ${t?"text-zinc-400":"text-gray-600"}`,children:[e.jsx($,{className:"w-3 h-3 animate-spin"})," Reconnecting"]}):e.jsxs("span",{className:`flex items-center gap-1.5 text-xs ${t?"text-zinc-400":"text-gray-600"}`,children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"})," Live"]})]})}),e.jsxs("div",{ref:x,className:"p-4 space-y-2 overflow-y-auto h-[calc(100%-44px)]",children:[u.length===0&&!f&&e.jsxs("div",{className:`p-6 rounded-lg text-center ${t?"bg-zinc-900/50":"bg-white/50"}`,children:[e.jsx($,{className:`w-6 h-6 animate-spin mx-auto mb-2 ${t?"text-zinc-400":"text-zinc-600"}`}),e.jsx("p",{className:`text-xs ${t?"text-zinc-500":"text-gray-500"}`,children:"Connecting..."})]}),u.map((l,m)=>e.jsx("div",{className:`p-3 rounded-lg border animate-in fade-in duration-300 ${t?"border-zinc-800 bg-zinc-900/80":"border-gray-200 bg-white"}`,children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:`text-[10px] font-bold tabular-nums shrink-0 ${t?"text-zinc-500":"text-gray-500"}`,children:[l.progress,"%"]}),e.jsx("p",{className:`text-xs leading-relaxed ${t?"text-zinc-200":"text-gray-800"}`,children:l.text})]})},`${l.timestamp}-${m}`)),f&&u.length>0&&e.jsxs("div",{className:`p-3 rounded-lg border flex items-center gap-2 ${t?"bg-zinc-800 border-zinc-700":"bg-gray-100 border-gray-200"}`,children:[e.jsx(F,{className:`w-4 h-4 ${t?"text-zinc-400":"text-gray-600"}`}),e.jsx("span",{className:`text-xs font-semibold ${t?"text-zinc-300":"text-gray-700"}`,children:"Complete"})]})]})]})]})]})});H.displayName="FullView";const q=o.memo(({analysis:s,isDarkMode:t,isReconnecting:h,onClose:r,onViewReport:b,onShowCheckout:a,hasSubscription:c,skipWaitCtaLabel:i,priceLine:j})=>s?e.jsx(T,{analysis:s,isDarkMode:t,isReconnecting:h,onClose:r,onViewReport:b,onExpandFull:void 0,hasSubscription:c,onShowCheckout:a,skipWaitCtaLabel:i,priceLine:j}):null);q.displayName="AgentProgressPanel";const J=o.memo(({isOpen:s,onClose:t,analysis:h,isDarkMode:r,isReconnecting:b,onViewReport:a,onShowCheckout:c,hasSubscription:i,variant:j="full",skipWaitCtaLabel:u,priceLine:z})=>{const[x,v]=o.useState(j);if(o.useEffect(()=>{v(j)},[j]),!s||!h)return null;const y=()=>{h?.status,t()},d=x==="full"?H:T,N=x==="full"?"w-full max-w-6xl":"w-full max-w-md";return e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm cursor-pointer",onClick:y}),e.jsx("div",{className:`relative ${N}`,onClick:g=>g.stopPropagation(),children:e.jsx(d,{analysis:h,isDarkMode:r,isReconnecting:b,onClose:t,onViewReport:a,onExpandFull:x==="minimal"?()=>v("full"):void 0,hasSubscription:i,onShowCheckout:c,skipWaitCtaLabel:u,priceLine:z})})]})});J.displayName="AgentProgressModal";export{J as AgentProgressModal,q as AgentProgressPanel};

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.