{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/K2WMRiI0IgCCCV5XrT58/Wyn7PzZa4vO3tVYZmqpT/AuthUtility.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";function parseCookies(cookieString){return cookieString.split(\"; \").reduce((cookies,cookie)=>{const[name,value]=cookie.split(\"=\");cookies[name]=decodeURIComponent(value);return cookies;},{});}export function withShareCodeText(Component){return function WrappedComponent(props){const[sharecode,setSharecode]=useState(\"No sharecode\");useEffect(()=>{const referralCode=localStorage.getItem(\"personal_referral_code\");const qrLink=localStorage.getItem(\"qr_link\");if(qrLink){setSharecode(qrLink);}else if(referralCode){setSharecode(`jazari.money/rewards?code=${referralCode}`);}},[]);return /*#__PURE__*/_jsx(Component,{...props,text:sharecode});};}export function withEmailText(Component){return function WrappedComponent(props){const[email,setEmail]=useState(\"\");useEffect(()=>{const storedEmail=localStorage.getItem(\"user_email\");if(storedEmail){setEmail(storedEmail);}},[]);return /*#__PURE__*/_jsx(Component,{...props,text:email||\"\"});};}export function withLoginText(Component){return function WrappedComponent(props){const[loginText,setLoginText]=useState(\"\");const buttonRef=useRef();const source=window.location.search;useEffect(()=>{const clickHandler=function(){const storedEmail=localStorage.getItem(\"user_email\");if(storedEmail){window.location.replace(\"https://whatsapp.jazari.money/web/Logout\");}else{window.location.replace(\"https://whatsapp.jazari.money/web/Login\");}};if(buttonRef?.current){buttonRef.current.addEventListener(\"click\",clickHandler);}return()=>{window.removeEventListener(\"click\",clickHandler);};},[buttonRef]);useEffect(()=>{const storedEmail=localStorage.getItem(\"user_email\");if(storedEmail){setLoginText(\"Logout\");}},[]);return /*#__PURE__*/_jsx(Component,{...props,text:loginText,ref:buttonRef});};}export function withMockRewardList(Component){return props=>{const rewards=[{image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_join.png\",is_completed:true,title:\"Join the Waitlist\"},{image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_1.png\",is_completed:true,title:\"Invite 1 friend\"},{title:\"Invite 2 friends\",image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_2.png\",is_completed:true},{title:\"Invite 3 friends\",image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_3.png\",is_completed:false},{title:\"Invite 4 friends\",image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_4.png\",is_completed:false},{title:\"Invite 5 friends\",image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_5.png\",is_completed:false},{title:\"Invite 6 friends\",image_url:\"https://storage.googleapis.com/jazaricdn/static/waitlist/reward_6.png\",is_completed:false}];const rewardCounter=rewards.filter(rw=>rw.is_completed).length;return /*#__PURE__*/_jsx(Component,{...props,rewards:rewards,rewardCounter:rewardCounter});};}function getCachedRewards(){const rawRewards=localStorage.getItem(\"user_rewards\");if(rawRewards){const rwds=JSON.parse(rawRewards)[\"rewards\"];return rwds;}return[];}export function withRewardList(Component){return props=>{const[rewards,setRewards]=useState([]);const setRewardsHandler=()=>{setRewards(getCachedRewards());};useEffect(()=>{setRewardsHandler();const interval=setInterval(()=>{if(rewards.length===0){console.log(\"check rewards\");setRewardsHandler();}},1e3);return()=>{clearInterval(interval);};},[rewards.length]);const rewardCounter=rewards.filter(rw=>rw.is_completed).length;return /*#__PURE__*/_jsx(Component,{...props,rewards:rewards,rewardCounter:rewardCounter});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withMockRewardList\":{\"type\":\"reactHoc\",\"name\":\"withMockRewardList\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShareCodeText\":{\"type\":\"reactHoc\",\"name\":\"withShareCodeText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRewardList\":{\"type\":\"reactHoc\",\"name\":\"withRewardList\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLoginText\":{\"type\":\"reactHoc\",\"name\":\"withLoginText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailText\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EAAE,CAACJ,CAAS,CAAC,EAAEX,EAAU,IAAI,CAAmB,aAAa,QAAQ,YAAY,GAAkBU,EAAa,QAAQ,CAAG,EAAE,CAAC,CAAC,EAAsBP,EAAKR,EAAU,CAAC,GAAGC,EAAM,KAAKa,EAAU,IAAIE,CAAS,CAAC,CAAE,CAAE,CAA2mC,SAASK,GAAkB,CAAC,IAAMC,EAAW,aAAa,QAAQ,cAAc,EAAE,OAAGA,EAAuB,KAAK,MAAMA,CAAU,EAAE,QAA8B,CAAC,CAAE,CAAQ,SAASC,EAAeC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAQC,CAAU,EAAEC,EAAS,CAAC,CAAC,EAAQC,EAAkB,IAAI,CAACF,EAAWN,EAAiB,CAAC,CAAE,EAAES,EAAU,IAAI,CAACD,EAAkB,EAAE,IAAME,EAAS,YAAY,IAAI,CAAIL,EAAQ,SAAS,IAAG,QAAQ,IAAI,eAAe,EAAEG,EAAkB,EAAG,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC,cAAcE,CAAQ,CAAE,CAAE,EAAE,CAACL,EAAQ,MAAM,CAAC,EAAE,IAAMM,EAAcN,EAAQ,OAAOO,GAAIA,EAAG,YAAY,EAAE,OAAO,OAAoBC,EAAKV,EAAU,CAAC,GAAGC,EAAM,QAAQC,EAAQ,cAAcM,CAAa,CAAC,CAAE,CAAE",
  "names": ["withShareCodeText", "Component", "props", "sharecode", "setSharecode", "ye", "ue", "referralCode", "qrLink", "p", "withEmailText", "email", "setEmail", "storedEmail", "withLoginText", "loginText", "setLoginText", "buttonRef", "pe", "source", "window", "clickHandler", "getCachedRewards", "rawRewards", "withRewardList", "Component", "props", "rewards", "setRewards", "ye", "setRewardsHandler", "ue", "interval", "rewardCounter", "rw", "p"]
}
