PageSourceSearch

https://bowtiesports.com/assets/SponsorOnboarding-DD6WUHNm.js

js bowtiesports.com collected 2026-10-07 02:28:14 UTC 14,032 bytes, 9 lines download raw bytes

1import{r as h,j as e}from"./react-vendor-DUhHROXo.js";import{P as N}from"./PortalLayout-BUxGSFei.js";import{C as E,a as K}from"./card-9IoFUltb.js";import{m as H,w as W,_ as Z,J as ee,a5 as f,o as i,O as se,X as O,N as te}from"./index-BLtzf0SR.js";import{B as ae}from"./badge-BsE4KYIf.js";import{P as re}from"./progress-DQIGmiuZ.js";import{T as $}from"./textarea-Da4-oaTC.js";import{L as v}from"./label-B2yiss_Q.js";import{s as w}from"./client-DTel1CZI.js";import{u as oe}from"./useMutation-BXp6BKyU.js";import{u as l}from"./index-Cx0UdoxP.js";import{L}from"./router-vendor-Dz9PdDzH.js";import{C as y}from"./circle-check-PV1EE3Kr.js";import{U as P}from"./upload-TDghJ2vl.js";import{A as ne}from"./arrow-left-CRb8P6iH.js";import{I as ie}from"./image-arBWrt3y.js";import{P as ce}from"./pen-line-BftNMd9B.js";import"./AdminLayout-4AAuHeAU.js";import"./NavLink-CsyG-eHO.js";import"./scroll-area-BdyOmc9o.js";import"./index-BdQq_4o_.js";import"./collapsible-BAD8kbtc.js";import"./index-CMI-ZfmW.js";import"./globe-CQ83QW2m.js";import"./users-CIwSfVhi.js";import"./activity-CwFToTs3.js";import"./list-todo-BR3jv1RJ.js";import"./calendar-BDETTnfZ.js";import"./users-round-CCw5yxW7.js";import"./radio-BQgeDg5T.js";import"./clapperboard-BvstouST.js";import"./clipboard-list-CQJ-vJ2y.js";import"./folder-open-CIWhCFhy.js";import"./pencil-C2cyk8cg.js";import"./message-square-BDdDilNB.js";import"./ticket-l9bl0kcm.js";import"./megaphone-DpQsxotQ.js";import"./package-DKB1lvtO.js";import"./circle-user-BeB3uaA1.js";import"./folder-kanban-B8jlMC6s.js";import"./settings-Baim_Eei.js";import"./briefcase-CdSp4ViD.js";import"./chart-line-ohAz7u_s.js";import"./HostOwnerLayout-PM2-LrXf.js";import"./layers-CvbkNa7J.js";import"./dollar-sign-D3lTBfQm.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 B=H("CalendarCheck",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]),k=[{key:"logo_uploaded",title:"Upload Logo & Brand Assets",subtitle:"Step 1 of 3",icon:ie,description:"Upload your company logo (PNG, SVG, or JPEG — min 500×500px) and any additional brand assets like color swatches or brand marks.",type:"file",accept:"image/png,image/svg+xml,image/jpeg",multiple:!0,secondaryKey:"brand_guidelines_uploaded",secondaryLabel:"Brand guidelines or style guide (optional)",secondaryAccept:"*/*"},{key:"ad_copy_submitted",title:"Ad Copy & Creative Guidelines",subtitle:"Step 2 of 3",icon:ce,description:"Provide the copy for host-read ads, banner text, newsletter blurbs, and any creative direction or guidelines for our team.",type:"text",secondaryKey:"creative_assets_uploaded",secondaryLabel:"Upload creative assets (banners, images, video — optional)"},{key:"schedule_confirmed",title:"Confirm Your Placement Schedule",subtitle:"Step 3 of 3",icon:B,description:"Review your sponsorship package details and confirm the placement schedule. Once confirmed, our team will begin activating your sponsorship.",type:"confirm"}],C=["logo_uploaded","brand_guidelines_uploaded","creative_assets_uploaded","ad_copy_submitted","schedule_confirmed"];function ss(){var G;const{user:c}=W(),q=Z(),[b,_]=h.useState(0),[g,z]=h.useState(""),[S,M]=h.useState(""),[n,p]=h.useState(null),[F,Y]=h.useState({}),{data:a,isLoading:I}=ee({queryKey:["sponsor-onboarding",c==null?void 0:c.id],queryFn:async()=>{const{data:s}=await w.from("sponsor_onboarding_checklists").select("*").eq("user_id",c.id).order("created_at",{ascending:!1}).limit(1);return(s==null?void 0:s[0])??null},enabled:!!c}),j=oe({mutationFn:async s=>{if(!a)return;const r={...s,updated_at:new Date().toISOString()},d={...a,...r};C.every(u=>d[u])&&(r.onboarding_status="completed",r.completed_at=new Date().toISOString());const{error:m}=await w.from("sponsor_onboarding_checklists").update(r).eq("id",a.id);if(m)throw m},onSuccess:()=>{q.invalidateQueries({queryKey:["sponsor-onboarding"]})},onError:()=>l.error("Failed to save progress")}),A=h.useCallback(async(s,r="*/*",d=!1)=>{const o=document.createElement("input");o.type="file",o.accept=r,o.multiple=d,o.onchange=async()=>{const m=o.files;if(m!=null&&m.length){p(s);try{const u=[];for(const x of Array.from(m)){const X=`${c.id}/${s}/${Date.now()}_${x.name}`,{error:D}=await w.storage.from("sponsor-assets").upload(X,x);if(D)throw D;u.push(x.name)}Y(x=>({...x,[s]:[...x[s]||[],...u]})),await j.mutateAsync({[s]:!0}),l.success("Files uploaded successfully!")}catch(u){l.error(u.message||"Upload failed")}finally{p(null)}}},o.click()},[c,j]),T=async()=>
6{if(!g.trim())return l.error("Please enter your ad copy");p("ad_copy_submitted");try{const s=S?`${g}
7
8--- Creative Guidelines ---
9${S}`:g,r=new Blob([s],{type:"text/plain"}),d=`${c.id}/ad_copy/${Date.now()}_ad-copy.txt`,{error:o}=await w.storage.from("sponsor-assets").upload(d,r);if(o)throw o;await j.mutateAsync({ad_copy_submitted:!0}),l.success("Ad copy submitted!")}catch(s){l.error(s.message||"Failed to submit ad copy")}finally{p(null)}},J=async()=>{p("schedule_confirmed");try{await j.mutateAsync({schedule_confirmed:!0}),l.success("Schedule confirmed!")}catch(s){l.error(s.message||"Failed to confirm")}finally{p(null)}},t=k[b],Q=(a==null?void 0:a.onboarding_status)==="completed",U=a?C.filter(s=>a[s]).length:0,R=U/C.length*100,V=a?!!a[t==null?void 0:t.key]:!1;return I?e.jsx(N,{children:e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(f,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):a?Q?e.jsx(N,{children:e.jsx("div",{className:"max-w-2xl mx-auto py-16",children:e.jsx(E,{className:"border-accent bg-accent/5",children:e.jsxs(K,{className:"pt-8 pb-8 text-center",children:[e.jsx(y,{className:"w-16 h-16 text-accent mx-auto mb-4"}),e.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold text-foreground mb-3",children:"You're All Set!"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Your onboarding is complete. Our team will review your materials and begin placing your sponsorship. You'll receive a confirmation once your first placement goes live."}),e.jsx(i,{size:"lg",asChild:!0,children:e.jsx(L,{to:"/partner",children:"Go to Partner Dashboard"})})]})})})}):e.jsx(N,{children:e.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold text-foreground",children:"Sponsor Onboarding"}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:["Complete these steps to activate your"," ",e.jsx("strong",{children:a.package_name})," sponsorship."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Overall progress"}),e.jsxs("span",{className:"font-medium text-foreground",children:[U," of ",C.length," tasks done"]})]}),e.jsx(re,{value:R,className:"h-2"})]}),e.jsx("div",{className:"flex items-center gap-2",children:k.map((s,r)=>{const d=a[s.key],o=r===b;return e.jsx("button",{onClick:()=>_(r),className:`flex-1 py-2 px-3 rounded-lg text-xs font-medium transition-all border ${o?"border-accent bg-accent/10 text-accent":d?"border-accent/30 bg-accent/5 text-accent":"border-border bg-card text-muted-foreground"}`,children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[d?e.jsx(y,{className:"w-3.5 h-3.5"}):e.jsx("span",{className:"w-4 h-4 rounded-full border border-current flex items-center justify-center text-[10px]",children:r+1}),e.jsxs("span",{className:"hidden sm:inline",children:["Step ",r+1]})]})},s.key)})}),e.jsx(E,{className:"border-border",children:e.jsxs(K,{className:"pt-8 pb-8",children:[e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(t.icon,{className:"w-6 h-6 text-accent"})}),e.jsxs("div",{children:[e.jsx(ae,{variant:"outline",className:"mb-2 text-xs",children:t.subtitle}),e.jsx("h2",{className:"font-display text-xl font-bold text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.description})]})]}),V?e.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-lg bg-accent/5 border border-accent/20",children:[e.jsx(y,{className:"w-5 h-5 text-accent flex-shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-accent",children:"This step is complete!"})]}):t.type==="file"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{onClick:()=>A(t.key,t.accept||"*/*",t.multiple||!1),className:"border-2 border-dashed border-border rounded-xl p-8 text-center cursor-pointer hover:border-accent/40 hover:bg-accent/5 transition-colors",children:[n===t.key?e.jsx(f,{className:"w-8 h-8 animate-spin text-accent mx-auto mb-2"}):e.jsx(P,{className:"w-8 h-8 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:n===t.key?"Uploading…":"Click to upload your logo & brand assets"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PNG, SVG, JPEG — min 500×500px"})]}),((G=F[t.key])==null?void 0:G.length)>0&&e.jsx("div",{className:"space-y-1",children:F[t.key].map((s,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground bg-muted/50 rounded-md px-3 py-1.5",children:[e.jsx(se,{className:"w-3.5 h-3.5 text-muted-foreground"}),s]},r))}),t.secondaryKey&&e.jsxs("div",{children:[e.jsx(v,{className:"text-sm text-muted-foreground mb-2 block",children:t.secondaryLabel}),e.jsx(i,{variant:"outline",size:"sm",onClick:()=>A(t.secondaryKey,t.secondaryAccept||"*/*",!0),disabled:n===t.secondaryKey,children:n===t.secondaryKey?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"w-4 h-4 animate-spin mr-2"}),"Uploading…"]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-4 h-4 mr-2"}),"Upload Guidelines"]})})]})]}):t.type==="text"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-sm font-medium mb-2 block",children:"Ad Copy"}),e.jsx($,{placeholder:"Enter your ad copy — host-read scripts, banner text, newsletter blurbs…",value:g,onChange:s=>
9z(s.target.value),rows:5,className:"resize-none"})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-sm font-medium mb-2 block",children:"Creative Guidelines (optional)"}),e.jsx($,{placeholder:"Any brand voice, tone, or placement preferences…",value:S,onChange:s=>M(s.target.value),rows:3,className:"resize-none"})]}),t.secondaryKey&&e.jsxs("div",{children:[e.jsx(v,{className:"text-sm text-muted-foreground mb-2 block",children:t.secondaryLabel}),e.jsx(i,{variant:"outline",size:"sm",onClick:()=>A(t.secondaryKey,"*/*",!0),disabled:n===t.secondaryKey,children:n===t.secondaryKey?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"w-4 h-4 animate-spin mr-2"}),"Uploading…"]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-4 h-4 mr-2"}),"Upload Assets"]})})]}),e.jsx(i,{onClick:T,disabled:n==="ad_copy_submitted"||!g.trim(),className:"bg-accent text-accent-foreground hover:bg-accent/90",children:n==="ad_copy_submitted"?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"w-4 h-4 animate-spin mr-2"}),"Submitting…"]}):"Submit Ad Copy"})]}):t.type==="confirm"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 border border-border p-4 space-y-3",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Package"}),e.jsx("span",{className:"font-medium text-foreground",children:a.package_name||"—"})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Logo Uploaded"}),e.jsx("span",{children:a.logo_uploaded?e.jsx(y,{className:"w-4 h-4 text-accent"}):e.jsx(O,{className:"w-4 h-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Ad Copy Submitted"}),e.jsx("span",{children:a.ad_copy_submitted?e.jsx(y,{className:"w-4 h-4 text-accent"}):e.jsx(O,{className:"w-4 h-4 text-muted-foreground"})})]})]}),e.jsx(i,{onClick:J,disabled:n==="schedule_confirmed",className:"w-full bg-accent text-accent-foreground hover:bg-accent/90",size:"lg",children:n==="schedule_confirmed"?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"w-4 h-4 animate-spin mr-2"}),"Confirming…"]}):e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),"Confirm & Activate Sponsorship"]})})]}):null]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(i,{variant:"outline",onClick:()=>_(s=>Math.max(0,s-1)),disabled:b===0,children:[e.jsx(ne,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Progress is saved automatically"}),b<k.length-1?e.jsxs(i,{onClick:()=>_(s=>Math.min(k.length-1,s+1)),children:["Next",e.jsx(te,{className:"w-4 h-4 ml-2"})]}):e.jsx(i,{variant:"outline",asChild:!0,children:e.jsx(L,{to:"/partner",children:"Partner Dashboard"})})]}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Need to finish later? Your progress is saved — just come back to"," ",e.jsx("span",{className:"font-medium text-foreground",children:"/partner/onboarding"})," ","anytime."]})]})}):e.jsx(N,{children:e.jsxs("div",{className:"max-w-xl mx-auto py-16 text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-bold text-foreground mb-3",children:"No Active Onboarding"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Complete a sponsorship purchase to begin the onboarding process."}),e.jsx(i,{asChild:!0,children:e.jsx(L,{to:"/sponsors",children:"View Sponsorship Packages"})})]})})}export{ss 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.