PageSourceSearch

https://story-os.ai/assets/ChannelAuditWizard-X1XhwhkU.js

js story-os.ai collected 2026-10-05 15:11:49 UTC 29,700 bytes, 2 lines download raw bytes

1var pe=Object.defineProperty;var fe=(t,s,r)=>s in t?pe(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;var te=(t,s,r)=>fe(t,typeof s!="symbol"?s+"":s,r);import{j as e}from"./ui-vendor-sd9EibYn.js";import{r as h}from"./react-vendor-CHx29PyI.js";import{B as A}from"./button-7spSmbHJ.js";import{I as se}from"./input-B-bVbcbu.js";import{aN as ge,o as ye,V as be,k as T,d as je,p as Ne,ay as we,a9 as ve,L as B,bn as ke,a5 as Ae,m as L,t as re,aw as Se}from"./index-Dk_EdvrQ.js";import{L as z}from"./label-C4U9wmkh.js";import{A as Ce,a as Te,b as Ue,c as Ee}from"./accordion--3_fzZ5U.js";import{C as ae}from"./circle-check-C52vZh_b.js";import{A as P}from"./arrow-right-Chwlwxx3.js";import{C as Ie}from"./clock-BhbQk23q.js";import{A as ne}from"./arrow-left-r0QswXBT.js";import{S as Fe}from"./shield-check-CTk7ZMyU.js";import{R as _e}from"./rotate-ccw-CNjrRxxs.js";import"./utils-vendor-Cchy62ty.js";import"./supabase-vendor-DQD4jYU5.js";const Me=({value:t})=>{const[s,r]=h.useState(0);h.useEffect(()=>{const y=setTimeout(()=>r(t),100);return()=>clearTimeout(y)},[t]);const a=52,c=2*Math.PI*a,p=c-Math.max(0,Math.min(100,s))/100*c;return e.jsxs("div",{className:"relative h-[140px] w-[140px] shrink-0",role:"img","aria-label":`Channel–Offer Fit Score ${Math.round(t)} out of 100`,children:[e.jsxs("svg",{viewBox:"0 0 120 120",className:"h-full w-full -rotate-90",children:[e.jsx("circle",{cx:"60",cy:"60",r:a,fill:"none",stroke:"var(--muted)",strokeWidth:"9"}),e.jsx("circle",{cx:"60",cy:"60",r:a,fill:"none",stroke:"var(--primary)",strokeWidth:"9",strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:p,className:"transition-all duration-1000 ease-out"})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:"text-4xl font-bold leading-none text-foreground",children:Math.round(s)}),e.jsx("span",{className:"mt-1 text-xs text-foreground/80",children:"/ 100"})]})]})},Le=({index:t,title:s,detail:r})=>{const[a,c]=h.useState(!1),p=!!r,y=e.jsxs("div",{className:"flex w-full items-center gap-5 px-5 py-5 text-left sm:px-6",children:[e.jsx("span",{className:"w-8 shrink-0 text-2xl font-bold text-primary",children:t}),e.jsx("span",{className:"h-10 w-px shrink-0 bg-border","aria-hidden":"true"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-[18px] font-semibold text-foreground",children:s}),!p&&e.jsx("span",{className:"sr-only",children:"No further detail"})]}),p&&e.jsx(be,{className:`h-5 w-5 shrink-0 text-foreground/80 transition-transform ${a?"rotate-90":""}`})]});return e.jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[p?e.jsx("button",{type:"button",onClick:()=>c(b=>!b),"aria-expanded":a,className:"w-full rounded-xl transition-colors hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:y}):y,p&&a&&e.jsx("p",{className:"border-t border-border px-5 pb-5 pt-4 text-[18px] leading-relaxed text-foreground/80 sm:px-6 sm:pl-[4.5rem]",children:r})]})},Re=["See which videos generate leads and sales","Find the calls to action that perform best","Repeat the content proven to grow your business"],Ye=({result:t,classificationLabel:s,diagnosis:r,recommendations:a,ctaHref:c})=>{var b,v,i,S,C,U,E,R;const p=a.slice(0,3),y=a.slice(3);return e.jsxs("div",{className:"space-y-10",children:[e.jsx("section",{className:"rounded-2xl border border-border bg-card p-6 sm:p-8",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 sm:flex-row sm:items-center sm:gap-10",children:[e.jsx(Me,{value:t.cpi??0}),e.jsxs("div",{className:"min-w-0 text-center sm:text-left",children:[e.jsx("h2",{className:"text-2xl font-bold leading-tight text-foreground sm:text-3xl",children:s}),r&&e.jsx("p",{className:"mt-3 max-w-[62ch] text-[18px] leading-relaxed text-foreground/80",children:r})]})]})}),p.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"mb-4 text-xl font-bold text-foreground sm:text-2xl",children:"What you should do next"}),e.jsx("div",{className:"space-y-3",children:p.map((m,g)=>
1e.jsx(Le,{index:g+1,title:m.title,detail:m.detail},`${m.title}-${g}`))})]}),e.jsxs("section",{className:"rounded-2xl border border-primary/60 bg-card p-6 sm:p-8",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:"Your next step"}),e.jsx("h3",{className:"mt-2 text-xl font-bold text-foreground sm:text-2xl",children:"Now discover which videos actually generate buyers"}),e.jsx("p",{className:"mt-2 text-[18px] text-foreground/80",children:"This audit estimates alignment. RevTrack shows you what viewers actually do."}),e.jsxs("div",{className:"mt-6 flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between",children:[e.jsx("ul",{className:"grid gap-3 sm:grid-cols-3 lg:flex-1",children:Re.map(m=>e.jsxs("li",{className:"flex items-start gap-2 text-[18px] leading-snug text-foreground/80",children:[e.jsx(ae,{className:"mt-1 h-4 w-4 shrink-0 text-primary"}),m]},m))}),e.jsx(A,{asChild:!0,size:"lg",className:"group shrink-0 font-semibold",children:e.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:["Track My YouTube Sales With RevTrack",e.jsx(P,{className:"ml-2 h-4 w-4 transition-transform group-hover:translate-x-1"})]})})]})]}),e.jsx(Ce,{type:"single",collapsible:!0,className:"rounded-2xl border border-border bg-card px-5 sm:px-6",children:e.jsxs(Te,{value:"evidence",className:"border-none",children:[e.jsx(Ue,{className:"py-5 hover:no-underline",children:e.jsxs("span",{className:"flex items-center gap-3 text-base font-semibold text-foreground",children:[e.jsx(ge,{className:"h-5 w-5 text-foreground/80"}),"See the evidence behind my score"]})}),e.jsxs(Ee,{className:"space-y-8 pb-8",children:[(t.channelIdentity||t.offerIdentity)&&e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-background/40 px-4 py-3",children:[e.jsx("p",{className:"mb-1 text-xs uppercase tracking-wider text-foreground/80",children:"Channel identity"}),e.jsx("p",{className:"text-[18px] font-medium text-foreground",children:t.channelIdentity||"—"})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-background/40 px-4 py-3",children:[e.jsx("p",{className:"mb-1 text-xs uppercase tracking-wider text-foreground/80",children:"Offer identity"}),e.jsx("p",{className:"text-[18px] font-medium text-foreground",children:t.offerIdentity||"—"})]})]}),t.identityAnalysis&&e.jsxs("div",{className:"rounded-xl border border-border bg-background/40 px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs uppercase tracking-wider text-foreground/80",children:"Alignment strength"}),e.jsxs("ul",{className:"space-y-2",children:[e.jsxs("li",{className:"text-[18px] leading-relaxed text-foreground/80",children:["Your channel attracts"," ",e.jsx("span",{className:"font-medium text-foreground",children:t.identityAnalysis.channelAttracts}),"."]}),e.jsxs("li",{className:"text-[18px] leading-relaxed text-foreground/80",children:["Your offer serves"," ",e.jsx("span",{className:"font-medium text-foreground",children:t.identityAnalysis.offerServes}),"."]}),e.jsxs("li",{className:"text-[18px] leading-relaxed text-foreground/80",children:["Match: ",e.jsx("span",{className:"font-medium text-foreground",children:t.identityAnalysis.match}),t.identityAnalysis.scoreCap?` — ${t.identityAnalysis.scoreCap}`:""]})]})]}),((b=t.matchMap)==null?void 0:b.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"mb-3 font-semibold text-foreground",children:"Channel problems compared with offer promises"}),e.jsx("div",{className:"space-y-3",children:t.matchMap.map((m,g)=>e.jsxs("div",{className:"rounded-xl border border-border bg-background/40 p-4",children:[e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-foreground/80",children:"Viewer problem"}),e.jsx("p",{className:"text-[18px] text-foreground",children:m.audienceProblem})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-foreground/80",children:"Offer promise"}),e.jsx("p",{className:"text-[18px] text-foreground",children:m.offerSolution})]})]}),e.jsxs("p",{className:"mt-3 text-xs font-semibold uppercase tracking-wider text-primary",children:[m.matchScore," match"]})]},g))})]}),((i=(v=t.insights)==null?void 0:v.working)==null?void 0:i.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"mb-3 font-semibold text-foreground",children:"What is working"}),e.jsx("ul",{className:"space-y-2",children:t.insights.working.map((m,g)=>e.jsxs("li",{className:"flex items-start gap-2 text-[18px] leading-relaxed text-foreground
1/80",children:[e.jsx(ae,{className:"mt-1 h-4 w-4 shrink-0 text-primary"}),m]},g))})]}),((C=(S=t.insights)==null?void 0:S.friction)==null?void 0:C.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"mb-3 font-semibold text-foreground",children:"Potential friction"}),e.jsx("ul",{className:"space-y-2",children:t.insights.friction.map((m,g)=>e.jsxs("li",{className:"flex items-start gap-2 text-[18px] leading-relaxed text-foreground/80",children:[e.jsx(ye,{className:"mt-1 h-4 w-4 shrink-0 text-primary"}),m]},g))})]}),(((U=t.scoreExplanation)==null?void 0:U.summary)||((R=(E=t.scoreExplanation)==null?void 0:E.reasons)==null?void 0:R.length)>0)&&e.jsxs("div",{children:[e.jsx("h4",{className:"mb-3 font-semibold text-foreground",children:"Why the score was awarded"}),t.scoreExplanation.summary&&e.jsx("p",{className:"mb-3 text-[18px] leading-relaxed text-foreground/80",children:t.scoreExplanation.summary}),e.jsx("ul",{className:"space-y-2",children:t.scoreExplanation.reasons.map((m,g)=>e.jsxs("li",{className:"text-[18px] leading-relaxed text-foreground/80",children:["• ",m]},g))})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"mb-3 font-semibold text-foreground",children:"Additional recommendations"}),e.jsx("ul",{className:"space-y-2",children:y.map((m,g)=>e.jsxs("li",{className:"text-[18px] leading-relaxed text-foreground/80",children:["• ",m.title,m.detail?` ${m.detail}`:""]},g))})]}),t.globalTransition&&e.jsx("p",{className:"text-[18px] leading-relaxed text-foreground/80",children:t.globalTransition})]})]})})]})};class ie extends Error{constructor(r="You've already run your audit today. Try again tomorrow.",a=null){super(r);te(this,"quota");this.name="DailyLimitError",this.quota=a}}const oe=async(t,s)=>{if(s&&s.context&&typeof s.context.json=="function")try{return await s.context.json()}catch{}return t},$e=async()=>{try{const{data:t,error:s}=await T.functions.invoke("analyze-conversion",{body:{mode:"quota"}}),r=await oe(t,s);return(r==null?void 0:r.quota)??null}catch{return null}},Oe=["reason","text","label","value","description","summary","title","topic","problem","solution","name"],x=t=>{if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(x).filter(Boolean).join(" · ");if(typeof t=="object"){const s=t;for(const a of Oe)if(typeof s[a]=="string"&&s[a])return s[a];return Object.values(s).find(a=>typeof a=="string"&&a)??""}return""},V=t=>(Array.isArray(t)?t:t==null?[]:[t]).map(x).filter(Boolean),G=(t,s=0)=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="object"&&t!==null){const a=t;for(const c of["score","value","cpi","percent"])if(typeof a[c]=="number")return a[c]}const r=parseFloat(String(t??""));return Number.isFinite(r)?r:s},Pe=t=>{const s=typeof t=="object"&&t!==null?t.score??t.matchScore??t:t;if(typeof s=="string"){const a=s.toLowerCase();if(a.includes("strong")||a.includes("high"))return"strong";if(a.includes("partial")||a.includes("medium")||a.includes("moderate"))return"partial";if(a.includes("weak")||a.includes("low")||a.includes("none"))return"weak"}const r=G(s,-1);if(r>=0){const a=r<=1?r*100:r;if(a>=70)return"strong";if(a>=40)return"partial"}return"weak"},J=t=>{var r,a,c,p,y,b,v;const s=t??{};return{...s,cpi:Math.max(0,Math.min(100,Math.round(G(s.cpi,0)))),channelIdentity:x(s.channelIdentity),offerIdentity:x(s.offerIdentity),topicAnalysis:s.topicAnalysis?{channelTopics:(Array.isArray(s.topicAnalysis.channelTopics)?s.topicAnalysis.channelTopics:[]).map(i=>({topic:x((i==null?void 0:i.topic)??i),percentOfContent:G(i==null?void 0:i.percentOfContent,0),topViewedExample:x(i==null?void 0:i.topViewedExample)})),offerTopic:x(s.topicAnalysis.offerTopic),topicOverlap:x(s.topicAnalysis.topicOverlap).toLowerCase(),topicVerdict:x(s.topicAnalysis.topicVerdict)}:void 0,identityAnalysis:s.identityAnalysis?{channelAttracts:x(s.identityAnalysis.channelAttracts),offerServes:x(s.identityAnalysis.offerServes),match:x(s.identityAnalysis.match).toLowerCase(),scoreCap:s.identityAnalysis.scoreCap==null?null:x(s.identityAnalysis.scoreCap)}:void 0,verdict:{aligned:!!((r=s.verdict)!=null&&r.aligned),headline:x((a=s.verdict)==null?void 0:a.headline),subheadline:x((c=s.verdict)==null?void 0:c.subheadline)},scoreExplanation:{summary:x((p=s.scoreExplanation)==null?void 0:p.summary),reasons:V((y=s.scoreExplanation)==null?void 0:y.reasons)},matchMap:(Array.isArray(s.matchMap)?s.matchMap:[]).map(i=>({audienceProblem:x(i==null?void 0:i.audienceProblem),offerSolution:x(i==null?void 0:i.offerSolution),matchScore:Pe(i==null?void 0:i.matchScore)})),insights:{working:V((b=s.insights)==null?void 0:b.working),friction:V((v=s.insights)==null?void 0:v.friction)},contentIdeas:(Array.isArray(s.contentIdeas)?s.contentIdeas:[]).map(i=>({topic:x(i==null?void 0:i.topic),focus:x(i==null?void 0:i.focus),whyItWorks:x(i==null?void 0:i.whyItWorks)})),globalTransition:x(s.globalTransition)}},De=async(t,s)=>{const{data:r,error:a}=await T.functions.invoke("analyze-conversion",{body:{youtubeData:t,salesPageUrl:s}}),c=await oe(r,a);if(c&&c.error==="daily_limit")throw new ie(c.message,{tier:c.tier,limit:c.limit??null,used:c.used,remaining:0,resetAt:c.resetAt??null,canUpgrade:!!c.canUpgrade});if(a)throw a;if(!(r!=null&&r.success))throw new Error((r==null?void 0:r.error)||"Analysis failed");return{result:J(r.result),quota:r.quota??null}},We=t=>t>=80?{label:"Strong fit",meaning:"Your videos are attracting the kind of people your offer is built for. Keep going and deepen the connection."}:t>=60?{label:"Good fit with gaps",meaning:"Most of your content pulls in the right people, but parts of your channel attract viewers your offer does not serve."}:t>=40?{label:"Partial fit",meaning:"Some of your audience could buy, but a lot of your views come from topics your offer does not answer."}:{label:"Weak fit",meaning:"The topics attracting your views and the problem your offer solves are pulling in different people."}
1,nt=({title:t="Channel–Offer Fit Audit",subtitle:s="Discover whether your YouTube content is attracting potential buyers",storageKey:r="storyos_channel_audit_v2",upgradeHref:a="https://story-os.ai/?website=Upgrade%20Via%20Use%20Cap%20"})=>{var Q,X,Z;const{toast:c}=je(),[p,y]=h.useState(0),[b,v]=h.useState(""),[i,S]=h.useState(""),[C,U]=h.useState(""),[E,R]=h.useState(!1),[m,g]=h.useState(!1),[d,Y]=h.useState(null),[j,D]=h.useState(null),[I,F]=h.useState({}),[W,le]=h.useState(null),$=h.useRef(null),H=h.useRef(null),ce=h.useRef(!1),K=h.useCallback(o=>{try{localStorage.setItem(r,JSON.stringify(o))}catch{}},[r]);h.useEffect(()=>{let o=!0;return(async()=>{var w;const{data:n}=await T.auth.getUser(),l=((w=n==null?void 0:n.user)==null?void 0:w.id)??null;if(!o)return;le(l);let u=!1;if(l){const{data:f}=await T.from("channel_audit_sessions").select("id, channel_url, youtube_data, sales_page_url, result").eq("user_id",l).order("updated_at",{ascending:!1}).limit(1).maybeSingle();if(!o)return;f&&($.current=f.id,v(f.channel_url??""),S(f.youtube_data??""),U(f.sales_page_url??""),f.result&&(Y(J(f.result)),y(3)),u=!0)}if(!u)try{const f=localStorage.getItem(r);if(f){const N=JSON.parse(f);v(N.channelUrl??""),S(N.youtubeData??""),U(N.salesPageUrl??""),N.result&&typeof N.result.cpi=="number"&&(Y(N.result?J(N.result):null),y(3))}}catch{}ce.current=!0})(),()=>{o=!1}},[r]),h.useEffect(()=>{let o=!0;return $e().then(n=>o&&D(n)),()=>{o=!1}},[]);const _=h.useCallback(async(o={})=>{const n={channelUrl:b,youtubeData:i,salesPageUrl:C,result:d,...o};if(K(n),!W)return;const l={user_id:W,channel_url:n.channelUrl||null,youtube_data:n.youtubeData||null,sales_page_url:n.salesPageUrl||null,result:n.result?JSON.parse(JSON.stringify(n.result)):null,completed_at:n.result?new Date().toISOString():null};try{if($.current)await T.from("channel_audit_sessions").update(l).eq("id",$.current);else{const{data:u}=await T.from("channel_audit_sessions").insert(l).select("id").maybeSingle();u!=null&&u.id&&($.current=u.id)}}catch{}},[b,i,C,d,W,K]),k=o=>{y(o),requestAnimationFrame(()=>{var n;(n=H.current)==null||n.focus(),window.scrollTo({top:0,behavior:"smooth"})})},de=async()=>{var o;if(!b.trim()){F({channelUrl:"Enter your public YouTube channel URL"});return}F({}),R(!0);try{const{data:n,error:l}=await T.functions.invoke("fetch-youtube-data",{body:{channelUrl:b.trim()}});let u=n;if(l&&((o=l.context)!=null&&o.json))try{u=await l.context.json()}catch{}if((u==null?void 0:u.error)==="daily_limit"){L.error(u.message||"You've used today's channel fetches.");return}if(l){L.error(re(l,{description:"We couldn't load your channel data. Please try again."}).description);return}if(!(n!=null&&n.success)){L.error((n==null?void 0:n.error)||"Failed to fetch channel data");return}if(S(n.formattedText),_({youtubeData:n.formattedText}),n.cached){const w=Math.max(1,Math.ceil((n.retryAfterSeconds??0)/3600));L.info(`Using your last fetch — try again in ~${w}h, or paste manually below.`)}else L.success(`Loaded ${n.data.videos.length} videos from ${n.data.channelTitle}`)}catch{L.error("Failed to fetch channel data")}finally{R(!1)}},ue=()=>{if(!i.trim()){F({youtubeData:"Fetch your channel or paste your recent video titles and view counts"});return}F({}),_(),k(2)},me=async()=>{const o=C.trim();if(!o||!/^https?:\/\/\S+\.\S+/.test(o)){F({salesPageUrl:"Enter the full public URL of your sales page"});return}F({}),g(!0),k(3);const n=d;Y(null);try{const{result:l,quota:u}=await De(i,o);Y(l),u&&D(u),_({result:l,salesPageUrl:o}),c({title:"Audit complete",description:`Your Channel–Offer Fit Score is ${l.cpi}`})}catch(l){if(l instanceof ie)l.quota&&D(l.quota),n?(Y(n),c({title:"Limit reached",description:`${l.message} Showing your previous result.`})):(k(2),c({title:"Limit reached",description:l.message,variant:"destructive"}));else{k(2);const u=re(l,{title:"Audit failed",description:"We couldn't complete your audit. Please try again."});c({title:u.title,description:u.description,variant:"destructive"})}}finally{g(!1)}},M=d?We(d.cpi):null,xe=h.useMemo(()=>{var n,l,u,w;if(!d)return null;if(((n=d.identityAnalysis)==null?void 0:n.match)==="different")return`Your channel attracts ${d.identityAnalysis.channelAttracts}, but your offer serves ${d.identityAnalysis.offerServes}.`;const o=[...d.matchMap??[]].sort((f,N)=>{const ee={weak:0,partial:1,strong:2};return ee[f.matchScore]-ee[N.matchScore]})[0];return o?`Viewers arrive wanting help with "${o.audienceProblem}", while your page promises "${o.offerSolution}".`:((u=(l=d.insights)==null?void 0:l.friction)==null?void 0:u[0])??((w=d.verdict)==null?void 0:w.subheadline)??null},[d]),he=h.useMemo(()=>{var n,l,u,w;if(!d)return[];if(d.cpi>=80)return[{title:"Establish which content is generating the most sales"},{title:"Repeat the topic"},{title:"Measure the results & repeat"}];if(((n=d.identityAnalysis)==null?void 0:n.match)==="different"){const f=d.identityAnalysis.channelAttracts||"your current viewers",N=d.identityAnalysis.offerServes||"your ideal buyers";return[{title:`Your channel attracts ${f}, but your offer serves ${N}
1.`,detail:`Either adjust your sales page to speak to ${f}, or shift your content to attract ${N}.`}]}const o=(u=(l=d.topicAnalysis)==null?void 0:l.topicOverlap)==null?void 0:u.toLowerCase();return o==="minimal"||o==="none"?[{title:"Your content topics and offer topic don't overlap enough.",detail:`Either create more content about ${((w=d.topicAnalysis)==null?void 0:w.offerTopic)||"your offer topic"}, or rewrite your sales page around the topics your channel already covers.`}]:[{title:"Your channel and offer are close but not fully aligned.",detail:"Tighten your sales-page messaging to match the problems your viewers arrive with, or adjust your content to match the problem your offer solves."}]},[d]),O=({children:o})=>e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"mx-auto w-full max-w-[850px] px-4 py-10 sm:py-14",children:[e.jsxs("div",{className:"mb-8 flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg border border-border bg-card",children:e.jsx(Se,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold leading-tight text-foreground",children:t}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s})]})]}),j&&j.limit!==null&&e.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-card px-4 py-3 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:j.remaining===null||j.remaining>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-foreground",children:j.remaining??j.limit})," of ",j.limit," audit",j.limit===1?"":"s"," left ",j.periodLabel??"today"]}):e.jsxs(e.Fragment,{children:["You've used your ",j.limit===1?"free audit":`${j.limit} audits`," for ",j.periodLabel??"today",".",j.canUpgrade?" Upgrade to StoryOS to run up to 5 audits a day.":""]})}),j.canUpgrade&&e.jsx("a",{href:a,className:"inline-flex items-center rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground transition-opacity hover:opacity-90",children:"Upgrade for more audits"})]}),e.jsx("div",{ref:H,tabIndex:-1,className:"rounded-2xl border border-border bg-card p-6 outline-none duration-300 animate-in fade-in slide-in-from-bottom-2 sm:p-8",children:o},p)]})}),q=({children:o})=>e.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:o});return p===0?e.jsxs(O,{children:[e.jsx(q,{children:"Before you begin"}),e.jsx("h2",{className:"text-2xl font-bold leading-tight text-foreground sm:text-3xl",children:"Is your YouTube channel attracting people who want your offer?"}),e.jsx("p",{className:"mt-4 max-w-[62ch] leading-relaxed text-muted-foreground",children:"This tool compares the topics attracting views on your channel with the problem and outcome promoted on your sales page. You'll receive a Channel–Offer Fit Score and practical recommendations for improving the connection."}),e.jsx("ul",{className:"mt-7 space-y-3",children:[{icon:Ne,text:"See whether your videos attract the right potential buyers"},{icon:we,text:"Find mismatches between your content and your offer"},{icon:ve,text:"Discover what you should improve next"}].map(({icon:o,text:n})=>e.jsxs("li",{className:"flex items-start gap-3 rounded-xl border border-border bg-background/40 px-4 py-3",children:[e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"text-sm leading-relaxed text-muted-foreground",children:n})]},n))}),e.jsx("p",{className:"mt-6 text-sm text-muted-foreground",children:"You'll need your public YouTube channel and sales-page links."}),e.jsxs("div",{className:"mt-7",children:[e.jsxs(A,{size:"lg",className:"font-semibold",onClick:()=>k(1),children:["Start My Free Audit",e.jsx(P,{className:"ml-2 h-4 w-4"})]}),e.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ie,{className:"h-3.5 w-3.5"}),"Takes approximately 2 minutes"]})]})]}):p===1?e.jsxs(O,{children:[e.jsx(q,{children:"Step 1 of 2"}),e.jsx("h2",{className:"text-2xl font-bold leading-tight text-foreground sm:text-3xl",children:"Add your YouTube channel"}
1),e.jsx("p",{className:"mt-3 max-w-[62ch] leading-relaxed text-muted-foreground",children:"We'll examine the topics attracting views and the problems your recent videos appear to solve."}),e.jsxs("div",{className:"mt-8 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{htmlFor:"ca-channel-url",className:"font-medium text-foreground",children:"YouTube channel URL"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(se,{id:"ca-channel-url",type:"url",inputMode:"url",placeholder:"https://youtube.com/@yourchannel",value:b,onChange:o=>v(o.target.value),onBlur:()=>void _(),"aria-describedby":"ca-channel-help",className:"flex-1",disabled:E}),e.jsx(A,{type:"button",variant:"secondary",onClick:de,disabled:E||!b.trim(),className:"shrink-0",children:E?e.jsx(B,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{className:"mr-2 h-4 w-4"}),"Fetch videos"]})})]}),e.jsx("p",{id:"ca-channel-help",className:"text-xs text-muted-foreground",children:"Your channel must be public"}),I.channelUrl&&e.jsx("p",{className:"text-xs text-destructive",children:I.channelUrl})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or paste manually"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{htmlFor:"ca-youtube-data",className:"font-medium text-foreground",children:"Recent YouTube video data"}),e.jsx(Ae,{id:"ca-youtube-data",value:i,onChange:o=>S(o.target.value),onBlur:()=>void _(),"aria-describedby":"ca-youtube-help",placeholder:`How I Made $10K in 30 Days | 245K views
2The TRUTH About Passive Income | 189K views`,className:"min-h-[170px] resize-none"}),e.jsx("p",{id:"ca-youtube-help",className:"text-xs text-muted-foreground",children:"Titles and view counts"}),I.youtubeData&&e.jsx("p",{className:"text-xs text-destructive",children:I.youtubeData})]})]}),e.jsxs("div",{className:"mt-8 flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(A,{variant:"ghost",onClick:()=>k(0),children:[e.jsx(ne,{className:"mr-2 h-4 w-4"}),"Back"]}),e.jsxs(A,{size:"lg",className:"font-semibold",onClick:ue,children:["Continue to My Offer",e.jsx(P,{className:"ml-2 h-4 w-4"})]})]})]}):p===2?e.jsxs(O,{children:[e.jsx(q,{children:"Step 2 of 2"}),e.jsx("h2",{className:"text-2xl font-bold leading-tight text-foreground sm:text-3xl",children:"Add the offer you promote"}),e.jsx("p",{className:"mt-3 max-w-[62ch] leading-relaxed text-muted-foreground",children:"Use the sales page viewers reach when they want to learn more or buy from you."}),e.jsxs("div",{className:"mt-8 space-y-2",children:[e.jsx(z,{htmlFor:"ca-sales-url",className:"font-medium text-foreground",children:"Sales page URL"}),e.jsx(se,{id:"ca-sales-url",type:"url",inputMode:"url",placeholder:"https://example.com/your-offer",value:C,onChange:o=>U(o.target.value),onBlur:()=>void _(),"aria-describedby":"ca-sales-help"}),e.jsx("p",{id:"ca-sales-help",className:"text-xs text-muted-foreground",children:"The page must be public"}),I.salesPageUrl&&e.jsx("p",{className:"text-xs text-destructive",children:I.salesPageUrl})]}),e.jsxs("div",{className:"mt-6 flex items-start gap-3 rounded-xl border border-border bg-background/40 px-4 py-3",children:[e.jsx(Fe,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),e.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Only use public channel and sales-page information. Never paste customer or payment data."})]}),e.jsxs("div",{className:"mt-8 flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(A,{variant:"ghost",onClick:()=>k(1),children:[e.jsx(ne,{className:"mr-2 h-4 w-4"}),"Back"]}),e.jsx(A,{size:"lg",className:"font-semibold",onClick:me,disabled:m,children:m?e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"mr-2 h-4 w-4 animate-spin"}),"Analysing…"]}):e.jsxs(e.Fragment,{children:["Generate My Audit",e.jsx(P,{className:"ml-2 h-4 w-4"})]})})]})]}):m||!d?e.jsx(O,{children:e.jsxs("div",{className:"flex flex-col items-center py-14 text-center",children:[e.jsx(B,{className:"h-7 w-7 animate-spin text-primary"}),e.jsx("h2",{className:"mt-5 text-xl font-semibold text-foreground",children:"Analysing your channel and offer"}),e.jsx("p",{className:"mt-2 max-w-[46ch] text-sm text-muted-foreground",children:"We're reading your recent videos and your sales page to work out who each one attracts."})]})}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"mx-auto w-full max-w-[980px] px-4 py-10",children:[e.jsxs("div",{className:"mb-8 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold leading-tight text-foreground sm:text-3xl",children:t}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s})]}),e.jsxs(A,{variant:"secondary",onClick:()=>k(1),children:[e.jsx(_e,{className:"mr-2 h-4 w-4"}),"Edit information"]})]}),e.jsx(Ye,{result:d,classificationLabel:((Q=d.verdict)==null?void 0:Q.headline)||`${(M==null?void 0:M.label)??""}`.trim()||"Your result",diagnosis:xe||((X=d.verdict)==null?void 0:X.subheadline)||((Z=d.scoreExplanation)==null?void 0:Z.summary)||(M==null?void 0:M.meaning)||"",recommendations:he,ctaHref:"https://getrevtrack.com/?website=Free%20Tool%20-%20Channel%20Audit"})]})})};export{nt as ChannelAuditWizard,nt 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.