PageSourceSearch

https://www.goaffpro.app/assets/ShopifyIndex-Ctiei4jZ.js

js goaffpro.app collected 2026-10-04 14:38:09 UTC 9,161 bytes, 1 lines download raw bytes

1var O=Object.defineProperty;var A=(s,t,n)=>t in s?O(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n;var _=(s,t,n)=>A(s,typeof t!="symbol"?t+"":t,n);import{r as c,aD as v,cE as j,cJ as D,ax as C,g as b,cP as I,cF as P,bk as E,j as e,av as M,cC as R,s as T,v as $,b8 as S,aw as U,L as k,B as z,c8 as J,y as B,ba as q,aK as H,aL as W,x as G,z as w,I as K,S as Q,bp as V,ay as X,az as f}from"./index-lEmP1PRk.js";import{i as Y,S as Z}from"./ShopifyInstall-BeLA3YqE.js";import{u as L}from"./shopifyApp-DBN5DeeH.js";function ee(s){try{return atob(s)}catch(t){}return null}function se(){const[s,t]=c.useState(!0),[n,l]=c.useState(null),{code:a,shop:h,host:o}=v(),d=j("admin_ref_code");let i=null;try{i=D.get("ref")}catch(u){}const N=j("mtoken"),y=C();return c.useEffect(()=>{b().post("/shopify/save_keys",{code:a,shop:h,ref:i,admin_ref_code:d,mtoken:N}).then(({data:u})=>{if(t(!1),u.access_token?I(u.access_token):l(u),u.access_token)try{if(j("oauth")){window.location="https://goaffpro.com/oauth/authorize?".concat(atob(j("oauth")),"&access_token=").concat(u.access_token),P("oauth");return}}catch(p){console.log(p)}if(o&&ee(o)){const p="https://".concat(atob(o),"/apps/").concat(E.clientId);window.top!==window.self?window.top.location=p:window.location=p}else y("/shopify/check-for-plan",{replace:!0})})},[]),e.jsx("div",{className:"container-fluid bg-light-subtle min-vh-100",children:e.jsx("div",{className:"row align-items-center justify-content-center",children:e.jsxs("div",{className:"col-6",children:[n?e.jsx("textarea",{className:"form-control",children:JSON.stringify(n,null,2)}):null,s?e.jsx(te,{}):null]})})})}function te(){return e.jsxs("div",{className:"pt-4 text-center",children:[e.jsx("p",{className:"display-4",children:"Please wait"}),e.jsx(M,{})]})}class ne extends c.Component{constructor(){super(...arguments);_(this,"state",{error:!1})}componentDidMount(){Y()}render(){return null}}function ie(){const{mtoken:s}=v();return s?R("mtoken",s):P("mtoken"),window.location="https://apps.shopify.com/goaffpro",null}function ae(){const s=v();return B(t=>{const{subscription:n,integration:l,hasChosenPlan:a}=t.settings;return s&&s.change_plan?!1:!!(Number(n)===1||a)})}function le(s){const t=v(),[n,l]=c.useState(!1),a=C();async function h(d){l(!0),Number(s.subscription)===1&&await b().post("/billing/shopify_cancel_plan").then(i=>s.updateSettings({subscription:0})).catch(i=>{console.log(i)}),s.updateSettings({hasChosenPlan:!0}).then(()=>{l(!1),a("/",{replace:!0})})}const o=ae();return c.useEffect(()=>{s.loading||o&&a("/",{replace:!0})},[s.loading,o]),s.loading?e.jsx("div",{className:"text-center py-4",children:e.jsx(U,{})}):e.jsx("div",{className:"container-fluid",children:e.jsx("div",{className:"row justify-content-center min-vh-100",style:{paddingTop:"80px"},children:e.jsxs("div",{className:"col-8",children:[e.jsx("h1",{className:"text-center",children:"Choose a plan"}),e.jsx("div",{className:"text-center mb-4",children:t.change_plan?e.jsx(k,{className:"btn btn-primary",to:"/",children:"Continue with current plan »"}):null}),e.jsxs("div",{className:"row row-cols-2  gy-4",children:[e.jsx("div",{className:"col",children:e.jsxs("div",{className:"card",children:[e.jsxs("div",{children:[e.jsx("div",{className:"card-body",children:e.jsx("h2",{children:"FREE"})}),e.jsxs("div",{className:"list-group list-group-flush",children:[e.jsx("div",{className:"list-group-item",children:"Unlimited affiliates"}),e.jsx("div",{className:"list-group-item",children:"Unlimited sales"}),e.jsx("div",{className:"list-group-item",children:"Unlimited revenue"}),e.jsx("div",{className:"list-group-item",children:"Basic affiliate portal"})]})]}),e.jsx("div",{className:"card-footer text-center",children:e.jsx(z,{loading:n,onClick:h,className:"btn btn-link",children:"Choose"})})]})}),e.jsx("div",{className:"col",children:e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"card-body",children:[e.jsxs("div",{className:"d-flex align-items-baseline",children:[e.jsxs("h2",{children:["$",J.shopify.monthly.premium]}),e.jsx("span",{children:"/mo"})]}),e.jsx("div",{children:"15-day free trial included"})]}),e.jsxs("div",{className:"list-group list-group-flush",children:[e.jsx("div",{className:"list-group-item",children:"Unlimited affiliates"}),e.jsx("div",{className:"list-group-item",children:"Unlimited sales"}),e.jsx("div",{className:"list-group-item",children:"Unlimited revenue"}),e.jsx("div",{className:"list-group-item",children:"Branded affiliate portal"}),e.jsx("div",{className:"list-group-item",children:"Targets and Bonuses"}),"  ",e.jsx("div",{className:"list-group-item",children:"Multiple Groups and 
1Sign up pages"}),"  ",e.jsx("div",{className:"list-group-item",children:"Automatic Invoices"}),"  ",e.jsx("div",{className:"list-group-item",children:"W9 Form collection"}),"  ",e.jsx("div",{className:"list-group-item",children:"Multi Level marketing"}),"  ",e.jsx("div",{className:"list-group-item",children:"S2S callbacks                    "}),e.jsx("div",{className:"list-group-item",children:"Embedded affiliate store"}),e.jsx("div",{className:"list-group-item",children:"Third party integrations                        "})]}),e.jsx("div",{className:"card-footer text-center",children:Number(s.subscription)===1?e.jsx("span",{children:"Current plan"}):e.jsx(k,{to:"/billing/shopify/preactivate/basic",className:"btn btn-primary",children:"Choose"})})]})})]})]})})})}const re=(s,t)=>{const{created:n,loading:l}=s.settings,a=S.tz(n).isBefore(S.tz(Date.now()).subtract(5,"days"));return{site_id:s.settings.site_id,hasChosenPlan:s.settings.hasChosenPlan,marketingIntroCompleted:a?!0:s.settings.marketingIntroCompleted,has_rated:s.settings.has_rated,subscription:s.settings.subscription,integration:s.settings.integration,isOldInstall:a,loading:l}},ce=T(re,$)(le),oe=s=>s.settings.recent_pos_selected;function de(s){const[t,n]=c.useState(""),l=q(t,300),{data:a,isLoading:h}=H("/v1/admin/affiliates?limit=30&fields=id,email,name,coupon,ref_code&search="+l,W),o=G(),d=B(oe),i=c.useMemo(()=>d?JSON.parse(d):[],[d]),{posApplyProperties:N}=L();async function y(r){i.unshift(r),i.slice(0,10),o(w({recent_pos_selected:JSON.stringify(i)})),await N({affiliate_id:r.id,ref_code:r.ref_code,coupon:r.coupon,name:r.name})}const u=c.useMemo(()=>{const r=(a==null?void 0:a.affiliates)||[];if(l)return r;{const g=i.map(({id:m})=>m).reverse(),F=[...r,...i];return[...new Set(F.map(m=>m.id))].map(m=>r.find(({id:x})=>m==x)||i.find(({id:x})=>m==x)).sort((m,x)=>g.indexOf(x.id)-g.indexOf(m.id))}},[l,a,i]),p=c.useCallback(()=>{o(w({recent_pos_selected:null}))},[]);return e.jsxs("div",{className:"container-fluid mt-3",children:[e.jsx("div",{className:"mb-3",children:e.jsx(K,{type:"search",placeholder:"Search by name, email, referral code or coupon code",value:t,onChange:n})}),i.length>0?e.jsx("div",{className:"text-right",children:e.jsx("button",{onClick:p,className:"btn btn-sm btn-link",children:"Clear selection history"})}):null,e.jsxs("ul",{className:"list-group overflow-hidden",children:[h?e.jsx(Q,{count:10,height:66}):null,!h&&u.length===0?e.jsx("p",{className:"text-center",children:"No results"}):null,u.map(r=>e.jsx(ue,{i:r,inHistory:i.some(({id:g})=>r.id==g),addAttributeToCart:y},String(r.id)))]})]})}function ue({i:s,addAttributeToCart:t,inHistory:n}){return e.jsx("li",{onClick:()=>t(s),className:"list-group-item list-group-item-action ".concat(n?"font-weight-bold":""),children:e.jsxs("div",{className:"d-flex align-items-start justify-content-between",children:[e.jsxs("div",{children:[s.name,e.jsx("br",{}),e.jsx("small",{className:"text-muted",children:s.email})]}),e.jsx("div",{children:e.jsx("small",{className:"text-muted",children:s.ref_code})})]})},String(s.id))}function he(s){const[t,n]=c.useState(!1),{getShopifySessionToken:l,shop:a}=L(),[h,o]=c.useState(!1);return c.useEffect(()=>{if(s.bypass){n(!0);return}l().then(d=>{d&&b().post("/shopify/shopify_session_token_to_goaffpro_token",{sessionToken:d,shop:a,secret_for_testing:E.clientSecret}).then(({data:i})=>{if(i.manager_access_only){o(!0);return}i.access_token&&(I(i.access_token),n(!0))})})},[]),t?s.children:h?e.jsx("div",{className:"container-fluid bg-light-subtle min-vh-100",children:e.jsx("div",{className:"text-center py-4",children:e.jsxs("p",{children:["Direct access is disabled. Please login via a ",e.jsx("a",{href:"https://goaffpro.com/login",rel:"noreferrer noopener",target:"_blank",children:"Manager account"})," to access the app"]})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:"container-fluid bg-light-subtle min-vh-100",children:e.jsxs("div",{className:"text-center py-4",children:[e.jsx("p",{className:"display-4",children:"Just a moment"}),e.jsx(V,{})]})})})}function je(){return e.jsxs(X,{children:[e.jsx(f,{path:"auth_callback",element:e.jsx(se,{})}),e.jsx(f,{path:"reinstall",element:e.jsx(ne,{})}),e.jsx(f,{path:"app-store",element:e.jsx(ie,{})}),e.jsx(f,{path:"pos/choose-affiliate",element:e.jsx(he,{bypass:document.location.host.startsWith("localhost"),children:e.jsx(de,{})})}),e.jsx(f,{path:"check-for-plan",element:e.jsx(ce,{})}),e.jsx(f,{index:!0,element:e.jsx(Z,{})})]})}export{je 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.