1import{r as c,j as e,B as g,C as Be,m as Ne,L as v,I as b,X as rs,k as _,U as ie,w as le,a0 as is,x as ne,y as oe,z as de,Y as Re,P as w,Z as ls,f as ns,D as je,t as y}from"./index-IxvR3ybE.js";import{T as we}from"./textarea-DABzMORD.js";import{S as Je}from"./switch-CVhsjzBh.js";import{T as os,a as ds,b as Oe,c as G,d as cs,e as W}from"./table-Bw9DV5w_.js";import{Q as ms}from"./index-DxkPEvTm.js";import{u as be,w as xs}from"./xlsx-CKN5doRT.js";import{D as ps,a as hs,b as us,e as Y}from"./dropdown-menu-M0zank7A.js";import{P as vs}from"./PaymentGuard-CsV7Fhnv.js";import{S as ze,a as Pe,b as Ue,c as Me,d as Ve}from"./select-C66k4zpo.js";import{C as gs,a as js,b as bs}from"./collapsible-Bv7LRjV-.js";import{P as ye}from"./plus-ByP2IBiw.js";import{G as fs}from"./grip-vertical-D4apGd34.js";import{S as Ns}from"./settings-C-Q7RH7S.js";import{T as Se}from"./trash-2-DklbPQfi.js";import{F as X}from"./file-text-CdQl0NG5.js";import{E as ce}from"./eye-BCxLm4fq.js";import{C as ws}from"./chart-column-BItVLKl8.js";import{T as He}from"./trending-up-NAysCqrH.js";import{C as ys}from"./circle-check-big-DrZso9hg.js";import{A as Ss}from"./index-zx_GWOLj.js";import{E as _s}from"./ellipsis-vertical-mn19GxBK.js";import{Q as Cs}from"./qr-code-Dq_IS1jX.js";import{C as fe}from"./copy-l3phfS-J.js";import{S as Fs}from"./square-pen-DP9ydQSt.js";import{C as Ds}from"./clock-DaRv8o2j.js";import{S as Es}from"./share-MOlCUOba.js";import{S as ks}from"./search-DJbhdKSj.js";import"./index-PCA-xeVB.js";import"./chevron-right-f_PxsSL8.js";import"./usePaystackConfig-BiPyfAu1.js";import"./usePayment-DbOsPFvK.js";import"./loader-IuTMkbZP.js";import"./credit-card-CqkMcI0L.js";import"./useReferralCode-DoUD49Ha.js";import"./AccessCodeInput-MBolaJC1.js";import"./lock-open-BznoiT3l.js";import"./key-p_SgkhAy.js";import"./index-BdQq_4o_.js";import"./chevron-up-Kie37_ZB.js";import"./index-B7Vayqaq.js";const Qe=[{value:"text",label:"Text Input",icon:"ð"},{value:"textarea",label:"Text Area",icon:"ð"},{value:"email",label:"Email",icon:"ð§"},{value:"phone",label:"Phone",icon:"ð"},{value:"url",label:"Website URL",icon:"ð"},{value:"number",label:"Number",icon:"ð¢"},{value:"date",label:"Date",icon:"ð
"},{value:"select",label:"Dropdown",icon:"â¬ï¸"},{value:"radio",label:"Radio Buttons",icon:"ð"},{value:"checkbox",label:"Checkboxes",icon:"âï¸"},{value:"file",label:"File Upload",icon:"ð"},{value:"rating",label:"Rating",icon:"â"},{value:"address",label:"Address",icon:"ð"},{value:"currency",label:"Currency",icon:"ð°"}],Ie=({fields:D,onFieldsChange:O})=>{const[me,Z]=c.useState(null),xe=()=>{const t={id:Date.now().toString(),label:"",type:"text",required:!1,placeholder:"",description:"",validation:{},options:[],defaultValue:""};O([...D,t]),Z(t.id)},j=(t,m)=>{O(D.map(x=>x.id===t?{...x,...m}:x))},h=t=>{O(D.filter(m=>m.id!==t)),me===t&&Z(null)},pe=t=>{var x;const m=D.find(f=>f.id===t);m&&j(t,{options:[...m.options||[],`Option ${(((x=m.options)==null?void 0:x.length)||0)+1}`]})},E=(t,m,x)=>{const f=D.find(S=>S.id===t);if(f&&f.options){const S=[...f.options];S[m]=x,j(t,{options:S})}},z=(t,m)=>{const x=D.find(f=>f.id===t);x&&x.options&&j(t,{options:x.options.filter((f,S)=>S!==m)})},U=t=>{var x,f,S;const m={placeholder:t.placeholder,required:t.required,className:"w-full"};switch(t.type){case"textarea":return e.jsx(we,{...m,rows:3});case"select":return e.jsxs(ze,{children:[e.jsx(Pe,{children:e.jsx(Ue,{placeholder:t.placeholder||"Select an option"})}),e.jsx(Me,{children:(x=t.options)==null?void 0:x.map((u,N)=>{const k=(u??"").toString().trim(),q=k||`option_${N+1}`,P=k||`Option ${N+1}`;return e.jsx(Ve,{value:q,children:P},`${q}_${N}`)})})]});case"radio":return e.jsx("div",{className:"space-y-2",children:(f=t.options)==null?void 0:f.map((u,N)=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"radio",name:t.id,id:`${t.id}-${N}`}),e.jsx("label",{htmlFor:`${t.id}-${N}`,className:"text-sm",children:u})]},N))});case"checkbox":return e.jsx("div",{className:"space-y-2",children:(S=t.options)==null?void 0:S.map((u,N)=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",id:`${t.id}-${N}`}),e.jsx("label",{htmlFor:`${t.id}-${N}`,className:"text-sm",children:u})]},N))});case"file":return e.jsx(b,{type:"file",...m});case"date":return e.jsx(b,{type:"date",...m});case"number":case"currency":return e.jsx(b,{type:"number",...m});case"rating":return e.jsx("div",{className:"flex space-x-1",children:[1,2,3,4,5].map(u=>e.jsx("span",{className:"text-2xl text-gray-300 cursor-pointer hover:text-yellow-400",children:"â"},u))});default:return e.jsx(b,{...m})}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Form Fields"}),e.jsxs(g,{onClick:xe,variant:"outline",size:"sm",children:[e.jsx(ye,{className:"h-4 w-4 mr-2"}),"Add Field"]})]}),e.jsx("div",{className:"space-y-4 max-h-96 overflow-y-auto",children:D.map((t,m)=>{var x,f,S,u,N,k,q,P,V;return e.jsx(Be,{className:"p-4",children:e.jsx(gs,{open:me===t.id,onOpenChange:n=>Z(n?t.id:null),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(fs,{className:"h-4 w-4 text-muted-foreground cursor-move"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium",children:t.label||`Field ${m+1}`}),e.jsx(Ne,{variant:"secondary",className:"text-xs",children:(x=Qe.find(n=>n.value===t.type))==null?void 0:x.label}),t.required&&e.jsx(Ne,{variant:"destructive",className:"text-xs",children:"Required"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(js,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",children:e.jsx(Ns,{className:"h-4 w-4"})})}),e.jsx(g,{onClick:()=>h(t.id),variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",children:e.jsx(Se,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{className:"text-sm font-medium",children:[t.label||"Untitled Field",t.required&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}),U(t)]}
1),e.jsxs(bs,{className:"space-y-4 mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-sm",children:"Field Label"}),e.jsx(b,{value:t.label,onChange:n=>j(t.id,{label:n.target.value}),placeholder:"Enter field label"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-sm",children:"Field Type"}),e.jsxs(ze,{value:t.type,onValueChange:n=>j(t.id,{type:n}),children:[e.jsx(Pe,{children:e.jsx(Ue,{})}),e.jsx(Me,{children:Qe.map(n=>e.jsx(Ve,{value:n.value,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{children:n.icon}),e.jsx("span",{children:n.label})]})},n.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-sm",children:"Placeholder Text"}),e.jsx(b,{value:t.placeholder||"",onChange:n=>j(t.id,{placeholder:n.target.value}),placeholder:"Enter placeholder text"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-sm",children:"Description (Optional)"}),e.jsx(b,{value:t.description||"",onChange:n=>j(t.id,{description:n.target.value}),placeholder:"Help text for this field"})]})]}),(t.type==="select"||t.type==="radio"||t.type==="checkbox")&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(v,{className:"text-sm",children:"Options"}),e.jsxs(g,{onClick:()=>pe(t.id),variant:"outline",size:"sm",children:[e.jsx(ye,{className:"h-4 w-4 mr-1"}),"Add Option"]})]}),e.jsx("div",{className:"space-y-2",children:(f=t.options)==null?void 0:f.map((n,L)=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(b,{value:n,onChange:H=>E(t.id,L,H.target.value),placeholder:`Option ${L+1}`,className:"flex-1"}),e.jsx(g,{onClick:()=>z(t.id,L),variant:"ghost",size:"sm",className:"text-destructive",children:e.jsx(Se,{className:"h-4 w-4"})})]},L))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{className:"text-sm font-medium",children:"Validation & Settings"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Je,{checked:t.required,onCheckedChange:n=>j(t.id,{required:n})}),e.jsx(v,{className:"text-sm",children:"Required field"})]}),(t.type==="text"||t.type==="textarea")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-xs",children:"Min Length"}),e.jsx(b,{type:"number",value:((S=t.validation)==null?void 0:S.minLength)||"",onChange:n=>j(t.id,{validation:{...t.validation,minLength:parseInt(n.target.value)||void 0}}),placeholder:"0"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-xs",children:"Max Length"}),e.jsx(b,{type:"number",value:((u=t.validation)==null?void 0:u.maxLength)||"",onChange:n=>j(t.id,{validation:{...t.validation,maxLength:parseInt(n.target.value)||void 0}}),placeholder:"1000"})]})]}),(t.type==="number"||t.type==="currency")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-xs",children:"Min Value"}),e.jsx(b,{type:"number",value:((N=t.validation)==null?void 0:N.min)||"",onChange:n=>j(t.id,{validation:{...t.validation,min:parseFloat(n.target.value)||void 0}}),placeholder:"0"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-xs",children:"Max Value"}),e.jsx(b,{type:"number",value:((k=t.validation)==null?void 0:k.max)||"",onChange:n=>j(t.id,{validation:{...t.validation,max:parseFloat(n.target.value)||void 0}}),placeholder:"999999"})]})]}),t.type==="file"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-xs",children:"Allowed File Types"}),e.jsx(b,{value:((P=(q=t.validation)==null?void 0:q.fileTypes)==null?void 0:P.join(", "))||"",onChange:n=>j(t.id,{validation:{...t.validation,fileTypes:n.target.value.split(",").map(L=>L.trim())}}),placeholder:"pdf, doc, jpg, png"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{className:"text-xs",children:"Max File Size (MB)"}),e.jsx(b,{type:"number",value:((V=t.validation)==null?void 0:V.maxFileSize)||"",onChange:n=>
1j(t.id,{validation:{...t.validation,maxFileSize:parseFloat(n.target.value)||void 0}}),placeholder:"5"})]})]})]})]})]})]})})},t.id)})}),D.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{children:'No fields added yet. Click "Add Field" to get started.'})})]})};function Ts(){const[D,O]=c.useState(!1),[me,Z]=c.useState(!1),[xe,j]=c.useState(!1),[h,pe]=c.useState(null),[E,z]=c.useState([]),[U,t]=c.useState([]),[m,x]=c.useState(""),[f,S]=c.useState(!1),[u,N]=c.useState(null),[k,q]=c.useState(""),[P,V]=c.useState(""),[n,L]=c.useState([{id:"1",label:"Business Name",type:"text",required:!0,placeholder:"Enter your business name"},{id:"2",label:"Product/Service Description",type:"textarea",required:!0,placeholder:"Describe your products or services"},{id:"3",label:"WhatsApp Contact",type:"phone",required:!0,placeholder:"+1234567890"},{id:"4",label:"Instagram Handle",type:"text",required:!1,placeholder:"@yourbusiness"},{id:"5",label:"Phone Number",type:"phone",required:!0,placeholder:"+1234567890"}]),[H,he]=c.useState(!1),[C,_e]=c.useState(null),[Q,Ce]=c.useState(""),[I,Fe]=c.useState(""),[T,ue]=c.useState([]),K=c.useRef(new Set),B=c.useRef(null),[De,ve]=c.useState(!1),[Ee,ge]=c.useState(null),[ee,Ge]=c.useState(null),{selectedEventId:A}=rs();c.useEffect(()=>{A&&(J(),We())},[A]);const J=async()=>{if(A)try{const{data:s,error:l}=await _.from("vendor_forms").select(` 2 *, 3 vendor_submissions(count), 4 vendor_form_fields(*) 5 `).eq("event_id",A).order("created_at",{ascending:!1});if(l){console.error("Error loading vendor forms:",l);return}const d=(s||[]).map(i=>{var r,a;
5return{id:i.id,title:i.form_title,description:i.form_description||"",fields:(i.vendor_form_fields||[]).sort((o,p)=>(o.field_order??0)-(p.field_order??0)).map(o=>({id:o.field_id,label:o.label,type:o.field_type,required:o.is_required,placeholder:o.placeholder||"",description:o.field_description||"",options:o.field_options?typeof o.field_options=="string"?JSON.parse(o.field_options):o.field_options:void 0,validation:o.validation_rules?typeof o.validation_rules=="string"?JSON.parse(o.validation_rules):o.validation_rules:void 0})),isActive:i.is_active,createdAt:i.created_at,submissionsCount:((a=(r=i.vendor_submissions)==null?void 0:r[0])==null?void 0:a.count)||0,settings:{allowMultipleSubmissions:!1,requireEmailVerification:!1,autoResponse:!1,categories:[]}}});z(d)}catch(s){console.error("Error loading vendor forms:",s)}},We=async()=>{if(A)try{const{data:s,error:l}=await _.from("vendor_submissions").select(` 6 *, 7 vendor_forms!inner(event_id) 8 `).eq("vendor_forms.event_id",A).order("submitted_at",{ascending:!1});if(l){console.error("Error loading submissions:",l);return}const d=(s||[]).map(i=>({id:i.id,formId:i.form_id,responses:i.responses,submittedAt:i.submitted_at,vendorName:i.vendor_name,vendorEmail:i.vendor_email,status:i.status,notes:i.notes||void 0}));t(d)}catch(s){console.error("Error loading submissions:",s)}},Ye=async()=>{if(!k.trim()){y({title:"Error",description:"Please enter a form title",variant:"destructive"});return}if(!A){y({title:"Error",description:"No event selected",variant:"destructive"});return}try{const{data:s,error:l}=await _.from("vendor_forms").insert({event_id:A,form_title:k,form_description:P||null,is_active:!0,shareable_link:null}).select().single();if(l){console.error("Error creating form:",l),y({title:"Error",description:"Failed to create form. Please try again.",variant:"destructive"});return}const d=n.map((r,a)=>({form_id:s.id,field_id:r.id,label:r.label,field_type:r.type,is_required:r.required,placeholder:r.placeholder,field_description:r.description,field_options:r.options?JSON.stringify(r.options):null,validation_rules:r.validation?JSON.stringify(r.validation):null,field_order:a})),{error:i}=await _.from("vendor_form_fields").insert(d);if(i){console.error("Error creating form fields:",i),await _.from("vendor_forms").delete().eq("id",s.id),y({title:"Error",description:"Failed to create form fields. Please try again.",variant:"destructive"});return}await J(),O(!1),q(""),V(""),y({title:"Success",description:"Form created successfully"})}catch(s){console.error("Error creating form:",s),y({title:"Error",description:"Failed to create form. Please try again.",variant:"destructive"})}},Xe=async(s,l)=>{const d=E.find(a=>a.id===s);if(!d)return;const i=!d.isActive;z(a=>a.map(o=>o.id===s?{...o,isActive:i}:o));const{error:r}=await _.from("vendor_forms").update({is_active:i}).eq("id",s);if(r){z(a=>a.map(o=>o.id===s?{...o,isActive:d.isActive}:o)),y({title:"Error",description:"Failed to update form status. Please try again.",variant:"destructive"});return}y({title:"Success",description:`Form ${i?"activated":"deactivated"} successfully`}),await J()},Ze=async s=>{const l=E;z(i=>i.filter(r=>r.id!==s));const{error:d}=await _.from("vendor_forms").delete().eq("id",s);if(d){z(l),y({title:"Error",description:"Failed to delete form. Please try again.",variant:"destructive"});return}await J(),y({title:"Success",description:"Form deleted successfully"})},ke=s=>`${window.location.origin}/vendor-form/${s}`,Te=s=>{const l=ke(s);navigator.clipboard.writeText(l),y({title:"Success",description:"Form URL copied to clipboard"})},Ae=s=>{pe(s),j(!0)},$e=(s,l="csv")=>{const d=U.filter(F=>F.formId===s),i=E.find(F=>F.id===s);if(!i||d.length===0){y({title:"No Data",description:"No submissions found to export",variant:"destructive"});return}const r=["Submission Date","Name","Email",...i.fields.map(F=>F.label)],a=new Date().toISOString().split("T")[0],p=`${i.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}_submissions_${a}`;if(l==="csv"){const F=[r.join(","),...d.map($=>[new Date($.submittedAt).toLocaleDateString(),$.vendorName,$.vendorEmail,...i.fields.map(M=>$.responses[M.id]||"")].map(M=>`"${M}"`).join(","))].join(` 9`),ae=new Blob([F],{type:"text/csv"}),re=window.URL.createObjectURL(ae),R=document.createElement("a");R.href=re,R.download=`${p}.csv`,document.body.appendChild(R),R.click(),document.body.removeChild(R),window.URL.revokeObjectURL(re)}else{const F=d.map($=>{const M={"Submission Date":new Date($.submittedAt).toLocaleDateString(),Name:$.vendorName,Email:$.vendorEmail};return i.fields.forEach(Le=>{M[Le.label]=$.responses[Le.id]||"N/A"}),M}),ae=be.json_to_sheet(F),re=[{wch:15},{wch:20},{wch:30},...i.fields.map(()=>({wch:20}))];ae["!cols"]=re;const R=be.book_new();be.book_append_sheet(R,ae,"Form Submissions"),xs(R,`${p}.xlsx`)}y({title:"Success",description:`Submissions exported successfully as ${l.toUpperCase()}`})},se=s=>U.filter(l=>l.formId===s),Ke=s=>{N(s),S(!0)},es=(s,l)=>{const d=document.getElementById(`qr-code-${s}`);if(d){const i=new XMLSerializer().serializeToString(d),r=document.createElement("canvas"),a=r.getContext("2d"),o=new Image;r.width=256,r.height=256,o.onload=()=>
9{if(a){a.fillStyle="white",a.fillRect(0,0,r.width,r.height),a.drawImage(o,0,0);const p=document.createElement("a");p.download=`${l.replace(/\s+/g,"_")}_QR_Code.png`,p.href=r.toDataURL(),p.click()}},o.src="data:image/svg+xml;base64,"+btoa(i)}},ss=s=>{const l=`${window.location.origin}/vendor-form/${s}`;navigator.clipboard.writeText(l).then(()=>{y({title:"Success",description:"Form URL copied to clipboard!"})}).catch(()=>{y({title:"Error",description:"Failed to copy URL to clipboard.",variant:"destructive"})})},ts=async s=>{_e(s),Ce(s.title),Fe(s.description||""),ue(s.fields),K.current=new Set(s.fields.map(i=>i.id)),ge(null),he(!0);const{data:l,error:d}=await _.from("vendor_form_fields").select("*").eq("form_id",s.id).order("field_order",{ascending:!0});if(!d&&l){const i=(l||[]).map(r=>({id:r.field_id,label:r.label,type:r.field_type,required:r.is_required,placeholder:r.placeholder||"",description:r.field_description||"",options:r.field_options?typeof r.field_options=="string"?JSON.parse(r.field_options):r.field_options:void 0,validation:r.validation_rules?typeof r.validation_rules=="string"?JSON.parse(r.validation_rules):r.validation_rules:void 0}));ue(i),K.current=new Set(i.map(r=>r.id))}},as=async()=>{if(C){ve(!0),ge(null);try{if(Q!==C.title||(I||"")!==(C.description||"")){const{error:a}=await _.from("vendor_forms").update({form_title:Q,form_description:I||null}).eq("id",C.id);if(a)throw a}const s=K.current,l=new Set(T.map(a=>a.id)),d=T.filter(a=>!s.has(a.id)),i=T.filter(a=>s.has(a.id)),r=Array.from(s).filter(a=>!l.has(a));if(await Promise.all(i.map(a=>_.from("vendor_form_fields").update({label:a.label,field_type:a.type,is_required:a.required,placeholder:a.placeholder||null,field_description:a.description||null,field_options:a.options?JSON.stringify(a.options):null,validation_rules:a.validation?JSON.stringify(a.validation):null,field_order:T.findIndex(o=>o.id===a.id)}).eq("form_id",C.id).eq("field_id",a.id))),d.length){const a=d.map(p=>({form_id:C.id,field_id:p.id,label:p.label,field_type:p.type,is_required:p.required,placeholder:p.placeholder||null,field_description:p.description||null,field_options:p.options?JSON.stringify(p.options):null,validation_rules:p.validation?JSON.stringify(p.validation):null,field_order:T.findIndex(F=>F.id===p.id)})),{error:o}=await _.from("vendor_form_fields").insert(a);if(o)throw o}if(r.length){const{error:a}=await _.from("vendor_form_fields").delete().eq("form_id",C.id).in("field_id",r);if(a)throw a}K.current=new Set(T.map(a=>a.id)),_e(a=>a&&{...a,title:Q,description:I,fields:T}),await J(),Ge(new Date().toLocaleTimeString()),ve(!1)}catch(s){ve(!1),ge((s==null?void 0:s.message)||"Failed to save changes"),y({title:"Save failed",description:"Your edits are kept locally. Please continue editing; we will retry saving automatically.",variant:"destructive"})}}};c.useEffect(()=>{if(!(!H||!C))return B.current&&window.clearTimeout(B.current),B.current=window.setTimeout(()=>{as()},800),()=>{B.current&&window.clearTimeout(B.current)}},[Q,I,T,H,C==null?void 0:C.id]);const qe=h?se(h.id).filter(s=>s.vendorName.toLowerCase().includes(m.toLowerCase())||s.vendorEmail.toLowerCase().includes(m.toLowerCase())):[],te={totalForms:E.length,activeForms:E.filter(s=>s.isActive).length,totalSubmissions:U.length,recentSubmissions:U.filter(s=>{const l=new Date(s.submittedAt),d=new Date(Date.now()-24*60*60*1e3);return l>d}).length};return e.jsx(vs,{eventId:A||"",eventName:"this event",feature:"Forms",children:e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-6xl",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-3xl bg-gradient-to-br from-primary/5 via-background to-primary/10 border border-border/50 backdrop-blur-sm mb-8",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/[0.02] to-transparent"}),e.jsx("div",{className:"relative p-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-6",children:[e.jsxs("div",{className:"flex items-start gap-4 min-w-0 flex-1",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("div",{className:"flex items-center justify-center w-16 h-16 bg-gradient-to-br from-primary to-primary/80 rounded-2xl shadow-lg",children:e.jsx(X,{className:"h-8 w-8 text-primary-foreground"})}),e.jsx("div",{className:"absolute -top-1 -right-1 w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center",children:e.jsx(ie,{className:"h-3 w-3 text-white"})})]}),e.jsxs("div",{className:"space-y-3 min-w-0",children:[e.jsx("h1",{className:"text-3xl lg:text-4xl font-bold tracking-tight bg-gradient-to-r from-foreground to-foreground
9/70 bg-clip-text text-transparent",children:"Forms"}),e.jsx("p",{className:"text-base text-muted-foreground leading-relaxed max-w-2xl",children:"Create and manage forms with powerful customization options"}),e.jsxs("div",{className:"flex items-center gap-4 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),e.jsx("span",{children:"Forms Management"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-pulse"}),e.jsx("span",{children:"Real-time Analytics"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0 flex-wrap lg:flex-nowrap",children:[e.jsxs(g,{variant:"outline",className:"h-11 px-6 border-border/50 hover:bg-accent/50 backdrop-blur-sm",children:[e.jsx(ce,{className:"h-4 w-4 mr-2"}),"Preview Forms"]}),e.jsxs(le,{open:D,onOpenChange:O,children:[e.jsx(is,{asChild:!0,children:e.jsxs(g,{className:"h-11 px-6 shadow-lg",children:[e.jsx(ye,{className:"h-4 w-4 mr-2"}),"Create Form"]})}),e.jsxs(ne,{className:"max-w-[95vw] sm:max-w-5xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(oe,{className:"pb-6",children:[e.jsx(de,{className:"text-xl",children:"Create Form"}),e.jsx(Re,{children:"Design a custom form to collect information for your event"})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"formTitle",className:"text-sm font-medium",children:"Form Title"}),e.jsx(b,{id:"formTitle",value:k,onChange:s=>q(s.target.value),placeholder:"Form Title",className:"h-11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"formDescription",className:"text-sm font-medium",children:"Description"}),e.jsx(we,{id:"formDescription",value:P,onChange:s=>V(s.target.value),placeholder:"Brief description of the form purpose...",rows:2,className:"resize-none"})]})]})}),e.jsx(Ie,{fields:n,onFieldsChange:L}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 pt-6 border-t",children:[e.jsxs(g,{onClick:Ye,disabled:!k.trim(),className:"flex-1 h-11",children:[e.jsx(X,{className:"h-4 w-4 mr-2"}),"Create Form"]}),e.jsx(g,{variant:"outline",onClick:()=>O(!1),className:"flex-1 h-11",children:"Cancel"})]})]})]})]})]})]})})]}),e.jsxs(w.div,{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-8",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[e.jsxs(w.div,{className:"group relative overflow-hidden bg-gradient-to-br from-card via-card to-card/50 border border-border/50 rounded-2xl p-6 hover:shadow-xl hover:shadow-primary/5 transition-all duration-500 hover:-translate-y-1",whileHover:{scale:1.02},transition:{type:"spring",stiffness:300},children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e.jsxs("div",{className:"relative space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(w.div,{className:"text-3xl font-bold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent",initial:{scale:.5},animate:{scale:1},transition:{type:"spring",bounce:.6,delay:.3},children:te.totalForms}),e.jsx("div",{className:"p-2 bg-blue-500/10 rounded-xl",children:e.jsx(ws,{className:"h-4 w-4 text-blue-500"})})]}),e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Forms"}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-blue-600",children:[e.jsx(He,{className:"h-3 w-3"}),e.jsxs("span",{children:["+",Math.round(Math.random()*12),"% this week"]})]})]})]}),e.jsxs(w.div,{className:"group relative overflow-hidden bg-gradient-to-br from-card via-card to-card/50 border border-border/50 rounded-2xl p-6 hover:shadow-xl hover:shadow-green-500/5 transition-all duration-500 hover:-translate-y-1",whileHover:{scale:1.02},transition:{type:"spring",stiffness:300},children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-green-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e.jsxs("div",{className:"relative space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(w.div,{className:"text-3xl font-bold text-green-600",initial:{scale:.5},animate:{scale:1},transition:{type:"spring",bounce:.6,delay:.4},children:te.activeForms}),e.jsx("div",{className:"p-2 bg-green-500/10 rounded-xl",children:e.jsx(ys,{className:"h-4 w-4 text-green-500"})})]}),e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Active Forms"}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[e.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),e.jsx("span",{children:"Live & collecting"})]})]})]}),e.jsxs(w.div,{className:"group relative overflow-hidden bg-gradient-to-br from-card via-card to-card/50 border border-border/50 rounded-2xl p-6 hover:shadow-xl hover:shadow-
9purple-500/5 transition-all duration-500 hover:-translate-y-1",whileHover:{scale:1.02},transition:{type:"spring",stiffness:300},children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e.jsxs("div",{className:"relative space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(w.div,{className:"text-3xl font-bold text-purple-600",initial:{scale:.5},animate:{scale:1},transition:{type:"spring",bounce:.6,delay:.5},children:te.totalSubmissions}),e.jsx("div",{className:"p-2 bg-purple-500/10 rounded-xl",children:e.jsx(ie,{className:"h-4 w-4 text-purple-500"})})]}),e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Submissions"}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-purple-600",children:[e.jsx(He,{className:"h-3 w-3"}),e.jsxs("span",{children:["+",Math.round(Math.random()*25),"% growth"]})]})]})]}),e.jsxs(w.div,{className:"group relative overflow-hidden bg-gradient-to-br from-card via-card to-card/50 border border-border/50 rounded-2xl p-6 hover:shadow-xl hover:shadow-orange-500/5 transition-all duration-500 hover:-translate-y-1",whileHover:{scale:1.02},transition:{type:"spring",stiffness:300},children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-orange-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e.jsxs("div",{className:"relative space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(w.div,{className:"text-3xl font-bold text-orange-600",initial:{scale:.5},animate:{scale:1},transition:{type:"spring",bounce:.6,delay:.6},children:te.recentSubmissions}),e.jsx("div",{className:"p-2 bg-orange-500/10 rounded-xl",children:e.jsx(ls,{className:"h-4 w-4 text-orange-500"})})]}),e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Recent (24h)"}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-orange-600",children:[e.jsx("div",{className:"w-2 h-2 bg-orange-500 rounded-full animate-pulse"}),e.jsx("span",{children:"Last 24 hours"})]})]})]})]}),e.jsx(w.div,{className:"space-y-6",initial:{opacity:0}
9,animate:{opacity:1},transition:{delay:.4},children:e.jsx(Ss,{children:E.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center border rounded-lg",children:[e.jsx(X,{className:"h-10 w-10 text-muted-foreground"}),e.jsx("p",{className:"mt-4 text-lg font-medium",children:"No forms yet"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Create your first form to start collecting submissions."})]}):e.jsx("div",{className:"grid gap-6",children:E.map((s,l)=>e.jsx(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:l*.1},whileHover:{scale:1.02,y:-4},className:"group",children:e.jsxs(Be,{className:"relative overflow-hidden border border-border/50 hover:border-primary/20 bg-gradient-to-br from-card via-card to-card/50 backdrop-blur-sm transition-all duration-500 hover:shadow-2xl hover:shadow-primary/10",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/5 via-transparent to-purple-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-700"}),e.jsx("div",{className:`absolute top-0 left-0 right-0 h-1 bg-gradient-to-r ${s.isActive?"from-green-500 to-emerald-400":"from-gray-400 to-gray-300"}`}),e.jsxs(ns,{className:"relative p-8 space-y-6",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between gap-6",children:[e.jsxs("div",{className:"flex items-start gap-4 flex-1",children:[e.jsx(w.div,{className:`flex items-center justify-center w-12 h-12 rounded-2xl shadow-lg ${s.isActive?"bg-gradient-to-br from-green-500 to-emerald-600":"bg-gradient-to-br from-gray-400 to-gray-500"}`,whileHover:{rotate:5},children:e.jsx(X,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{className:"space-y-3 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h3",{className:"text-xl font-bold bg-gradient-to-r from-foreground to-foreground/80 bg-clip-text text-transparent line-clamp-1",children:s.title}),e.jsx(Ne,{variant:s.isActive?"default":"secondary",className:`px-3 py-1 rounded-full font-medium ${s.isActive?"bg-green-500/10 text-green-700 border-green-500/20":"bg-gray-500/10 text-gray-600 border-gray-500/20"}`,children:s.isActive?"â Active":"â Inactive"})]}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:s.description})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w.div,{whileTap:{scale:.95},children:e.jsx(Je,{checked:s.isActive,onCheckedChange:()=>Xe(s.id),className:"data-[state=checked]:bg-green-500"})}),e.jsxs(ps,{children:[e.jsx(hs,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-10 w-10 rounded-xl hover:bg-accent/50",children:e.jsx(_s,{className:"h-4 w-4"})})}),e.jsxs(us,{align:"end",className:"w-48",children:[e.jsxs(Y,{onClick:()=>Ae(s),children:[e.jsx(ce,{className:"h-4 w-4 mr-2"}),"View Submissions"]}),e.jsxs(Y,{onClick:()=>Ke(s.id),children:[e.jsx(Cs,{className:"h-4 w-4 mr-2"}),"Generate QR Code"]}),e.jsxs(Y,{onClick:()=>Te(s.id),children:[e.jsx(fe,{className:"h-4 w-4 mr-2"}),"Copy URL"]}),e.jsxs(Y,{onClick:()=>ts(s),children:[e.jsx(Fs,{className:"h-4 w-4 mr-2"}),"Edit Form"]}),e.jsxs(Y,{onClick:()=>Ze(s.id),className:"text-destructive focus:text-destructive",children:[e.jsx(Se,{className:"h-4 w-4 mr-2"}),"Delete Form"]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-blue-500/5 border border-blue-500/10",children:[e.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg",children:e.jsx(X,{className:"h-4 w-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-bold text-blue-700",children:s.fields.length}),e.jsx("div",{className:"text-xs text-blue-600/80",children:"Fields"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-purple-500/5 border border-purple-500/10",children:[e.jsx("div",{className:"p-2 bg-purple-500/10 rounded-lg",children:e.jsx(ie,{className:"h-4 w-4 text-purple-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-bold text-purple-700",children:se(s.id).length}),e.jsx("div",{className:"text-xs text-purple-600/80",children:"Submissions"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-emerald-500/5 border border-emerald-500/10",children:[e.jsx("div",{className:"p-2 bg-emerald-500/10 rounded-lg",children:e.jsx(Ds,{className:"h-4 w-4 text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-emerald-700",children:new Date(s.createdAt).toLocaleDateString()}),e.jsx("div",{className:"text-xs text-emerald-600/80",children:"Created"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-orange-500/5 border border-orange-500/10",children:[e.jsx("div",{className:"p-2 bg-orange-500/10 rounded-lg",children:e.jsx(Es,{className:"h-4 w-4 text-orange-600"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-medium text-orange-700 truncate",children:ke(s.id).split("/").pop()}),e.jsx("div",{className:"text-xs text-orange-600/80",children:"Share URL"})]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 pt-4 border-t border-border/50",children:[e.jsx(w.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:e.jsxs(g,{onClick:()=>
9Ae(s),variant:"outline",className:"h-10 px-4 rounded-xl border-border/50 hover:bg-blue-500/5 hover:border-blue-500/20 hover:text-blue-700 transition-all duration-200",children:[e.jsx(ce,{className:"h-4 w-4 mr-2"}),"View (",se(s.id).length,")"]})}),e.jsx(w.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:e.jsxs(g,{onClick:()=>$e(s.id,"csv"),variant:"outline",disabled:se(s.id).length===0,className:"h-10 px-4 rounded-xl border-border/50 hover:bg-green-500/5 hover:border-green-500/20 hover:text-green-700 transition-all duration-200 disabled:opacity-50",children:[e.jsx(je,{className:"h-4 w-4 mr-2"}),"Export CSV"]})}),e.jsx(w.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:e.jsxs(g,{onClick:()=>Te(s.id),variant:"outline",className:"h-10 px-4 rounded-xl border-border/50 hover:bg-purple-500/5 hover:border-purple-500/20 hover:text-purple-700 transition-all duration-200",children:[e.jsx(fe,{className:"h-4 w-4 mr-2"}),"Copy Link"]})})]})]})]})},s.id))})})}),e.jsx(le,{open:f,onOpenChange:S,children:e.jsxs(ne,{className:"sm:max-w-md max-w-[95vw]",children:[e.jsxs(oe,{children:[e.jsx(de,{children:"QR Code for Form"}),e.jsx(Re,{children:"Scan this QR code or share it to allow users to access the form directly."})]}),e.jsx("div",{className:"flex flex-col items-center space-y-4",children:u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-4 bg-white rounded-lg",children:e.jsx(ms,{id:`qr-code-${u}`,value:`${window.location.origin}/vendor-form/${u}`,size:200,level:"M",includeMargin:!0})}),e.jsxs("div",{className:"text-center space-y-2 w-full",children:[e.jsx("p",{className:"text-sm text-muted-foreground break-all",children:`${window.location.origin}/vendor-form/${u}`}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>ss(u),className:"flex items-center justify-center gap-1 w-full",children:[e.jsx(fe,{className:"h-3 w-3"}),"Copy Link"]}),e.jsxs(g,{size:"sm",onClick:()=>{const s=E.find(l=>l.id===u);s&&es(u,s.title)},className:"flex items-center justify-center gap-1 w-full",children:[e.jsx(je,{className:"h-3 w-3"}),"Download QR"]})]})]})]})})]})}),e.jsx(le,{open:xe,onOpenChange:j,children:e.jsxs(ne,{className:"max-w-[95vw] sm:max-w-6xl max-h-[90vh] overflow-y-auto",children:[e.jsx(oe,{children:e.jsxs(de,{children:["Submissions for ",h==null?void 0:h.title]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ks,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(b,{placeholder:"Search by name or email...",value:m,onChange:s=>x(s.target.value),className:"pl-9"})]}),e.jsxs(g,{onClick:()=>h&&$e(h.id),variant:"outline",size:"sm",className:"w-full sm:w-auto",children:[e.jsx(je,{className:"h-4 w-4 mr-2"}),"Export All"]})]}),qe.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(ie,{className:"mx-auto h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No submissions yet"}),e.jsx("p",{className:"text-muted-foreground",children:m?"No submissions match your search.":h?"Share the form link to start receiving submissions.":"Select a form to view submissions."})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(os,{children:[e.jsx(ds,{children:e.jsxs(Oe,{children:[e.jsx(G,{children:"Date"}),e.jsx(G,{children:"Name"}),e.jsx(G,{children:"Email"}),h==null?void 0:h.fields.slice(0,3).map(s=>e.jsx(G,{children:s.label},s.id)),e.jsx(G,{children:"Actions"})]})}),e.jsx(cs,{children:qe.map(s=>e.jsxs(Oe,{children:[e.jsx(W,{children:new Date(s.submittedAt).toLocaleDateString()}),e.jsx(W,{className:"font-medium",children:s.vendorName}),e.jsx(W,{children:s.vendorEmail}),h==null?void 0:h.fields.slice(0,3).map(l=>e.jsx(W,{className:"max-w-[150px] truncate",children:s.responses[l.id]||"-"},l.id)),e.jsx(W,{children:e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>{const l=h==null?void 0:h.fields.map(d=>`${d.label}: ${s.responses[d.id]||"N/A"}`).join(` 10`);alert(`Full Submission Details: 11 12${l}`)},children:[e.jsx(ce,{className:"h-4 w-4 mr-2"}),"Details"]}
12)})]},s.id))})]})})]})]})}),e.jsx(le,{open:H,onOpenChange:he,children:e.jsxs(ne,{className:"max-w-[95vw] sm:max-w-5xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(oe,{className:"pb-4",children:[e.jsx(de,{className:"text-xl",children:"Edit Form"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:De?"Savingâ¦":Ee?e.jsx("span",{className:"text-destructive",children:"Save failed"}):ee?`All changes saved at ${ee}`:"All changes saved"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"editTitle",className:"text-sm font-medium",children:"Form Title"}),e.jsx(b,{id:"editTitle",value:Q,onChange:s=>Ce(s.target.value),placeholder:"Form Title",className:"h-11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"editDescription",className:"text-sm font-medium",children:"Description"}),e.jsx(we,{id:"editDescription",value:I,onChange:s=>Fe(s.target.value),placeholder:"Brief description of the form purpose...",rows:2,className:"resize-none"})]})]}),e.jsx(Ie,{fields:T,onFieldsChange:ue})]}),e.jsxs("div",{className:"flex items-center justify-between pt-6 border-t",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:De?"Savingâ¦":Ee?e.jsx("span",{className:"text-destructive",children:"Save failed"}):ee?`Saved at ${ee}`:""}),e.jsx("div",{className:"flex gap-2",children:e.jsx(g,{variant:"outline",onClick:()=>he(!1),children:"Close"})})]})]})})]})})})}const jt=Ts;export{jt 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.