1import{f as et,g as Re,B as Te,A as Ue,a6 as tt,o as i,c as l,a as e,b as h,l as c,X as st,V as G,t as p,d as V,F as g,m as b,r as T,O as U,E as W,G as Y,N as oe,p as d,q,cN as ot,cO as nt,y as m,cP as it,P as Pe,aA as je,h as lt,S as rt,i as at,s as De,k as dt,u as ut,z as ve,C as ct,cQ as pt,cR as ht,n as me,cS as bt,v as Ve,cT as ft,R as gt,_ as vt}from"./Bl7aIc7Y.js";import{d as mt}from"./B7zl-mXC.js";import{R as xe}from"./BbHqwxDV.js";import{a as xt}from"./BTLtDkWu.js";import{A as Ie,I as wt}from"./CEuPowNu.js";import{u as yt,a as _t,b as kt,C as $t,T as Ct,E as At}from"./BHCUhnPL.js";import{A as St}from"./hCNgqYvz.js";import{A as Pt}from"./s9I36zUG.js";import{C as Dt}from"./2_An5q7F.js";import{P as Vt}from"./D-aNUEV1.js";import{S as It}from"./Ad73TV1m.js";import{C as Rt}from"./D3MSiAdk.js";import{T as Tt}from"./BzZmBb6u.js";import"./B0FwBhnJ.js";import"./BIpKDfdz.js";import"./C5LHMNf6.js";import"./BMnU5D32.js";const Ut=et("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),jt={class:"glass-panel p-5 rounded-2xl md:p-8 md:rounded-3xl"},Et={class:"mb-6 flex items-center justify-between"},zt={key:0,class:"flex flex-col items-center justify-center gap-3 py-16 text-center text-white/60"},Lt={class:"text-sm md:text-base"},Mt={key:1,class:"py-8 text-center"},Nt={class:"mb-4 text-sm text-red-400"},Ot={class:"flex justify-center gap-3"},Bt={key:0,class:"mb-5 rounded-xl bg-white/5 px-4 py-3 text-xs text-white/50"},qt={class:"space-y-3 mb-8"},Ft=["checked","onChange"],Ht={class:"flex-1"},Gt={class:"block text-sm font-semibold"},Wt={class:"mt-0.5 block text-xs text-white/50"},Yt={key:0,class:"mt-1 block text-xs text-white/35"},Kt=["checked"],Qt={class:"flex-1"},Xt={class:"mb-3 block text-xs font-semibold uppercase tracking-wider text-white/40"},Jt={class:"space-y-3 mb-8"},Zt=["onClick"],es=["checked"],ts={class:"flex-1"},ss={class:"flex flex-wrap items-center gap-2"},os={class:"text-sm font-semibold"},ns={class:"mt-0.5 text-xs text-white/50"},is=["onClick"],ls={key:1,class:"mt-1.5 space-y-1 text-xs text-white/45"},rs={key:0},as={key:0,class:"border-l border-white/15 pl-2"},ds=["href"],us={class:"mb-8 text-xs leading-relaxed text-white/50"},cs={class:"space-y-4 mb-8"},ps={class:"text-sm font-semibold"},hs={key:0,class:"mt-0.5 text-xs text-white/40"},bs={key:1,class:"mt-2.5 flex flex-wrap gap-2"},fs=["onClick"],gs=["onUpdate:modelValue"],vs={class:"mt-2.5 flex flex-col-reverse gap-3 sm:flex-row sm:items-center"},ms=["disabled"],xs=["disabled"],ws=["disabled"],ys=2500,_s=33e4,ks=Re({__name:"InsightPanel",props:{appInfoId:{}},emits:["applied","close","busy","insufficient"],setup(we,{expose:j,emit:K}){const ne=we,P=K,f=d("research"),I=d(null),L=d(""),_=d(""),M=d(""),v=d(!1),x=d([]),k=je({}),Q=d(""),E=d(""),$=q(()=>I.value?.draft||null),ie=q(()=>(I.value?.warnings||[]).includes("search_degraded")),z=q(()=>{const r=I.value?.progress;if(!r||!r.stage)return"Researching your product â reviews, competitors and market signals.";switch(r.stage){case"collecting_internal":return"Reading your product listing and reviewsâ¦";case"planning_search":return"Planning research queriesâ¦";case"searching":return`Searching the web (${r.searches_done}/${r.searches_total})${r.detail?`: â${r.detail}â`:""}â¦`;case"summarizing":return"Summarizing findings from the webâ¦";case"synthesizing":return"Drafting audience & selling pointsâ¦";default:return"Researching your productâ¦"}}),F=q(()=>{const r={};for(const t of I.value?.evidences||[])r[t.id]={snippet:t.snippet,url:t.url};return r});let C=0;const A=r=>new Promise(t=>setTimeout(t,r)),D=()=>{const r=$.value;if(!r)return;_.value=r.audience_candidates[0]?.id||"",v.value=!r.audience_candidates.length;const t=[...r.selling_point_candidates].filter(s=>s.confidence!=="low");x.value=t.slice(0,5).map(s=>s.id),x.value.length||(x.value=r.selling_point_candidates.slice(0,5).map(s=>s.id));for(const s of r.open_questions)k[s.id]={option_ids:[],text:""}},R=r=>(I.value=r,r.status==="draft_ready"||r.status==="finalized"?(f.value="draft",D(),!0):r.status==="failed"||r.status==="expired"?(f.value="failed",L.value=r.error||"Analysis failed, please try again.",!0):!1),N=async(r=!1)=>{f.value="research",L.value="";const t=++C;try{const s=await ot(ne.appInfoId,r);if(t!==C||R(s))return;const u=Date.now();for(;t===C;){if(await A(ys),t!==C)return;let S=null;try{S=await nt(s.session_id)}catch{}if(t!==C||S&&R(S))return;if(Date.now()-u>_s){f.value="failed",L.value="Analysis timed out, please try again.";return}}}catch(s){if(t!==C)return;if(String(s?.errmsg||"").startsWith("Insufficient credits")){P("insufficient");return}f.value="failed",L.value="",m(s,"error")}},X=r=>{const t=x.value;t.includes(r)?x.value=t.filter(s=>s!==r):t.length<5?x.value=[...t,r]:m("Pick at most 5 selling points.","warning")},O=(r,t,s)=>{const u=k[r];u&&(s?u.option_ids=u.option_ids.includes(t)?u.option_ids.filter(S=>S!==t):[...u.option_ids,t]:u.option_ids=u.option_ids.includes(t)?[]:[t])},J=async()=>
1{if(!I.value)return;if(!x.value.length){m("Select at least one selling point.","warning");return}if(v.value&&!M.value.trim()){m("Describe your target audience first.","warning");return}const r={selected_audience_id:v.value?"":_.value,custom_audience:v.value?M.value.trim():"",selected_selling_point_ids:x.value,answers:Object.entries(k).filter(([,t])=>t.option_ids.length||t.text.trim()).map(([t,s])=>({question_id:t,option_ids:s.option_ids,text:s.text.trim()})),user_note:Q.value.trim()};f.value="submitting";try{const t=await it(I.value.session_id,r);t.final?P("applied",t.final):(f.value="draft",m("Unexpected response, please try again.","error"))}catch(t){f.value="draft",m(t,"error")}};Te(f,r=>P("busy",r==="research"||r==="submitting"),{immediate:!0});const le=q(()=>f.value==="draft");return j({submit:J,hasDraft:le}),Ue(()=>N()),tt(()=>{C+=1,P("busy",!1)}),(r,t)=>(i(),l("section",jt,[e("div",Et,[t[10]||(t[10]=e("h2",{class:"text-xl font-bold font-display"},"Deep Analysis",-1)),e("button",{type:"button",class:"flex items-center justify-center rounded-full bg-white/5 p-1.5 text-white/50 transition-colors hover:bg-white/10 hover:text-white cursor-pointer","aria-label":"Close deep analysis",onClick:t[0]||(t[0]=s=>P("close"))},[h(c(st),{class:"w-4 h-4"})])]),f.value==="research"?(i(),l("div",zt,[h(c(G),{size:"large",stroke:"9d9d9d"}),e("p",Lt,p(z.value),1),t[11]||(t[11]=e("p",{class:"text-xs text-white/40"},"This usually takes 30â90 seconds.",-1))])):f.value==="failed"?(i(),l("div",Mt,[e("p",Nt,p(L.value||"Analysis failed, please try again."),1),e("div",Ot,[e("button",{type:"button",class:"flex h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-5 text-sm font-bold text-white/70 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",onClick:t[1]||(t[1]=s=>N(!0))},[h(c(xe),{class:"w-4 h-4"}),t[12]||(t[12]=V(" Try again ",-1))]),e("button",{type:"button",class:"flex h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-5 text-sm font-bold text-white/70 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",onClick:t[2]||(t[2]=s=>P("close"))}," Use quick generation instead ")])])):$.value?(i(),l(g,{key:2},[ie.value?(i(),l("p",Bt," Web research was unavailable â this analysis is based on your product listing and reviews only. ")):b("",!0),t[18]||(t[18]=e("h3",{class:"mb-3 block text-xs font-semibold uppercase tracking-wider text-white/40"},"Who is this for?",-1)),e("div",qt,[(i(!0),l(g,null,T($.value.audience_candidates,s=>(i(),l("label",{key:s.id,class:U(["flex cursor-pointer items-start gap-3 rounded-2xl border border-white/10 bg-white/[0.03] p-4 transition-colors hover:bg-white/[0.06]",{"border-brand-purple/60 bg-brand-purple/10":!v.value&&_.value===s.id}])},[e("input",{type:"radio",class:"mt-1 accent-brand-purple",checked:!v.value&&_.value===s.id,onChange:u=>(v.value=!1,_.value=s.id)},null,40,Ft),e("span",Ht,[e("span",Gt,p(s.name),1),e("span",Wt,p(s.description),1),s.rationale?(i(),l("span",Yt,"Why: "+p(s.rationale),1)):b("",!0)])],2))),128)),e("label",{class:U(["flex cursor-pointer items-start gap-3 rounded-2xl border border-white/10 bg-white/[0.03] p-4 transition-colors hover:bg-white/[0.06]",{"border-brand-purple/60 bg-brand-purple/10":v.value}])},[e("input",{type:"radio",class:"mt-1 accent-brand-purple",checked:v.value,onChange:t[3]||(t[3]=s=>v.value=!0)},null,40,Kt),e("span",Qt,[t[13]||(t[13]=e("span",{class:"block text-sm font-semibold"},"My own audience",-1)),W(e("textarea",{"onUpdate:modelValue":t[4]||(t[4]=s=>M.value=s),rows:2,placeholder:"Describe who you want to target",class:"mt-1.5 w-full resize-none rounded-xl border border-white/10 bg-white/5 px-3 py-2 text-sm focus:border-brand-purple/50 focus:outline-hidden",onFocus:t[5]||(t[5]=s=>v.value=!0)},null,544),[[Y,M.value]])])],2)]),e("h3",Xt," Selling points ("+p(x.value.length)+"/5) ",1),e("div",Jt,[(i(!0),l(g,null,T($.value.selling_point_candidates,s=>(i(),l("div",{key:s.id,class:U(["flex cursor-pointer items-start gap-3 rounded-2xl border border-white/10 bg-white/[0.03] p-4 transition-colors hover:bg-white/[0.06]",{"border-brand-purple/60 bg-brand-purple/10":x.value.includes(s.id
1)}]),onClick:u=>X(s.id)},[e("input",{type:"checkbox",class:"mt-1 pointer-events-none accent-brand-purple",checked:x.value.includes(s.id)},null,8,es),e("div",ts,[e("div",ss,[e("span",os,p(s.title),1),e("span",{class:U(["rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider",{"bg-green-500/15 text-green-300":s.confidence==="high","bg-amber-500/15 text-amber-300":s.confidence==="medium","bg-white/10 text-white/40":s.confidence==="low"}])},p(s.confidence)+" confidence",3)]),e("p",ns,p(s.pain_point)+" â "+p(s.benefit),1),s.evidence||s.evidence_refs.length?(i(),l("button",{key:0,type:"button",class:"mt-1 text-xs text-white/40 underline cursor-pointer",onClick:Pe(u=>E.value=E.value===s.id?"":s.id,["stop"])},p(E.value===s.id?"Hide evidence":"Show evidence"),9,is)):b("",!0),E.value===s.id?(i(),l("div",ls,[s.evidence?(i(),l("p",rs,p(s.evidence),1)):b("",!0),(i(!0),l(g,null,T(s.evidence_refs,u=>(i(),l(g,{key:u},[F.value[u]?(i(),l("p",as,[V(p(F.value[u].snippet)+" ",1),F.value[u].url?(i(),l("a",{key:0,href:F.value[u].url,target:"_blank",rel:"noopener noreferrer",class:"ml-1 inline-flex items-center gap-0.5 underline",onClick:t[6]||(t[6]=Pe(()=>{},["stop"]))},[t[14]||(t[14]=V("source ",-1)),h(c(Ut),{class:"size-2.5"})],8,ds)):b("",!0)])):b("",!0)],64))),128))])):b("",!0)])],10,Zt))),128))]),$.value.competitor_notes?(i(),l(g,{key:1},[t[15]||(t[15]=e("h3",{class:"mb-3 block text-xs font-semibold uppercase tracking-wider text-white/40"},"Versus competitors",-1)),e("p",us,p($.value.competitor_notes),1)],64)):b("",!0),$.value.open_questions.length?(i(),l(g,{key:2},[t[16]||(t[16]=e("h3",{class:"mb-3 block text-xs font-semibold uppercase tracking-wider text-white/40"},"A few questions for you",-1)),e("div",cs,[(i(!0),l(g,null,T($.value.open_questions,s=>(i(),l("div",{key:s.id,class:"rounded-2xl border border-white/10 bg-white/[0.03] p-4"},[e("p",ps,p(s.question),1),s.reason?(i(),l("p",hs,p(s.reason),1)):b("",!0),s.type!=="text"?(i(),l("div",bs,[(i(!0),l(g,null,T(s.options,u=>(i(),l("button",{key:u.id,type:"button",class:U(["rounded-xl border px-3 py-1.5 text-xs font-semibold transition-colors cursor-pointer",k[s.id]?.option_ids.includes(u.id)?"border-brand-purple/60 bg-brand-purple/20 text-white":"border-white/10 bg-white/5 text-white/60 hover:bg-white/10"]),onClick:S=>O(s.id,u.id,s.type==="multi")},p(u.label),11,fs))),128))])):k[s.id]?W((i(),l("input",{key:2,"onUpdate:modelValue":u=>k[s.id].text=u,type:"text",placeholder:"Your answer (optional)",class:"mt-2.5 w-full rounded-xl border border-white/10 bg-white/5 px-3.5 py-2.5 text-sm focus:border-brand-purple/50 focus:outline-hidden"},null,8,gs)),[[Y,k[s.id].text]]):b("",!0)]))),128))])],64)):b("",!0),t[19]||(t[19]=e("h3",{class:"mb-3 block text-xs font-semibold uppercase tracking-wider text-white/40"},"Anything else?",-1)),W(e("textarea",{"onUpdate:modelValue":t[7]||(t[7]=s=>Q.value=s),rows:2,maxlength:"500",placeholder:"Optional note â e.g. brand tone, angles to avoidâ¦",class:"w-full resize-none rounded-xl border border-white/10 bg-white/5 px-4 py-3 text-sm focus:border-brand-purple/50 focus:outline-hidden"},null,512),[[Y,Q.value]]),t[20]||(t[20]=e("p",{class:"mt-5 text-xs text-white/40"}," Your selected audience & selling points will replace the product highlights below. ",-1)),e("div",vs,[e("button",{type:"button",class:"flex h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-5 text-sm font-bold text-white/70 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",disabled:f.value==="submitting",onClick:t[8]||(t[8]=s=>N(!0))},[h(c(xe),{class:"w-4 h-4"}),t[17]||(t[17]=V(" Re-run research ",-1))],8,ms),e("button",{type:"button",class:"flex h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-5 text-sm font-bold text-white/70 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",disabled:f.value==="submitting",onClick:t[9]||(t[9]=s=>P("close"))}," Cancel ",8,xs),e("button",{type:"button",class:"flex h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl bg-linear-to-r from-brand-purple to-brand-blue px-7 text-sm font-bold text-white shadow-[0_0_24px_rgba(139,92,246,0.3)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",disabled:f.value==="submitting",onClick:J},[f.value==="submitting"?(i(),oe(c(G),{key:0,size:"small",stroke:"ffffff"})):(i(),l(g,{key:1},[V("Apply to highlights below")],64))],8,ws)])],64)):b("",!0)]))}}),$s=Object.assign(ks,{__name:"AppInsightPanel"}),Cs={class:"max-w-4xl mx-auto mt-20 mb-12 px-4 sm:px-6 md:mt-24 md:mb-24"},As={key:0,class:"flex flex-col items-center justify-center gap-3 py-24 text-white/50"},Ss={key:1,class:"space-y-8"},Ps={class:"glass-panel p-5 rounded-2xl md:p-6 md:rounded-3xl"},Ds={class:"flex items-center gap-4"},Vs=["src"],Is={class:"min-w-0 flex-1"},Rs={class:"truncate text-lg font-bold font-display md:text-xl"},Ts={class:"text-xs font-semibold"},Us={key:0,class:"mt-5 space-y-5 border-t border-white/10 pt-5"},js={key:0,class:"space-y-1.5"},Es={class:"text-sm leading-relaxed text-white/70 whitespace-pre-line"},zs={key:1,class:"space-y-1.5"},Ls={class:"flex flex-wrap gap-2"},Ms=["src"],Ns={key:2,class:"space-y-1.5"},Os={class:"flex flex-wrap gap-2"},Bs=["src"],qs={key:0,class:"flex flex-col items-center justify-center gap-3 py-16 text-center text-white/60"},Fs={class:"mb-8 space-y-2"},Hs={class:"space-y-5"},Gs={class:"mb-4 flex items-center justify-between"},Ws={class:"text-xs font-bold uppercase tracking-[0.18em] text-brand-cyan/80"},Ys=["onClick"],Ks={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},Qs={class:"block text-xs font-semibold text-white/40 uppercase tracking-wider"},Xs={class:"flex items-start gap-1.5 text-xs text-white/30 normal-case tracking-normal"},Js=["placeholder","onUpdate:modelValue"],Zs=["placeholder","onUpdate:modelValue"],eo={key:0,class:"rounded-2xl border border-dashed border-white/10 bg-white/[0.02] py-10 text-center text-white/40"},to={class:"mt-6 border-t border-white/10 pt-6"},so={class:"flex flex-col gap-3 sm:flex-row sm:items-center"},oo=["disabled"],no=["disabled"],io={class:"flex h-full items-center justify-center gap-2 rounded-[calc(1rem-1.5px)] bg-[#2b2840] px-6 text-sm font-bold text-white transition-colors group-hover:bg-[#37325a]"},lo={key:0,class:"ml-1 rounded-full bg-white/15 px-2 py-0.5 text-[11px] leading-none"},ro={class:"flex flex-col-reverse gap-3 pt-2 sm:flex-row sm:items-center sm:justify-end md:pt-4"},ao={class:"flex flex-col gap-3 sm:flex-row sm:items-center"},uo=["disabled"],co=["disabled"],po=Re({__name:"[id]",setup(we){const{$firebaseAnalytics:j}=lt(),K=rt(),ne=at(),{isLoggedIn:P,isReady:f,points:I}=De(ne),L=dt(),{appInfoID:_,sourceType:M}=De(L),{showTemplateDialog:v,openStartWithoutTemplateDialog:x}=yt(),{showExplainerDialog:k,openExplainerDialog:Q}=_t(),{showAvatarOptionsDialog:E,openAvatarOptionsDialog:$,onAvatarOptionsConfirm:ie}=kt(),z=K.params.id,F=K.query.mode==="create",C=d(!0),A=d(!1),D=d(!1),R=d(!1),N=d(!1),X=q(()=>R.value&&N.value),O=d(0),J=q(()=>{const n=O.value;return!n||n<=0?"":`${Number.isInteger(n)?String(n):n.toFixed(1)} ${n===1?"credit":"credits"}`}),le=()=>{bt().then(n=>{O.value=n?.enabled?Number(n.credits||0):0}).catch(()=>{})},r=d(!1),t=()=>{S(),r.value=!0},s=()=>{r.value=!1,Ve(`/pricing?return=${encodeURIComponent(K.fullPath)}`)},u=()=>{if(O.value>0&&Number(I.value||0)<O.value){t();return}R.value=!0,window.scrollTo({top:0,behavior:"smooth"})},S=()=>{R.value=!1,N.value=!1},re=d(null),ye=d(null),ae=d(!1),Ee=n=>{H.value=n.target_audience||"",w.splice(0,w.length),(n.selling_points||[]).forEac
1h(o=>{w.push({pain_point:o.pain_point||"",benefit:o.benefit||""})}),S(),m("Deep analysis applied to your product highlights.","success"),gt(()=>{ye.value?.scrollIntoView({behavior:"smooth",block:"start"}),ae.value=!0,setTimeout(()=>ae.value=!1,1800)})},de=d(!1);let te=null;const ze=()=>R.value&&!!re.value?.hasDraft,Le=()=>{te=null,re.value?.submit()},Me=()=>{const n=te;te=null,S(),n&&fe(n.tag,n.after)},Z=d(!1),ue=d(!1),ee=d(!1),_e=d(""),ke=d(""),ce=d(""),pe=d([]),he=d([]),H=d(""),w=je([]),$e=[{key:"pain_point",label:"Pain Point / Player Motivations",subtitle:"Describe the user problems, needs, frustrations, or player motivations your product addresses",type:"textarea",placeholder:"The user pain point it addresses"},{key:"benefit",label:"Key Benefits",subtitle:"Describe the main benefits, features, or hooks that make your product appealing.",type:"textarea",placeholder:"The benefit it delivers"}];ut({title:"App Product Highlights"});const Ne=()=>({pain_point:"",benefit:""}),Oe=n=>typeof n=="string"?n:n?.url||n?.video_url||"";Ue(()=>{Be(),ve.on("loginSuccess",be)}),ct(()=>{ve.off("loginSuccess",be)});const Be=()=>{Te(f,n=>{n&&(P.value?be():ve.emit("showLoginDialog"))},{immediate:!0})};let Ce=!1;const be=()=>{Ce||!P.value||(Ce=!0,C.value=!0,le(),pt(z).then(n=>{qe(n),_.value=z,M.value=n.source_type||"app";const o=Array.isArray(n.selling_points);F&&!o?Se():Ae(n)}).catch(n=>{m(n,"error")}).finally(()=>{C.value=!1}))},qe=n=>{_e.value=n.app_logo?.url||"",ke.value=n.app_name||"",ce.value=n.app_description||"",pe.value=n.screenshots||[],he.value=n.video_resources||[]},Ae=n=>{H.value=n.target_audience||"",w.splice(0,w.length),(n.selling_points||[]).forEach(o=>{w.push({pain_point:o.pain_point||"",benefit:o.benefit||""})})},Se=()=>{A.value=!0,ht(z).then(n=>{Ae(n)}).catch(n=>{m(n,"error")}).finally(()=>{A.value=!1})},Fe=()=>{j?.trackEvent("click_sellingpoints_regenerate"),ee.value=!0},He=()=>{ee.value=!1,Se()},Ge=()=>{j?.trackEvent("click_sellingpoints_add"),w.push(Ne())},We=n=>{j?.trackEvent("click_sellingpoints_remove"),w.splice(n,1)},Ye=()=>{if(!H.value.trim())return m("Please enter the target audience.","warning"),!1;for(let n=0;n<w.length;n++){const o=w[n];for(const a of $e)if(!String(o[a.key]??"").trim())return m(`Product highlight ${n+1}: please fill in "${a.label}".`,"warning"),!1}return!0},Ke=()=>{const n={target_audience:H.value.trim(),selling_points:w.map(o=>({pain_point:o.pain_point.trim(),benefit:o.benefit.trim()}))};return ft(z,n)},se=d(""),fe=(n,o)=>{if(A.value){m("Please wait for the analysis to complete.","warning");return}if(ze()){te={tag:n,after:o},de.value=!0;return}Ye()&&(se.value=n,D.value=!0,Ke().then(()=>o()).catch(a=>{m(a,"error")}).finally(()=>{D.value=!1,se.value=""}))},Qe=()=>{j?.trackEvent("click_sellingpoints_save"),fe("save",()=>{m("Product highlights saved.","success")})},Xe=()=>{j?.trackEvent("click_sellingpoints_create_video"),fe("video",()=>{if(M.value==="product"){$(_.value);return}ue.value=!0})},Je=n=>{if(j?.trackEvent("click_sellingpoints_creative_mode_next",{mode:n}),n==="auto"){x(_.value);return}if(n==="explainer"){Q(_.value);return}$(_.value)},Ze=()=>{Ve(`/app/${z}`)};return(n,o)=>(i(),l("main",Cs,[e("button",{class:"mb-6 inline-flex items-center gap-2 text-white/50 hover:text-white transition-colors cursor-pointer",onClick:Ze},[h(c(Pt),{class:"w-5 h-5"}),o[11]||(o[11]=e("span",{class:"text-sm font-semibold"},"Back",-1))]),C.value?(i(),l("div",As,[h(c(G),{size:"large",stroke:"9d9d9d"}),o[12]||(o[12]=e("span",{class:"text-sm"},"Loading app info...",-1))])):(i(),l("div",Ss,[e("section",Ps,[e("div",Ds,[e("img",{src:_e.value||c(mt),alt:"app logo",class:"w-14 h-14 shrink-0 rounded-2xl border border-white/10 bg-white/5 object-cover"},null,8,Vs),e("div",Is,[e("h1",Rs,p(ke.value||"Untitled App"),1),o[13]||(o[13]=e("p",{class:"text-white/40 text-xs"},"Product details",-1))]),e("button",{class:"flex items-center gap-1 text-white/50 hover:text-white transition-colors cursor-pointer shrink-0",onClick:o[0]||(o[0]=a=>Z.value=!Z.value)},[e("span",Ts,p(Z.value?"Hide":"Show"),1),h(c(Dt),{class:U(["w-4 h-4 transition-transform",Z.value?"rotate-180":""])},null,8,["class"])])]),Z.value?(i(),l("div",Us,[ce.value?(i(),l("div",js,[o[14]||(o[14]=e("label",{class:"block text-xs font-semibold text-white/40 uppercase tracking-wider"},"Description",-1)),e("p",Es,p(ce.value),1)])):b("",!0),pe.value.length?(i(),l("div",zs,[o[15]||(o[15]=e("label",{class:"block text-xs font-semibold text-white/40 uppercase tracking-wider"},"Screenshots",-1)),e("div",Ls,[(i(!0),l(g,null,T(pe.value,(a,B)=>(i(),l("img",{key:B,src:a.url,alt:"screenshot",class:"h-24 w-auto rounded-lg border border-white/10 bg-white/5 object-cover"},null,8,Ms))),128))])])):b("",!0),he.value.length?(i(),l("div",Ns,[o[16]||(o[16]=e("label",{class:"block text-xs font-semibold text-white/40 uppercase tracking-wider"},"Video Assets",-1)),e("div",Os,[(i(!0),l(g,null,T(he.value,(a,B)=>(i(),l("video",{key:B,src:Oe(a),controls:"",class:"h-28 w-auto rounded-lg border border-white/10 bg-black"},null,8,Bs))),128))])])):b("",!0)])):b("",!0)]),R.value?(i(),oe($s,{key:0,ref_key:"insightPanelRef",ref:re,"app-info-id":c(z),onApplied:Ee,onClose:S,onBusy:o[1]||(o[1]=a=>N.value=a),onInsufficient:t},null,8,["app-info-id"])):b("",!0),e("section",{ref_key:"highlightsSectionRef",ref:ye,class:U(["glass-panel p-5 rounded-2xl md:p-8 md:rounded-3xl",{"insight-flash":ae.value}])},[o[24]||(o[24]=e("h2",{class:"text-xl font-bold mb-6 font-display md:mb-8"}," Product Highlights ",-1)),A.value?(i(),l("div",qs,[h(c(G),{size:"large",stroke:"9d9d9d"}),o[17]||(o[17]=e("p",{class:"text-sm md:text-base"}," Analyzing your product and identifying its highlights... ",-1))])):(i(),l(g,{key:1},[e("div",Fs,[o[18]||(o[18]=e("label",{class:"block text-xs font-semibold text-white/40 uppercase tracking-wider"},"Target Audience",-1)),W(e("textarea",{rows:3,placeholder:"Describe the target audience of your app...",class:"w-full bg-white/5 border border-white/10 rounded-xl py-3 px-4 focus:outline-hidden focu
1s:border-brand-purple/50 transition-colors resize-none","onUpdate:modelValue":o[2]||(o[2]=a=>H.value=a)},null,512),[[Y,H.value]])]),e("div",Hs,[(i(!0),l(g,null,T(w,(a,B)=>(i(),l("div",{key:B,class:"relative rounded-2xl border border-white/10 bg-white/[0.03] p-4 md:p-5"},[e("div",Gs,[e("span",Ws,"Product Highlight "+p(B+1),1),e("button",{type:"button",class:"flex items-center justify-center rounded-full bg-white/5 p-1.5 text-white/50 transition-colors hover:bg-white/10 hover:text-white cursor-pointer","aria-label":"Remove product highlight",onClick:y=>We(B)},[h(c(Tt),{class:"w-4 h-4"})],8,Ys)]),e("div",Ks,[(i(),l(g,null,T($e,y=>e("div",{key:y.key,class:U(["space-y-1.5",y.type==="textarea"?"md:col-span-2":""])},[e("label",Qs,p(y.label),1),e("p",Xs,[h(c(wt),{class:"size-3.5 shrink-0 mt-0.5 text-white/30"}),e("span",null,p(y.subtitle),1)]),y.type==="input"?W((i(),l("input",{key:0,type:"text",placeholder:y.placeholder,class:"w-full bg-white/5 border border-white/10 rounded-xl py-2.5 px-3.5 text-sm focus:outline-hidden focus:border-brand-purple/50 transition-colors","onUpdate:modelValue":ge=>a[y.key]=ge},null,8,Js)),[[Y,a[y.key]]]):W((i(),l("textarea",{key:1,rows:2,placeholder:y.placeholder,class:"w-full bg-white/5 border border-white/10 rounded-xl py-2.5 px-3.5 text-sm focus:outline-hidden focus:border-brand-purple/50 transition-colors resize-none","onUpdate:modelValue":ge=>a[y.key]=ge},null,8,Zs)),[[Y,a[y.key]]])],2)),64))])]))),128))]),w.length?b("",!0):(i(),l("div",eo,[...o[19]||(o[19]=[e("p",{class:"text-sm"},' No product highlights yet. Add one manually or use "Regenerate product highlights". ',-1)])])),e("button",{type:"button",class:"mt-5 flex w-full items-center justify-center gap-2 rounded-2xl border-2 border-dashed border-white/10 py-4 text-sm font-semibold text-white/50 transition-all hover:border-brand-purple/50 hover:bg-brand-purple/5 hover:text-brand-purple cursor-pointer",onClick:Ge},[h(c(Vt),{class:"w-5 h-5"}),o[20]||(o[20]=V(" Add product highlight ",-1))]),e("div",to,[e("div",so,[e("button",{type:"button",class:"flex h-12 items-center justify-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-6 text-sm font-bold text-white/70 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",disabled:A.value||D.value||X.value,onClick:Fe},[h(c(xe),{class:U(["w-4 h-4",A.value?"animate-spin":""])},null,8,["class"]),o[21]||(o[21]=V(" Regenerate ",-1))],8,oo),e("button",{type:"button",class:"group h-12 cursor-pointer rounded-2xl bg-linear-to-r from-brand-purple via-brand-blue to-brand-cyan p-[1.5px] shadow-[0_0_22px_rgba(139,92,246,0.5)] transition-shadow hover:shadow-[0_0_30px_rgba(34,211,238,0.55)] disabled:cursor-not-allowed disabled:opacity-60",disabled:A.value||D.value||R.value,onClick:u},[e("span",io,[h(c(It),{class:"w-4 h-4 text-brand-cyan"}),o[22]||(o[22]=V(" Deep analysis ",-1)),J.value?(i(),l("span",lo,p(J.value),1)):b("",!0)])],8,no)]),o[23]||(o[23]=e("p",{class:"mt-3 text-xs leading-relaxed text-white/40"}," Deep analysis researches your reviews, competitors and market signals, then asks you a few questions to refine the highlights and target audience. ",-1))])],64))],2),e("div",ro,[e("div",ao,[e("button",{type:"button",class:"flex h-12 items-center justify-center gap-2 rounded-2xl border border-white/10 bg-white/5 px-6 text-sm font-bold text-white/70 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",disabled:A.value||D.value||X.value,onClick:Qe},[D.value&&se.value==="save"?(i(),oe(c(G),{key:0,size:"small",stroke:"9d9d9d"})):(i(),l(g,{key:1},[V("Save Only")],64))],8,uo),e("button",{type:"button",class:"flex h-12 cursor-pointer items-center justify-center gap-2 rounded-2xl bg-linear-to-r from-brand-purple to-brand-blue px-7 text-sm font-bold text-white shadow-[0_0_24px_rgba(139,92,246,0.3)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",disabled:A.value||D.value||X.value,onClick:Xe},[D.value&&se.value==="video"?(i(),oe(c(G),{key:0,size:"small",stroke:"ffffff"})):(i(),l(g,{key:1},[o[25]||(o[25]=V(" Save & Create ads ",-1)),h(c(Rt),{class:"w-5 h-5"})],64))],8,co)])])])),h(xt,{modelValue:r.value,"onUpdate:modelValue":o[3]||(o[3]=a=>r.value=a),"required-credits":O.value,onPurchase:s},null,8,["modelValue","required-credits"]),h(Ie,{"is-open":de.value,mode:"confirm",type:"warning",title:"Deep analysis not applied",content:"Your deep analysis results haven't been applied to the product highlights yet. Apply them now, or discard them and continue?","confirm-text":"Apply now","cancel-text":"Discard & continue",onConfirm:Le,onCancel:Me,onClose:o[4]||(o[4]=a=>de.value=!1)},null,8,["is-open"]),h($t,{modelValue:ue.value,"onUpdate:modelValue":o[5]||(o[5]=a=>ue.value=a),onNext:Je},null,8,["modelValue"]),h(St,{modelValue:c(E),"onUpdate:modelValue":o[6]||(o[6]=a=>me(E)?E.value=a:null),onConfirm:c(ie)},null,8,["modelValue","onConfirm"]),h(Ct,{modelValue:c(v),"onUpdate:modelValue":o[7]||(o[7]=a=>me(v)?v.value=a:null)},null,8,["modelValue"]),h(At,{modelValue:c(k),"onUpdate:modelValue":o[8]||(o[8]=a=>me(k)?k.value=a:null)},null,8,["modelValue"]),h(Ie,{"is-open":ee.value,mode:"confirm",type:"warning",title:"Regenerate",content:"This will over
1write all current product highlights and target audience. Continue?","confirm-text":"Regenerate","cancel-text":"Cancel",onConfirm:He,onCancel:o[9]||(o[9]=a=>ee.value=!1),onClose:o[10]||(o[10]=a=>ee.value=!1)},null,8,["is-open"])]))}}),Vo=vt(po,[["__scopeId","data-v-f472efe7"]]);export{Vo 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.