PageSourceSearch

https://devsunite.com/_next/static/chunks/761f4ed03047d33b.js

js devsunite.com collected 2026-10-02 00:48:31 UTC 31,649 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,225913,e=>{"use strict";var t=e.i(207670);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=t.clsx;e.s(["cva",0,(e,t)=>a=>{var n;if((null==t?void 0:t.variants)==null)return i(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:o,defaultVariants:s}=t,u=Object.keys(o).map(e=>{let t=null==a?void 0:a[e],i=null==s?void 0:s[e];if(null===t)return null;let n=r(t)||r(i);return o[e][n]}),c=a&&Object.entries(a).reduce((e,t)=>{let[r,i]=t;return void 0===i||(e[r]=i),e},{});return i(e,u,null==t||null==(n=t.compoundVariants)?void 0:n.reduce((e,t)=>{let{class:r,className:i,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...s,...c}[t]):({...s,...c})[t]===r})?[...e,r,i]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},167881,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(991918),a=e.i(225913),n=e.i(647163);let o=(0,a.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-accent-foreground underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),s=r.forwardRef(({className:e,variant:r,size:a,asChild:s=!1,...u},c)=>{let l=s?i.Slot:"button";return(0,t.jsx)(l,{className:(0,n.cn)(o({variant:r,size:a,className:e})),ref:c,...u})});s.displayName="Button",e.s(["Button",()=>s,"buttonVariants",()=>o])},841947,e=>{"use strict";let t=(0,e.i(475254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},394580,e=>{"use strict";let t={debug:0,info:1,warn:2,error:3};class r{scope;constructor(e){this.scope=e}emit(e,r,i){t[e]>=t.info&&(this.scope?r(`[${this.scope}]`,...i):r(...i))}debug(...e){this.emit("debug",console.debug,e)}info(...e){this.emit("info",console.info,e)}warn(...e){this.emit("warn",console.warn,e)}error(...e){this.emit("error",console.error,e)}child(e){return new r(this.scope?`${this.scope}:${e}`:e)}}let i=new r;function a(e){return new r(e)}e.s(["createLogger",()=>a,"logger",0,i])},475254,e=>{"use strict";var t=e.i(271645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,t.forwardRef)(({color:e="currentColor",size:a=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s="",children:u,iconNode:c,...l},d)=>(0,t.createElement)("svg",{ref:d,...i,width:a,height:a,stroke:e,strokeWidth:o?24*Number(n)/Number(a):n,className:r("lucide",s),...l},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(u)?u:[u]])),n=(e,i)=>{let n=(0,t.forwardRef)(({className:n,...o},s)=>(0,t.createElement)(a,{ref:s,iconNode:i,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...o}));return n.displayName=`${e}`,n};e.s(["default",()=>n],475254)},207670,e=>{"use strict";function t(){for(var e,t,r=0,i="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=function e(t){var r,i,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(r=0;r<n;r++)t[r]&&(i=e(t[r]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}(e))&&(i&&(i+=" "),i+=t);return i}e.s(["clsx",()=>t,"default",0,t])},618566,(e,t,r)=>{t.exports=e.r(976562)},408617,118081,e=>{"use strict";var t=e.i(247167);e.i(436180);var r=e.i(317875),i=e.i(176009),a=e.i(394580);let n=["skills","certifications","experienceEducation","social","projects"];function o(e){return n.includes(e)}e.s(["DEFAULT_SECTION_ORDER",0,n,"isSectionId",()=>o],118081);let s=(0,a.createLogger)("Firestore");async function u(e){if("true"!==t.default.env.NEXT_PUBLIC_USE_MOCKS&&e)try{let t=(0,r.doc)(i.firestoremain,"users",e.uid),a=(0,r.doc)(i.firestoremain,`users/${e.uid}/profile`,"data"),n=(0,r.doc)(i.firestoremain,`users/${e.uid}/subscription`,"current");
1if(!(await (0,r.getDoc)(a)).exists()){let i={uid:e.uid,email:e.email,displayName:e.displayName,photoURL:e.photoURL,createdAt:new Date().toISOString(),isPublic:!1,role:"NORMAL_USER"};if(await (0,r.setDoc)(a,i),await (0,r.setDoc)(t,{createdAt:new Date().toISOString(),isPublic:!1},{merge:!0}),!(await (0,r.getDoc)(n)).exists()){let e={plan:"free",matchesUsed:0,coverLettersUsed:0,interview_prepUsed:0,resetDate:new Date(Date.now()+2592e6).toISOString()};await (0,r.setDoc)(n,e)}}}catch(e){s.error("Error syncing user profile to Firestore:",e)}}async function c(a){if("true"===t.default.env.NEXT_PUBLIC_USE_MOCKS){let{MOCK_RESUME:t}=await e.A(621021);return t}try{let e=(0,r.doc)(i.firestoremain,`users/${a}/resume`,"current"),t=await (0,r.getDoc)(e);if(t.exists())return t.data();return null}catch(e){return s.error("Error fetching user resume:",e),null}}async function l(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.updateDoc)(a,{displayName:t}),await (0,r.updateDoc)(n,{displayName:t}),!0}catch(e){return s.error("Error updating display name in Firestore:",e),!1}}async function d(e,t){try{let a=(0,r.doc)(i.firestoremain,`users/${e}/resume`,"current");return await (0,r.setDoc)(a,{...t,updatedAt:new Date().toISOString()},{merge:!0}),!0}catch(e){return s.error("Error saving user resume:",e),!1}}async function f(a){if("true"===t.default.env.NEXT_PUBLIC_USE_MOCKS){let{MOCK_SUBSCRIPTION:t}=await e.A(621021);return t}try{let e=(0,r.doc)(i.firestoremain,`users/${a}/subscription`,"current"),t=await (0,r.getDocFromServer)(e).catch(t=>(s.warn("Server fetch failed, falling back to cache:",t),(0,r.getDoc)(e)));if(t.exists())return t.data();return null}catch(e){return s.error("Error fetching subscription:",e),null}}async function m(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(a,{isPublic:t},{merge:!0}),await (0,r.setDoc)(n,{isPublic:t},{merge:!0}),!0}catch(e){return s.error("Error toggling profile public status:",e),!1}}async function g(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(a,{githubUsername:t},{merge:!0}),await (0,r.setDoc)(n,{githubUsername:t},{merge:!0}),!0}catch(e){return s.error("Error saving GitHub username:",e),!1}}
1async function p(a){if("true"===t.default.env.NEXT_PUBLIC_USE_MOCKS){let{MOCK_USER_PROFILE:t}=await e.A(621021);return t}try{let e=(0,r.doc)(i.firestoremain,"users",a),t=await (0,r.getDoc)(e);if(t.exists())return t.data();return null}catch(e){return s.error("Error fetching user data:",e),null}}async function h(a){if("true"===t.default.env.NEXT_PUBLIC_USE_MOCKS){let{MOCK_USER_PROFILE:t,MOCK_RESUME:r}=await e.A(621021);return{uid:t.uid,profile:t,resume:r,endorsements:[]}}if(!a)return s.error("getPublicProfile called with empty identifier"),null;try{let e=a,t=(0,r.doc)(i.firestoremain,"usernames",a),n=await (0,r.getDoc)(t);n.exists()&&(e=n.data().uid);let o=(0,r.doc)(i.firestoremain,"users",e),u=await (0,r.getDoc)(o);if(!u.exists())return null;let c=u.data();if(!c?.isPublic)return null;let l=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data"),d=await (0,r.getDoc)(l),f=(0,r.doc)(i.firestoremain,`users/${e}/resume`,"current"),m=await (0,r.getDoc)(f),g=[];try{g=(await (0,r.getDocs)((0,r.query)((0,r.collection)(i.firestoremain,`users/${e}/endorsements`),(0,r.where)("approved","==",!0)))).docs.map(e=>({id:e.id,...e.data()}))}catch(e){s.error("Error fetching endorsements:",e)}return{uid:e,profile:d.exists()?d.data():{uid:e,email:null,displayName:null,photoURL:null,createdAt:"",role:"NORMAL_USER"},resume:m.exists()?m.data():null,endorsements:g}}catch(e){return s.error("Error fetching public profile:",e),null}}async function y(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e);return await (0,r.setDoc)(a,t,{merge:!0}),!0}catch(e){return s.error("Error saving job preferences:",e),!1}}async function w(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(a,{socialProfiles:t},{merge:!0}),await (0,r.setDoc)(n,{socialProfiles:t},{merge:!0}),!0}catch(e){return s.error("Error saving social profiles:",e),!1}}async function v(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(a,t,{merge:!0}),await (0,r.setDoc)(n,t,{merge:!0}),!0}catch(e){return s.error("Error saving profile header fields:",e),!1}}async function S(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(a,{sectionConfig:t},{merge:!0}),await (0,r.setDoc)(n,{sectionConfig:t},{merge:!0}),!0}catch(e){return s.error("Error saving section config:",e),!1}}function b(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}async function C(e,t){try{let a=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data"),n=b({...t,flow:"value_first",completedAt:new Date().toISOString()});return await (0,r.setDoc)(a,{onboarding:n},{merge:!0}),!0}catch(e){return s.error("Error saving value-first onboarding completion:",e),!1}}async function x(e,t,a){try{let n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(n,{onboarding:{...b(a),deferredAnswered:{[t]:!0}}},{merge:!0}),!0}catch(e){return s.error("Error saving deferred onboarding answer:",e),!1}}async function A(e,t){try{let a=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data"),n={...t,completedAt:new Date().toISOString()},o=Object.fromEntries(Object.entries(n).filter(([,e])=>void 0!==e));return await (0,r.setDoc)(a,{onboarding:o},{merge:!0}),!0}catch(e){return s.error("Error saving onboarding data:",e),!1}}async function E(e){try{let t=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data"),a=await (0,r.getDoc)(t);if(a.exists())return a.data();return null}catch(e){return s.error("Error fetching user profile:",e),null}}async function k(e){try{return(await (0,r.getDocs)((0,r.query)((0,r.collection)(i.firestoremain,`users/${e}/messages`),(0,r.orderBy)("createdAt","desc")))).docs.map(e=>({id:e.id,...e.data()}))}catch(e){return s.error("Error fetching messages:",e),[]}}async function P(e,t){try{return await (0,r.updateDoc)((0,r.doc)(i.firestoremain,`users/${e}/messages`,t),{read:!0}),!0}catch(e){return s.error("Error marking message read:",e),!1}}async function D(e,t){try{return await (0,r.deleteDoc)((0,r.doc)(i.firestoremain,`users/${e}/messages`,t)),!0}catch(e){return s.error("Error deleting message:",e),!1}}async function _(e){try{return(await (0,r.getDocs)((0,r.query)((0,r.collection)(i.firestoremain,`users/${e}/endorsements`),(0,r.orderBy)("createdAt","desc")))).docs.map(e=>({id:e.id,...e.data()}))}catch(e){return s.error("Error fetching endorsements:",e),[]}}async function O(e,t,a){try{return await (0,r.updateDoc)((0,r.doc)(i.firestoremain,`users/${e}/endorsements`,t),{approved:a}),!0}catch(e){return s.error("Error updating endorsement:",e),!1}}async function U(e,t){try{return await (0,r.deleteDoc)((0,r.doc)(i.firestoremain,`users/${e}/endorsements`,t)),!0}catch(e){return s.error("Error deleting endorsement:",e),!1}}async function R(e){try{let t=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"analytics"),a=await (0,r.getDoc)(t);if(a.exists()){let e=a.data();return{totalViews:e.totalViews??0,viewsByDay:e.viewsByDay??{},lastViewedAt:e.lastViewedAt}}return{totalViews:0,viewsByDay:{}}}catch(e){return s.error("Error fetching profile analytics:",e),null}}async function $(e,t){try{let a=(0,r.doc)(i.firestoremain,"users",e),n=(0,r.doc)(i.firestoremain,`users/${e}/profile`,"data");return await (0,r.setDoc)(a,{skills:t},{merge:!0}),await (0,r.setDoc)(n,{skills:t},{merge:!0}),!0}catch(e){return s.error("Error saving user skills:",e),!1}}e.s(["SECTION_LABELS",0,{skills:"Skills & Technologies",certifications:"Certifications",experienceEducation:"Experience & Education",social:"Social Profiles",projects:"Projects"},"deleteEndorsement",()=>U,"deleteMessage",()=>D,"getAllEndorsements",()=>
1_,"getMessages",()=>k,"getProfileAnalytics",()=>R,"getPublicProfile",()=>h,"getUserData",()=>p,"getUserProfile",()=>E,"getUserResume",()=>c,"getUserSubscription",()=>f,"markMessageRead",()=>P,"saveDeferredAnswer",()=>x,"saveGithubUsername",()=>g,"saveJobPreferences",()=>y,"saveOnboardingData",()=>A,"saveProfileHeader",()=>v,"saveSectionConfig",()=>S,"saveSocialProfiles",()=>w,"saveUserResume",()=>d,"saveUserSkills",()=>$,"saveValueFirstCompletion",()=>C,"setEndorsementApproved",()=>O,"syncUserProfile",()=>u,"toggleProfilePublic",()=>m,"updateUserDisplayName",()=>l],408617)},443082,e=>{"use strict";e.s(["event",0,(e,t)=>{"function"==typeof window.gtag&&window.gtag("event",e,t)},"pageview",0,e=>{"function"==typeof window.gtag&&window.gtag("config","G-G7NFC7ZW9J",{page_path:e})}])},668234,e=>{"use strict";var t=e.i(271645),r=e.i(618566);let i="ref_code";function a(){try{return localStorage.getItem(i)}catch{return null}}function n(){let e=(0,r.useSearchParams)();(0,t.useEffect)(()=>{let t=e.get("ref");if(t){try{document.cookie=`ref=${encodeURIComponent(t)}; max-age=2592000; path=/; SameSite=Lax`}catch{}try{localStorage.setItem(i,t)}catch{}}},[e])}e.s(["getCapturedReferralCode",()=>a,"useReferralCapture",()=>n])},628873,e=>{"use strict";var t=e.i(271645),r=e.i(618566),i=e.i(443082);let a="qr_campaign_code";function n(){try{return localStorage.getItem(a)}catch{return null}}function o(){let e=(0,r.useSearchParams)();(0,t.useEffect)(()=>{let t=e.get("qr");if(t){try{document.cookie=`qr=${encodeURIComponent(t)}; max-age=2592000; path=/; SameSite=Lax`}catch{}try{localStorage.setItem(a,t)}catch{}(0,i.event)("qr_poster_scan",{campaign_code:t}),fetch("/api/track/qr-scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({campaignCode:t})}).catch(()=>{})}},[e])}e.s(["getCapturedQrCode",()=>n,"useQrCapture",()=>o])},898309,e=>{"use strict";var t=e.i(271645),r=e.i(618566),i=e.i(443082);let a="campaign_link_code",n="campaign_link_utm";function o(){try{return localStorage.getItem(a)}catch{return null}}function s(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):null}catch{return null}}function u(){let e=(0,r.useSearchParams)();(0,t.useEffect)(()=>{let t=e.get("cl"),r=e.get("utm_source");if(t||r)try{if(t&&!localStorage.getItem(a)){localStorage.setItem(a,t),localStorage.removeItem(n),(0,i.event)("campaign_link_click",{link_code:t,utm_source:e.get("utm_source")||void 0,utm_medium:e.get("utm_medium")||void 0,utm_campaign:e.get("utm_campaign")||void 0,utm_content:e.get("utm_content")||void 0});return}if(!t&&r&&!localStorage.getItem(a)&&!localStorage.getItem(n)){let t={utm_source:r},i=e.get("utm_medium"),a=e.get("utm_campaign"),o=e.get("utm_content"),s=e.get("utm_term");i&&(t.utm_medium=i),a&&(t.utm_campaign=a),o&&(t.utm_content=o),s&&(t.utm_term=s),localStorage.setItem(n,JSON.stringify(t))}}catch{}},[e])}e.s(["getCapturedCampaignLinkCode",()=>o,"getCapturedCampaignLinkUtm",()=>s,"useCampaignLinkCapture",()=>u])},697815,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(176009);e.i(151718);var a=e.i(441264),n=e.i(408617),o=e.i(668234),s=e.i(628873),u=e.i(898309);let c=(0,e.i(394580).createLogger)("AuthContext"),l=(0,r.createContext)(null);e.s(["AuthProvider",0,({children:d})=>{let{user:f,setUser:m,getCurrentUser:g}=function(e=null){let[t,i]=(0,r.useState)(e),a=(0,r.useRef)(e);return{user:t,setUser:(0,r.useCallback)(e=>{a.current=e,i(e)},[]),getCurrentUser:(0,r.useCallback)(()=>a.current,[])}}(null),[p,h]=(0,r.useState)(null),[y,w]=(0,r.useState)(null),[v,S]=(0,r.useState)(!0),[b,C]=(0,r.useState)("NORMAL_USER"),[x,A]=(0,r.useState)(!1),[E,k]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!0),[_,O]=(0,r.useState)(!0),[,U]=(0,r.useState)(0);(0,r.useEffect)(()=>{let t=(0,a.onAuthStateChanged)(i.auth,async t=>{c.debug("onAuthStateChanged fired. User:",t?.uid,"Verified:",t?.emailVerified),c.debug("Setting user state to:",t?.uid),m(t??null),t?(O(!0),S(!0),e.A(79161).then(async({syncUserProfile:r,getUserSubscription:i,getUserProfile:a})=>{c.debug("Syncing user profile for:",t.uid),await r(t);
1let[n,o,s,u]=await Promise.all([i(t.uid),a(t.uid),e.A(79161).then(e=>e.getUserData(t.uid)),t.getIdToken()]);c.debug("Profile/Sub fetched. Subscription:",n?.plan),h(n),O(!1),w(o),S(!1),o?.role&&C(o.role),s&&k(!0===s.hasUsedTrial),"true"===sessionStorage.getItem(`admin_status_${t.uid}`)?(c.debug("Admin status loaded from session cache."),A(!0)):(c.debug("Initiating Admin Check for UID:",t.uid),fetch("/api/blog/admin-check",{headers:{Authorization:`Bearer ${u}`}}).then(async e=>{if(c.debug("Admin Check HTTP Status:",e.status),e.ok){let r=await e.json();c.debug("Admin Check Data Received:",r),r.isAdmin?(c.debug("ADMIN STATUS CONFIRMED"),A(!0),sessionStorage.setItem(`admin_status_${t.uid}`,"true")):(sessionStorage.setItem(`admin_status_${t.uid}`,"false"),c.warn("User is NOT in the ADMIN collection."))}}).catch(e=>{c.error("Admin check API call failed:",e)})),fetch("/api/auth/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:u})}).catch(e=>c.error("Session sync failed:",e))})):(h(null),O(!1),w(null),S(!1),A(!1),k(!1),C("NORMAL_USER")),D(!1)});return()=>t()},[]),(0,r.useEffect)(()=>{let e=async()=>{let e=i.auth.currentUser;if(e&&!e.emailVerified){try{await e.reload()}catch(e){c.error("Verification re-check reload failed:",e);return}i.auth.currentUser?.emailVerified&&(m(i.auth.currentUser),U(e=>e+1))}},t=()=>{"visible"===document.visibilityState&&e()};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",t)}},[]);let R=async e=>{try{await fetch("/api/user/create",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({referralCode:(0,o.getCapturedReferralCode)(),qrCampaignCode:(0,s.getCapturedQrCode)(),campaignLinkCode:(0,u.getCapturedCampaignLinkCode)(),campaignLinkUtm:(0,u.getCapturedCampaignLinkUtm)()})}),await fetch("/api/auth/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:e})})}catch(e){c.error("User creation in backend failed:",e)}},$=async()=>{let e=new a.GoogleAuthProvider;e.setCustomParameters({prompt:"select_account"});let t=await (0,a.signInWithPopup)(i.auth,e),r=await t.user.getIdToken();await R(r)},I=async e=>{let t=a.GoogleAuthProvider.credential(e),r=await (0,a.signInWithCredential)(i.auth,t),n=await r.user.getIdToken();await R(n)},N=async(e,t)=>{let r=await (0,a.createUserWithEmailAndPassword)(i.auth,e,t);await (0,a.sendEmailVerification)(r.user);try{let e=await r.user.getIdToken();await fetch("/api/user/create",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({referralCode:(0,o.getCapturedReferralCode)(),qrCampaignCode:(0,s.getCapturedQrCode)(),campaignLinkCode:(0,u.getCapturedCampaignLinkCode)(),campaignLinkUtm:(0,u.getCapturedCampaignLinkUtm)()})}),await fetch("/api/auth/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:e})})}catch(e){c.error("User creation in backend failed:",e)}},L=async(e,t)=>{c.debug("signInWithEmail called");let r=await (0,a.signInWithEmailAndPassword)(i.auth,e,t);c.debug("signInWithEmailAndPassword successful."),c.debug("Reloading user to check verification..."),await r.user.reload();let n=i.auth.currentUser;return c.debug("User reloaded. Verified:",n?.emailVerified),m(n),(async()=>{try{c.debug("Starting background sync...");let e=await n?.getIdToken();await Promise.all([fetch("/api/user/create",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({referralCode:(0,o.getCapturedReferralCode)(),qrCampaignCode:(0,s.getCapturedQrCode)(),campaignLinkCode:(0,u.getCapturedCampaignLinkCode)(),campaignLinkUtm:(0,u.getCapturedCampaignLinkUtm)()})}),fetch("/api/auth/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:e})})]),c.debug("Background sync successful.")}catch(e){c.error("Background sync failed:",e)}})(),r},j=async()=>{let e=i.auth.currentUser;if(!e)throw Error("No signed-in user to verify.");await (0,a.sendEmailVerification)(e)},T=async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),await (0,a.signOut)(i.auth),m(null)};return(0,t.jsx)(l.Provider,{value:{user:f,getCurrentUser:g,emailVerified:f?.emailVerified??!1,resendVerificationEmail
1:j,subscription:p,subscriptionLoading:_,profile:y,profileLoading:v,role:b,isAdmin:x,hasUsedTrial:E,signInWithGoogle:$,signInWithGoogleCredential:I,signOut:T,loading:P,signUpWithEmail:N,signInWithEmail:L,refreshSubscription:async()=>{if(f){let e=await (0,n.getUserSubscription)(f.uid);return h(e),e}return null},refreshProfile:async()=>{if(f){let e=await (0,n.getUserProfile)(f.uid);return w(e),e}return null},refreshUser:async()=>{await i.auth.currentUser?.reload(),m(i.auth.currentUser),U(e=>e+1)}},children:d})},"useAuth",0,()=>(0,r.useContext)(l)],697815)},678745,e=>{"use strict";let t=(0,e.i(475254).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t])},635804,e=>{"use strict";var t=e.i(271645),r=e.i(934620);function i(e){let[i,a]=t.useState(void 0);return(0,r.useLayoutEffect)(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let n=t[0];if("borderBoxSize"in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;a({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}a(void 0)},[e]),i}e.s(["useSize",()=>i])},853660,e=>{"use strict";var t=e.i(271645),r=e.i(953760),i=e.i(174080),a="undefined"!=typeof document?t.useLayoutEffect:function(){};function n(e,t){let r,i,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(i=r;0!=i--;)if(!n(e[i],t[i]))return!1;return!0}if((r=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(i=r;0!=i--;)if(!({}).hasOwnProperty.call(t,a[i]))return!1;for(i=r;0!=i--;){let r=a[i];if(("_owner"!==r||!e.$$typeof)&&!n(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function o(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s(e,t){let r=o(e);return Math.round(t*r)/r}function u(e){let r=t.useRef(e);return a(()=>{r.current=e}),r}var c=e.i(248425),l=e.i(843476),d=t.forwardRef((e,t)=>{let{children:r,width:i=10,height:a=5,...n}=e;return(0,l.jsx)(c.Primitive.svg,{...n,ref:t,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,l.jsx)("polygon",{points:"0,0 30,0 15,10"})})});d.displayName="Arrow";var f=e.i(820783),m=e.i(30030),g=e.i(30207),p=e.i(934620),h=e.i(635804),y="Popper",[w,v]=(0,m.createContextScope)(y),[S,b]=w(y),C=e=>{let{__scopePopper:r,children:i}=e,[a,n]=t.useState(null);return(0,l.jsx)(S,{scope:r,anchor:a,onAnchorChange:n,children:i})};C.displayName=y;var x="PopperAnchor",A=t.forwardRef((e,r)=>{let{__scopePopper:i,virtualRef:a,...n}=e,o=b(x,i),s=t.useRef(null),u=(0,f.useComposedRefs)(r,s);return t.useEffect(()=>{o.onAnchorChange(a?.current||s.current)}),a?null:(0,l.jsx)(c.Primitive.div,{...n,ref:u})});A.displayName=x;var E="PopperContent",[k,P]=w(E),D=t.forwardRef((e,d)=>{var m,y,w;let v,S,C,x,A,P,D,_,O,U,N,L,{__scopePopper:j,side:T="bottom",sideOffset:M=0,align:B="center",alignOffset:V=0,arrowPadding:z=0,avoidCollisions:W=!0,collisionBoundary:q=[],collisionPadding:J=0,sticky:F="partial",hideWhenDetached:H=!1,updatePositionStrategy:X="optimized",onPlaced:K,...G}=e,Q=b(E,j),[Y,Z]=t.useState(null),ee=(0,f.useComposedRefs)(d,e=>Z(e)),[et,er]=t.useState(null),ei=(0,h.useSize)(et),ea=ei?.width??0,en=ei?.height??0,eo="number"==typeof J?J:{top:0,right:0,bottom:0,left:0,...J},es=Array.isArray(q)?q:[q],eu=es.length>0,ec={padding:eo,boundary:es.filter(R),altBoundary:eu},{refs:el,floatingStyles:ed,placement:ef,isPositioned:em,middlewareData:eg}=function(e){void 0===e&&(e={});let{placement:c="bottom",strategy:l="absolute",middleware:d=[],platform:f,elements:{reference:m,floating:g}={},transform:p=!0,whileElementsMounted:h,open:y}=e,[w,v]=t.useState({x:0,y:0,strategy:l,placement:c,middlewareData:{},isPositioned:!1}),[S,b]=t.useState(d);n(S,d)||b(d);let[C,x]=t.useState(null),[A,E]=t.useState(null),k=t.useCallback(e=>{e!==O.current&&(O.current=e,x(e))},[]),P=t.useCallback(e=>
1{e!==U.current&&(U.current=e,E(e))},[]),D=m||C,_=g||A,O=t.useRef(null),U=t.useRef(null),R=t.useRef(w),$=null!=h,I=u(h),N=u(f),L=u(y),j=t.useCallback(()=>{if(!O.current||!U.current)return;let e={placement:c,strategy:l,middleware:S};N.current&&(e.platform=N.current),(0,r.computePosition)(O.current,U.current,e).then(e=>{let t={...e,isPositioned:!1!==L.current};T.current&&!n(R.current,t)&&(R.current=t,i.flushSync(()=>{v(t)}))})},[S,c,l,N,L]);a(()=>{!1===y&&R.current.isPositioned&&(R.current.isPositioned=!1,v(e=>({...e,isPositioned:!1})))},[y]);let T=t.useRef(!1);a(()=>(T.current=!0,()=>{T.current=!1}),[]),a(()=>{if(D&&(O.current=D),_&&(U.current=_),D&&_){if(I.current)return I.current(D,_,j);j()}},[D,_,j,I,$]);let M=t.useMemo(()=>({reference:O,floating:U,setReference:k,setFloating:P}),[k,P]),B=t.useMemo(()=>({reference:D,floating:_}),[D,_]),V=t.useMemo(()=>{let e={position:l,left:0,top:0};if(!B.floating)return e;let t=s(B.floating,w.x),r=s(B.floating,w.y);return p?{...e,transform:"translate("+t+"px, "+r+"px)",...o(B.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:t,top:r}},[l,p,B.floating,w.x,w.y]);return t.useMemo(()=>({...w,update:j,refs:M,elements:B,floatingStyles:V}),[w,j,M,B,V])}({strategy:"fixed",placement:T+("center"!==B?"-"+B:""),whileElementsMounted:(...e)=>(0,r.autoUpdate)(...e,{animationFrame:"always"===X}),elements:{reference:Q.anchor},middleware:[(v={mainAxis:M+en,alignmentAxis:V},{...(0,r.offset)(v),options:[v,S]}),W&&(A={mainAxis:!0,crossAxis:!1,limiter:"partial"===F?{...(0,r.limitShift)(C),options:[C,x]}:void 0,...ec},{...(0,r.shift)(A),options:[A,P]}),W&&(D={...ec},{...(0,r.flip)(D),options:[D,_]}),(O={...ec,apply:({elements:e,rects:t,availableWidth:r,availableHeight:i})=>{let{width:a,height:n}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${r}px`),o.setProperty("--radix-popper-available-height",`${i}px`),o.setProperty("--radix-popper-anchor-width",`${a}px`),o.setProperty("--radix-popper-anchor-height",`${n}px`)}},{...(0,r.size)(O),options:[O,U]}),et&&{...{name:"arrow",options:w=m={element:et,padding:z},fn(e){let{element:t,padding:i}="function"==typeof w?w(e):w;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?(0,r.arrow)({element:t.current,padding:i}).fn(e):{}:t?(0,r.arrow)({element:t,padding:i}).fn(e):{}}},options:[m,y]},$({arrowWidth:ea,arrowHeight:en}),H&&(N={strategy:"referenceHidden",...ec},{...(0,r.hide)(N),options:[N,L]})]}),[ep,eh]=I(ef),ey=(0,g.useCallbackRef)(K);(0,p.useLayoutEffect)(()=>{em&&ey?.()},[em,ey]);let ew=eg.arrow?.x,ev=eg.arrow?.y,eS=eg.arrow?.centerOffset!==0,[eb,eC]=t.useState();return(0,p.useLayoutEffect)(()=>{Y&&eC(window.getComputedStyle(Y).zIndex)},[Y]),(0,l.jsx)("div",{ref:el.setFloating,"data-radix-popper-content-wrapper":"",style:{...ed,transform:em?ed.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eb,"--radix-popper-transform-origin":[eg.transformOrigin?.x,eg.transformOrigin?.y].join(" "),...eg.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,l.jsx)(k,{scope:j,placedSide:ep,onArrowChange:er,arrowX:ew,arrowY:ev,shouldHideArrow:eS,children:(0,l.jsx)(c.Primitive.div,{"data-side":ep,"data-align":eh,...G,ref:ee,style:{...G.style,animation:em?void 0:"none"}})})})});D.displayName=E;var _="PopperArrow",O={top:"bottom",right:"left",bottom:"top",left:"right"},U=t.forwardRef(function(e,t){let{__scopePopper:r,...i}=e,a=P(_,r),n=O[a.placedSide];return(0,l.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,l.jsx)(d,{...i,ref:t,style:{...i.style,display:"block"}})})});function R(e){return null!==e}U.displayName=_;var $=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:i,middlewareData:a}=t,n=a.arrow?.centerOffset!==0,o=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[u,c]=I(r),l={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+o/2,f=(a.arrow?.y??0)+s/2,m="",g="";return"bottom"===u?(m=n?l:`${d}px`,g=`${-s}px`):"top"===u?(m=n?l:`${d}px`,g=`${i.floating.height+s}px`):"right"===u?(m=`${-s}px`,g=n?l:`${f}px`):"left"===u&&(m=`${i.floating.width+s}px`,g=n?l:`${f}px`),{data:{x:m,y:g}}}});function I(e){let[t,r="center"]=e.split("-");return[t,r]}e.s(["Anchor",()=>A,"Arrow",()=>U,"Content",()=>D,"Root",()=>C,"createPopperScope",()=>v],853660)},75830,586318,e=>{"use strict";var t=e.i(271645),r=e.i(30030),i=e.i(820783),a=e.i(991918),n=e.i(843476);function o(e){let o=e+"CollectionProvider",[s,u]=(0,r.createContextScope)(o),[c,l]=s(o,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:i}=e,a=t.default.useRef(null),o=t.default.useRef(new Map).current;return(0,n.jsx)(c,{scope:r,itemMap:o,collectionRef:a,children:i})};d.displayName=o;let f=e+"CollectionSlot",m=t.default.forwardRef((e,t)=>
1{let{scope:r,children:o}=e,s=l(f,r),u=(0,i.useComposedRefs)(t,s.collectionRef);return(0,n.jsx)(a.Slot,{ref:u,children:o})});m.displayName=f;let g=e+"CollectionItemSlot",p="data-radix-collection-item",h=t.default.forwardRef((e,r)=>{let{scope:o,children:s,...u}=e,c=t.default.useRef(null),d=(0,i.useComposedRefs)(r,c),f=l(g,o);return t.default.useEffect(()=>(f.itemMap.set(c,{ref:c,...u}),()=>void f.itemMap.delete(c))),(0,n.jsx)(a.Slot,{...{[p]:""},ref:d,children:s})});return h.displayName=g,[{Provider:d,Slot:m,ItemSlot:h},function(r){let i=l(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=i.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(i.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[i.collectionRef,i.itemMap])},u]}e.s(["createCollection",()=>o],75830);var s=t.createContext(void 0);function u(e){let r=t.useContext(s);return e||r||"ltr"}e.s(["useDirection",()=>u],586318)}]);

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.