1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7497],{49856:function(e,r,t){"use strict";t.r(r),t.d(r,{__N_SSP:function(){return H},default:function(){return J}});var n,a,o,i,c=t(20406),s=t(95235),l=t(82841),u=t.n(l),p=t(57611),d=t(40694),f=t(11269),g=t(61733),m=t(85188),h=t(71286),v=t(91157),C=t(81095),y=t(2784),b=t(83112),S=t(52005),P=t(85772),M=t(50340),_=t(57759),I=t(98747),T=t(75792);t(28765);var R=t(47582);T.log.getLogger("[UUIDConversion]");var w=T.log.getLogger("[incentive-campaign-grpc]");function L(){return(L=(0,c.Z)(u().mark(function e(r,t,n,a,o){var i,c,s;return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(e){var r=e.replace(/-/g,"");if(!/^[0-9A-Fa-f]{32}$/.test(r))throw Error("Invalid UUID format: ".concat(e));var t=r.substring(0,16),n=r.substring(16,32);return{highBits:BigInt("0x".concat(t)).toString(),lowBits:BigInt("0x".concat(n)).toString()}}(n),c=M.IncentiveAttributionPayload.fromPartial({attributionType:M.AttributionType.ATTRIBUTION_TYPE_PHONE,phoneNumber:a,phoneCountryCode:o}),s=_.SubmitInviteeReferralRequest.fromPartial({referralCode:t,inviteId:i,payload:c}),e.prev=3,(0,p.incrementCounter)("incentive_campaign_submit_referral_invitee_attempt"),e.next=7,r.SubmitInviteeReferral(s);case 7:(0,p.incrementCounter)("incentive_campaign_submit_referral_invitee_success"),e.next=15;break;case 10:throw e.prev=10,e.t0=e.catch(3),(0,p.incrementCounter)("incentive_campaign_submit_referral_invitee_error"),w.error("Failed to submit referral invitee",e.t0),e.t0;case 15:case"end":return e.stop()}},e,null,[[3,10]])}))).apply(this,arguments)}var N=(n=({}).transportFactory,a=function(){return(0,I.unaryFactory)({onUnauthorizedError:function(){},metricsPrefix:"incentive-campaign-grpc",transportFactory:n,hostURL:"https://aws.api.snapchat.com"})},o=new _.IncentiveCampaignWebServiceClientImpl({unary:a()}),{submitInviteeReferral:(i=(0,c.Z)(u().mark(function e(r,t,n,a){return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e,r,t,n,a){return L.apply(this,arguments)}(o,r,t,n,a));case 1:case"end":return e.stop()}},e)})),function(e,r,t,n){return i.apply(this,arguments)})}),E=t(75190),A=["US","CA","GB","FR","DE","AC","AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","GA","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TA","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"].sort(),O=t(6277),G=t(5632),U=t(42670),x=t(99418),k=t(37409),B=t.n(k),j=t(52322),D=function(e){var r,t=e.referralCode,n=e.country,a=e.inviteId,o=e.locale,i=(0,y.useContext)(m.PageContext).isMobile,l=(0,y.useState)(""),d=l[0],f=l[1],g=(0,y.useState)("US"),h=g[0],v=g[1],C=(0,y.useState)(!1),S=C[0],M=C[1],_=(0,y.useState)(!1),T=_[0],w=_[1],L=(0,y.useState)(null),k=L[0],D=L[1],Z=(0,b.Z)(),F=(0,G.useRouter)();(0,y.useEffect)(function(){A.includes(n.toUpperCase())&&v(n.toUpperCase())},[n]);var K=(0,y.useCallback)(function(e){return/^[0-9-]*$/.test(e.number)},[]),W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.redirectToDownload"),1),setTimeout(function(){F.isReady?F.push({pathname:"/download"}).catch():setTimeout(function(){F.push({pathname:"/download"}).catch()},500)},e)},V=(r=(0,c.Z)(u().mark(function e(r){var n,o;return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r.preventDefault(),!S){e.next=3;break}return e.abrupt("return");case 3:return M(!0),D(null),(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.handleSubmit.start"),1),n=d.replace(/[^\d]/g,""),e.prev=7,e.next=10,N.submitInviteeReferral(t,a,n,h);case 10:D(Z.formatMessage({id:"hZTN+L",defaultMessage:[{type:0,value:"Download Snapchat to connect!"}]}
1)),(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.handleSubmit.success"),1),W(1e3),e.next=21;break;case 15:e.prev=15,e.t0=e.catch(7),e.t0 instanceof I.GrpcWebError&&e.t0.code===P.grpc.Code.InvalidArgument?(o=Z.formatMessage({id:"wLKnlf",defaultMessage:[{type:0,value:"Not a valid phone number. Please enter a valid number and try again."}]}),(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.handleSubmit.error.invalidPhoneNumber"),1)):e.t0 instanceof I.GrpcWebError&&e.t0.code===P.grpc.Code.FailedPrecondition?(o=Z.formatMessage({id:"RCkv6z",defaultMessage:[{type:0,value:"Invalid referral URL. Please check the link and try again."}]}),(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.handleSubmit.error.invalidURL"),1)):(o=Z.formatMessage({id:"/KQvns",defaultMessage:[{type:0,value:"Network error. Please check your connection and try again."}]}),e.t0 instanceof I.GrpcWebError&&e.t0.code===P.grpc.Code.Unavailable&&(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.handleSubmit.error.unavailable"),1)),(0,R.logSentryError)(o),M(!1),D(o);case 21:case"end":return e.stop()}},e,null,[[7,15]])})),function(e){return r.apply(this,arguments)});return(0,j.jsx)("div",{className:(0,O.default)(B().container,(0,s.Z)({},B().isMobile,i)),children:(0,j.jsxs)("div",{className:(0,O.default)(B().formContainer,(0,s.Z)({},B().isMobile,i)),children:[(0,j.jsx)("h1",{className:B().title,children:(0,j.jsx)(U.Z,{id:"Uk4o31",defaultMessage:[{type:0,value:"Join Your Friend on Snapchat!"}]})}),(0,j.jsx)("p",{className:B().description,children:(0,j.jsx)(U.Z,{id:"wAA0Sr",defaultMessage:[{type:0,value:"Share Snaps together, try fun camera effects and more! And by joining, you'll also get your friend closer to a free month of Snapchat+ \uD83D\uDE4C"}]})}),(0,j.jsxs)("form",{onSubmit:function(e){V(e)},children:[(0,j.jsx)(E.PhoneNumberInput,{onChange:function(e){var r=e.replace(/[^\d]/g,"");f(r),r.length>=7?((0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.phoneReady"),1),w(!0)):w(!1)},onCountryRegionChange:function(e){(0,p.incrementCounter)("".concat(x.m,".ReferralPageContent.CountryRegionChange"),1),v(e)},selectStyles:B().phoneInputOverrideStyles,phoneInputStyles:B().phoneInputOverrideStyles,defaultPhoneNumber:d,defaultCountryRegion:h,autofocusInput:!0,stripRegionCode:!0,validator:K}),(0,j.jsx)("button",{type:"submit",className:B().submitButton,disabled:S||!T,children:(0,j.jsx)(U.Z,{id:"ztRaSB",defaultMessage:[{type:0,value:"Get Snapchat"}]})})]}),k&&(0,j.jsx)("div",{className:B().submitMessage,children:k}),(0,j.jsx)("p",{className:B().disclaimer,children:(0,j.jsx)(U.Z,{id:"7rHP7k",defaultMessage:[{type:0,value:"By continuing, you agree to the "},{type:8,value:"termsLink",children:[{type:0,value:"Terms of Service"}]},{type:0,value:" and "},{type:8,value:"privacyPolicyLink",children:[{type:0,value:"Privacy Policy"}]},{type:0,value:"."}],values:{termsLink:function(e){return(0,j.jsx)("a",{href:"https://www.snap.com/terms?lang=".concat(o),target:"_blank",rel:"noopener noreferrer",children:e})},privacyPolicyLink:function(e){return(0,j.jsx)("a",{href:"https://values.snap.com/privacy/privacy-policy?lang=".concat(o),target:"_blank",rel:"noopener noreferrer",children:e})}}})})]})})},Z=t(74408),F=t(49746),K=t(40891);function W(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function V(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?W(Object(t),!0).forEach(function(r){(0,s.Z)(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):W(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var H=!0,Y=function(e){var r=(0,y.useMemo)(function(){return(0,K.I)()},[]),t=(0,C.useCreateOrUpdateWebClientId)({isGdpr:e.isGdprCountry}),n=f.PageType.INCENTIVE_REFERRAL,a=f.PageType[n].toLowerCase(),o=(0,f.useGenerateWebPageViewTraceId)().traceId,i=(0,v.useLocale)({defaultLocale:e.locale,defaultMessages:e.messages,loadMessages:F.E,metricsPage:"referral"}),s=i.locale,l=i.messages,S=i.changeLocale,P=e.referralCode,M="https://www.snapchat.com/referral/".concat(P),_=(0,b.Z)(),I=_.formatMessage({id:"DX+te/",defaultMessage:[{type:0,value:"Join your Friend on Snapchat!"}]}),T=_.formatMessage({id:"xIavgB",defaultMessage:[{type:0,value:"Share Snaps together. Try fun camera effects. Discover amazing content."}]}),R=(0,y.useMemo)(function(){return{pageType:n,pageTitle:I,pageDescription:T}},[I,T,n]),w=(0,Z.$E)(a),L=(0,Z.i8)(a),N=(0,m.consumerWebOneLinkParams)({pageTypeName:a,deepLinkUrl:M,iosAppStoreUrl:w,desktopPageUrl:L}),E={locale:s,webClientId:t,webPageViewTraceId:o,openInSnapchatLink:M,downloadUrl:L,localeChange:S,oneLinkParams:N,pageType:R.pageType},A=V(V({},h.defaultPreviewImages),{},{title:I,description:T,canonicalUrl:M,snapchatTitle:I}),O=(0,y.useCallback)((0,c.Z)(u().mark(function r(){return u().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve(e.isValidReferral));case 1:case"end":return r.stop()}},r)})),[e.isValidReferral]);return(0,y.useEffect)(function(){(0,p.incrementCountsByPageAndCountry)(x.m,a,1,e.country)},[a,e.country]),(0,j.jsx)(m.LockedRoute,{backupRoute:"/download",lockingEvaluator:O,children:(0,j.jsx)(m.Shell,V(V({},r),{},{isGDPRCountry:e.isGdprCountry,locale:s,messages:l,direction:(0,v.getDirectionForLocale)(s),country:e.country,canonicalUrl:M,description:T,snapchatDeepLinkUrl:E.openInSnapchatLink,linkPreview:A,title:I,pageMetadata:R,webClientId:t,webPageViewTraceId:o,gaid:e.isGdprCountry?void 0:d.WWW_DOT_SNAPCHAT_DOT_COM_GA,children:(0,j.jsx)(m.PageFrame,{locale:s,appType:g.ConsumerApp.Unset,pageType:R.pageType,downloadUrl:E.downloadUrl,webClientId:t,webPageViewTraceId:o,localeChange:E.localeChange,messages:l,footerProps:E,disableMobileBottomNav:!0,hideDefaultFooter:!0,children:(0,j.jsx)(D,{referralCode:e.referralCode,country:e.country,inviteId:e.inviteId,locale:s})})}))})},J=function(e){return(0,j.jsx)(S.Z,{locale:e.locale,messages:e.messages,defaultLocale:v.DEFAULT_LOCALE,children:(0,j.jsx)(Y,V({},e))})}},3726:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/referral/[referralCode]",function(){return t(49856)}])},37409:function(e){e.exports={container:"referral_container__1RzHd",isMobile:"referral_isMobile__K7t8C",formContainer:"referral_formContainer__c194o",title:"referral_title__BRvyJ",description:"referral_description__xU_PS",submitButton:"referral_submitButton__huQd9",disclaimer:"referral_disclaimer__Irsdx",submitMessage:"referral_submitMessage__jC5h7",phoneInputOverrideStyles:"referral_phoneInputOverrideStyles__6P2KW"}}},function(e){var r=function(r){return e(e.s=r)};e.O(0,[6018,2888,9774,179],function(){return r(56209),r(3726)}),_N_E=e.O()}]); 2//# sourceMappingURL=[referralCode]-2bfd4709c61b5ef4.js.map
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.