PageSourceSearch

https://hay-price-engine.replit.app/assets/affiliates-Cm8vYDtc.js

js hay-price-engine.replit.app collected 2026-10-03 03:54:08 UTC 6,159 bytes, 1 lines download raw bytes

1import{j as e}from"./index-Dyw0_7Xu.js";import{r}from"./index-g-292YYE.js";import{a as p,P as o,F as t,i as n,b as y}from"./shared-D2Z8PFV5.js";function w(){const[s,u]=r.useState(null),[c,l]=r.useState(""),[d,m]=r.useState(!1),[h,x]=r.useState(!1);r.useEffect(()=>{p("/api/affiliates/program").then(a=>u(a.settings)).catch(a=>l(a.message))},[]);async function f(a){a.preventDefault();const i=new FormData(a.currentTarget);m(!0),l("");try{await p("/api/affiliates/apply",{method:"POST",body:JSON.stringify({...Object.fromEntries(i),acceptTerms:i.get("acceptTerms")==="on"})}),x(!0)}catch(g){l(g.message)}finally{m(!1)}}return e.jsx("main",{className:"min-h-screen bg-stone-50 text-stone-900",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-5 py-8 space-y-8",children:[e.jsxs("header",{className:"flex justify-between gap-4",children:[e.jsx("a",{href:"/",className:"font-bold text-green-800",children:"BUYHAY.AI"}),e.jsx("a",{href:"/affiliate",className:"underline",children:"Affiliate sign in"})]}),e.jsxs("section",{className:"rounded-2xl bg-green-950 p-7 sm:p-12 text-white space-y-4",children:[e.jsx("p",{className:"uppercase tracking-widest text-sm text-green-200",children:"The BuyHay affiliate program"}),e.jsx("h1",{className:"text-3xl sm:text-5xl font-bold max-w-3xl",children:"Know people who buy hay by the load?"}),e.jsx("p",{className:"text-lg max-w-2xl",children:"Introduce them to BuyHay. We handle quotes, payment, and delivery. You earn on qualifying orders."}),s&&e.jsx("div",{className:"grid sm:grid-cols-3 gap-4 pt-4",children:[[s.firstCommissionPercent,"first-order commission"],[s.repeatCommissionPercent,"reorder commission"],[s.firstDiscountPercent,"first-order customer savings"]].map(([a,i])=>e.jsxs("div",{className:"border border-green-700 rounded-xl p-4",children:[e.jsxs("strong",{className:"block text-3xl",children:[a,"%"]}),e.jsx("span",{children:i})]},i))})]}),c&&e.jsx("p",{role:"alert",className:"text-red-700",children:c}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-5",children:[e.jsx(o,{title:"A link. A relationship. Repeat business.",children:e.jsxs("ol",{className:"list-decimal pl-5 space-y-3",children:[e.jsx("li",{children:"Apply and get approved."}),e.jsx("li",{children:"Share your personal link, QR code, or flyer."}),e.jsx("li",{children:"Track qualifying sales and earnings in your portal."})]})}),e.jsxs(o,{title:"Straightforward program terms",children:[e.jsx("p",{children:"Commissions and customer discounts apply to eligible delivered hay charges before the affiliate discount, excluding taxes and separately itemized extras. Earnings are not guaranteed."}),e.jsx("p",{children:"Offers may have minimum purchases, savings caps, and product or order-type restrictions. The customer’s quote shows the applicable offer before purchase."}),s&&e.jsxs("ul",{className:"list-disc pl-5 space-y-1",children:[s.minimumOrderCents>0&&e.jsxs("li",{children:["Minimum eligible hay purchase: $",(s.minimumOrderCents/100).toFixed(2),"."]}),s.firstDiscountCapCents!=null&&e.jsxs("li",{children:["First-order customer savings are capped at $",(s.firstDiscountCapCents/100).toFixed(2),"."]}),s.repeatDiscountCapCents!=null&&e.jsxs("li",{children:["Reorder customer savings are capped at $",(s.repeatDiscountCapCents/100).toFixed(2),"."]}),!!s.eligibleHayTypeIds?.length&&e.jsx("li",{children:"Only selected hay products qualify; mixed orders containing excluded products do not qualify."}),!!s.eligibleOrderSources?.length&&e.jsx("li",{children:"Only selected order types qualify. Confirm eligibility on the quote before purchase."}),!s.allowStacking&&e.jsx("li",{children:"Cannot be combined with other promotional discounts."})]}),e.jsx("p",{children:"Commissions become payable after final billing, cleared payment, delivery, and the applicable hold. Refunds and credits may adjust earnings. Payout setup and required tax information must be approved."}),e.jsx("p",{children:"No self-referrals or misleading claims. Disclose that you may earn a commission. Only contact people you have permission to contact."}),s&&e.jsxs("p",{children:["Initial referral window: ",s.referralDays," days. Browser restrictions may affect cookies; identified referrals are recorded with quotes. Customer reorder savings: ",s.repeatDiscountPercent,"%."]})]})]}
1),e.jsx(o,{title:"Apply to become an affiliate",children:s?h?e.jsxs("div",{role:"status",children:[e.jsx("h3",{className:"font-semibold",children:"Application received"}),e.jsx("p",{children:"You can sign in to check your approval status."}),e.jsx("a",{className:"underline",href:"/affiliate",children:"Go to your portal"})]}):s.enrollmentEnabled?e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsx(t,{label:"Your name or business",children:e.jsx("input",{name:"name",className:n,required:!0,minLength:2,maxLength:150,autoComplete:"name"})}),e.jsx(t,{label:"Email",children:e.jsx("input",{name:"email",className:n,type:"email",required:!0,autoComplete:"email"})}),e.jsx(t,{label:"Phone",children:e.jsx("input",{name:"phone",className:n,type:"tel",required:!0,maxLength:40,autoComplete:"tel"})}),e.jsx(t,{label:"Who would you introduce to BuyHay?",children:e.jsx("textarea",{name:"audience",className:n,required:!0,minLength:10,maxLength:3e3,rows:3})}),e.jsx(t,{label:"Create a password (at least 12 characters)",children:e.jsx("input",{name:"password",className:n,type:"password",required:!0,minLength:12,maxLength:256,autoComplete:"new-password"})}),e.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[e.jsx("input",{name:"acceptTerms",type:"checkbox",required:!0,className:"mt-1"}),e.jsx("span",{children:"I agree to the program terms above, including commission disclosure, qualifying-order requirements, and adjustments for refunds."})]}),e.jsx("button",{className:y,disabled:d,children:d?"Submitting…":"Submit application"})]}):e.jsxs("p",{children:["Applications are not open yet. Please check back soon. Existing affiliates can ",e.jsx("a",{href:"/affiliate",className:"underline",children:"sign in"}),"."]}):e.jsx("p",{children:"Loading program…"})})]})]})})}export{w 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.