PageSourceSearch

https://growithjane.com/_next/static/chunks/1313-f190399fecb2afd6.js

js growithjane.com collected 2026-10-01 16:31:08 UTC 15,244 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1313],{1439:(e,o,t)=>{t.d(o,{CI:()=>l.CI,IG:()=>d,db:()=>c,j2:()=>u});var r=t(23915),l=t(93004),n=t(35317),a=t(81427),i=t(90858);let s=(0,r.Wp)({apiKey:"AIzaSyD5lIam2OmqyDBAT0LDTKSRdu5I7xDnL1g",authDomain:"jane-14027.firebaseapp.com",projectId:"jane-14027",storageBucket:"jane-14027.appspot.com",databaseURL:"https://jane-14027.firebaseio.com",messagingSenderId:"164029308690",appId:"1:164029308690:web:5f05e7a61de534c8"}),u=(0,l.xI)(s),c=(0,n.aU)(s);(0,a.Uz)(s);let d=(0,i.c7)(s)},86317:(e,o,t)=>{t.d(o,{$P:()=>v,L8:()=>u,Ob:()=>d,Tz:()=>c,jw:()=>s,rS:()=>w,rl:()=>i});var r=t(61125);let l="https://api.growithjane.com/",n=async function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=await fetch(l+e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",headers:{"Content-Type":"application/json"},redirect:"follow",body:JSON.stringify(o)});if(!t.ok)throw Error("HTTP error! status: ".concat(t.status));return t.json()},a=e=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),i=async(e,o)=>{if(a(e))return e;try{let t=await n("sso/email",{username:e,password:o});if(t.error)throw Error(t.error);let r=t.email;return r.includes("@")||(r+="@growithjane.usertoken"),r}catch(o){if(console.error("Error resolving username to email:",o),"Invalid credentials"===o.message||401===o.status)throw Error("Invalid username or password");if(!e.includes("@"))return e+"@growithjane.usertoken";throw o}},s=async e=>{try{let o=await n("sso/session",{idToken:e});return console.log("Session created:",JSON.stringify(o)),new r.A().set("__session",o.cookie,{domain:".growithjane.com",path:"/",maxAge:o.maxAge,secure:!0,sameSite:"lax"}),o}catch(e){throw console.error("Error creating session:",e),e}},u=async e=>{try{var o,t;let r=await n("sso/onboarding",e);return{success:null!==(t=r.success)&&void 0!==t?t:!(null===(o=r.errors)||void 0===o?void 0:o.length),errors:r.errors||[]}}catch(e){throw console.error("Complete onboarding error:",e),e}},c=()=>{window.location.href="".concat("https://social.growithjane.com/","/session/sso")},d=async()=>{try{let e=await fetch("".concat(l,"sso/logout"),{method:"GET",credentials:"include"});if(!e.ok)throw Error("SSO logout failed with status ".concat(e.status));let o=await e.json(),t=new r.A;return h(),t.remove("authToken",{path:"/"}),o.redirect&&(window.location.href=o.redirect),o}catch(e){throw console.error("SSO logout error:",e),e}},v=()=>!!new r.A().get("__session"),w=()=>new r.A().get("__session")||null,h=()=>{new r.A().remove("__session",{path:"/",domain:".growithjane.com"})}},88891:(e,o,t)=>{t.d(o,{A:()=>c,O:()=>u});var r=t(95155),l=t(12115),n=t(1439),a=t(93004),i=t(86317);let s=(0,l.createContext)(null),u=e=>{let{children:o}=e,[t,u]=(0,l.useState)(null),[c,d]=(0,l.useState)(!0),[v,w]=(0,l.useState)(!1),[h,p]=(0,l.useState)(null);(0,l.useEffect)(()=>{(()=>{let e=(0,i.$P)(),o=(0,i.rS)();w(e),p(o)})()},[]),(0,l.useEffect)(()=>{let e,o=!1;return(async()=>{try{await (0,a.oM)(n.j2,a.F0)}catch(e){console.error("Failed to set Firebase auth persistence:",e)}o||(e=(0,a.hg)(n.j2,async e=>{if(u(e),e){if(!(0,i.$P)())try{let o=await e.getIdToken(!0);await (0,i.jw)(o),w(!0),p((0,i.rS)())}catch(e){console.error("Failed to create backend session:",e)}}else w(!1),p(null);d(!1)}))})(),()=>{o=!0,null==e||e()}},[]);let g=async()=>{if(t)try{let e=await t.getIdToken(!0);await (0,i.jw)(e),w(!0),p((0,i.rS)())}catch(e){throw console.error("Failed to refresh session:",e),e}};return(0,r.jsx)(s.Provider,{value:{user:t,loading:c,hasSession:v,sessionCookie:h,refreshSession:g},children:o})},c=()=>{let e=(0,l.useContext)(s);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}},92607:(e,o,t)=>{t.d(o,{$2:()=>G,$n:()=>z,BC:()=>D,C0:()=>S,F4:()=>b,Fy:()=>M,Gm:()=>F,HM:()=>m,KJ:()=>T,QA:()=>x,Re:()=>O,SR:()=>A,Tu:()=>R,X2:()=>k,ZK:()=>y,e6:()=>C,j:()=>H,mH:()=>U,mp:()=>j,qM:()=>P,qx:()=>f,r7:()=>I,rp:()=>_,uk:()=>B,vr:()=>N,x5:()=>E,zC:()=>L});var r=t(1439),l=t(90858);let n="https://api.growithjane.com/";function a(e,o,t){let r=Error("API ".concat(o," ").concat(t," failed with status ").concat(e.status));return r.status=e.status,r}async function i(){let e={"Content-Type":"application/json"};try{let o=r.j2.currentUser;if(o){let t=await o.getIdToken();e.Authorization="Bearer ".concat(t)}}catch(e){console.error("Error getting Firebase auth token:",e)}return e}function s(){var e,o;return null!==(o=null===(e=r.j2.currentUser)||void 0===e?void 0:e.uid)&&void 0!==o?o:""}async function u(e){let o=await fetch("".concat(n).concat(e),{method:"GET",credentials:"include",headers:await i()});if(!o.ok)throw a(o,"GET",e);return o.json()}async function c(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=await fetch("".concat(n).concat(e),{method:"POST",credentials:"include",headers:await i(),body:JSON.stringify(o)});if(!t.ok)throw a(t,"POST",e);return t.json()}async function d(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=await fetch("".concat(n).concat(e),{method:"PATCH",credentials:"include",headers:await i(),body:JSON.stringify(o)});if(!t.ok)throw a(t,"PATCH",e);return t.json()}async function v(e){let o=await fetch("".concat(n).concat(e),{method:"DELETE",credentials:"include",headers:await i()});
1if(!o.ok)throw a(o,"DELETE",e);return o.json()}function w(e){var o,t,r,l,n,a,i,s,u,c,d,v,w,p,g,m,f,y,I,b;let C=null!==(o=e.user)&&void 0!==o?o:{},k=null!==(t=e.stats)&&void 0!==t?t:{},j=null!==(r=e.userGrowlogs)&&void 0!==r?r:[],A=j.reduce((e,o)=>e+(Number(o.views)||0),0),U=Number(k.totalGrowlogViews)||A,T=null!==(l=e.recentFollowers)&&void 0!==l?l:[],E=null!==(n=e.recentFollowing)&&void 0!==n?n:[];return{userId:null!==(a=C.uid)&&void 0!==a?a:"",displayName:null!==(i=C.displayName)&&void 0!==i?i:"",bio:C.bio,avatarUrl:null!==(s=C.photoUrl)&&void 0!==s?s:C.avatarUrl,profileColorHex:null!==(c=null!==(u=C.profileColorHex)&&void 0!==u?u:e.profileColorHex)&&void 0!==c?c:void 0,isPublic:!e.isPrivate,isPro:null!==(d=C.isPro)&&void 0!==d&&d,isFollowing:null!==(v=e.isFollowing)&&void 0!==v&&v,canViewPrivateInfo:null!==(w=e.canViewPrivateInfo)&&void 0!==w&&w,joinDate:null!==(m=null!==(g=null!==(p=C.joinDate)&&void 0!==p?p:C.joinedAt)&&void 0!==g?g:C.createdAt)&&void 0!==m?m:null,recentFollowers:T.map(h),recentFollowing:E.map(h),userGrowlogs:j,discourseUsername:null!==(f=C.discourseUsername)&&void 0!==f?f:void 0,stats:{followers:null!==(y=k.followerCount)&&void 0!==y?y:0,following:null!==(I=k.followingCount)&&void 0!==I?I:0,growlogs:null!==(b=k.growlogCount)&&void 0!==b?b:0,views:U}}}function h(e){var o,t,r,l;return{uid:null!==(o=e.uid)&&void 0!==o?o:"",displayName:null!==(t=e.displayName)&&void 0!==t?t:"",avatarUrl:null!==(r=e.photoUrl)&&void 0!==r?r:e.avatarUrl,isPro:null!==(l=e.isPro)&&void 0!==l&&l,isFollowing:e.isFollowing}}function p(e){var o,t,r,l,n,a,i,u,c,d,v,w,h,g;let m=null!==(o=e.replies)&&void 0!==o?o:[],f=null!==(t=e.createdAt)&&void 0!==t?t:"",y=null!==(r=e.isDeleted)&&void 0!==r&&r,I=null!==(l=e.canEdit)&&void 0!==l&&l;return I||y||!f||e.userId!==s()||(I=Date.now()-new Date(f).getTime()<9e5),{id:null!==(a=null!==(n=e._id)&&void 0!==n?n:e.id)&&void 0!==a?a:"",growlogId:null!==(i=e.growlogId)&&void 0!==i?i:"",userId:null!==(u=e.userId)&&void 0!==u?u:"",parentId:e.parentId,body:null!==(c=e.body)&&void 0!==c?c:"",translatedBody:null!==(d=e.translatedBody)&&void 0!==d?d:null,isDeleted:y,userDisplayName:null!==(v=e.userDisplayName)&&void 0!==v?v:"Unknown",userAvatarUrl:null!==(w=e.userPhotoUrl)&&void 0!==w?w:e.userAvatarUrl,userIsPro:null!==(h=e.userIsPro)&&void 0!==h&&h,createdAt:f,updatedAt:null!==(g=e.updatedAt)&&void 0!==g?g:"",replies:m.map(p),canEdit:I}}function g(e){var o,t,r,l,n,a,i,s,u,c,d,v;let w="object"==typeof e.rule&&null!==e.rule?e.rule:{},h=null!==(o=w.threshold)&&void 0!==o?o:e.threshold,p=null!==(t=w.showThreshold)&&void 0!==t?t:e.showThreshold,g=null!==(r=w.metric)&&void 0!==r?r:e.metric,m=null!==(l=w.operator)&&void 0!==l?l:e.operator;return{id:null!==(a=null!==(n=e._id)&&void 0!==n?n:e.id)&&void 0!==a?a:"",slug:null!==(i=e.slug)&&void 0!==i?i:"",title:null!==(s=e.title)&&void 0!==s?s:"",description:null!==(u=e.description)&&void 0!==u?u:"",category:null!==(c=e.category)&&void 0!==c?c:"custom",icon:e.icon,tier:e.tier,isActive:null===(d=e.isActive)||void 0===d||d,unlocked:null!==(v=e.unlocked)&&void 0!==v&&v,unlockedAt:e.unlockedAt,grantedBy:e.grantedBy,ruleOperator:"string"==typeof m?m.trim().toLowerCase():void 0,ruleThreshold:"number"==typeof h?h:"string"==typeof h&&Number(h)||void 0,showThreshold:"boolean"==typeof p?p:"true"===p||"false"!==p&&void 0,measuredMetric:"string"==typeof g&&g.trim()?g.trim().toLowerCase():void 0}}function m(e){if(!e)return"New grower";let o=new Date(e);if(isNaN(o.getTime()))return"New grower";let t=new Date,r=(t.getFullYear()-o.getFullYear())*12+(t.getMonth()-o.getMonth());if(r<1)return"New grower";if(r<12)return"".concat(r," month").concat(1!==r?"s":"");let l=Math.floor(r/12),n=r%12;return 0===n?"".concat(l," year").concat(1!==l?"s":""):"".concat(l,"y ").concat(n,"m")}let f=async()=>{var e;let o=await u("user/profile/me");return w(null!==(e=o.data)&&void 0!==e?e:o)},y=async e=>{var o;let t=await u("public/users/".concat(encodeURIComponent(e),"/profile"));return w(null!==(o=t.data)&&void 0!==o?o:t)},I=async e=>{var o;let t={uid:s()};void 0!==e.displayName&&(t.displayName=e.displayName),void 0!==e.bio&&(t.bio=e.bio),void 0!==e.isPublic&&(t.isPrivate=!e.isPublic),void 0!==e.avatarUrl&&(t.photoUrl=e.avatarUrl),e.clearProfileColor?t.profileColorHex=null:void 0!==e.profileColorHex&&(t.profileColorHex=e.profileColorHex);let r=await c("user/profile/update",t);
1if(r&&!1===r.success){let e=Error(r.message||"Failed to update profile");throw e.errorCode=r.errorCode,e}return w(null!==(o=r.data)&&void 0!==o?o:r)},b=async e=>{var o;if(!e.type.startsWith("image/"))throw Error("File must be an image");if(e.size>5242880)throw Error("File size exceeds 5MB limit");let t=null===(o=r.j2.currentUser)||void 0===o?void 0:o.uid;if(!t)throw Error("Must be signed in to upload an avatar");let n=e.name.includes(".")?e.name.split(".").pop():"jpg",a="".concat(t,"/").concat(Date.now(),".").concat(n),i=(0,l.KR)(r.IG,a);return await (0,l.D)(i,e,{contentType:e.type}),{url:await (0,l.qk)(i)}},C=e=>c("user/follow/add",{followingId:e}),k=e=>c("user/follow/remove",{followingId:e}),j=async e=>!0===(await u("user/follow/check?followingId=".concat(encodeURIComponent(e)))).isFollowing,A=async function(e){var o,t,r,l,n,a,i;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,d=await u("user/follow/followers?userId=".concat(encodeURIComponent(e),"&limit=").concat(s,"&skip=").concat(c)),v=null!==(t=null!==(o=d.followers)&&void 0!==o?o:d.rows)&&void 0!==t?t:[],w=null!==(r=d.meta)&&void 0!==r?r:{};return{rows:v.map(h),total:null!==(n=null!==(l=w.total)&&void 0!==l?l:d.total)&&void 0!==n?n:0,page:null!==(a=w.page)&&void 0!==a?a:1,hasMore:w.pages?c+s<w.total:null!==(i=d.hasMore)&&void 0!==i&&i}},U=async function(e){var o,t,r,l,n,a,i;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,d=await u("user/follow/following?userId=".concat(encodeURIComponent(e),"&limit=").concat(s,"&skip=").concat(c)),v=null!==(t=null!==(o=d.following)&&void 0!==o?o:d.rows)&&void 0!==t?t:[],w=null!==(r=d.meta)&&void 0!==r?r:{};return{rows:v.map(e=>({...h(e),isFollowing:!0})),total:null!==(n=null!==(l=w.total)&&void 0!==l?l:d.total)&&void 0!==n?n:0,page:null!==(a=w.page)&&void 0!==a?a:1,hasMore:w.pages?c+s<w.total:null!==(i=d.hasMore)&&void 0!==i&&i}},T=async function(){var e,o,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,l=await u("user/users/recommended?limit=".concat(r)),n=null!==(o=null!==(e=l.users)&&void 0!==e?e:l.rows)&&void 0!==o?o:[];return{rows:n.map(h),total:null!==(t=l.total)&&void 0!==t?t:n.length,page:1,hasMore:!1}},E=async function(e){var o,t,r,l,n,a,i;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,d=await u("user/profile/search?query=".concat(encodeURIComponent(e),"&limit=").concat(s,"&skip=").concat(c)),v=null!==(t=null!==(o=d.rows)&&void 0!==o?o:d.users)&&void 0!==t?t:[],w=null!==(r=d.meta)&&void 0!==r?r:{},p=null!==(n=null!==(l=w.total)&&void 0!==l?l:d.total)&&void 0!==n?n:v.length;return{rows:v.map(h),total:p,page:null!==(a=w.page)&&void 0!==a?a:Math.floor(c/s)+1,hasMore:w.pages?c+v.length<p:null!==(i=d.hasMore)&&void 0!==i&&i}},P=async(e,o)=>{var t,r;let l={uid:null!=e?e:s()};(null==o?void 0:o.limit)!==void 0&&(l.limit=o.limit),(null==o?void 0:o.skip)!==void 0&&(l.skip=o.skip);let n=await c("public/favorites/get",l);return Array.isArray(n)?{rows:n,total:n.length,hasMore:!1}:{rows:null!==(t=n.rows)&&void 0!==t?t:[],total:null!==(r=n.total)&&void 0!==r?r:0,hasMore:!!n.hasMore}},S=async e=>{var o;let t=await c("public/growlogs/search",{filters:{user_id:e,active:!0}}),r=Array.isArray(t)?t:null!==(o=t.rows)&&void 0!==o?o:[];return{rows:r,total:r.length,hasMore:!1}},F=e=>c("public/favorites/add",{uid:s(),slug:e}),M=e=>c("public/favorites/remove",{uid:s(),slug:e}),N=async function(e){var o,t,r,l;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,s="public/comments/".concat(encodeURIComponent(e),"?limit=").concat(n,"&offset=").concat(a);i&&(s+="&locale=".concat(encodeURIComponent(i)));let c=await u(s);return{rows:(null!==(t=null!==(o=c.comments)&&void 0!==o?o:c.rows)&&void 0!==t?t:[]).map(p),total:null!==(r=c.total)&&void 0!==r?r:0,hasMore:null!==(l=c.hasMore)&&void 0!==l&&l}},D=async(e,o,t)=>{var r;let l=await c("user/comments/add",{growlogId:e,body:o,parentId:t});return p(null!==(r=l.comment)&&void 0!==r?r:l)},x=async(e,o)=>{var t;let r=await d("user/comments/".concat(encodeURIComponent(e)),{body:o});return p(null!==(t=r.comment)&&void 0!==t?t:r)},R=e=>v("user/comments/".concat(encodeURIComponent(e))),_=async()=>({rows:(await u("user/my-growlogs?filter=all&limit=500")).growlogs||[]}),O=(e,o)=>d("user/growlogs/".concat(encodeURIComponent(e),"/privacy"),{privacy:o}),H=async function(){var e;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null!==(e=(await u("user/follow/growlogs?limit=".concat(o,"&skip=").concat(t))).growlogs)&&void 0!==e?e:[]},z=async()=>{let e=await c("public/favorites/getSlugs",{uid:s()});return Array.isArray(e)?e:[]},B=async e=>{var o,t,r;let l=await u("public/users/".concat(encodeURIComponent(e),"/achievements")),n=null!==(o=l.achievements)&&void 0!==o?o:[];return{achievements:n.map(g),earnedCount:null!==(t=l.earnedCount)&&void 0!==t?t:n.filter(e=>e.unlocked).length,totalCount:null!==(r=l.totalCount)&&void 0!==r?r:n.length}},G=async()=>{try{await c("user/achievements/check")}catch(e){}},L=async(e,o,t,r)=>{let l={contentType:e,contentId:o,reason:t};return r&&(l.additionalDetails=r),c("user/reports/submit",l)}}}]);

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.