1import{u as ve,w as ye,K as _e,a0 as be,r as x,$ as Ne,N as n,aU as ie,j as e,I as z,a5 as A,L as ne,B as b,a7 as we,a8 as Ce,a9 as Pe,at as ke,T as Se,aw as N,ah as Fe,aN as Ae,ag as Ee,ap as qe,aO as Ie,az as $}from"./index-ncH4CRZS.js";import{z as c,u as Le,t as Te}from"./index-Z79-0VeN.js";import{T as oe}from"./textarea-LTZgJtsi.js";import{S as Ue,a as De,b as ze,c as $e,d as v}from"./select-D_TXHlrF.js";import{F as Be,a as d,b as m,c as u,d as h,e as p}from"./form-Dw7cAv1o.js";import{R as w}from"./RichTextEditor-OS7N0jWs.js";import{C}from"./checkbox-BcUIJEMj.js";import{A as Re,a as Ge,b as Je,c as He,d as Me,e as Oe,f as Qe,g as Ve,h as Ye}from"./alert-dialog-BnRMhYt4.js";import{a as Ke}from"./usePersonas-Behdbo5T.js";import{u as We}from"./useInsights-DD5VB0Dw.js";import{a as Xe}from"./useUserNeeds-B8vMy77F.js";import{u as Ze}from"./useExperiments-D-qiiX-R.js";import{u as es}from"./useJourneys-r1XLV9JH.js";import{u as ss}from"./usePolicies-BgmQPmN0.js";import{P as rs}from"./PageActionBar-D-zJVYPa.js";import{F as y}from"./FormSection-BKcwndiA.js";import{F as as}from"./FormPageLayout-BgGdJxbi.js";import"./index-BdQq_4o_.js";import"./isEqual-BC5tzDZV.js";import"./dialog-D5nIJMtd.js";import"./tabs-DSB4Hz_q.js";import"./scroll-area-Cs-Jq6s9.js";import"./useMediaLibrary-BzTsksnM.js";import"./articleContent-CGNC_AoC.js";import"./statusPalette-CqyxNXfS.js";const ts=c.object({name:c.string().min(1,"Name is required"),age:c.string().optional(),location:c.string().optional(),role:c.enum(["homeowner","tenant","landlord","policy_maker","academic_researcher","community_advocate","contractor","local_authority"]),property:c.string().optional(),household:c.string().optional(),occupation:c.string().optional(),income:c.string().optional(),description:c.string().optional(),retrofit_summary:c.string().optional(),motivations:c.string().optional(),challenges:c.string().optional(),biases_and_heuristics:c.string().optional(),research_quotes:c.string().optional(),size_of_prize:c.string().optional()}),As=()=>{const{slug:B}=ve(),le=ye(),{toast:j}=_e(),ce=be(),{data:r,isLoading:de,error:me}=Ke(B),{data:R=[]}=We(),{data:G=[]}=Xe(),{data:J=[]}=Ze(),{data:H=[]}=es(),{data:he=[]}=ss(),pe=new Date().getFullYear(),M=he.filter(s=>{if(!s.end_year)return!0;const a=parseInt(s.end_year);return isNaN(a)||a>=pe}).filter(s=>{var a;return!((a=s.level)!=null&&a.includes("(local)"))}),O=x.useRef(null),[P,Q]=x.useState(null),[E,q]=x.useState(""),[k,S]=x.useState(!1),[F,V]=x.useState(!1),[I,Y]=x.useState([]),[L,K]=x.useState([]),[T,W]=x.useState([]),[U,X]=x.useState([]),[D,Z]=x.useState([]),{data:_}=Ne({queryKey:["persona-links",r==null?void 0:r.id],queryFn:async()=>{var l,se,re,ae,te;if(!r)return null;const[s,a,t,o,g]=await Promise.all([n.from("insight_personas").select("insight_id").eq("persona_id",r.id),n.from("user_need_personas").select("user_need_id").eq("persona_id",r.id),n.from("experiment_personas").select("experiment_id").eq("persona_id",r.id),n.from("journey_personas").select("journey_id").eq("persona_id",r.id),n.from("policy_personas").select("policy_id").eq("persona_id",r.id)]);return{insights:((l=s.data)==null?void 0:l.map(f=>f.insight_id).filter(Boolean))||[],userNeeds:((se=a.data)==null?void 0:se.map(f=>f.user_need_id).filter(Boolean))||[],experiments:((re=t.data)==null?void 0:re.map(f=>f.experiment_id).filter(Boolean))||[],journeys:((ae=o.data)==null?void 0:ae.map(f=>f.journey_id).filter(Boolean))||[],policies:((te=g.data)==null?void 0:te.map(f=>f.policy_id).filter(Boolean))||[]}},enabled:!!r});ie.useEffect(()=>{_&&(Y(_.insights),K(_.userNeeds),W(_.experiments),X(_.journeys),Z(_.policies))},[_]);const i=Le({resolver:Te(ts),defaultValues:{name:"",age:"",location:"",role:"homeowner",property:"",household:"",occupation:"",income:"",description:"",retrofit_summary:"",motivations:"",challenges:"",biases_and_heuristics:"",research_quotes:"",size_of_prize:""}});ie.useEffect(()=>{var s;r&&(i.reset({name:r.name||"",age:((s=r.age)==null?void 0:s.toString())||"",location:r.location||"",role:r.role||"homeowner",property:r.property||"",household:r.household||"",occupation:r.occupation||"",income:r.income||"",description:r.description||"",retrofit_summary:r.retrofit_summary||"",motivations:r.motivations||"",challenges:r.challenges||"",biases_and_heuristics:r.biases_and_heuristics||"",research_quotes:r.research_quotes||"",size_of_prize:r.size_of_prize||""}),q(r.avatar_url||""))},[r,i]);const ue=s=>{var t;const a=(t=s.target.files)==null?void 0:t[0];if(a)if(a.type==="image/png"||a.type==="image/jpeg"||a.type==="image/jpg"){Q(a);const o=URL.createObjectURL(a);q(o)}else j({title:"Invalid file type",description:"Please select a PNG or JPG file.",variant:"destructive"})},xe=async()=>
1{if(!P||!r)return null;try{S(!0);const s=P.name.split(".").pop(),a=`${r.id}.${s}`,{error:t}=await n.storage.from("persona-avatars").upload(a,P,{upsert:!0});if(t)throw t;const{data:o}=n.storage.from("persona-avatars").getPublicUrl(a);return o.publicUrl}catch(s){return console.error("Error uploading avatar:",s),j({title:"Upload failed",description:"Failed to upload avatar image.",variant:"destructive"}),null}finally{S(!1)}},je=async()=>{if(r!=null&&r.avatar_url)try{const s=r.avatar_url.split("/"),a=s[s.length-1];a&&await n.storage.from("persona-avatars").remove([a]),q(""),Q(null),j({title:"Avatar deleted",description:"Avatar image has been removed."})}catch(s){console.error("Error deleting avatar:",s),j({title:"Delete failed",description:"Failed to delete avatar image.",variant:"destructive"})}},ge=!!(i.watch("name")&&i.watch("role")&&i.watch("location")&&i.watch("description")&&i.watch("retrofit_summary")&&i.watch("motivations")&&i.watch("challenges")),ee=async(s="generate")=>{var a;if(r){V(!0);try{const{data:t}=await n.auth.getSession();if(!((a=t==null?void 0:t.session)==null?void 0:a.access_token)){j({title:"Error",description:"You must be logged in",variant:"destructive"});return}const{data:g,error:l}=await n.functions.invoke("generate-persona-prompt",{body:{personaId:r.id,mode:s}});if(l)throw l;j({title:s==="regenerate"?"Chat prompt evolved":"Chat prompt generated",description:s==="regenerate"?"The chatbot personality has been evolved based on your latest changes. The previous version has been saved to history.":"The chatbot personality has been created. Chat is now available for this persona."}),ce.invalidateQueries({queryKey:["persona","slug",B]})}catch(t){console.error("Error generating prompt:",t),j({title:"Generation failed",description:(t==null?void 0:t.message)||"Failed to generate chat prompt. Please try again.",variant:"destructive"})}finally{V(!1)}}},fe=async s=>{if(r)try{S(!0);let a=r.avatar_url;if(P){const l=await xe();l&&(a=l)}else!E&&r.avatar_url&&(a=null);const{data:{user:t}}=await n.auth.getUser(),{error:o}=await n.from("personas").update({name:s.name,age:s.age?parseInt(s.age):null,location:s.location||null,role:s.role,property:s.property||null,household:s.household||null,occupation:s.occupation||null,income:s.income||null,description:s.description||null,retrofit_summary:s.retrofit_summary||null,motivations:s.motivations||null,challenges:s.challenges||null,biases_and_heuristics:s.biases_and_heuristics||null,research_quotes:s.research_quotes||null,size_of_prize:s.size_of_prize||null,avatar_url:a,updated_at:new Date().toISOString(),last_updated_by:t==null?void 0:t.id}).eq("id",r.id);if(o)throw o;await Promise.all([n.from("insight_personas").delete().eq("persona_id",r.id),n.from("user_need_personas").delete().eq("persona_id",r.id),n.from("experiment_personas").delete().eq("persona_id",r.id),n.from("journey_personas").delete().eq("persona_id",r.id),n.from("policy_personas").delete().eq("persona_id",r.id)]);const g=[];I.length>0&&g.push(n.from("insight_personas").insert(I.map(l=>({persona_id:r.id,insight_id:l})))),L.length>0&&g.push(n.from("user_need_personas").insert(L.map(l=>({persona_id:r.id,user_need_id:l})))),T.length>0&&g.push(n.from("experiment_personas").insert(T.map(l=>({persona_id:r.id,experiment_id:l})))),U.length>0&&g.push(n.from("journey_personas").insert(U.map(l=>({persona_id:r.id,journey_id:l})))),D.length>0&&g.push(n.from("policy_personas").insert(D.map(l=>({persona_id:r.id,policy_id:l})))),await Promise.all(g),j({title:"Success",description:"Persona updated successfully"}),le(`/personas/${r.slug}`)}catch(a){console.error("Error updating persona:",a),j({title:"Error",description:"Failed to update persona",variant:"destructive"})}finally{S(!1)}};return de?e.jsx(z,{children:e.jsxs("div",{className:"flex justify-center items-center py-12",children:[e.jsx(A,{className:"h-8 w-8 animate-spin text-gray-500"}),e.jsx("span",{className:"ml-2 text-gray-600",children:"Loading persona..."})]})}):me||!r?e.jsx(z,{children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-red-600 mb-4",children:"Error loading persona. Please try again."}
1),e.jsx(ne,{to:"/personas",children:e.jsx(b,{children:"Back to Personas"})})]})}):e.jsxs(z,{children:[e.jsx(rs,{backTo:`/personas/${r.slug}`,backLabel:"Persona"}),e.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("h2",{className:"text-3xl font-semibold text-brand-dark-blue",children:"Edit Persona"}),e.jsx(Be,{...i,children:e.jsx("form",{onSubmit:i.handleSubmit(fe),children:e.jsxs(as,{actions:e.jsxs(e.Fragment,{children:[e.jsx(ne,{to:`/personas/${r.slug}`,children:e.jsx(b,{type:"button",variant:"outline",children:"Cancel"})}),e.jsx(b,{type:"submit",variant:"orange",disabled:k||i.formState.isSubmitting,children:k||i.formState.isSubmitting?e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"h-4 w-4 mr-2 animate-spin"}),"Updating..."]}):"Update Persona"})]}),children:[e.jsxs(y,{title:"Avatar",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs(we,{className:"h-24 w-24",children:[e.jsx(Ce,{src:E,alt:r.name}),e.jsx(Pe,{className:"text-2xl bg-primary/10",children:r.name.split(" ").map(s=>s[0]).join("")})]}),e.jsxs("div",{className:"space-x-2",children:[e.jsxs(b,{type:"button",variant:"outline",onClick:()=>{var s;return(s=O.current)==null?void 0:s.click()},disabled:k,children:[e.jsx(ke,{className:"h-4 w-4 mr-2"}),"Upload"]}),E&&e.jsxs(b,{type:"button",variant:"outline",onClick:je,disabled:k,children:[e.jsx(Se,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]}),e.jsx("input",{ref:O,type:"file",accept:".png,.jpg,.jpeg",onChange:ue,className:"hidden"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Accepted formats: PNG, JPG (max 5MB)"})]}),e.jsxs(y,{title:"1. About",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(d,{control:i.control,name:"name",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Name"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Enter persona name",...s})}),e.jsx(p,{})]})}),e.jsx(d,{control:i.control,name:"age",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Age"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Age",...s})}),e.jsx(p,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(d,{control:i.control,name:"location",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Location"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Location",...s})}),e.jsx(p,{})]})}),e.jsx(d,{control:i.control,name:"role",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Role"}),e.jsxs(Ue,{onValueChange:s.onChange,value:s.value,children:[e.jsx(h,{children:e.jsx(De,{children:e.jsx(ze,{placeholder:"Select role"})})}),e.jsxs($e,{children:[e.jsx(v,{value:"homeowner",children:"Homeowner"}),e.jsx(v,{value:"tenant",children:"Tenant"}),e.jsx(v,{value:"landlord",children:"Landlord"}),e.jsx(v,{value:"policy_maker",children:"Policy Maker"}),e.jsx(v,{value:"academic_researcher",children:"Academic Researcher"}),e.jsx(v,{value:"community_advocate",children:"Community Advocate"}),e.jsx(v,{value:"contractor",children:"Contractor"}),e.jsx(v,{value:"local_authority",children:"Local Authority"})]})]}),e.jsx(p,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(d,{control:i.control,name:"property",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Property"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Property type/details",...s})}),e.jsx(p,{})]})}),e.jsx(d,{control:i.control,name:"household",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Household"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Household composition",...s})}),e.jsx(p,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(d,{control:i.control,name:"occupation",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Occupation"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Occupation",...s})}),e.jsx(p,{})]})}),e.jsx(d,{control:i.control,name:"income",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Income"}),e.jsx(h,{children:e.jsx(N,{placeholder:"Income level/range",...s})}),e.jsx(p,{})]})})]}),e.jsx(d,{control:i.control,name:"description",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"General Description"}),e.jsx(h,{children:e.jsx(oe,{placeholder:"Brief description of this persona",...s})}),e.jsx(p,{})]})})]}),e.jsx(y,{title:"2. Retrofit Summary",wide:!0,children:e.jsx(d,{control:i.control,name:"retrofit_summary",render:({field:s})=>e.jsxs(m,{children:[e.jsx(h,{children:e.jsx(w,{value:s.value||"",onChange:s.onChange,placeholder:"Detailed retrofit summary with formatting..."})}),e.jsx(p,{})]})})}),e.jsxs(y,{title:"3. Behaviours",wide:!0,children:[e.jsx(d,{control:i.control,name:"motivations",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Motivations"}),e.jsx(h,{children:e.jsx(w,{value:s.value||"",onChange:s.onChange,placeholder:"Describe motivations with formatting..."})}),e.jsx(p,{})]})}),e.jsx(d,{control:i.control,name:"challenges",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Challenges"}),e.jsx(h,{children:e.jsx(w,{value:s.value||"",onChange:s.onChange,placeholder:"Describe challenges with formatting..."})}),e.jsx(p,{})]})}),e.jsx(d,{control:i.control,name:"biases_and_heuristics",render:({field:s})=>e.jsxs(m,{children:[e.jsx(u,{children:"Biases and Heuristics"}),e.jsx(h,{children:e.jsx(w,{value:s.value||"",onChange:s.onChange,placeholder:"Describe biases and heuristics with formatting..."})}),e.jsx(p,{})]})})]}),e.jsx(y,{title:"4. Research Quotes",children:e.jsx(d,{control:i.control,name:"research_quotes",render:({field:s})=>e.jsxs(m,{children:[e.jsx(h,{children:e.jsx(oe,{placeholder:"Paste real quotes from research interviews with this person or people like them. These help the AI understand how they speak, their vocabulary, accent, and emotional tone.",className:"min-h-[120px]",...s})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Verbatim quotes help the AI generate a more authentic chatbot voice. Include dialect, slang, and natural speech patterns."}),e.jsx(p,{})]})})}),e.jsx(y,{title:"5. Size of the Prize",children:e.jsx(d,{control:i.control,name:"size_of_prize",render:({field:s})=>e.jsxs(m,{children:[e.jsx(h,{children:e.jsx(w,{value:s.value||"",onChange:s.onChange,placeholder:"Describe the potential impact and value..."})}),e.jsx(p,{})]})})}),e.jsxs(y,{title:"6. Linked Items",wide:!0,children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Fe,{className:"h-5 w-5",style:{color:"#284d5e"}}),e.jsx("h4",{className:"font-medium",style:{color:"#284d5e"},children:"Insights"})]}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-md p-3 bg-white/50",children:R.length>0?R.map(s=>e.jsxs("div",{className:"flex items-center space-x-3 py-1",children:[e.jsx(C,{id:`insight-${s.id}
1`,checked:I.includes(s.id),onCheckedChange:a=>{Y(t=>a?[...t,s.id]:t.filter(o=>o!==s.id))}}),e.jsx("label",{htmlFor:`insight-${s.id}`,className:"text-sm cursor-pointer flex-1",children:s.title})]},s.id)):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No insights available"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ae,{className:"h-5 w-5",style:{color:"#284d5e"}}),e.jsx("h4",{className:"font-medium",style:{color:"#284d5e"},children:"User Needs"})]}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-md p-3 bg-white/50",children:G.length>0?G.map(s=>e.jsxs("div",{className:"flex items-center space-x-3 py-1",children:[e.jsx(C,{id:`userneed-${s.id}`,checked:L.includes(s.id),onCheckedChange:a=>{K(t=>a?[...t,s.id]:t.filter(o=>o!==s.id))}}),e.jsxs("label",{htmlFor:`userneed-${s.id}`,className:"text-sm cursor-pointer flex-1",children:[e.jsx("span",{className:"text-muted-foreground mr-2",children:s.identifier}),s.action]})]},s.id)):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No user needs available"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ee,{className:"h-5 w-5",style:{color:"#284d5e"}}),e.jsx("h4",{className:"font-medium",style:{color:"#284d5e"},children:"Experiments"})]}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-md p-3 bg-white/50",children:J.length>0?J.map(s=>e.jsxs("div",{className:"flex items-center space-x-3 py-1",children:[e.jsx(C,{id:`experiment-${s.id}`,checked:T.includes(s.id),onCheckedChange:a=>{W(t=>a?[...t,s.id]:t.filter(o=>o!==s.id))}}),e.jsx("label",{htmlFor:`experiment-${s.id}`,className:"text-sm cursor-pointer flex-1",children:s.title})]},s.id)):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No experiments available"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(qe,{className:"h-5 w-5",style:{color:"#284d5e"}}),e.jsx("h4",{className:"font-medium",style:{color:"#284d5e"},children:"Journeys"})]}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-md p-3 bg-white/50",children:H.length>0?H.map(s=>e.jsxs("div",{className:"flex items-center space-x-3 py-1",children:[e.jsx(C,{id:`journey-${s.id}`,checked:U.includes(s.id),onCheckedChange:a=>{X(t=>a?[...t,s.id]:t.filter(o=>o!==s.id))}}),e.jsxs("label",{htmlFor:`journey-${s.id}`,className:"text-sm cursor-pointer flex-1",children:[e.jsx("span",{className:"text-muted-foreground mr-2",children:s.identifier}),s.title]})]},s.id)):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No journeys available"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ie,{className:"h-5 w-5",style:{color:"#284d5e"}}),e.jsx("h4",{className:"font-medium",style:{color:"#284d5e"},children:"Policies"})]}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-md p-3 bg-white/50",children:M.length>0?M.map(s=>e.jsxs("div",{className:"flex items-center space-x-3 py-1",children:[e.jsx(C,{id:`policy-${s.id}`,checked:D.includes(s.id),onCheckedChange:a=>{Z(t=>a?[...t,s.id]:t.filter(o=>o!==s.id))}}),e.jsx("label",{htmlFor:`policy-${s.id}`,className:"text-sm cursor-pointer flex-1",children:s.title})]},s.id)):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No policies available"})})]})]}),ge&&e.jsxs(y,{title:"Chat Prompt",icon:$,children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r.system_prompt_template?"This persona has a chat prompt. You can evolve it to incorporate any changes you've made above. The current version will be saved to history.":"This persona has enough information to generate a chat prompt. Click below to create one using AI."}),r.system_prompt_template?e.jsxs(Re,{children:[e.jsx(Ge,{asChild:!0,children:e.jsx(b,{type:"button",variant:"outline",disabled:F,children:F?e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"h-4 w-4 mr-2 animate-spin"}),"Evolving..."]}):e.jsxs(e.Fragment,{children:[e.jsx($,{className:"h-4 w-4 mr-2"}),"Evolve Chat Prompt"]})})}),e.jsxs(Je,{children:[e.jsxs(He,{children:[e.jsx(Me,{children:"Evolve Chat Prompt?"}),e.jsx(Oe,{children:"This will evolve the existing prompt based on your latest changes. The current version will be saved to version history."})]}),e.jsxs(Qe,{children:[e.jsx(Ve,{children:"Cancel"}),e.jsx(Ye,{onClick:()=>ee("regenerate"),children:"Evolve Prompt"})]})]})]}):e.jsx(b,{type:"button",onClick:()=>ee("generate"),disabled:F,className:"bg-retrofit-orange hover:bg-retrofit-orange/90 text-white",children:F?e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx($,{className:"h-4 w-4 mr-2"}),"Generate Chat Prompt"]})})]})]})})})]})})]})};export{As 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.