1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d00100cc-0c03-55d8-96ff-aff788dd6be8")}catch(e){}}(); 3import{s as e,t}from"./jsx-runtime-D4ePz0Hl.js";import{t as n}from"./react-BXH-GOAS.js";import{D as r,N as i,R as a,f as o,l as s}from"./components-CDo3yjgw.js";import{t as c}from"./Trans-tHiUt0Wm.js";import{t as l}from"./useTranslation-xRzBcOIb.js";import{t as u}from"./classnames-B9Sa-P4w.js";import{a as d}from"./buildPostAuthRedirectUrl-CwSA4760.js";import{n as f}from"./community-Bclg0n5L.js";import{n as ee}from"./CsrfContext-ByWWfcRz.js";import{z as te}from"./QueryClientProvider-Cdu2unP4.js";import{i as ne}from"./nectarTrackingFields-BN5KBl15.js";import{i as re,r as ie,t as p}from"./nectarPageBlock-Dhr05eLZ.js";import{n as m}from"./transition-B4qu-R77.js";import{d as h}from"./useCommunityPosts-DdDplmLs.js";import{t as g}from"./XMarkIcon-DmEhIDFO.js";import{t as ae,u as oe}from"./SignupAction-DRL8Ijkc.js";import{i as se,n as ce,o as _}from"./ActionForm-ubtCpxTm.js";import{t as v}from"./CommunityMemberActionsProvider-CxjYyBf-.js";import{n as y,t as b}from"./BottomSheetDialog-DcPGSOIu.js";import{r as x,t as S}from"./PillButton-DKmaS7V0.js";import{n as le,t as ue}from"./getFullCommunityName-D1FaVagz.js";import{t as C}from"./Dialog-CMOTIGCZ.js";import{n as w}from"./Avatar-BIBwmBTY.js";import{t as T}from"./useCommunityLogoUrl-aJXeAVzG.js";var E=e(n());function D({title:e,titleId:t,...n},r){return E.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?E.createElement(`title`,{id:t},e):null,E.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z`}))}var O=E.forwardRef(D),k=e(t(),1);function A({isOpen:e,onOpenChange:t,isLoading:n,children:r,showCloseButton:i,hideOverflow:a}){return(0,k.jsx)(_,{isOpen:e,onClose:e=>{n||t?.(e)},className:`shadow-lg overflow-hidden sm:rounded-md`,style:{"--overlay-background-color":`#00000030`,"--modal-close-button-color":void 0,"--modal-close-button-placement-top":`24px`,"--modal-close-button-placement-right":`24px`},showRoundedBorders:!1,showCloseButton:i,shouldCloseOnOutsideClick:!n,hideOverflow:a,overlayClassName:`!z-[999]`,children:r})}function j(e){let t=e.replace(`#`,``).trim().toLowerCase();return t.length===6&&/^[0-9a-f]+$/.test(t)?t:t.length===8&&/^[0-9a-f]+$/.test(t)?t.slice(0,6):t.length===3&&/^[0-9a-f]+$/.test(t)||t.length===4&&/^[0-9a-f]+$/.test(t)?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:null}function M(e){let t=e.match(/#([0-9a-fA-F]{3,8})\b/g);return t&&t.length>0?j(t[0]):null}function N(e){let t=Number.parseInt(e.slice(0,2),16)/255,n=Number.parseInt(e.slice(2,4),16)/255,r=Number.parseInt(e.slice(4,6),16)/255,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4;return .2126*i+.7152*a+.0722*o}function P(e){if(!e||typeof e!=`string`)return null;let t=j(e);return!t&&e.toLowerCase().includes(`gradient`)&&(t=M(e)),t}function F(e,t){let n=P(e),r=P(t);if(!n||!r)return null;let i=N(n),a=N(r),o=Math.max(i,a),s=Math.min(i,a);return(o+.05)/(s+.05)}var I=2;function L(e,t){let n=F(e,t);return n===null?!1:n>=I}function R(e){if(!e||typeof e!=`string`)return`#000000`;let t=j(e);return!t&&e.toLowerCase().includes(`gradient`)&&(t=M(e)),t?N(t)>.5?`#000000`:`#FFFFFF`:`#000000`}var z=()=>{let{t:e}=l();return{consentText:e(`shared.cta.gdpr_signup_consent`)||`I consent to receive newsletters via email.`,termsOfUseText:e(`footer.terms_of_use`)||`Terms of Use`,privacyPolicyText:e(`footer.privacy_policy`)||`Privacy Policy`,andText:e(`shared.cta.and`)||`and`,consentTextVariantTwo:`${e(`shared.cta.gdpr_signup_consent`)} ${e(`shared.cta.sign_up`)}`||`I consent to receive newsletters via Email. Signup`,termsOfServiceText:e(`meta.titles.tos`)||`Terms of Service`,chooseNewslettersText:e(`shared.cta.choose_newsletters`)||`Choose your newsletters`,selectAllText:e(`shared.cta.select_all`)||`Select all`}},B=async({publication_id:e,email:t,redirect_to:n})=>{let r=new FormData;return r.append(`publication_id`,e),r.append(`email`,t),r.append(`redirect_to`,n),r.append(`should_return_redirect_url`,`true`),await(await fetch(`/authenticate/sso_redirect`,{method:`POST`,body:r})).json()},V=({checked:e,onChange:t})=>(0,k.jsxs)(`label`,{className:`flex w-full cursor-pointer items-start gap-2 text-left text-[13px] leading-5 text-black/60`,children:[(0,k.jsx)(`input`,{type:`checkbox`,name:`community_terms_accepted`,value:`true`,checked:e,onChange:e=>t(e.target.checked),required:!0,className:`mt-0.5 h-4 w-4 shrink-0 cursor-pointer rounded border border-gray-300 accent-black`}),(0,k.jsx)(`span`,{children:(0,k.jsx)(c,{i18nKey:`community.join.terms_consent`,components:{termsLink:(0,k.jsx)(`a`,{href:`https://www.beehiiv.com/community-terms`,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-1 hover:opacity-80`,onClick:e=>e.stopPropagation()})}})})]}),H=e(u(),1),U=({className:e,...t})=>(0,k.jsx)(`input`,{className:(0,H.default)(`h-12 w-full rounded-full border border-black/10 bg-black/5 px-4 text-[16px] font-medium leading-4 tracking-[-0.13px] text-black outline-none ring-0 placeholder:text-black/30 sm:text-[13px] sm:focus:text-[13px]`,`transition-colors duration-150 hover:border-black/20 focus:border-black/30 focus:bg-black/[0.07]`,e),...t}),W=({imageUrl:e,imageAlt:t,title:n,description:r,className:i})=>{let a=y();return(0,k.jsxs)(`div`,{className:(0,H.default)(`flex w-full flex-col items-center gap-8`,i),children:[e&&(0,k.jsx)(`img`,{src:w(e,128),alt:t,className:`h-16 w-auto rounded-md object-contain`}),(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-[11px] text-center`,children:[(0,k.jsx)(m.Title,{as:`h2`,className:(0,H.default)(`font-semibold text-black`,{"text-2xl leading-7":a,"text-[28px] leading-8 tracking-[-0.56px]":!a}),children:n}),r&&(0,k.jsx)(`p`,{className:`text-[15px] leading-5 text-black/50`,children:r})]})]})},G=({onClose:e,label:t,className:n})=>(0,k.jsx)(`button`,{type:`button`,onClick:e,className:(0,H.default)(`group flex items-center justify-center rounded-full transition-colors duration-150 hover:bg-black/5 active:scale-95`,n),"aria-label":t,children:(0,k.jsx)(g,{className:`size-6 text-black opacity-50 transition-opacity duration-150 group-hover:opacity-80`,"aria-hidden":`true`})}),K=({isOpen:e,onClose:t,title:n,description:r,closeLabel:i,publicationName:a,children:o,footer:s,disableInitialTransition:c=!1})=>{let l=y(),u=(0,k.jsxs)(`div`,{className:`flex w-full max-w-[320px] flex-col items-center gap-8`,children:[(0,k.jsx)(W,{imageUrl:T(),imageAlt:`${a} logo`,title:n,description:r}),o,s]});return l?(0,k.jsxs)(b,{isOpen:e,onClose:t,disableInitialTransition:c,absolutePanel:!0,panelClassName:`flex flex-col overflow-hidden bg-white shadow-xl`,children:[(0,k.jsx)(`div`,{className:`flex h-14 shrink-0 items-center justify-end py-2 pl-3 pr-2`,children:(0,k.jsx)(G,{onClose:t,label:i,className:`p-2`})}),(0,k.jsx)(`div`,{className:`flex flex-col items-center px-6 py-10`,children:u})]}):(0,k.jsxs)(C,{isOpen:e,onClose:t,disableInitialTransition:c,containerClassName:f,className:`relative flex w-full max-w-[460px] min-h-[520px] flex-col rounded-[24px] bg-white shadow-xl`,children:[(0,k.jsx)(G,{onClose:t,label:i,className:`absolute right-4 top-4 size-8`}),(0,k.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-center px-6 py-8 sm:px-16`,children:u})]})},q={join:{titleKey:`community.join.title`,descriptionKey:`community.join.email_prompt`,closeKey:`community.join.
3close`,footerPromptKey:`community.join.already_member`,footerCtaKey:`shared.cta.sign_in`,formId:`community-signup-form`},login:{titleKey:`community.login.title`,descriptionKey:`community.login.email_prompt`,closeKey:`community.login.close`,footerPromptKey:`community.login.not_a_member`,footerCtaKey:`community.join.cta`,formId:`community-signin-form`}},de={...q.login,titleKey:`community.login.verify_title`,descriptionKey:`community.login.verify_email_prompt`},J=({mode:e,isOpen:t,onClose:n,onSwitchMode:c,isLoggedIn:u,publicationName:f,community:m,publicationId:h,redirectTo:g})=>{let{t:_}=l(),v=ee(),{site:y}=o(`root`),b=z(),C=a(),[w]=r(),T=i(),D=s(),[O,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(!1),[N,P]=(0,E.useState)(!1),[F,I]=(0,E.useState)(void 0),L=(0,E.useRef)(!1),[R,H]=(0,E.useState)(null),[W,G]=(0,E.useState)(!1),J=e===`login`&&w.get(`upgrade_return`)===`1`?de:q[e],Y=ue(m),X=se(O.trim())&&!!h,Z=D.state!==`idle`,fe=!(m?.tier_gated&&!m.community_accessible),{terms_of_service_enabled:Q,terms_of_service:pe,terms_of_service_text:me}=y.viewable_site_version.settings,$=u&&e===`join`,he=$?Y:_(J.titleKey,{communityName:Y}),ge=$?le(m,_):_(J.descriptionKey);(0,E.useEffect)(()=>{t||(A(``),M(!1),P(!1),H(null),G(!1),L.current=!1)},[t]),(0,E.useEffect)(()=>{if(!t||e!==`login`)return;let n=ce();n&&A(n)},[t,e]),(0,E.useEffect)(()=>{if(D.state!==`idle`){L.current=!1;return}if(D.data){if(D.data.ok){if(L.current)return;L.current=!0,n(),C.revalidate();return}H(D.data.message??_(`errors.default`))}},[D.state,D.data,n,C,_]),(0,E.useEffect)(()=>{t&&!u&&d().then(I)},[t,u]);let _e=async()=>{H(null);let e=new FormData;e.append(`intent`,`join`),v&&e.append(`csrf`,v),e.append(`community_terms_accepted`,`true`);let t=await d();t&&e.append(`stytch_telemetry_id`,t),te(e,ie(w.get(ne))),D.submit(e,{method:`post`,action:`/community_membership`})},ve=async e=>{if(e.preventDefault(),h){H(null),G(!0);try{let{redirect_url:e}=await B({publication_id:h,email:O.trim(),redirect_to:g});if(!e)throw Error(`sso_redirect returned no url`);T(e)}catch{H(_(`errors.default`)),G(!1)}}},ye=u?void 0:(0,k.jsxs)(`p`,{className:`text-center text-[13px] leading-6 text-black/50`,children:[_(J.footerPromptKey),` `,(0,k.jsx)(`button`,{type:`button`,onClick:c,className:`underline transition-colors duration-150 hover:text-black`,children:_(J.footerCtaKey)})]});return(0,k.jsx)(K,{isOpen:t,onClose:n,title:he,description:ge,closeLabel:_(J.closeKey),publicationName:f,footer:ye,children:u?(0,k.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[R&&(0,k.jsx)(`p`,{className:`text-sm text-red-600`,children:R}),(0,k.jsx)(V,{checked:j,onChange:M}),(0,k.jsx)(S,{variant:`primary`,size:`lg`,fullWidth:!0,onClick:_e,disabled:Z||!j,className:x,...p(re.CommunityJoinModal),children:_(Z?`shared.actions.submitting`:`community.join.cta`)})]}):e===`login`?(0,k.jsxs)(`form`,{id:J.formId,onSubmit:ve,className:`flex w-full flex-col gap-4`,children:[R&&(0,k.jsx)(`p`,{className:`text-sm text-red-600`,children:R}),(0,k.jsx)(U,{type:`email`,name:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`none`,autoCorrect:`off`,value:O,onChange:e=>A(e.target.value),placeholder:_(`subscribe.email_placeholder`)}),(0,k.jsx)(S,{type:`submit`,variant:`primary`,size:`lg`,fullWidth:!0,disabled:!X||W,className:x,children:_(W?`shared.actions.submitting`:`shared.cta.continue`)})]}):(0,k.jsx)(ae,{id:J.formId,shouldSkipRedirectsAfterSuccess:!0,redirectUrl:g,disableSparkLoop:!0,children:({emailFieldName:e,emailFieldType:t})=>(0,k.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[(0,k.jsx)(`input`,{type:`hidden`,value:`true`,name:`send_otp_after_subscribe`}),(0,k.jsx)(`input`,{type:`hidden`,value:fe?`true`:`false`,name:`join_community`}),(0,k.jsx)(`input`,{type:`hidden`,name:`stytch_telemetry_id`,value:F??``}),(0,k.jsx)(U,{type:t,name:e,inputMode:`email`,autoComplete:`email`,autoCapitalize:`none`,autoCorrect:`off`,value:O,onChange:e=>A(e.target.value),placeholder:_(`subscribe.email_placeholder`)}),Q&&(0,k.jsx)(`div`,{className:`w-full`,onChange:e=>{let t=e.target;t.name===`tos_consent`&&P(t.checked)},style:{"--gdpr-text-color":`rgba(0, 0, 0, 0.5)`,"--gdpr-checkbox-color":`#000000`},children:(0,k.jsx)(oe,{hasCustomTermsOfService:pe,customTermsOfServiceText:me||void 0,defaultTOSConsentValue:!1,gdprTranslations:b})}),(0,k.jsx)(V,{checked:j,onChange:M}),(0,k.jsx)(S,{type:`submit`,variant:`primary`,size:`lg`,fullWidth:!0,disabled:!X||!j||Q&&!N,className:x,...p(re.CommunityJoinModal),children:_(`shared.cta.continue`)})]})})})},Y=({children:e})=>(0,k.jsx)(v,{children:(0,k.jsx)(h,{children:e})}),X=({node:e})=>{let t=Math.min(Math.max(e.attrs?.data?.length??1,1),3);return(0,k.jsx)(`div`,{className:`flex w-full flex-wrap justify-center gap-6 py-8`,"aria-hidden":`true`,children:Array.from({length:t},(e,t)=>(0,k.jsx)(`div`,{className:`h-96 w-80 max-w-full animate-pulse rounded-xl bg-black/5`},t))})};export{G as a,B as c,L as d,A as f,K as i,z as l,Y as n,W as o,O as p,J as r,V as s,X as t,R as u}; 4//# sourceMappingURL=PricingSkeleton-DlARTStk.js.map 5//# debugId=d00100cc-0c03-55d8-96ff-aff788dd6be8
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.