1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3877],{9713:(e,t,a)=>{a.d(t,{A:()=>d});var r=a(95155),l=a(29911),s=a(70694),o=a(70599),n=a(62223),i=a(34105);function c(e){if(e<1e3)return e.toString();let t=["k","m","b"],a=e,r=-1;for(;a>=1e3&&r<t.length-1;)a/=1e3,r++;let l=a.toFixed(1);return l.endsWith(".0")&&(l=l.slice(0,-2)),"".concat(l).concat(t[r])}function d(e){var t,a,d,u;let{className:g="",growlog:x,url:m="",showBreederLogo:p=!1,...h}=e,{slug:v,name:f,views:w=0,commentCount:b,environment:j,tree:N,strain:y,breederName:k,breederLogo:C}=x||{},A=Number(w)||0,S=Number(b)||0,_=(0,o.l)(null==N?void 0:null===(t=N.avatar)||void 0===t?void 0:t.path)||"/images/avatar-vegetative_v1.jpg",I=(null==y?void 0:y.breederName)||k||(null==y?void 0:null===(a=y.breeder)||void 0===a?void 0:a.name),P=(null==y?void 0:y.breederLogo)||(null==y?void 0:null===(d=y.breeder)||void 0===d?void 0:d.logo)||C;return(0,r.jsxs)("div",{className:"relative aspect-[6/10] w-full overflow-hidden rounded-lg bg-transparent group/card ".concat(g),"data-testid":"growlog-card",...h,children:[(0,r.jsx)("img",{src:_,alt:"".concat((null==N?void 0:N.name)||"Cannabis plant"," growlog in ").concat((null==j?void 0:j.name)||"cultivation environment"),className:" absolute inset-0 w-full h-full object-cover object-center transition-transform duration-300 ease-in-out group-hover/card:scale-110 ","data-testid":"growlog-card-image"}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col justify-between",children:[(0,r.jsx)("div",{className:"absolute transition-transform duration-300 ease-in-out group-hover:scale-110 inset-0 bg-gradient-to-b from-[rgba(0,0,0,0)] via-[rgba(0,0,0,0.2)] to-[rgba(0,0,0,0.7)]"}),(0,r.jsx)("div",{className:"flex justify-between z-10 p-3","data-testid":"growlog-card-top-row",children:(null===(u=x.user)||void 0===u?void 0:u.displayName)?(0,r.jsxs)(i.N_,{href:"/profile/".concat(encodeURIComponent(x.user.displayName)),className:"flex items-center gap-1.5 px-2 py-1 bg-[rgba(0,0,0,0.3)] rounded-full max-w-[70%]",onClick:e=>e.stopPropagation(),"data-testid":"growlog-card-user",children:[x.user.photoUrl?(0,r.jsx)("img",{src:x.user.photoUrl,alt:x.user.displayName||"Grower",className:"w-5 h-5 rounded-full object-cover flex-shrink-0"}):(0,r.jsx)("span",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary",children:(0,n.y)(x.user.displayName)}),(0,r.jsx)("span",{className:"gwj-text-chip text-white truncate",children:x.user.displayName||"Grower"})]}):(0,r.jsx)("div",{})}),(0,r.jsxs)("div",{className:"z-10 p-3 text-white space-y-2","data-testid":"growlog-card-info",children:[(null==N?void 0:N.name)&&(0,r.jsx)(i.N_,{href:m||"/growlog/"+v,onClick:h.onClick,className:"z-10 text-xl font-semibold leading-tight line-clamp-2 anchor-text-fix","data-testid":"growlog-card-name",children:null==N?void 0:N.name}),(null==y?void 0:y.name)&&(0,r.jsxs)("span",{className:"gwj-text-chip flex w-fit max-w-full items-center gap-1.5 truncate rounded-md bg-surface-container px-2 py-1 text-on-surface opacity-95","data-testid":"growlog-card-strain",title:I?"".concat(y.name," from ").concat(I):y.name,children:[P?(0,r.jsx)("img",{src:P,alt:I||y.name,className:"h-5 w-5 flex-shrink-0 rounded-full","data-testid":"growlog-card-breeder-avatar"}):(0,r.jsx)(s.A,{className:"inline-flex items-center justify-center h-5 w-5 flex-shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:y.name})]}),(0,r.jsxs)("div",{className:"gwj-text-chip flex flex-wrap items-center gap-3 text-white/85","data-testid":"growlog-card-stats-row",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5","data-testid":"growlog-card-views-container",children:[(0,r.jsx)(l.Ny1,{className:"text-xs"}),(0,r.jsx)("span",{children:c(A)})]}),S>0&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),(0,r.jsx)("span",{children:c(S)})]})]})]})]})]},x.slug)}},20193:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(12115),l=a(72152);function s(e){let{carouselId:t,carouselName:a,itemCount:s,categoryId:o,collectionId:n,campaignId:i,breederId:c,campaignType:d,strainId:u}=e,g=(0,r.useRef)(!1),x=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=new IntersectionObserver(r=>{r.forEach(r=>{r.isIntersecting&&!g.current&&t&&s>0&&((0,l.H5)({category:"Content",action:"Carousel Impression",label:a,value:s,carouselId:t,carouselName:a,itemCount:s,...o&&{categoryId:o},...n&&{collectionId:n},...i&&{campaignId:i},...c&&{breederId:c}
1,...d&&{campaignType:d},...u&&{strainId:u},page:"explore"}),g.current=!0,e.disconnect())})},{threshold:.1});return x.current&&e.observe(x.current),()=>{e.disconnect()}},[t,a,s,o,n,i,c,u]),{trackCarouselInteraction:e=>{(0,l.H5)({category:"Content",action:"Carousel ".concat(e),label:a,value:s,carouselId:t,carouselName:a,...o&&{categoryId:o},...n&&{collectionId:n},...i&&{campaignId:i},...c&&{breederId:c},page:"explore"})},trackItemClick:(e,r,s)=>{(0,l.H5)({category:"Content",action:"Carousel Item Click",label:"".concat(a," - ").concat(r),value:s,carouselId:t,carouselName:a,itemId:e,itemName:r,position:s,...o&&{categoryId:o},...n&&{collectionId:n},...i&&{campaignId:i},...c&&{breederId:c},page:"explore"})},trackSlideVisibility:e=>{let{breederId:r,campaignId:s,campaignTitle:i,position:c}=e;(0,l.H5)({category:"Content",action:"Slide Visible",label:"".concat(a," - ").concat(i),value:c,carouselId:t,carouselName:a,breederId:r,campaignId:s,campaignTitle:i,position:c,...o&&{categoryId:o},...n&&{collectionId:n},page:"explore"})},carouselRef:x}}},21513:(e,t,a)=>{a.d(t,{S:()=>i,SearchProvider:()=>n});var r=a(95155),l=a(12115),s=a(35695);let o=(0,l.createContext)(void 0),n=e=>{let{children:t}=e;var a=(0,s.usePathname)().split("/"),n=a.indexOf("search");let[i,c]=(0,l.useState)(n>-1?a[n+1].replaceAll("+"," "):"");return(0,r.jsx)(o.Provider,{value:{searchValue:i,setSearchValue:c},children:t})},i=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=(0,l.useContext)(o);if(!e)throw Error("useSearch must be used within a SearchProvider");return e}},31441:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(12115);let l=(e,t)=>{let[a,l]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let a=setTimeout(()=>{l(e)},t);return()=>{clearTimeout(a)}},[e]),a}},34105:(e,t,a)=>{a.d(t,{N_:()=>s,a8:()=>n,rd:()=>i});var r=a(30981),l=a(77519);let{Link:s,redirect:o,usePathname:n,useRouter:i,getPathname:c}=(0,r.A)(l.DT)},45741:(e,t,a)=>{a.d(t,{A:()=>m});var r=a(95155),l=a(12115),s=a(15305),o=a(6874),n=a.n(o),i=a(67384),c=a(35695),d=a(9713),u=a(86599),g=a(85005),x=a(20193);let m=e=>{let{title:t,url:a,sort:o="-score,-views",filters:m={},search:p="",emptyText:h,initialGrowlogs:v=null,breederId:f=null,strainId:w=null}=e,[b,j]=(0,l.useState)(v||[]),[N,y]=(0,l.useState)(!v),k=(0,c.useRouter)(),C={align:"start",slidesToScroll:2,containScroll:"trimSnaps",loop:b.length>3},[A,S]=(0,g.A)(C),{trackCarouselInteraction:_,trackItemClick:I,trackSlideVisibility:P,carouselRef:z}=(0,x.A)({carouselId:"growlog-carousel-".concat((null==m?void 0:m.breeder)||"general"),carouselName:t||"Growlog Carousel",itemCount:b.length,breederId:f||(null==m?void 0:m.breeder),strainId:w}),E=(0,l.useCallback)(()=>{S&&(S.scrollPrev(),_("Previous"))},[S,_]),H=(0,l.useCallback)(()=>{S&&(S.scrollNext(),_("Next"))},[S,_]);(0,l.useEffect)(()=>{v||(async()=>{y(!0),j((await (0,i.$K)({page:1,pageSize:8,queryFilters:m,sort:o,search:p,query:p})).rows||[]),y(!1)})()},[m,o,p,v]);let L=e=>{k.push("/growlog/".concat(e.slug))};return(0,r.jsxs)("section",{"aria-labelledby":"carousel-heading",className:"xl:mx-auto xl:max-w-7xl","data-testid":"growlog-carousel",children:[(0,r.jsx)("div",{className:"flex items-center justify-between",children:a?(0,r.jsx)(n(),{href:a,children:(0,r.jsxs)("h2",{id:"carousel-heading",className:"text-lg tracking-tight text-secondary font-semibold gap-2 inline-flex items-center","data-testid":"growlog-carousel-title",children:[t,(0,r.jsx)(u.A,{})]})}):(0,r.jsx)("h2",{id:"carousel-heading",className:"text-lg tracking-tight text-secondary font-semibold","data-testid":"growlog-carousel-title",children:t})}),N||0!==b.length?(0,r.jsxs)("div",{className:"relative group/carousel -mx-2",ref:z,children:[(0,r.jsx)("div",{ref:A,className:"overflow-hidden","data-testid":"growlog-carousel-viewport",children:(0,r.jsx)("div",{className:"flex","data-testid":"growlog-carousel-items",children:N?Array(8).fill(0).map((e,t)=>(0,r.jsxs)("div",{className:"flex-[0_0_auto] px-2 py-4 w-[min(44vw,220px)] sm:w-[220px] animate-pulse","data-testid":"growlog-carousel-loading-item-loading",children:[(0,r.jsx)("div",{className:"bg-outline-variant rounded-lg w-full aspect-[6
1/10]"}),(0,r.jsx)("span",{className:"sr-only",children:"Loading..."})]},"loading_"+t)):b.map((e,t)=>(0,r.jsx)("div",{className:"flex-[0_0_auto] px-2 py-4 w-[min(44vw,220px)] sm:w-[220px]","data-testid":"growlog-carousel-item",children:(0,r.jsx)(d.A,{growlog:e,onClick:()=>{var a;I(e._id||e.id||e.slug,(null===(a=e.tree)||void 0===a?void 0:a.name)||e.name||"Unnamed Growlog",t),L(e)}})},t))})}),(0,r.jsx)("button",{onClick:E,className:"absolute hidden lg:flex items-center left-0 group-hover/carousel:opacity-100 opacity-0 top-4 bottom-4 transition py-4 bg-gradient-to-r from-[rgba(0,0,0,0.7)] via-[rgba(0,0,0,0.5)] to-[rgba(0,0,0,0)] px-4 text-white stroke-4 z-10","data-testid":"growlog-carousel-prev-button",children:(0,r.jsx)(s.Y5o,{className:"font-bold"})}),(0,r.jsx)("button",{onClick:H,className:"absolute hidden lg:flex items-center right-0 top-4 bottom-4 group-hover/carousel:opacity-100 transition opacity-0 bg-gradient-to-r from-[rgba(0,0,0,0)] via-[rgba(0,0,0,0.5)] to-[rgba(0,0,0,0.7)] text-white px-4 py-4 border-gray-700 text-sm z-10","data-testid":"growlog-carousel-next-button",children:(0,r.jsx)(s.xyO,{})})]}):(0,r.jsx)("div",{className:"px-2 py-4 text-center","data-testid":"growlog-carousel-empty",children:(0,r.jsx)("p",{children:h||"No growlogs found"})})]})}},62223:(e,t,a)=>{a.d(t,{y:()=>r});function r(e){let t=(e||"").trim().split(/\s+/).filter(Boolean).slice(0,2);return 0===t.length?"?":t.map(e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.toUpperCase()}).join("")}},70694:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(95155),l=a(94804);function s(e){let{className:t}=e;return(0,r.jsx)(l.A,{name:"icon-strain",className:null!=t?t:"inline-block mr-1.5"})}},77519:(e,t,a)=>{a.d(t,{DT:()=>s,IB:()=>l});var r=a(49984);let l=["en","es","de","pt"],s=(0,r.A)({locales:l,defaultLocale:"en",localePrefix:"as-needed"})},86599:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(95155);function l(){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:".8em",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,r.jsx)("path",{d:"M4.5 3l5 5-5 5"})})}}}]);
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.