try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="2897e6ee-1a7c-420d-beb9-8da18d52686c",e._sentryDebugIdIdentifier="sentry-dbid-2897e6ee-1a7c-420d-beb9-8da18d52686c")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5127],{1403:(e,a,t)=>{"use strict";t.d(a,{Z:()=>n});var r=t(12115);let n=e=>{let a=(0,r.useRef)(e);return(0,r.useEffect)(()=>{a.current=e},[e]),a.current}},2482:(e,a,t)=>{"use strict";t.d(a,{b:()=>i});var r=t(95155),n=t(47650),c=t(83580),o=t(53071),s=t(60165);let i=e=>{let{title:a,startContent:t,size:i,isDisabled:l,analyticsEvent:u,onSubmit:_}=e,{pending:d,data:y}=(0,n.useFormStatus)();return d&&u&&s.j.track(u.eventName,{...y,...u.eventProperties}),(0,r.jsx)(c.T,{className:"min-h-8 w-full py-4 ".concat(i&&"text-".concat(i)),isDisabled:d||l,isLoading:d,radius:"sm",size:"lg",spinner:(0,r.jsx)(o.o,{color:"white",size:"sm"}),startContent:d?null:t,style:{backgroundColor:"#0066CC",color:"white"},type:"submit",onPress:_,children:d?"Loading...":a})}},10565:(e,a,t)=>{"use strict";t.d(a,{O:()=>n,n:()=>r});let r={cc_feature_freemium_flow:"cc_feature_freemium_flow",cc_abc_subscription_prices:"cc_abc_subscription_prices",cc_ab_deep_search:"cc_ab_deep_search",cc_ab_deep_search_2:"cc_ab_deep_search_2",cc_ab_deep_search_3:"cc_ab_deep_search_3",cc_ab_deep_search_4:"cc_ab_deep_search_4",cc_ab_deep_search_5:"cc_ab_deep_search_5",cc_ab_deep_search_6:"cc_ab_deep_search_6",cc_ab_deep_search_7:"cc_ab_deep_search_7",cc_ab_free_deep_lookup:"cc_ab_free_deep_lookup",cc_deep_search_gift_v2:"cc_deep_search_gift_v2",abc_cc_image_funnel_main_page_copy:"abc_cc_image_funnel_main_page_copy",cc_ab_subscription_cost:"cc_ab_subscription_cost",cc_ab_phone_email_input_switcher:"cc_ab_phone_email_input_switcher",cc_ab_main_page_tabs_switcher:"cc_ab_main_page_tabs_switcher",cc_ab_phone_funnel_copy_variation:"cc_ab_phone_funnel_copy_variation",cc_ab_heroui_animations:"cc_ab_heroui_animations",cc_abc_traffic_without_upsells_lowered_upsell_price:"cc_abc_traffic_without_upsells_lowered_upsell_price",cc_ab_daring_banner_report_image:"cc_ab_daring_banner_report_image",cc_abcd_counter_main_phone:"cc_abcd_counter_main_phone",cc_ab_no_commitment_phone:"cc_ab_no_commitment_phone",ab_primer_risk_endpoint_v2_32fraud:"ab_primer_risk_endpoint_v2_32fraud",cc_ab_warning_bar_progress_phone_v2:"cc_ab_warning_bar_progress_phone_v2",cc_abc_free_reduced_upsells_revised:"cc_abc_free_reduced_upsells_revised",cc_ab_email_sequence:"cc_ab_email_sequence",cc_abc_promo_pre_paywall:"cc_abc_promo_pre_paywall",cc_abcd_counter_main_phone_v3:"cc_abcd_counter_main_phone_v3",cc_abc_promo_pre_paywall_v2:"cc_abc_promo_pre_paywall_v2",cc_abc_paywall_bonus_popup:"cc_abc_paywall_bonus_popup",cc_abcd_subtitle_image:"cc_abcd_subtitle_image",cc_ab_countrycode_inline_phone:"cc_ab_countrycode_inline_phone",cc_ab_weekly_sub_price_adjustments:"cc_ab_weekly_sub_price_adjustments",cc_ab_subtitle_email:"cc_ab_subtitle_email",cc_abcd_cta_paywall_phone:"cc_abcd_cta_paywall_phone",cc_ab_reduce_space_lookup_phone:"cc_ab_reduce_space_lookup_phone",cc_ab_testimonials_mainpage_phone:"cc_ab_testimonials_mainpage_phone",cc_ab_testimonials_mainpage_email:"cc_ab_testimonials_mainpage_email",cc_ab_testimonials_mainpage_image:"cc_ab_testimonials_mainpage_image",cc_ab_report_v3:"cc_ab_report_v3",cc_ab_shorter_mainpage_phone:"cc_ab_shorter_mainpage_phone",cc_ab_howitworks_phone:"cc_ab_howitworks_phone",cc_abc_cheating_headlines_image:"cc_abc_cheating_headlines_image",cc_ab_weekly_vs_monthly_subscription:"cc_ab_weekly_vs_monthly_subscription",cc_abc_confetti_paywall_phone:"cc_abc_confetti_paywall_phone"};var n=function(e){return e.no_images_no_emails="no_images_no_emails",e.one_image_no_emails="one_image_no_emails",e.multiple_images_no_emails="multiple_images_no_emails",e.one_email_no_images="one_email_no_images",e.one_image_one_email="one_image_one_email",e.multiple_emails_no_images="multiple_emails_no_images",e.multiple_images_multiple_emails="multiple_images_multiple_emails",e}({})},12388:(e,a,t)=>{"use strict";t.d(a,{DT:()=>o,IB:()=>n,r_:()=>c});var r=t(49984);let n=["en","de","fr","pt","br","es","ru","it","pl","nl","ro","ua","sr","hr","jp","ja","pt-br","es-mx","es-latam","ar-sa","ao","at","ba","be","bj","bw","cg","ch","cm","ga","gm","ie","jm","md","mg","ml","mu","na","ne","rs","sg","sn","td","tt","ug","ar","bo","cl","co","cr","cu","do","ec","sv","gt","pa","pe","pr","uy","mx","dz","bh","jo","kw","om","qa","sa","ae","tr","se","sk","gr","no","lv","ee","cz"],c={en:"en-US",de:"de-DE",fr:"fr-FR",pt:"pt","pt-br":"pt-BR",es:"es","es-mx":"es","es-latam":"es",ru:"ru-RU",it:"it-IT",pl:"pl-PL",nl:"nl-NL",ro:"ro-RO",ua:"uk-UA",sr:"sr-RS",hr:"hr-HR",ja:"jp-JP",jp:"jp-JP","ar-sa":"ar",tr:"tr-TR",se:"sv-SE",sk:"sk-SK",gr:"el-GR",no:"nb-NO",lv:"lv-LV",ee:"et-EE",cz:"cs-CZ"},o=(0,r.A)({locales:n,defaultLocale:"en",localeDetection:!1,localePrefix:{mode:"as-needed"}})},22100:(e,a,t)=>{"use strict";t.d(a,{A:()=>c});var r=t(12115),n=t(34960);function c(){let e=(0,r.useContext)(n.cy);if(void 0===e)throw Error("useAuth must be used within a AuthProvider");return e}},25401:(e,a,t)=>{"use strict";t.d(a,{Q:()=>o});var r=t(95155),n=t(36545),c=t(77347);let o=e=>{let{error:a,className:t}=e;return(0,r.jsxs)(n.P.div,{animate:{opacity:1,y:0},className:"mt-2 flex items-center gap-[10px] rounded-[8px] bg-red-100 p-[12px] ".concat(t),initial:{opacity:0,y:-30},children:[(0,r.jsx)(c.Icon,{className:"min-h-10 min-w-7 text-[40px] text-red-600",icon:"material-symbols:error"}),(0,r.jsx)("div",{className:"text-[12px]",children:(0,r.jsx)("p",{className:"text-pretty",children:a})})]})}},27388:()=>{},32071:(e,a,t)=>{"use strict";t.d(a,{CO:()=>r,a9:()=>c,cf:()=>n});let r="US",n="BR",c=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","EL","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"]},32286:(e,a,t)=>{"use strict";t.d(a,{m:()=>i,r:()=>l});var r=t(29674),n=t(34064),c=t(41894),o=t(63367);let s=async e=>await (0,r.A)(async()=>await (0,n.loadStripe)(e),{retries:3}),i=async e=>{let a=c.RG[e];if(!a)return;let t=await s(a);if(t){let{radarSession:a,error:r}=await t.createRadarSession();r||o.R.setItem(e,a.id)}},l=()=>c.AD.reduce((e,a)=>{let t=o.R.getItem(a)||"";return t&&(e[a]=t),e},{[c.lU]:o.R.getItem(c.lU)||"",[c.Ed]:o.R.getItem(c.lU)||""})},34097:(e,a,t)=>{"use strict";t.d(a,{O:()=>r});let r=e=>{let{type:a,data:t}=e;fetch("https://hooks.slack.com/triggers/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",{method:"POST",body:JSON.stringify({type:a,json:JSON.stringify(t)})}).catch(e=>{console.error("Error sending message to Slack",e)})}},34960:(e,a,t)=>{"use strict";t.d(a,{cy:()=>p,OJ:()=>b});var r=t(95155),n=t(12115),c=t(73706),o=t(1403),s=t(41894),i=t(32286),l=t(60165),u=t(79737),_=t(63367);let d=(e,a)=>{if(document.getElementById(e))return;let t=document.createElement("script");t.id=e,t.src=a,document.body.appendChild(t)};var y=t(15752);let p=(0,n.createContext)(void 0);function m(e){let{children:a}=e,[t,m]=(0,n.useState)(),b=(0,o.Z)(t);try{let e=(0,u.A)();d("paypal-script","https://c.paypal.com/da/r/fb.js?f=".concat(e,"&s=").concat("DXLTPWUTVBHN2","_checkout-page&sandbox=").concat(!1)),_.R.setItem(s.lU,e),d("paypal-fraudnet-script","https://c.paypal.com/da/r/fb.js")}catch(e){console.error("Failed to initiate PayPal payment session:",e)}return(0,n.useEffect)(()=>{for(let e of s.AD)(0,i.m)(e)},[]),(0,n.useEffect)(()=>{b&&!t&&l.j.reset(),t&&(l.j.identifyUser({user_id:t.primer_id,email:t.email}),y.A.setItem(c.r.IsToxic,t.is_toxic),y.A.setItem(c.r.UserId,t.primer_id))},[t,b]),(0,r.jsx)(p.Provider,{value:{user:t,setUser:m,isAuthenticated:!!t,onLogout:()=>{y.A.removeItem(c.r.SubscriptionPlan),y.A.removeItem(c.r.Currency),y.A.removeItem(c.r.PaymentMethodType),y.A.removeItem(c.r.IsReviewLeft),y.A.removeItem(c.r.FlowType),y.A.removeItem(c.r.UserId),m(null)}},children:a})}function b(e){let{children:a}=e;return(0,r.jsx)(m,{children:a})}},36527:(e,a,t)=>{"use strict";t.d(a,{h:()=>r});let r=[{value:"Alabama",label:"Alabama"},{value:"Alaska",label:"Alaska"},{value:"American Samoa",label:"American Samoa"},{value:"Arizona",label:"Arizona"},{value:"Arkansas",label:"Arkansas"},{value:"California",label:"California"},{value:"Colorado",label:"Colorado"},{value:"Connecticut",label:"Connecticut"},{value:"Delaware",label:"Delaware"},{value:"District of Columbia",label:"District of Columbia"},{value:"Federated States of Micronesia",label:"Federated States of Micronesia"},{value:"Florida",label:"Florida"},{value:"Georgia",label:"Georgia"},{value:"Guam",label:"Guam"},{value:"Hawaii",label:"Hawaii"},{value:"Idaho",label:"Idaho"},{value:"Illinois",label:"Illinois"},{value:"Indiana",label:"Indiana"},{value:"Iowa",label:"Iowa"},{value:"Kansas",label:"Kansas"},{value:"Kentucky",label:"Kentucky"},{value:"Louisiana",label:"Louisiana"},{value:"Maine",label:"Maine"},{value:"Marshall Islands",label:"Marshall Islands"},{value:"Maryland",label:"Maryland"},{value:"Massachusetts",label:"Massachusetts"},{value:"Michigan",label:"Michigan"},{value:"Minnesota",label:"Minnesota"},{value:"Mississippi",label:"Mississippi"},{value:"Missouri",label:"Missouri"},{value:"Montana",label:"Montana"},{value:"Nebraska",label:"Nebraska"},{value:"Nevada",label:"Nevada"},{value:"New Hampshire",label:"New Hampshire"},{value:"New Jersey",label:"New Jersey"},{value:"New Mexico",label:"New Mexico"},{value:"New York",label:"New York"},{value:"North Carolina",label:"North Carolina"},{value:"North Dakota",label:"North Dakota"},{value:"Northern Mariana Islands",label:"Northern Mariana Islands"},{value:"Ohio",label:"Ohio"},{value:"Oklahoma",label:"Oklahoma"},{value:"Oregon",label:"Oregon"},{value:"Palau",label:"Palau"},{value:"Pennsylvania",label:"Pennsylvania"},{value:"Puerto Rico",label:"Puerto Rico"},{value:"Rhode Island",label:"Rhode Island"},{value:"South Carolina",label:"South Carolina"},{value:"South Dakota",label:"South Dakota"},{value:"Tennessee",label:"Tennessee"},{value:"Texas",label:"Texas"},{value:"Utah",label:"Utah"},{value:"Vermont",label:"Vermont"},{value:"Virgin Island",label:"Virgin Island"},{value:"Virginia",label:"Virginia"},{value:"Washington",label:"Washington"},{value:"West Virginia",label:"West Virginia"},{value:"Wisconsin",label:"Wisconsin"},{value:"Wyoming",label:"Wyoming"}]},38325:(e,a,t)=>{"use strict";t.d(a,{h3:()=>u,tJ:()=>s,x7:()=>_,z4:()=>d,zy:()=>l});var r=t(47162),n=t.n(r),c=t(44488);let o=["AUD","BRL","CAD"],s=e=>{let{price:a,currencyName:t,usdRate:r,eurRate:n,currencyToConvert:s,isFractional:l,isLocalAcquiring:u}=e,_=["AU","CA","GB"].some(e=>u[e]),d=["USD","GBP","EUR","CAD","AUD"],y=c.fL.includes(t),p=!r&&!n,m=y?"EUR":"USD",b=y?n:r;if(o.includes(t)&&s&&_){let e=i({isFractional:l,convertFrom:m,rate:b,currencyName:t,price:a});return l?e:Number(e.toFixed())}return(null==d?void 0:d.includes(t))||!t||p||s&&!s.includes(t)?a:i({isFractional:l,convertFrom:m,rate:b,currencyName:t,price:a})},i=e=>{let{isFractional:a,convertFrom:t,rate:r,currencyName:c,price:s}=e;n().base=t,n().rates={[c]:r};let i=Number(n()(s).from(t).to(c).toFixed(2)),l=Math.round(i),u=a?l-.01:l;return o.includes(c)?i<=6?i:u:i<1?.99:u},l=e=>e?Number(e.toFixed(2).replace(".","")):0,u=(e,a)=>c.$f[e]?c.$f[e].currencyCode:({GB:"GBP",US:"USD"})[e]||"USD",_=(e,a,t)=>{let r=c.$f[e];return(null==r?void 0:r.currencyCode)==="GBP"?a:c.uM[null==r?void 0:r.currencyCode]||"$"},d=e=>{let{currencySymbol:a,symbolAtStart:t,price:r}=e;return t?"".concat(a).concat(r):"".concat(r).concat(a)}},40364:(e,a,t)=>{"use strict";t.d(a,{EB:()=>n,eo:()=>r}),t(36527),t(87358);class r extends Error{constructor(e,a){super(e),this.statusCode=a,Object.setPrototypeOf(this,r.prototype)}}class n extends Error{constructor(e,a){super(e),this.name="UserAlreadyExistsError",this.status=a}}},41894:(e,a,t)=>{"use strict";t.d(a,{AD:()=>r,Ed:()=>c,RG:()=>o,lU:()=>n});let r=["stripe_session_id","uk_stripe_session_id","ca_stripe_session_id","au_stripe_session_id","eu_stripe_session_id"],n="paypal_session_id",c="paypal_client_metadata_id",o={stripe_session_id:"pk_live_51PvHKYFBbZPQgZ0vbJ7EGDVGczIqsOXDUKiKRlHl0nf0ixQgu89b8OFPOAGompUmvA9qEoAiEtSPh80ITpqpg5vz00pRiyP1e4",uk_stripe_session_id:"pk_live_51PsLE8KfNDPUFdQeygAdgOYWvgdt6IFmwIdIc51YUdOt5vem0cLXX8mWyeW70on3ZDbMDowzANANQEn4aXeVaUW800jwjecSZk",ca_stripe_session_id:"pk_live_51PsQtRJW8ispmp3Ju60a2u0WmutZ0NQWja6xDtZJUEbaZHUaHT3xZQrozbgZAeiqTyNZCkt3CCBRuhIpjd2Hh8oS00vAVSnyJX",au_stripe_session_id:"pk_live_51PsQ9QG4gjUWVGNsvedEoSPCAhdCwObxNmJ1GNXXtXWcYLAAVMNfSX3GCFmVQbgsGsNayy2JuiTL8lqPSz61gUgj00cVjEbUZG",eu_stripe_session_id:"pk_live_51Q5OYnGT5Nu5VOuI824nN3rHRcmUg7tH9WccAaNiUMOKazSi0nONboFc1ut6daWm40CChY4NviB3iEH8aWHxvubG00yK8HYD3U"}},44488:(e,a,t)=>{"use strict";t.d(a,{$f:()=>r,VK:()=>o,fL:()=>n,uM:()=>c});let r={AL:{currencyCode:"USD",payment_gateway:"eu"},AD:{currencyCode:"EUR",payment_gateway:"eu"},AM:{currencyCode:"USD",payment_gateway:"eu"},AT:{currencyCode:"EUR",payment_gateway:"eu"},AZ:{currencyCode:"USD",payment_gateway:"eu"},BY:{currencyCode:"USD",payment_gateway:"eu"},BE:{currencyCode:"EUR",payment_gateway:"eu"},BA:{currencyCode:"USD",payment_gateway:"eu"},BG:{currencyCode:"EUR",payment_gateway:"eu"},HR:{currencyCode:"EUR",payment_gateway:"eu"},CY:{currencyCode:"EUR",payment_gateway:"eu"},CZ:{currencyCode:"EUR",payment_gateway:"eu"},DK:{currencyCode:"EUR",payment_gateway:"eu"},EE:{currencyCode:"EUR",payment_gateway:"eu"},FI:{currencyCode:"EUR",payment_gateway:"eu"},FR:{currencyCode:"EUR",payment_gateway:"eu"},GE:{currencyCode:"USD",payment_gateway:"eu"},DE:{currencyCode:"EUR",payment_gateway:"eu"},GR:{currencyCode:"EUR",payment_gateway:"eu"},HU:{currencyCode:"EUR",payment_gateway:"eu"},IS:{currencyCode:"USD",payment_gateway:"eu"},IE:{currencyCode:"EUR",payment_gateway:"eu"},IT:{currencyCode:"EUR",payment_gateway:"eu"},KZ:{currencyCode:"USD",payment_gateway:"eu"},XK:{currencyCode:"USD",payment_gateway:"eu"},LV:{currencyCode:"EUR",payment_gateway:"eu"},LI:{currencyCode:"EUR",payment_gateway:"eu"},LT:{currencyCode:"EUR",payment_gateway:"eu"},LU:{currencyCode:"EUR",payment_gateway:"eu"},MT:{currencyCode:"EUR",payment_gateway:"eu"},MD:{currencyCode:"USD",payment_gateway:"eu"},MC:{currencyCode:"EUR",payment_gateway:"eu"},ME:{currencyCode:"USD",payment_gateway:"eu"},NL:{currencyCode:"EUR",payment_gateway:"eu"},MK:{currencyCode:"USD",payment_gateway:"eu"},NO:{currencyCode:"USD",payment_gateway:"eu"},PL:{currencyCode:"EUR",payment_gateway:"eu"},PT:{currencyCode:"EUR",payment_gateway:"eu"},RO:{currencyCode:"EUR",payment_gateway:"eu"},RU:{currencyCode:"USD",payment_gateway:"eu"},SM:{currencyCode:"EUR",payment_gateway:"eu"},RS:{currencyCode:"USD",payment_gateway:"eu"},SK:{currencyCode:"EUR",payment_gateway:"eu"},SI:{currencyCode:"EUR",payment_gateway:"eu"},ES:{currencyCode:"EUR",payment_gateway:"eu"},SE:{currencyCode:"EUR",payment_gateway:"eu"},CH:{currencyCode:"USD",payment_gateway:"eu"},TR:{currencyCode:"USD",payment_gateway:"eu"},UA:{currencyCode:"USD",payment_gateway:"eu"},VA:{currencyCode:"EUR",payment_gateway:"eu"},GB:{currencyCode:"GBP",payment_gateway:"gb"},US:{currencyCode:"USD",payment_gateway:""},CA:{currencyCode:"CAD",payment_gateway:"ca"},BR:{currencyCode:"USD",payment_gateway:"eu"},AU:{currencyCode:"AUD",payment_gateway:"au"}},n=["ALL","AMD","AZN","BYN","BGN","HRK","CZK","DKK","GEL","HUF","ISK","KZT","CHF","MDL","MKD","NOK","PLN","RON","RUB","RSD","SEK","CHF","TRY","UAH","GBP","EUR"],c={EUR:"€",GBP:"\xa3",USD:"$",CAD:"CA$",AUD:"AU$"},o=["USD","GBP","EUR","AUD","CAD"]},55988:(e,a,t)=>{"use strict";t.d(a,{F:()=>v});var r=t(95155),n=t(17652),c=t(12115),o=t(81719),s=t(98828),i=t(73706),l=t(15752),u=t(98965);let _={formSpacings:{betweenLabelAndInput:"0px",betweenInputs:"6px"},paymentMethodButton:{borderRadius:"8px"},input:{base:{fontFamily:"SF Pro Text, system-ui, sans-serif",height:"48px",borderRadius:"8px",lineHeight:"48px",borderColor:"#FFFFFF",focus:{background:"#F6F6F6",borderColor:"#066fde"}},error:{background:"#F6F6F6",focus:{background:"#F6F6F6"}}},inputErrorText:{fontFamily:"SF Pro Text, system-ui, sans-serif",fontSize:"12px",color:"#FF4D2B",fontWeight:"400",lineHeight:"16px"},submitButton:{base:{color:"#ffffff",background:"#066fde",borderRadius:"8px",fontFamily:"SF Pro Text, system-ui, sans-serif",fontWeight:"bold",boxShadow:"none",fontSize:"18px"},loading:{color:"#ffffff",background:"#066fde"},disabled:{color:"#ffffff",background:"#066fde"}}};var d=t(1921),y=t(60881),p=t(72797),m=t(25401),b=t(2482),g=t(10565);let h=e=>{let{submitBtnTitle:a,error:t,isSubmitButtonVisible:c,universalCheckout:o,isActionsDisabled:s,noIcon:i=!1}=e,l=(0,n.c3)("Payment.form"),u=(0,p.Ym)(),_=(0,d.Br)(g.n.cc_abcd_cta_paywall_phone,"default"),h=["1","2"].includes(String(_)),f=["ru","ro","pl","lv"].includes(u);return(0,r.jsxs)(r.Fragment,{children:[t.isErrorShown&&(0,r.jsx)(m.Q,{error:t.errorMessage}),c&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(b.b,{isDisabled:s,size:f&&"sm",startContent:i?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(y.A,{className:"inline h-5 w-5"}),title:a||l(h?"start-7days-trial-".concat(_):"start-7days-trial"),onSubmit:()=>{var e;null==o||o.submit(),null==(e=document.getElementById("checkout-container"))||e.scrollIntoView({behavior:"smooth"})}})})]})};t(27388);let f={generic_decline:"generic_decline",insufficient_funds:"insufficient_funds",lost_card:"lost_card",stolen_card:"stolen_card",UNKNOWN:"UNKNOWN"},v=e=>{let{submitBtnTitle:a,theme:t,locale:d,paymentClientSession:y,onBeforePaymentCreate:p,onCheckoutComplete:m,onCheckoutFail:b,isActionsDisabled:g,setIsActionsDisabled:v,noIcon:w=!1}=e,C=(0,c.useRef)(!1),E=(0,c.useRef)(y),S=(0,n.c3)("Payment.errors"),[U,A]=(0,c.useState)(!1),[R,N]=(0,c.useState)(!1),[I,P]=(0,c.useState)(""),[D,T]=(0,c.useState)({errorMessage:"",isErrorShown:!1}),[k,M]=(0,c.useState)(null),x=(0,c.useRef)(null);(0,c.useEffect)(()=>{(async()=>{if(E.current=y,I)try{let e=await (0,u.$R)({clientToken:I,diff:y});x.current=e.response,P(e.clientToken),null==k||k.refreshClientSession()}catch(e){console.error("Error updating client session:",e)}})()},[y.metadata.flow_type,y.amount]),(0,c.useEffect)(()=>{I||C.current||(async()=>{null==v||v(!0);let e=await (0,u.a6)(y);(null==e?void 0:e.clientToken)&&(x.current=e.response,P(e.clientToken),null==v||v(!1))})()},[]);let F=async e=>{await s.Primer.showUniversalCheckout(e,{locale:d,vault:{visible:!1},card:{preferredFlow:"DEDICATED_SCENE"},googlePay:{captureBillingAddress:!0,buttonSizeMode:"fill"},paypal:{paymentFlow:s.PaymentFlow.PREFER_VAULT},applePay:{buttonType:"buy",buttonStyle:"light"===t?"black":"white",captureBillingAddress:!0},submitButton:{useBuiltInButton:!1,onVisible:e=>N(e)},style:{..._,focusCheckoutOnInit:!1},errorMessage:{disabled:!0,onErrorMessageShow(e){T({errorMessage:""===e?void 0:e,isErrorShown:!0})},onErrorMessageHide(){T({errorMessage:"",isErrorShown:!1})}},onBeforePaymentCreate(e,a){let{paymentMethodType:t}=e;t===s.PaymentMethodType.PAYMENT_CARD&&A(!0),l.A.setItem(i.r.PaymentMethodType,t),null==p||p({customerId:x.current.customerId,paymentMethodType:t}),t!==s.PaymentMethodType.PAYMENT_CARD?N(!1):N(!0),a.continuePaymentCreation()},onPaymentMethodAction(e){"PAYMENT_METHOD_UNSELECTED"===e&&N(!1)},container:"#checkout-container",async onCheckoutComplete(e){let{payment:a}=e;A(!1),await (null==m?void 0:m({clientSession:x.current,payment:a}))},async onCheckoutFail(e,a,t){var r,n;A(!1),null==b||b({error:e,data:a});let c=S("UNKNOWN");if(null==a||null==(r=a.payment)?void 0:r.id)try{let e,t=await fetch("/api/payments/".concat(a.payment.id)).then(e=>e.json()),r=null==t||null==(n=t.statusReason)?void 0:n.message;f[r]&&(e=S(f[r])),e&&(c=e)}catch(e){console.error("Error fetching payment error info:",e)}null==t||t.showErrorMessage(c),N(!0)}}).then((0,o.a)()).then(e=>M(e))};return(0,c.useEffect)(()=>{let e;if(I&&!C.current){if(document.getElementById("checkout-container")){C.current=!0,F(I);return}e=setInterval(()=>{"undefined"!=typeof document&&document.getElementById&&document.getElementById("checkout-container")&&(C.current=!0,clearInterval(e),F(I))},100);let a=setTimeout(()=>{e&&(clearInterval(e),console.error("#checkout-container element not found."))},1e4);return()=>{e&&clearInterval(e),clearTimeout(a)}}return()=>{e&&clearInterval(e)}},[I]),(0,c.useEffect)(()=>()=>{k&&k.teardown()},[k]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-full text-left",id:"checkout-container"}),(0,r.jsx)(h,{error:D,isActionsDisabled:g||U,isSubmitButtonVisible:R,noIcon:w,submitBtnTitle:a,universalCheckout:k})]})}},56971:(e,a,t)=>{"use strict";t.d(a,{N_:()=>c,a8:()=>s,rd:()=>i});var r=t(30981),n=t(12388);let{Link:c,redirect:o,usePathname:s,useRouter:i}=(0,r.A)(n.DT)},64681:(e,a,t)=>{"use strict";t.d(a,{m:()=>m});var r=t(62105),n=t(57141),c=t(11314),o=t(73706),s=t(11651);async function i(e,a,t){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e3,o=0;for(;oe.json()),n.BK.includes(s.status)||a.includes(s.status))return s}catch(e){console.error("Error on attempt ".concat(o+1,":"),e)}if(!(++osetTimeout(e,c))}}var l=t(97261),u=t(21895),_=t(60165),d=t(15752),y=t(34097),p=t(32286);let m=async e=>{let{data:a,analyticsProperties:t,paymentMetadata:m,onSuccess:b,onError:g,emailMetadata:h}=e,f={..._.j.getAnalyticsProperty(),flow_type:n.vi.OneTimePayment,amount:a.price,currency:a.currencyCode,...t};_.j.track(c.q.PurchaseAttempt,f);let v=(()=>{switch(m.one_time_payment_type){case n.iX.UnlimitedPdfAccess:return s.M.UNLIMITED_PDF_ACCESS;case n.iX.AdditionalCredits:return s.M.ADDITIONAL_CREDITS;case n.iX.BreachDataUpsell:return s.M.DATA_BREACH_REPORT_ACCESS;case n.iX.SexOffendersUpsell:return s.M.UPSELL_SEX_OFFENDERS;case n.iX.UpgradeToActive:return s.M.MONTHLY_UPGRADE_EMAIL}})(),w=m.price/100,C=m.original_price?m.original_price:2*m.price/100,E=Math.round((C-w)/C*100),S={price:a.price,currencyCode:a.currencyCode,userId:(0,u.F)(),countryCode:d.A.getItem(o.r.Country),metadata:{...f,...(0,p.r)(),...m},emailMetadata:h||{to:m.email,type:v,language:f.locale,message_data:{...m.credits_purchased&&{credits:m.credits_purchased},...m.price&&{discount:E,price:w,original_price:C},...m.currency_symbol&&{currency_symbol:m.currency_symbol}}}},U=null,A=null;try{var R,N,I,P,D,T,k,M,x,F,O,L,j;if((null==(U=await fetch("/api/payments",{method:"POST",body:JSON.stringify(S)}).then(e=>e.json()))?void 0:U.id)&&(A=await i("/api/payments/".concat(U.id),n.dG,void 0),n.dG.includes(null==A?void 0:A.status)))return _.j.track(c.q.PurchaseSuccess,{...f,payment_processor:null==U||null==(j=U.processor)?void 0:j.name,payment_id:null==U?void 0:U.id}),await (0,l.c)(1500),null==b||b(A),!0;return _.j.track(c.q.PurchaseError,{...f,payment_id:null==U?void 0:U.id,payment_processor:null==U||null==(R=U.processor)?void 0:R.name,error_code:(null==A||null==(N=A.statusReason)?void 0:N.type)||(null==A||null==(D=A.transactions)||null==(P=D[0])||null==(I=P.processorStatusReason)?void 0:I.type)||(null==A||null==(T=A.statusReason)?void 0:T.code)||(null==A?void 0:A.status)||(null==U?void 0:U.errorId)||"PAYMENT_ERROR_UNKNOWN",error_message:(null==A||null==(k=A.statusReason)?void 0:k.message)||(null==A||null==(F=A.transactions)||null==(x=F[0])||null==(M=x.processorStatusReason)?void 0:M.message)||(null==U?void 0:U.description)||"PAYMENT_ERROR_UNKNOWN",error_diagnostics_id:(null==A||null==(L=A.transactions)||null==(O=L[0])?void 0:O.diagnosticsId)||(null==U?void 0:U.diagnosticsId)||(null==A?void 0:A.id)||(null==U?void 0:U.id)||"none"}),null==g||g(A||U),!1}catch(e){return _.j.track(c.q.PurchaseError,{...f,error_code:"PAYMENT_ERROR_CATCH_UNKNOWN",error_message:e instanceof Error?e.message:String(e),error_diagnostics_id:"none"}),(0,r.Cp)(e,{level:"error",tags:{identity:"clarity",service:"payment",endpoint:"handleOneTimePayment"},extra:{data:JSON.stringify({userId:(0,u.F)(),responseId:null==U?void 0:U.id,paymentId:null==A?void 0:A.id})}}),(0,y.O)({type:"api/payments",data:{error:e,paymentPayload:S,response:U,payment:A}}),null==g||g(e),!1}}},70263:(e,a,t)=>{"use strict";t.d(a,{cn:()=>c});var r=t(52596),n=t(39688);function c(){for(var e=arguments.length,a=Array(e),t=0;t{"use strict";t.d(a,{g:()=>o});var r=t(98828),n=t(73706),c=t(15752);let o=e=>e?e===r.PaymentMethodType.PAYPAL:c.A.getItem(n.r.PaymentMethodType)===r.PaymentMethodType.PAYPAL},94583:(e,a,t)=>{"use strict";t.d(a,{H:()=>g});var r=t(12115),n=t(98828),c=t(44488),o=t(73706),s=t(65453),i=t(46786),l=t(35095),u=t(32071),_=t(15752);let d="currency-store",y={currencyName:"USD",currencySymbol:"$",usdRate:1,eurRate:1.0833,symbolAtStart:!0},p=()=>({countryCode:_.A.getItem(o.r.Country)||u.CO,currency:y,isLoading:!1,isLoaded:!1,error:null}),m=(0,s.v)()((0,i.Zr)((0,l.D)((e,a)=>({...p(),_setLoading:()=>e(e=>{e.isLoading=!0,e.error=null,e.isLoaded=!1}),_setSuccess:(a,t)=>e(e=>{e.countryCode=a,_.A.setItem(o.r.Country,a),e.currency=t,e.isLoading=!1,e.isLoaded=!0}),_setError:a=>e(e=>{e.error=a,e.isLoading=!1,e.isLoaded=!1,e.currency=y}),resetCurrencyState:()=>{e(p())},fetchCurrency:async()=>{if(!a().isLoading&&!a().isLoaded){a()._setLoading();try{let e=await fetch("/api/currency");if(!e.ok)throw Error("Failed to fetch currency data. Status: ".concat(e.status));let t=await e.json();a()._setSuccess(t.country_2code,{usdRate:t.usd_exchange_rate,eurRate:t.eur_exchange_rate,currencySymbol:t.currency_symbol,currencyName:t.currency_code,symbolAtStart:t.symbol_at_start})}catch(e){a()._setError(e instanceof Error?e.message:"An unknown error occurred")}}}})),{name:d,storage:(0,i.KU)(()=>sessionStorage),onRehydrateStorage:()=>(e,a)=>{a?console.error('Failed to rehydrate store for key "'.concat(d,'":'),a):e&&(e.isLoading=!1)}}));var b=t(38325);let g=()=>{let{countryCode:e,currency:a,isLoading:t,fetchCurrency:s}=m();(0,r.useEffect)(()=>{s()},[s]);let i=_.A.getItem(o.r.PaymentMethodType)===n.PaymentMethodType.PAYMENT_CARD,l=["AU","CA","GB"],{usdRate:u,eurRate:d,currencyName:y,currencySymbol:p,symbolAtStart:g}=a,h=l.includes(null==e?void 0:e.toUpperCase())?y:(0,b.h3)(e,i),f=c.VK.includes(h.toUpperCase())?h:"USD";return{countryCode:e,currencySymbol:p,symbolAtStart:g,currencySymbolByAvailableCurrency:l.includes(null==e?void 0:e.toUpperCase())?p:(0,b.x7)(e,p,i),currencyName:y,currencyCodeByAvailableCountry:f,usdRate:u,eurRate:d,convertCurrency:(e,a)=>(0,b.tJ)({price:e,currencyName:y,usdRate:u,eurRate:d,isFractional:a,isLocalAcquiring:l}),convertPriceByAvailableCountry:(e,a)=>(0,b.tJ)({price:e,currencyName:y,usdRate:u,eurRate:d,currencyToConvert:c.VK,isFractional:a,isLocalAcquiring:l}),isCurrencyLoading:t,isLocalAcquiringCountries:l}}},97261:(e,a,t)=>{"use strict";t.d(a,{c:()=>r});let r=e=>new Promise(a=>setTimeout(a,e))},98965:(e,a,t)=>{"use strict";t.d(a,{$R:()=>u,Rf:()=>i,a6:()=>l});var r=t(29674),n=t(11314),c=t(40364),o=t(60165),s=t(34097);let i=async e=>await (0,r.A)(async()=>{let a=await fetch("/api/subscription/create",{method:"POST",body:JSON.stringify(e)});if(!a.ok){let e=await a.text();if(409===a.status)throw new c.EB("User already exists: ".concat(e),a.status);throw new c.eo("Error: Subscription creation failed! status: ".concat(a.status,", message: ").concat(e),a.status)}return await a.json()},{retries:10,shouldRetry:e=>{var a,t;if(e instanceof c.EB)return!1;let r=e instanceof Error?e.message:String(e);return"5"===(null==(t=e.statusCode)||null==(a=t.toString())?void 0:a[0])||r.includes("Load failed")||r.includes("Failed to fetch")||r.includes("NetworkError when attempting to fetch resource.")},onFailedAttempt:e=>{}}).catch(e=>{throw(0,s.O)({type:"handleOnSubscriptionCreate",data:e}),e instanceof Error?e:Error(String(e))}),l=async e=>await (0,r.A)(async()=>{let a=await fetch("/api/payment/client-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw Error(a.statusText);return await a.json()},{retries:5,onFailedAttempt:a=>{o.j.track(n.q.GetClientTokenError,{error:"HTTP error! status: ".concat(a.message)});let t=a instanceof Error?a.message:String(a);(0,s.O)({type:"getClientSession-response",data:{errorMessage:t,clientSession:e}})}}),u=async e=>{let{clientToken:a,diff:t}=e;try{let e=await fetch("/api/payment/client-session/update",{method:"PATCH",cache:"no-store",headers:{"X-API-VERSION":"2.4","X-API-KEY":"111245cf-4915-4b28-9697-bfdc1fdec07d","Content-Type":"application/json"},body:JSON.stringify({clientToken:a,diff:{...t}})});return await e.json()}catch(e){console.error("Error fetching subscription plan",e)}}}}]);