PageSourceSearch

https://www.tubeboostr.ai/assets/Ideation-b88ky-Bc.js

js tubeboostr.ai collected 2026-10-05 14:24:15 UTC 21,399 bytes, 6 lines download raw bytes

1import{o as De,c as Oe,d as Be,_ as qe,Q as Je,r as n,f as x,g as d,j as e,a as ce,h as y,G as Me,B as u,e as W,S as U,$ as de,p as Re,W as Pe,T as $e,q as We}from"./index-DnFRH9_L.js";import{I as me}from"./input-YiMh8UMS.js";import{L as ue}from"./label-DjUX3ZWM.js";import{S as Ue}from"./switch-D_S-hhju.js";import{h as Ve}from"./creditErrorHandler-Cnl4ivdK.js";import{T as Qe,a as He,b as he,c as xe}from"./tabs-DGf9UqLC.js";import{S as Ke}from"./skeleton-C4k5jx_g.js";import{C as Ye,a as Ze,b as Xe}from"./collapsible-aZi2rPS-.js";import{A as es,a as ss,b as ts,c as rs,d as as,e as os,f as is,g as ns}from"./alert-dialog-Bnd9c2AW.js";import{q as _}from"./proxy-WXJE_cR1.js";import{A as ge}from"./index-CPFe3lYD.js";import{C as pe}from"./check-B7CpPNb4.js";import{B as ls,a as V}from"./bookmark-OUoPnp0C.js";import{C as cs}from"./copy-ncBrIDW-.js";import{S as fe}from"./search-BNNgzx81.js";import{F as ds}from"./folder-open-D9ChjZLn.js";import{T as ms}from"./trending-up-B8KfHcru.js";import{M as us}from"./message-square-BjOFZEz2.js";import{Z as hs}from"./zap-tN9ExfC1.js";import"./index-CfRvVmmW.js";import"./index-Bb-fnLL9.js";import"./index-BnL4qY8P.js";import"./index-DS96Y1Su.js";import"./index-BpcA3wZG.js";import"./Combination-kISE9yI6.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const xs=De("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),p="active_idea_job_id",ve="ideation-workspace-draft",gs=()=>{try{const T=localStorage.getItem(ve);return T?JSON.parse(T):null}catch{return null}},ps=[{value:"trending",label:"Trending & Timely",icon:ms,description:"Current trends and hot topics"},{value:"evergreen",label:"Evergreen Content",icon:xs,description:"Timeless, always-relevant ideas"},{value:"controversial",label:"Controversial Takes",icon:us,description:"Debate-worthy, contrarian angles"},{value:"educational",label:"Educational",icon:hs,description:"How-to and explainer content"}],ye={curiosity:"bg-primary/20 text-primary",excitement:"bg-primary/20 text-primary",surprise:"bg-accent/20 text-accent",fear:"bg-destructive/20 text-destructive",inspiration:"bg-primary/20 text-primary",nostalgia:"bg-muted text-muted-foreground",humor:"bg-accent/20 text-accent"},be={easy:"bg-green-500/20 text-green-400",medium:"bg-yellow-500/20 text-yellow-400",hard:"bg-destructive/20 text-destructive"};function Rs(){const T=Oe(),{user:l}=Be(),{generations:A,addGeneration:E,updateGeneration:Q}=qe(),{getCost:G,checkCustomCostOrWarn:je}=Je(),c=gs(),[m,F]=n.useState((c==null?void 0:c.niche)||""),[b,L]=n.useState((c==null?void 0:c.style)||"trending"),[h,S]=n.useState((c==null?void 0:c.ideas)||[]),[I,we]=n.useState((c==null?void 0:c.useWebResearch)??!1),[v,N]=n.useState(!1),[Ne,H]=n.useState(null),[Se,M]=n.useState(!0),[O,R]=n.useState((c==null?void 0:c.currentSessionId)||null),[Ie,P]=n.useState(!1),[z,B]=n.useState([]),[D,q]=n.useState(new Set),[K,Y]=n.useState(null),[C,f]=n.useState(null),[j,k]=n.useState(new Set),[Z,X]=n.useState(!1),[ee,se]=n.useState("create"),[J,te]=n.useState(""),[re,Ce]=n.useState(new Set);n.useEffect(()=>{k(new Set)},[h]),n.useEffect(()=>{const s={niche:m,style:b,ideas:h,currentSessionId:O,useWebResearch:I};localStorage.setItem(ve,JSON.stringify(s))},[m,b,h,O,I]),n.useEffect(()=>{l?(ke(),_e()):M(!1)},[l]),n.useEffect(()=>{if(!C)return;const s=A.find(t=>t.id===C);if(s)if(s.status==="completed"&&s.result){const t=s.result;S(t),N(!1),l&&x.from("idea_sessions").insert({user_id:l.id,niche:m,style:b,ideas:t}).select().single().then(({data:r,error:a})=>{a?console.error("Error saving session:",a):r&&R(r.id)}),localStorage.removeItem(p),f(null),d.success(`Generated ${t.length} video ideas!`)}else s.status==="failed"&&(N(!1),localStorage.removeItem(p),f(null),d.error(s.error||"Failed to generate ideas"))},[A,C,l,m,b]),n.useEffect(()=>{if(!v||!C||A.find(i=>i.id===C))return;const t=localStorage.getItem(p);if(!t){N(!1),f(null);return}const r=A.find(i=>{var o;return i.type==="ideas"&&((o=i.metadata)==null?void 0:o.jobId)===t&&i.status==="generating"});if(r){f(r.id);return}const a=E("ideas",`Ideas: ${m.slice(0,30)}`,{jobId:t});f(a)},[v,C,A,E,m]);const ke=async()=>{try{const s=localStorage.getItem(p);if(s){const{data:a,error:i}=await x.from("idea_jobs").select("*").eq("id",s).eq("user_id",l.id).single(),o=a?Date.now()-new Date(a.created_at).getTime():1/0,g=3*60*1e3;if(!i&&a&&(a.status==="pending"||a.status==="processing")&&o<g){F(a.niche),L(a.style),N(!0),S([]);const w=E("ideas",`Ideas: ${a.niche.slice(0,30)}`,{jobId:s});f(w);return}else if(!i&&a&&(a.status==="pending"||a.status==="processing")&&o>=g)localStorage.removeItem(p),await x.from("idea_jobs").update({status:"failed",error_message:"Job timed out (stale)",updated_at:new Date().toISOString()}).eq("id",s);else if(!i&&a&&a.status==="completed"&&a.ideas){const w=a.ideas;F(a.niche),L(a.style),S(w),localStorage.removeItem(p);const{data:le}=await x.from("idea_sessions").insert({user_id:l.id,niche:a.niche,style:a.style,ideas:w}).select().single();le&&R(le.id),d.success(`Generated ${w.length} video ideas!`);return}else localStorage.removeItem(p)}const t=new Date(Date.now()-3*60*1e3).toISOString(),{data:r}=await x.from("idea_jobs").select("*").eq("user_id",l.id).in("status",["pen
6ding","processing"]).gte("created_at",t).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(r){F(r.niche),L(r.style),N(!0),S([]),localStorage.setItem(p,r.id);const a=E("ideas",`Ideas: ${r.niche.slice(0,30)}`,{jobId:r.id});f(a);return}await ae()}catch(s){console.error("Error checking active jobs:",s),await ae()}},ae=async()=>{try{const{data:s,error:t}=await x.from("idea_sessions").select("*").eq("user_id",l.id).order("created_at",{ascending:!1}).limit(1).single();t&&t.code!=="PGRST116"&&console.error("Error loading session:",t),s&&(F(s.niche),L(s.style),S(s.ideas),R(s.id))}catch(s){console.error("Error loading last session:",s)}},_e=async()=>{M(!0);try{const{data:s,error:t}=await x.from("saved_ideas").select("*").eq("user_id",l.id).is("deleted_at",null).order("created_at",{ascending:!1}).limit(50);if(t)throw t;s&&(B(s),q(new Set(s.map(r=>r.title))))}catch(s){console.error("Error loading saved ideas:",s)}finally{M(!1)}},Te=()=>{if(!m.trim()){d.error("Please enter a niche");return}h.length>0?P(!0):oe()},oe=async()=>{P(!1);const s=G("ideas")+(I?G("web_research"):0);if(je(s)){N(!0),S([]);try{const{data:t,error:r}=await x.from("idea_jobs").insert({user_id:l.id,niche:m,style:b,status:"pending"}).select().single();if(r||!t)throw new Error((r==null?void 0:r.message)||"Failed to create job");const a=t.id;localStorage.setItem(p,a);const i=E("ideas",`Ideas: ${m.slice(0,30)}`,{jobId:a});f(i);const{data:o,error:g}=await x.functions.invoke("generate-ideas",{body:{niche:m,style:b,jobId:a,useWebResearch:I||void 0}});if(g){console.error("Edge function invoke error:",g);return}if((o==null?void 0:o.status)==="completed"&&(o!=null&&o.ideas)){Q(i,{status:"completed",result:o.ideas});return}if((o==null?void 0:o.status)==="failed"){Q(i,{status:"failed",error:(o==null?void 0:o.error)||"Failed to generate ideas"});return}}catch(t){console.error("Generation error:",t),N(!1),localStorage.removeItem(p),f(null),Ve(t,T)||d.error(t.message||"Failed to generate ideas")}}},Ae=async(s,t,r)=>{r.stopPropagation(),await navigator.clipboard.writeText(s.title),H(t),d.success("Title copied!"),setTimeout(()=>H(null),2e3)},ie=(s,t)=>{t==null||t.stopPropagation(),T("/dashboard/scriptwriter",{state:{videoTitle:s.title,topic:s.hook}})},Ee=async(s,t,r)=>{if(r.stopPropagation(),!l){d.error("Please sign in to save ideas");return}if(D.has(s.title)){d.info("This idea is already saved");return}Y(t);try{const{data:a,error:i}=await x.from("saved_ideas").insert({user_id:l.id,title:s.title,hook:s.hook,emotion:s.emotion,difficulty:s.difficulty,content_type:s.contentType,source_session_id:O,niche:m||"Uncategorized"}).select().single();if(i)throw i;a&&(B(o=>[a,...o]),q(o=>new Set([...o,s.title])),d.success("Idea saved!"))}catch(a){console.error("Error saving idea:",a),d.error("Failed to save idea")}finally{Y(null)}},Ge=async(s,t)=>{try{await We("saved_ideas",s),B(r=>r.filter(a=>a.id!==s)),q(r=>{const a=new Set(r);return a.delete(t),a}),d.success("Idea moved to bin")}catch(r){console.error("Error deleting saved idea:",r),d.error("Failed to delete idea")}},Fe=s=>{k(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},Le=async()=>{if(!l||j.size===0)return;const t=Array.from(j).map(r=>h[r]).filter(r=>!D.has(r.title));if(t.length===0){d.info("All selected ideas are already saved");return}X(!0);try{const r=t.map(o=>({user_id:l.id,title:o.title,hook:o.hook,emotion:o.emotion,difficulty:o.difficulty,content_type:o.contentType,source_session_id:O,niche:m||"Uncategorized"})),{data:a,error:i}=await x.from("saved_ideas").insert(r).select();if(i)throw i;a&&(B(o=>[...a,...o]),q(o=>new Set([...o,...t.map(g=>g.title)])),d.success(`${t.length} idea${t.length>1?"s":""} saved!`)),k(new Set)}catch(r){console.error("Error bulk saving ideas:",r),d.error("Failed to save ideas")}finally{X(!1)}},ze=s=>{Ce(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},$=n.useMemo(()=>z.reduce((s,t)=>{const r=t.niche||"Uncategorized";return s[r]||(s[r]=[]),s[r].push(t),s},{}),[z]),ne=n.useMemo(()=>{if(!J.trim())return $;const s=J.toLowerCase(),t={};return Object.entries($).forEach(([r,a])=>{const i=a.filter(o=>{var g,w;return o.title.toLowerCase().includes(s)||o.hook.toLowerCase().includes(s)||((g=o.emotion)==null?void 0:g.toLowerCase().includes(s))||((w=o.content_type)==null?void 0:w.toLowerCase().includes(s))});i.length>0&&(t[r]=i)}),t},[$,J]);return e.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[e.jsx(es,{open:Ie,onOpenChange:P,children:e.jsxs(ss,{children:[e.jsxs(ts,{children:[e.jsx(rs,{children:"Replace current ideas?"}),e.jsxs(as,{children:["Generating new ideas will replace your current ",h.length," ideas. Make sure you've saved any ideas you want to keep using the bookmark button."]})]}),e.jsxs(os,{children:[e.jsx(is,{children:"Cancel"}),e.jsx(ns,{onClick:oe,children:"Generate New Ideas"})]})]})}),e.jsx(_.div,{initial:{opacity:0,y:-20}
6,animate:{opacity:1,y:0},className:"mb-8",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-primary to-accent flex items-center justify-center shadow-lg shadow-primary/30",children:e.jsx(ce,{className:"w-6 h-6 text-primary-foreground"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"AI Ideation"}),e.jsx("p",{className:"text-muted-foreground",children:"Discover viral video topics for your niche"})]})]})}),e.jsxs(Qe,{value:ee,onValueChange:se,className:"w-full",children:[e.jsxs(He,{className:"mb-6",children:[e.jsx(he,{value:"create",children:"Create"}),e.jsxs(he,{value:"library",className:"gap-2",children:["Library",z.length>0&&e.jsx("span",{className:"ml-1 px-2 py-0.5 rounded-full bg-primary/20 text-primary text-xs font-medium",children:z.length})]})]}),e.jsxs(xe,{value:"create",children:[e.jsx(_.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"bg-card border border-border rounded-2xl p-6 mb-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(ue,{htmlFor:"niche",className:"text-sm font-medium mb-2 block",children:"What's your niche or topic area?"}),e.jsx(me,{id:"niche",placeholder:"e.g., Personal finance, Gaming, Fitness, Tech reviews, Cooking...",value:m,onChange:s=>F(s.target.value),className:"py-6 text-base rounded-xl",disabled:v})]}),e.jsxs("div",{children:[e.jsx(ue,{className:"text-sm font-medium mb-3 block",children:"Content Style"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:ps.map(s=>e.jsxs("button",{onClick:()=>L(s.value),disabled:v,className:y("p-4 rounded-xl border-2 transition-all text-left",b===s.value?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:[e.jsx(s.icon,{className:y("w-5 h-5 mb-2",b===s.value?"text-primary":"text-muted-foreground")}),e.jsx("p",{className:"font-medium text-sm",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s.description})]},s.value))})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-border bg-background/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:["Web Research ",e.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["(+",G("web_research")," credits)"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Search the web for current trends and events"})]})]}),e.jsx(Ue,{checked:I,onCheckedChange:we,disabled:v})]}),e.jsx(u,{onClick:Te,disabled:v||!m.trim(),className:"w-full py-6 text-lg rounded-xl gradient-button text-white border-0",children:v?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-5 h-5 mr-2 animate-spin"}),"Finding viral ideas..."]}):e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-5 h-5 mr-2"}),"Generate Video Ideas",e.jsxs("span",{className:"ml-2 text-sm opacity-80",children:["(",(G("ideas")+(I?G("web_research"):0)).toFixed(2)," credits)"]})]})})]})}),e.jsx(ge,{children:h.length>0&&e.jsxs(_.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(U,{className:"w-5 h-5 text-primary"}),h.length," Video Ideas Generated"]}),e.jsx("div",{className:"flex items-center gap-2",children:j.size>0?e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>k(new Set),children:"Deselect All"}):e.jsx(u,{variant:"ghost",size:"sm",onClick:()=>k(new Set(h.map((s,t)=>t))),children:"Select All"})})]}),e.jsx("div",{className:"grid gap-4",children:h.map((s,t)=>{var r,a;return e.jsx(_.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.05},onClick:()=>Fe(t),className:y("bg-card border rounded-2xl p-5 transition-all cursor-pointer group",j.has(t)?"border-primary bg-primary/10 ring-2 ring-primary/20":"border-border hover:shadow-lg hover:border-primary/20"),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:y("w-5 h-5 rounded border-2 flex items-center justify-center shrink-0 mt-1 transition-colors",j.has(t)?"bg-primary border-primary":"border-muted-foreground
6/30"),children:j.has(t)&&e.jsx(pe,{className:"w-3 h-3 text-primary-foreground"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-foreground text-lg mb-2 group-hover:text-primary transition-colors",children:s.title}),e.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:s.hook}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:y("text-xs font-medium px-2.5 py-1 rounded-full",ye[(r=s.emotion)==null?void 0:r.toLowerCase()]||"bg-muted text-muted-foreground"),children:s.emotion}),e.jsx("span",{className:y("text-xs font-medium px-2.5 py-1 rounded-full",be[(a=s.difficulty)==null?void 0:a.toLowerCase()]||"bg-muted text-muted-foreground"),children:s.difficulty}),e.jsx("span",{className:"text-xs font-medium px-2.5 py-1 rounded-full bg-primary/10 text-primary",children:s.contentType})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(u,{variant:"ghost",size:"icon",onClick:i=>Ee(s,t,i),disabled:K===t,className:y("h-9 w-9",D.has(s.title)&&"text-primary"),title:D.has(s.title)?"Already saved":"Save idea",children:K===t?e.jsx(W,{className:"w-4 h-4 animate-spin"}):D.has(s.title)?e.jsx(ls,{className:"w-4 h-4"}):e.jsx(V,{className:"w-4 h-4"})}),e.jsx(u,{variant:"ghost",size:"icon",onClick:i=>Ae(s,t,i),className:"h-9 w-9",children:Ne===t?e.jsx(pe,{className:"w-4 h-4 text-green-500"}):e.jsx(cs,{className:"w-4 h-4"})}),e.jsx(u,{variant:"ghost",size:"icon",onClick:i=>ie(s,i),className:"h-9 w-9",title:"Use in Scriptwriter",children:e.jsx(de,{className:"w-4 h-4"})})]})]})},t)})})]})}),h.length===0&&!v&&e.jsxs(_.div,{initial:{opacity:0}
6,animate:{opacity:1},className:"text-center py-16",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-3xl bg-gradient-to-br from-primary/10 to-accent/10 flex items-center justify-center",children:e.jsx(ce,{className:"w-10 h-10 text-primary/50"})}),e.jsx("h3",{className:"text-lg font-medium text-muted-foreground mb-2",children:"Find your next viral hit"}),e.jsx("p",{className:"text-sm text-muted-foreground/70 max-w-md mx-auto",children:"Enter your niche above and let AI discover trending, high-potential video ideas that can help grow your channel."})]})]}),e.jsxs(xe,{value:"library",children:[e.jsxs("div",{className:"relative mb-6",children:[e.jsx(fe,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),e.jsx(me,{placeholder:"Search saved ideas...",value:J,onChange:s=>te(s.target.value),className:"pl-12 py-6 text-base rounded-xl"})]}),Se?e.jsx("div",{className:"space-y-3",children:[...Array(4)].map((s,t)=>e.jsx(Ke,{className:"h-24 w-full rounded-xl"},t))}):z.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-3xl bg-gradient-to-br from-primary/10 to-accent/10 flex items-center justify-center",children:e.jsx(V,{className:"w-10 h-10 text-primary/50"})}),e.jsx("h3",{className:"text-lg font-medium text-muted-foreground mb-2",children:"No saved ideas yet"}),e.jsx("p",{className:"text-sm text-muted-foreground/70 max-w-md mx-auto mb-6",children:"Generate ideas and click the bookmark icon to save them here. Ideas are organized by niche."}),e.jsxs(u,{onClick:()=>se("create"),children:[e.jsx(U,{className:"w-4 h-4 mr-2"}),"Generate Ideas"]})]}):Object.keys(ne).length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(fe,{className:"w-12 h-12 mx-auto text-muted-foreground/30 mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No ideas match your search"}),e.jsx(u,{variant:"link",onClick:()=>te(""),className:"mt-2",children:"Clear search"})]}):e.jsx("div",{className:"space-y-4",children:Object.entries(ne).map(([s,t])=>e.jsx(Ye,{open:!re.has(s),onOpenChange:()=>ze(s),children:e.jsxs("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:[e.jsxs(Ze,{className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-muted/50 transition-colors",children:[re.has(s)?e.jsx(Re,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Pe,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ds,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"font-medium flex-1 text-left",children:s}),e.jsxs("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5 text-muted-foreground",children:[t.length," idea",t.length!==1?"s":""]})]}),e.jsx(Xe,{children:e.jsx("div",{className:"border-t border-border",children:t.map(r=>{var a,i;return e.jsx("div",{className:"px-4 py-4 border-b border-border last:border-b-0 hover:bg-muted/30 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"font-medium text-foreground mb-1 truncate",children:r.title}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:r.hook}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.emotion&&e.jsx("span",{className:y("text-xs font-medium px-2 py-0.5 rounded-full",ye[(a=r.emotion)==null?void 0:a.toLowerCase()]||"bg-muted text-muted-foreground"),children:r.emotion}),r.difficulty&&e.jsx("span",{className:y("text-xs font-medium px-2 py-0.5 rounded-full",be[(i=r.difficulty)==null?void 0:i.toLowerCase()]||"bg-muted text-muted-foreground"),children:r.difficulty}),r.content_type&&e.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:r.content_type})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>ie(r),className:"h-8 px-3",children:[e.jsx(de,{className:"w-3 h-3 mr-1"}),"Script"]}),e.jsx(u,{size:"icon",variant:"ghost",onClick:()=>Ge(r.id,r.title),className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx($e,{className:"w-4 h-4"})})]})]})},r.id)})})})]})},s))})]})]}),e.jsx(ge,{children:j.size>0&&ee==="create"&&e.jsx(_.div,{initial:{opacity:0,y:20}
6,animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-full bg-background border border-border shadow-lg",children:[e.jsxs("span",{className:"text-sm font-medium",children:[j.size," selected"]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs(u,{size:"sm",onClick:Le,disabled:Z,children:[Z?e.jsx(W,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(V,{className:"w-4 h-4 mr-2"}),"Save Selected"]}),e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>k(new Set),children:"Clear"})]})})})]})}export{Rs 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.