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]="8aabf3d5-93f1-5f13-87a9-a0784839ea00")}catch(e){}}(); 3import{s as e}from"./jsx-runtime-D4ePz0Hl.js";import{t}from"./react-BXH-GOAS.js";import{D as n}from"./components-CDo3yjgw.js";import{t as r}from"./utils-CjUr88hv.js";import{r as i}from"./useSignupRedirects-BSkdT_4N.js";import{r as a}from"./community-Bclg0n5L.js";import{i as o}from"./pushSubscription-vzO9AQ6U.js";var s=e(t(),1),c=`active_upgrade_2`,l=[`popup_closed`,`email_capture_disabled`,c,`language`,`visit_token`,`referral_id`,`form_preview_banner_disabled`,`last_resource_guid`,`admin_logged_in`,`notifications_read`,`beehiiv_honey`,i],u=[`email_capture_modal_closed_`],d={popup_closed:{name:`popup_closed`,value:`true`,days:4},email_capture_disabled:{name:`email_capture_disabled`,value:`true`,days:30},[c]:{name:c,value:`true`,days:30}},f=({initialCookies:e})=>{let[t]=n(),[r,i]=(0,s.useState)({}),[a,o]=(0,s.useState)(!1),[c,f]=(0,s.useState)({}),p=(0,s.useCallback)(()=>{let e=document.cookie.split(`; `),t={};for(let n of e){let[e,r]=n.split(`=`),i=e||r,a=l.includes(e)||u.some(t=>e.startsWith(t));i&&a&&(t[e]=decodeURIComponent(r))}return t},[]),m=({name:e,value:t,days:n,minutes:r})=>{let i=new Date;if(r!==void 0)i.setTime(i.getTime()+r*60*1e3);else if(n!==void 0)i.setTime(i.getTime()+n*24*60*60*1e3);else throw Error(`Either days or minutes must be provided`);document.cookie=`${e}=${encodeURIComponent(t)};expires=${i.toUTCString()};path=/`,c[e]=t,f({...c})},h=e=>{document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;let t={...c};delete t?.[e],f({...t}),i(t=>{let n={...t};return delete n[e],n})};return(0,s.useEffect)(()=>{if(a)return;i(p());for(let[t,n]of Object.entries(e)){let e=d[t];n&&e&&m(e)}let n=t.get(`ref`);n&&m({name:`referral_id`,value:n,days:30}),o(!0)},[]),{setCookie:m,cookies:{...r,...c},cookiesSet:a,removeCookie:h}},p=async e=>{e===`token`&&await o(),document.cookie=`${e}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`,window.location.href=window.location.pathname},m=()=>{let e=r();return!!e&&e.VITE_STYTCH_DEVICE_FINGERPRINTING_ENABLED===`true`},h=async()=>{if(!m())return;let e=r(),t=e.VITE_STYTCH_PUBLIC_TOKEN;if(!t||typeof window.GetTelemetryID!=`function`)return;let n=e.VITE_STYTCH_SUBMIT_URL;try{return await window.GetTelemetryID(n?{publicToken:t,submitURL:n}:{publicToken:t})}catch{return}},g=[`jwt_token`,`admin_token`],_=e=>{let t=new URL(e,`http://localhost`);for(let e of g)t.searchParams.delete(e);return t.pathname+t.search},v=(e,t,n={})=>{let r=new URLSearchParams({modal:e,redirect_to:_(t),...n});return`${a.root}?${r.toString()}`},y=e=>!(!e||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`),b=()=>typeof window>`u`?`/login`:`/login?postSlug=${encodeURIComponent(window.location.pathname)}`,x=e=>{let t=e.searchParams.get(`redirect_to`)??e.pathname+e.search;return v(`community_login`,y(t)?t:a.root)},S=(e,t)=>{if(typeof document>`u`)return;if(e&&t)try{let n=new URL(e.url);if((e.modal_param||n.searchParams.get(`modal`))===`login`||n.pathname===`/login`){let e=new URL(t.url);return t.modal_param&&e.searchParams.set(`modal`,t.modal_param),`${document.location.origin}${e.pathname}${e.search}`}}catch{}let n=new URLSearchParams(document.location.search),r=n.get(`postSlug`);n.delete(`modal`),n.delete(`postSlug`);let i=y(r)?r:document.location.pathname,a=n.toString();return a?`${document.location.origin}${i}?${a}`:`${document.location.origin}${i}`};export{h as a,c,y as i,f as l,b as n,m as o,S as r,p as s,x as t}; 4//# sourceMappingURL=buildPostAuthRedirectUrl-CwSA4760.js.map 5//# debugId=8aabf3d5-93f1-5f13-87a9-a0784839ea00
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.