PageSourceSearch

https://app.anvevoice.app/assets/EmbedImpact-Bw3ElZAX.js

js anvevoice.app collected 2026-10-02 03:39:15 UTC 6,725 bytes, 1 lines download raw bytes

1import{r as c,F as E,C as L,a as S,t as A,j as e,B as u,H as I}from"./index-BKInu8Gb.js";import{D as b}from"./DashboardLayout-BXFPlznX.js";import{a as R}from"./useEmbeds-CpgIiDFX.js";import{A as D}from"./AuroraBackground-BNjCNtFe.js";import{u as T,I as B}from"./useLabImpact-Jouotz67.js";import{L as H}from"./loader-circle-CYXtu1pc.js";import{G as P}from"./globe-DBDfSSAg.js";import{A as j}from"./arrow-left-0nCR_9p3.js";import{S as W}from"./sparkles-Dy67g5WL.js";import"./BrandingContext-BRH9k_I2.js";import"./anvevoice-logo-C8ZQvCP0.js";import"./AnnouncementBanner-DnsBLgq7.js";import"./index-Cuaw5peq.js";import"./menu-d-k1676P.js";import"./layout-dashboard-D9pjzpyJ.js";import"./code-xml-DpgDlPge.js";import"./terminal-0Fn1Zx3D.js";import"./chart-column-CL-MSr0k.js";import"./receipt-m7kBySie.js";import"./settings-B1GBuJyd.js";import"./ticket-s0MeUJXb.js";import"./circle-help-OttUiTMq.js";import"./history-JeYh37Y2.js";import"./external-link-CcuYPQGf.js";import"./link-2-dwew5_57.js";import"./useSubscription-DWrMv6r9.js";import"./useMutation-BRPD8YYR.js";import"./coins-6cb5NLBx.js";import"./ClientLayout-DhuLwAfQ.js";import"./dialog-ENkXqeK3.js";import"./index-Be2tF3Kx.js";import"./index-DyLHZbNU.js";import"./label-Bs-8-fl1.js";import"./radio-group-BtMboj_o.js";import"./index-BuvS6xj3.js";import"./index-BdUYosLC.js";import"./index-90jyQyqH.js";import"./circle-XCExElpo.js";import"./textarea-Gt--OfrP.js";import"./circle-check-Bljibo5l.js";/* empty css                  */import"./costEstimator-nQbWfvy8.js";import"./trending-up-BqvKCaVh.js";import"./zap-Pd2rkksN.js";import"./target-y_Fxu5VP.js";import"./message-circle-kX9zx27V.js";import"./rocket-Bq1EGkIQ.js";const y="anve_impact_brief_v1:",$=30*60*1e3,g=new Map;function z(t){const s=g.get(t);if(s)return s;try{const r=sessionStorage.getItem(y+t);if(!r)return null;const m=JSON.parse(r);return Date.now()-m.at>$?null:(g.set(t,m.value),m.value)}catch{return null}}function F(t,s){g.set(t,s);try{sessionStorage.setItem(y+t,JSON.stringify({at:Date.now(),value:s}))}catch{}}function G(t){const[s,r]=c.useState(null),[m,a]=c.useState(!1),[f,i]=c.useState(null),n=c.useRef(null);return c.useEffect(()=>{if(!t){r(null);return}const x=z(t);if(x){r(x),a(!1),i(null);return}if(n.current===t)return;n.current=t;let l=!1;return a(!0),i(null),(async()=>{try{const{data:o,error:d}=await E.functions.invoke("lab-site-brief",{body:{host:t}});if(l)return;if(d)throw d;if(o&&typeof o=="object"&&o.brief){const p=o;F(t,p),r(p)}else i("invalid_response")}catch(o){l||i(o.message||"failed")}finally{l||a(!1),n.current===t&&(n.current=null)}})(),()=>{l=!0}},[t]),{data:s,loading:m,error:f}}function J(t){if(!t)return"";try{return new URL(/^https?:\/\//i.test(t)?t:`https://${t}`).hostname.replace(/^www\./,"")}catch{return t}}function Pe(){const{id:t}=L(),s=S(),{data:r,isLoading:m}=R(t),a=J(r==null?void 0:r.target_website),f=c.useRef(!1),i=c.useCallback((h,C={})=>{A(h,{...C,embedId:t,host:a})},[t,a]);c.useEffect(()=>{f.current||!r||!a||(f.current=!0,i("impact_page_opened",{}))},[r,a,i]);const{data:n,loading:x,error:l}=G(a||null),o=(n==null?void 0:n.brief)??null,d=c.useRef(!1);c.useEffect(()=>{var h;d.current||(n?(d.current=!0,i("impact_brief_completed",{cached:!1,citations_count:((h=n.citations)==null?void 0:h.length)??0})):l&&(d.current=!0,i("impact_brief_failed",{reason:l})))},[n,l,i]);const{data:p,loading:v,error:w}=T(a,o),N=()=>{i("impact_back_to_install",{}),s(`/embeds/${t}?tab=code`)};if(m||!r)return e.jsx(b,{children:e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(H,{className:"h-6 w-6 animate-spin text-muted-foreground"})})});if(!a)return e.jsx(b,{children:e.jsxs("div",{className:"max-w-2xl mx-auto py-12 px-4 text-center space-y-4",children:[e.jsx("div",{className:"mx-auto h-12 w-12 rounded-full bg-primary/10 border border-primary/30 flex items-center justify-center",children:e.jsx(P,{className:"h-5 w-5 text-primary"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Add your site to see the impact"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We use your website to show what ",r.name," would do for real visitors. Add a target URL on the config tab and come back here."]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[e.jsxs(u,{variant:"outline",onClick:()=>s(`/embeds/${t}?tab=config`),children:[e.jsx(j,{className:"h-4 w-4 mr-1.5"}),"Back to bot"]}),e.jsx(u,{onClick:()=>s(`/embeds/${t}?tab=config`),children:"Add target site"})]})]})});
1const k=x||!!o&&v&&!p,_=l&&!o;return e.jsxs(b,{children:[e.jsxs(I,{children:[e.jsxs("title",{children:["Impact · ",r.name," · AnveVoice"]}),e.jsx("meta",{name:"robots",content:"noindex,nofollow"})]}),e.jsxs("div",{className:"relative min-h-[calc(100vh-4rem)]",children:[e.jsx(D,{}),e.jsxs("div",{className:"relative max-w-6xl mx-auto px-4 sm:px-6 py-6 space-y-6",children:[e.jsx("div",{className:"rounded-2xl border border-primary/30 bg-gradient-to-br from-primary/10 via-primary/5 to-transparent p-4 sm:p-5",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary/15 border border-primary/30 flex items-center justify-center shrink-0",children:e.jsx(W,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm sm:text-base font-semibold text-foreground",children:["See the impact of ",e.jsx("span",{className:"text-primary",children:r.name})," on"," ",e.jsx("span",{className:"font-mono",children:a})]}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-0.5",children:"We look up your site and tell you exactly where a voice agent would move the needle."})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:e.jsxs(u,{variant:"ghost",size:"sm",onClick:N,children:[e.jsx(j,{className:"h-4 w-4 mr-1.5"}),"Install"]})})]})}),_?e.jsxs("div",{className:"rounded-xl border border-destructive/40 bg-destructive/5 p-5 text-center space-y-3",children:[e.jsxs("p",{className:"text-sm text-foreground",children:["We couldn't look up ",a,". Please try again in a moment."]}),e.jsx(u,{variant:"outline",size:"sm",onClick:()=>window.location.reload(),children:"Try again"})]}):w&&!p?e.jsxs("div",{className:"rounded-xl border border-destructive/40 bg-destructive/5 p-5 text-center space-y-3",children:[e.jsxs("p",{className:"text-sm text-foreground",children:["We read about ",a," but couldn't generate the analysis. Please try again."]}),e.jsx(u,{variant:"outline",size:"sm",onClick:()=>window.location.reload(),children:"Try again"})]}):e.jsx(B,{host:a,data:p,loading:k,onTrack:i})]})]})]})}export{Pe 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.