"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[60],{189:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});const n={container:"YpBrAgGQ",imageContainer:"ddOroEQQ",tiersContainer:"b7Oterhj",ordersTable:"llbiTeTS",button:"hFn25pfA",dot:"HPhqesO3",mobileHidden:"uop0z1AH",modalOverlay:"gbSYvbOx",infoModal:"QPtoqunx",modalContent:"bF93W0kK",desktopHiddenRow:"TTzSqEcV"}},308:(e,t,i)=>{const n=i(153);(0,i(2).createEntrypoint)("inveterate_membership_benefits",n.InveterateMembershipBenefits)},153:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InveterateMembershipBenefits=function({mainImageSrc:e,benefitsRowsData:t,benefitsToShow:i="all",hideValueColumn:n,hideLoginLink:o=!1,useSharedState:c}){var u,h,m,p;if(!t||0===t.rows.length)return null;const f=c(),{addToCart:b,openCart:v}=f((e=>({addToCart:e.addToCart,openCart:e.openCart}))),x=(null===(u=t.subscriptionData)||void 0===u?void 0:u.variantId)&&(null===(h=t.subscriptionData)||void 0===h?void 0:h.sellingPlanId)?`/cart/add?id=${t.subscriptionData.variantId}&quantity=1&selling_plan=${t.subscriptionData.sellingPlanId}&properties[_inveterate_subscription]=true&return_to=/content/membership?viewcart=true`:null,[j,_]=(0,r.useState)(!1),g=e=>{e.preventDefault(),(()=>{if("READY"!=f.getState().cartStatus.status)return;if(!(null==t?void 0:t.subscriptionData))return;const e=f.getState().cart,i=null==e?void 0:e.items.find((e=>{var i;return e.id.toString()==(null===(i=t.subscriptionData)||void 0===i?void 0:i.variantId)}));if(i)return void _(!0);const n={items:[{id:t.subscriptionData.variantId,quantity:1,properties:{_inveterate_subscription:"true"},selling_plan:Number(t.subscriptionData.sellingPlanId)}]};b(n),v()})()},E=e=>{e.preventDefault(),(0,a.setCookie)("joinFreeMembership","true",{path:"/",maxAgeInSeconds:60,secure:!0,sameSite:"Lax"}),window.location.href="/account/membership"};return(0,r.useEffect)((()=>{var e,t,i,n;const s=document.getElementById("membership_join"),r=document.getElementById("membership_join_table"),a=document.getElementById("sticky_add_to_cart"),d=document.getElementById("membership_join_for_free");return s&&"true"!=(null===(e=s.dataset)||void 0===e?void 0:e.listener)&&(s.addEventListener("click",g),s.dataset.listener="true"),r&&"true"!=(null===(t=r.dataset)||void 0===t?void 0:t.listener)&&(r.addEventListener("click",g),r.dataset.listener="true"),a&&"true"!=(null===(i=a.dataset)||void 0===i?void 0:i.listener)&&(a.addEventListener("click",g),a.dataset.listener="true"),d&&"true"!=(null===(n=d.dataset)||void 0===n?void 0:n.listener)&&(d.addEventListener("click",E),d.dataset.listener="true"),()=>{null==s||s.removeEventListener("click",g),null==r||r.removeEventListener("click",g),null==a||a.removeEventListener("click",g),null==d||d.removeEventListener("click",E)}}),[]),(0,s.jsxs)("div",{class:d.default.container,children:[e&&(0,s.jsx)("div",{class:`${d.default.imageContainer} ${"all"!=i?d.default.mobileHidden:""}`,children:(0,s.jsx)("img",{src:e,alt:"Membership Benefits",class:d.default.image})}),(0,s.jsx)("div",{class:d.default.tiersContainer,children:"all"===i?(0,s.jsxs)("table",{class:d.default.ordersTable,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Membership Benefits"}),(0,s.jsx)("th",{children:"FREE"}),(0,s.jsx)("th",{children:"PAID"}),!n&&(0,s.jsx)("th",{children:"VALUE"})]})}),(0,s.jsx)("tbody",{children:t.rows.map(((e,t)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:e.description}),(0,s.jsx)("td",{children:e.FREE&&(0,s.jsx)("span",{className:d.default.dot})}),(0,s.jsx)("td",{children:e.PAID&&(0,s.jsx)("span",{className:d.default.dot})}),!n&&(0,s.jsx)("td",{children:e.VALUE})]},t)))}),(0,s.jsxs)("tfoot",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{colSpan:4,className:d.default.buttonGroup,children:[x&&(0,s.jsxs)("a",{id:"membership_join_table",className:d.default.button,href:"#",children:["Join Now For"," ",null!==(p=null===(m=t.subscriptionData)||void 0===m?void 0:m.price)&&void 0!==p?p:""]}),!o&&(0,s.jsxs)("p",{className:d.default.mobileHidden,children:["Already a member? ",(0,s.jsx)("a",{href:"/account/membership",children:"Log in"})," "]})]})}),(0,s.jsx)("tr",{className:d.default.desktopHiddenRow,children:(0,s.jsx)("td",{colSpan:4,style:{paddingTop:"8px"},children:!o&&(0,s.jsxs)("p",{children:["Already a member? ",(0,s.jsx)("a",{href:"/account/membership",children:"Log in"})," "]})})})]})]}):(0,s.jsxs)("table",{class:d.default.ordersTable,children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{children:"Free Membership Benefits"})})}),(0,s.jsx)("tbody",{children:t.rows.filter((e=>e.FREE)).map(((e,t)=>(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:e.description})},t)))}),(0,s.jsxs)("tfoot",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{colSpan:4,className:d.default.buttonGroup,children:[x&&(0,s.jsx)("a",{className:d.default.button,id:"membership_join_for_free",href:"/account/membership",children:"Join Now For Free"}),!o&&(0,s.jsxs)("p",{className:d.default.mobileHidden,children:["Already a member? ",(0,s.jsx)("a",{href:"/account/membership",children:"Log in"})," "]})]})}),(0,s.jsx)("tr",{className:d.default.desktopHiddenRow,children:(0,s.jsx)("td",{colSpan:4,style:{paddingTop:"8px"},children:!o&&(0,s.jsxs)("p",{children:["Already a member? ",(0,s.jsx)("a",{href:"/account/membership",children:"Log in"})," "]})})})]})]})}),j&&(0,s.jsx)(l.MembershipAddedModal,{closeModal:()=>{_(!1);const e=document.getElementById("infoModal");e&&e.remove()}})]})};const s=i(0),r=i(3),a=i(29),d=n(i(189)),l=i(154)},154:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MembershipAddedModal=void 0;const s=i(0),r=n(i(189));t.MembershipAddedModal=({closeModal:e})=>(0,s.jsx)("div",{id:"infoModal",className:r.default.modalOverlay,onClick:()=>e(),children:(0,s.jsx)("div",{className:r.default.infoModal,onClick:e=>e.stopPropagation(),children:(0,s.jsxs)("div",{className:r.default.modalContent,children:[(0,s.jsx)("h2",{children:"The membership already added to the cart"}),(0,s.jsx)("button",{className:r.default.button,onClick:()=>e(),children:"Close"})]})})})},29:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setCookie=function(e,t,i={}){if("undefined"==typeof window)return;const{path:n="/",expiresInDays:s=1,secure:r=!0,sameSite:a="Lax",maxAgeInSeconds:d=0}=i,l=new Date;l.setTime(l.getTime()+24*s*60*60*1e3);const o=`expires=${l.toUTCString()}`,c=r?"; Secure":"",u=`; SameSite=${a}`,h=d?`; Max-Age=${d}`:"";document.cookie=`${e}=${t}; ${o}; path=${n}${c}${u}${h}`}}},e=>{e.O(0,[1],(()=>e(e.s=308))),e.O()}]);