1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2528],{4025:(e,i,t)=>{t.d(i,{Creation:()=>ea,p:()=>X,N:()=>en});var n,s=t(77718),a=t(9211),r=t(54202),l=t(68356),o=t(14004),d=t(32004),c=t(19582),p=t(41188),u=t(98087),g=t(88874),m=t(8983),h=t(6243),f=t(31581),x=t(56711),y=t(29701),_=t(42924),C=t(47569);let b=C.Ik({name:C.Yj().max(255,{error:""})});var Y=t(67619),v=t(17836),w=t(60437),k=t(73677),P=t(59972),S=t(92856),F=t(61942),D=t(63732),I=t(79206),M=t(13251),L=t(4884);let q=e=>({display:"flex",flexDirection:"column",gap:e.spacing.xs,width:"100%"}),T=e=>({backgroundColor:e.semanticColors.accentMedium,borderRadius:e.radius.full,height:"100%"}),z=e=>({backgroundColor:e.semanticColors.neutralsLowest,borderRadius:e.radius.full,height:e.spacing.s,width:"100%"}),R=()=>{let{form:e,setStep:i,step:t}=en(),n=(0,f.useMemo)(()=>t===X.Name?5:e.formState.isSubmitSuccessful?100:60,[e.formState.isSubmitSuccessful,t]);return(0,s.FD)("div",{css:q,children:[t===X.Name?(0,s.Y)(m.bm,{asChild:!0,children:(0,s.Y)(F.IconButton,{icon:(0,s.Y)(D.US,{size:20}),variant:"transparentPrimary"})}):(0,s.Y)(F.IconButton,{icon:(0,s.Y)(D.A6,{size:20}),onClick:()=>i(X.Name),variant:"transparentPrimary"}),(0,s.Y)(I.bL,{css:z,max:100,value:n,children:(0,s.Y)(I.C1,{asChild:!0,css:T,children:(0,s.Y)(M.P.div,{animate:{width:`${n}%`},initial:{width:`${n}%`},transition:{duration:L.s.Short,ease:"easeOut",type:"tween"}})})})]})};var E=t(13439),A=t(60424),B=t(30280),W=t(59860),$=t(73167);let O=e=>({display:"flex",flexDirection:"column",gap:e.spacing.s,[`@media ${_.q.Large}`]:{flexDirection:"row-reverse",justifyContent:"space-between",paddingBottom:e.spacing.xxl}}),K=e=>({height:e.spacing.l,[`@media ${_.q.Large}`]:{flexGrow:1}}),N=e=>({backgroundColor:"transparent",color:e.semanticColors.primary,border:"none",outline:"none"}),j=e=>({display:"flex",flexDirection:"column",gap:e.spacing.m,paddingBottom:e.spacing.s,paddingTop:e.spacing.s}),U=()=>{let{track:e}=(0,l.useAnalyticsContext)(),{form:i,setStep:t,step:n}=en(),d=(0,$.Ub)(_.q.Large),c=(0,r.c3)();(0,E.useViewedScreen)({isReady:n===X.Name,screen:y.J.KidsProfileCreationName});let p=i.watch("name"),u=(0,f.useMemo)(()=>p.trim().length>0&&b.safeParse({name:p}).success,[p]),g=(0,f.useCallback)(()=>{u&&(e({event:o.W.CompletedKidsProfileCreationStep,properties:{first_name:p,screen_name:y.J.KidsProfileCreationName}}),t(X.Pin))},[u,p,t,e]),m=(0,f.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),g())},[g]);return n!==X.Name?null:(0,s.FD)(f.Fragment,{children:[(0,s.FD)("label",{css:j,children:[(0,s.Y)(A.Text,{...{size:d?"m":"xl",type:d?"headline":"title"},children:(0,s.Y)(a.I18nMessage,{message:"kids_profile_creation_name_title"})}),(0,s.Y)(B.FormField,{control:i.control,name:"name",render:({field:e})=>(0,s.Y)(A.Text,{asChild:!0,size:"xl",type:"body",children:(0,s.Y)("input",{...e,autoComplete:"name",css:N,id:"name",onKeyDown:m,placeholder:c("kids_profile_creation_name_placeholder"),type:"text"})})})]}),(0,s.Y)("div",{css:K}),(0,s.Y)("div",{css:O,children:(0,s.Y)(W.Button,{disabled:!u,isFullWidth:!d,onClick:g,size:"l",type:"button",children:(0,s.Y)(a.I18nMessage,{message:"onboarding_button_continue"})})})]})};var J=t(43281),V=t(94505),H=t(39653);let G=({pinError:e})=>{let{track:i}=(0,l.useAnalyticsContext)(),{form:t,step:n}=en(),{setToast:a}=(0,J.useContext)(),r=(0,v.useRequestMePinExists)(),d=(0,V.useRequestMePinForgotPost)(),c=t.watch("pin"),p=(0,f.useMemo)(()=>1===new Set(String(c)).size,[c]),u=(0,f.useMemo)(()=>r.data?.exists?y.J.ParentPinInput:y.J.KidsProfileCreationParentPin,[r.data?.exists]);(0,E.useViewedScreen)({isReady:n===X.Pin,screen:u});let g=(0,f.useCallback)(async()=>{i({event:o.W.TappedForgotParentPin,properties:{screen_name:u}});let e=await d.mutateAsync({});e.success_text&&a(e.success_text)},[d.mutateAsync,u,a,i]);return((0,f.useEffect)(()=>{!r.data?.exists&&e&&i({event:o.W.EnteredIncorrectParentPIN,properties:{error:p?"four_identical_numbers":"four_consecutive_numbers",screen_name:u}})},[e,r.data?.exists]),(0,f.useEffect)(()=>{n===X.Pin&&document.getElementById("pin-0")?.focus()}
1,[n]),n!==X.Pin)?null:(0,s.Y)(H.CreationPinForm,{form:t,onForgotPin:g,pinError:e})};var X=((n={}).Name="name",n.Pin="pin",n);let Q=b.extend(Y.r.shape),Z={display:"none",flexGrow:1,maxHeight:"min(200px, 20dvh)",[`@media ${_.q.Large}`]:{display:"block"}},ee={display:"flex",flexDirection:"column",flexGrow:1,maxWidth:720,width:"100%"},ei=e=>({gap:e.spacing.l}),et=(0,f.createContext)({form:null,step:"name",setStep:()=>{}}),en=()=>(0,f.useContext)(et),es=({onSuccess:e,switchProfilesProps:i})=>{let t=(0,d.hS)(),{track:n}=(0,l.useAnalyticsContext)(),{form:r,setStep:p}=en(),u=(0,v.useRequestMePinExists)(),g=(0,k.X)(),_=(0,w.useRequestMePinPut)(),C=(0,f.useCallback)(()=>{r.reset(),p("name")},[r.reset]),{onOpenChange:b,resolve:Y}=(0,x.T)({modal:t,onClose:C}),F=r.watch("name"),D=(0,f.useMemo)(()=>u.data?.exists?y.J.ParentPinInput:y.J.KidsProfileCreationParentPin,[u.data?.exists]),I=(0,f.useCallback)(async s=>{let a={pin:s.pin,name:s.name.split(" ")[0],last_name:s.name.split(" ").slice(1).join(" ")};if(!u.data?.exists&&!(await _.mutateAsync({body:a})).success)return;let r=await g.mutateAsync({body:a});r&&(n({event:o.W.CompletedKidsProfileCreationStep,properties:{first_name:F,screen_name:D}}),e?.(r),Y(!0,()=>{(0,d.WU)(S.SwitchProfiles,{...i,isShowProfileReady:!0}),C(),t.remove()}))},[t.remove,g.mutateAsync,_.mutateAsync,F,C,e,u.data,Y,D,i,n]);return(0,s.FD)(P.n,{contentCss:ei,isOpen:t.visible,onOpenAutoFocus:e=>{e.preventDefault(),document.getElementById("name")?.focus()},onOpenChange:b,children:[(0,s.FD)(h.s6,{children:[(0,s.Y)(m.VY,{children:(0,s.Y)(a.I18nMessage,{message:"kids_profile_creation_accessibility_label"})}),(0,s.Y)(m.hE,{children:(0,s.Y)(a.I18nMessage,{message:"kids_profile_creation_accessibility_label"})})]}),(0,s.Y)(R,{}),(0,s.FD)(c.Form,{formCSS:ee,formProps:{onSubmit:r.handleSubmit(I)},...r,children:[(0,s.Y)("div",{css:Z}),(0,s.Y)(U,{}),(0,s.Y)(G,{pinError:g.error?.message||_.error?.message})]})]})},ea=(0,d.vt)(e=>{let i=(0,v.useRequestMePinExists)(),[t,n]=(0,f.useState)("name"),a=(0,r.c3)(),l=(0,f.useMemo)(()=>i.data?.exists?Q:b.extend((0,Y.C)({t:a}).shape),[i.data?.exists,a]),{resolver:o}=(0,p.useValidator)((0,u.F)(l)),d=(0,g.mN)({defaultValues:{name:"",pin:""},mode:"onChange",resolver:o});return(0,s.Y)(et.Provider,{value:{form:d,step:t,setStep:n},children:(0,s.Y)(es,{...e})})})},11663:(e,i,t)=>{t.d(i,{M:()=>n});let n=e=>["en","en-PH"].includes(e)},17836:(e,i,t)=>{t.d(i,{useRequestMePinExists:()=>s});var n=t(63406);let s=({...e}={})=>(0,n.useOpenApiQuery)({...e,queryKey:["me-pin-exists"],urlBackendPath:"/me/pin/exists"})},39653:(e,i,t)=>{t.d(i,{CreationPinForm:()=>C});var n=t(77718),s=t(9211),a=t(14824),r=t(60424),l=t(30280),o=t(59860),d=t(31581),c=t(73167),p=t(42924),u=t(17836),g=t(54801);let m=e=>({display:"flex",flexDirection:"column-reverse",gap:e.spacing.s,[`@media ${p.q.Large}`]:{flexDirection:"row-reverse",justifyContent:"space-between",paddingBottom:e.spacing.xxl}}),h=e=>({height:e.spacing.l,[`@media ${p.q.Large}`]:{flexGrow:1}}),f=e=>({display:"flex",flexDirection:"column",gap:e.spacing.s}),x=e=>({display:"flex",flexDirection:"column",gap:e.spacing.l,paddingBottom:e.spacing.s,paddingTop:e.spacing.s}),y=e=>({color:e.semanticColors.neutralsHigher,margin:0}),_={margin:0},C=({form:e,onForgotPin:i,pinError:t,existsTitle:C="kids_profile_enter_pin_title",newTitle:b="kids_profile_create_pin_title",existsSubtitle:Y="kids_profile_enter_pin_subtitle",newSubtitle:v="kids_profile_create_pin_subtitle"})=>{let w=(0,u.useRequestMePinExists)(),k=(0,c.Ub)(p.q.Large);return w.isLoading?(0,n.Y)(a.Loader,{}):(0,n.FD)(d.Fragment,{children:[(0,n.FD)("label",{css:x,children:[(0,n.FD)("div",{css:f,children:[(0,n.Y)(r.Text,{as:"h2",css:_,size:"xl",type:"title",children:(0,n.Y)(s.I18nMessage,{message:w.data?.exists?C:b})}),(0,n.Y)(r.Text,{css:y,size:"m",type:"body",children:(0,n.Y)(s.I18nMessage,{message:w.data?.exists?Y:v})})]}),(0,n.Y)(l.FormField,{control:e.control,name:"pin",render:({field:e,fieldState:i})=>(0,n.Y)(g.PinInput,{...e,autoSubmit:w.data?.exists,error:i.error?.message??t,onValueChange:e.onChange}),showErrorMessage:!1})]}),(0,n.Y)("div",{css:h}),(0,n.FD)("div",{css:m,children:[(0,n.Y)(o.Button,{disabled:e.formState.isSubmitting||!e.formState.isValid,isFullWidth:!k,isLoading:e.formState.isSubmitting,size:"l",children:(0,n.Y)(s.I18nMessage,{message:"onboarding_button_continue"})}),w.data?.exists&&(0,n.Y)(o.Button,{isFullWidth:!k,onClick:i,size:k?"l":"m",type:"button",variant:k?"transparentPrimary":"transparentNeutral",children:k?(0,n.Y)(s.I18nMessage,{message:"kids_profile_forgot_pin"}):(0,n.Y)(r.Text,{size:"m",type:"body",children:(0,n.Y)(s.I18nMessage,{message:"kids_profile_forgot_pin"})})})]})]})}},42146:(e,i,t)=>{t.d(i,{useKidProfiles:()=>a});var n=t(31581),s=t(34020);let a=()=>{let{data:e}=(0,s.useRequestMeRelatedAccounts)();return(0,n.useMemo)(()=>e?.filter(e=>e.is_kid),[e])}},59972:(e,i,t)=>{t.d(i,{n:()=>u});var n=t(77718),s=t(8983),a=t(74304),r=t(13251),l=t(4884),o=t(61400),d=t(58118);let c={zIndex:o.s.OverlayFullscreen}
1,p=e=>({alignItems:"center",backgroundColor:e.semanticColors.background,color:e.semanticColors.primary,display:"flex",flexDirection:"column",height:"100dvh",left:0,overflow:"hidden",paddingBottom:e.spacing.ms,paddingLeft:e.spacing.l,paddingRight:e.spacing.l,paddingTop:e.spacing.ms,position:"fixed",top:0,width:"100dvw",zIndex:o.s.ContentFullscreen}),u=({children:e,contentCss:i,isOpen:t,onOpenAutoFocus:o,onOpenChange:u})=>(0,n.Y)(s.bL,{onOpenChange:u,open:t,children:(0,n.FD)(s.ZL,{children:[(0,n.Y)(s.hJ,{asChild:!0,children:(0,n.Y)(d.h,{css:c,onClick:()=>u(!1)})}),(0,n.Y)(a.N,{children:t&&(0,n.Y)(s.UC,{asChild:!0,onOpenAutoFocus:o,onInteractOutside:e=>{e.stopPropagation(),e.preventDefault()},children:(0,n.Y)(r.P.div,{animate:{opacity:1,scale:1},css:[p,i],exit:{opacity:0,scale:.95},initial:{opacity:0,scale:.95},transition:{duration:l.s.Long,type:"spring"},children:e})})})]})})},60437:(e,i,t)=>{t.d(i,{useRequestMePinPut:()=>s});var n=t(32409);let s=(e={})=>(0,n.useOpenApiMutation)({method:"PUT",urlBackendPath:"/me/pin",...e})},73677:(e,i,t)=>{t.d(i,{X:()=>r});var n=t(31451),s=t(32409),a=t(34020);let r=({onSuccess:e,...i}={})=>{let t=(0,n.useQueryClient)();return(0,s.useOpenApiMutation)({method:"POST",onSuccess:(i,n,s)=>{t.invalidateQueries({queryKey:(0,a.z)()}),e?.(i,n,s)},urlBackendPath:"/register/kids",...i})}},77153:(e,i,t)=>{t.d(i,{u:()=>n});let n=12},92856:(e,i,t)=>{t.d(i,{SwitchProfiles:()=>eY});var n=t(77718),s=t(54202),a=t(9211),r=t(68356),l=t(13439),o=t(14004),d=t(73995),c=t(33976),p=t(32004),u=t(61942),g=t(63732),m=t(59860),h=t(60424),f=t(91766),x=t(8983),y=t(6243),_=t(31581),C=t(73167),b=t(42146),Y=t(56711),v=t(78922),w=t(77153),k=t(29701),P=t(42924),S=t(11663),F=t(43281),D=t(34020),I=t(89538),M=t(3301);let L={height:"100%",objectFit:"cover",objectPosition:"center",width:"100%"},q=e=>({borderRadius:e.radius.full,overflow:"hidden",height:88,position:"relative",width:88,[`@media ${P.q.Large}`]:{height:116,width:116}}),T={position:"relative"},z=e=>({position:"absolute",right:e.spacing.none,bottom:e.spacing.none,background:e.semanticColors.background,borderWidth:e.stroke.light,borderStyle:"solid",borderColor:e.semanticColors.background,borderRadius:e.radius.full}),R=e=>({alignItems:"center",display:"flex",flexDirection:"column",gap:e.spacing.m,justifyContent:"center",width:"100%",[`@media ${P.q.Large}`]:{gap:e.spacing.l}}),E=e=>({alignItems:"center",display:"flex",flexDirection:"column",gap:e.spacing.xxs,justifyContent:"center",textAlign:"center",width:"100%"}),A={height:"100%",width:"100%"},B=e=>({borderRadius:e.radius.xxs,height:20,width:"100%",[`@media ${P.q.Large}`]:{height:e.spacing.l}}),W=e=>({alignItems:"center",backgroundColor:e.semanticColors.accentMedium,bottom:0,color:e.colors.white,display:"flex",fontFamily:e.fontFamilies.sansSerif,fontSize:12,fontWeight:700,justifyContent:"center",left:-8,paddingBottom:e.spacing.s,paddingTop:3,position:"absolute",transform:"rotate(16deg)",width:"100%",[`@media ${P.q.Large}`]:{fontSize:16,left:-12,paddingTop:e.spacing.xxs}}),$=e=>({color:e.semanticColors.neutralsHigher}),O=({identifier:e,imgSrc:i,metadata:t,name:s,selected:a=!1,...r})=>{let l=(0,C.Ub)(P.q.Large);return(0,n.FD)("div",{css:R,children:[(0,n.FD)(M.bL,{css:T,...r,children:[(0,n.FD)("div",{css:q,children:[(0,n.Y)(M._V,{alt:s,css:L,src:i}),(0,n.Y)(M.H4,{asChild:!0,children:(0,n.Y)(I.Skeleton,{css:A})}),e&&(0,n.Y)("span",{css:W,children:e})]}),a&&(0,n.Y)(f.Nr.FilledOn,{css:z,size:l?32:24})]}),(0,n.FD)("div",{css:E,children:[s?(0,n.Y)(h.Text,{overflow:"ellipsis",size:l?"l":"m",type:"title",children:s}):(0,n.Y)(I.Skeleton,{css:B}),t&&(0,n.Y)(h.Text,{css:$,overflow:"ellipsis",size:l?"xl":"l",type:"detail",children:t})]})]})};var K=t(59972),N=t(4025),j=t(83741),U=t(3012),J=t(74304),V=t(13251),H=t(4884),G=t(61400),X=t(58118);let Q=e=>({backgroundColor:e.semanticColors.background,borderRadius:e.radius.l,bottom:e.spacing.xl,color:e.semanticColors.primary,display:"flex",flexDirection:"column",gap:e.spacing.l,left:"50%",maxWidth:`min(480px, calc(100dvw - calc(${e.spacing.l} * 2)))`,overflow:"hidden",padding:e.spacing.l,position:"fixed",textAlign:"center",width:"100dvw",zIndex:G.s.Content,[`@media ${P.q.Large}`]:{bottom:"auto",paddingBottom:e.spacing.xl,paddingTop:e.spacing.xl,textAlign:"left",top:"50%"}}),Z=e=>({color:e.semanticColors.neutralsHigher,margin:0,[`@media ${P.q.Large}`]:{color:e.semanticColors.primary}}),ee={margin:0},ei=e=>({alignItems:"center",display:"flex",gap:e.spacing.l,justifyContent:"center",[`@media ${P.q.Large}`]:{justifyContent:"space-between"}}),et=e=>({display:"flex",flexDirection:"column",gap:e.spacing.xs,[`@media ${P.q.Large}`]:{gap:e.spacing.m}}),en={display:"none",[`@media ${P.q.Large}`]:{display:"flex"}},es=(0,p.vt)(({modalName:e="kids_profile_created_confirmation",title:i,secondaryCta:t=null})=>{let d=(0,p.hS)(),{onOpenChange:c,resolve:f}=(0,Y.T)({modal:d}),{track:x}=(0,r.useAnalyticsContext)(),y=(0,C.Ub)(P.q.Large),b=(0,s.c3)();(0,l.useViewedScreen)({event:o.W.ViewedModal,isReady:d.visible,properties:{modal_name:e},screen:k.J.ProfileSelector});let v=(0,_.useCallback)(()=>{x({event:o.W.TappedModalPrimaryCTA,properties:{cta_lokalise_key:"general_word_okay",cta_text:b("general_word_okay"),modal_name:e,screen_name:k.J.ProfileSelector}}),f(!0,()=>d.hide())},[d.hide,f,b,x]);return(0,n.Y)(U.bL,{onOpenChange:c,open:d.visible,children:(0,n.Y)(U.ZL,{children:(0,n.FD)(J.N,{children:[(0,n.Y)(U.hJ,{asChild:!0,children:(0,n.Y)(X.h,{onClick:()=>c(!1)})}),(0,n.Y)(_.Fragment,{children:d.visible&&(0,n.Y)(U.UC,{asChild:!0,onOpenAutoFocus:e=>{e.preventDefault(),document.getElementById("alert-dialog-action")?.focus()}
1,children:(0,n.FD)(V.P.div,{animate:{opacity:1,scale:1,x:"-50%",y:y?"-50%":0},css:Q,exit:{opacity:0,scale:y?.95:1,x:"-50%",y:y?"-50%":"100%"},initial:{opacity:0,scale:y?.95:1,x:"-50%",y:y?"-50%":"100%"},transition:{duration:H.s.Long,type:"spring"},children:[(0,n.FD)("div",{css:et,children:[(0,n.FD)("div",{css:ei,children:[(0,n.Y)(h.Text,{asChild:!0,size:y?"s":"l",type:y?"headline":"title",children:(0,n.Y)(U.hE,{css:ee,children:i??b("kids_profile_created_modal_title")})}),(0,n.Y)(U.ZD,{asChild:!0,children:(0,n.Y)(u.IconButton,{css:en,icon:(0,n.Y)(g.US,{size:20}),size:"s",variant:"transparentPrimary"})})]}),(0,n.Y)(h.Text,{asChild:!0,children:(0,n.Y)(U.VY,{css:Z,children:(0,n.Y)(a.I18nMessage,{message:"kids_profile_created_modal_subtitle_web"})})})]}),(0,n.Y)(U.rc,{asChild:!0,id:"alert-dialog-action",onClick:v,children:(0,n.Y)(m.Button,{isFullWidth:!0,size:"l",children:(0,n.Y)(a.I18nMessage,{message:"general_word_okay"})})}),t?(0,n.Y)(U.rc,{asChild:!0,id:"alert-dialog-secondary-action",onClick:()=>t.onClick(d),children:t.content}):null]})})},"alertDialogContent")]})})})}),ea=e=>({alignItems:"center",display:"flex",flexDirection:"column",gap:e.spacing.m,justifyContent:"center",width:"100%",[`@media ${P.q.Large}`]:{gap:e.spacing.l}}),er=e=>({borderRadius:e.radius.l,paddingBottom:e.spacing.l,paddingLeft:e.spacing.m,paddingRight:e.spacing.m,paddingTop:e.spacing.l}),el=e=>({cursor:"pointer",":hover":{background:e.semanticColors.neutralsLowest}}),eo=e=>({display:"flex",flexDirection:"column",gap:e.spacing.l,maxWidth:840,width:"100%"}),ed=e=>({display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:e.spacing.xs,[`@media ${P.q.Large}`]:{gridTemplateColumns:"repeat(3, 1fr)"}}),ec=e=>({alignItems:"center",display:"flex",justifyContent:"space-between",width:"100%"}),ep=e=>({overflowX:"hidden",overflowY:"auto",paddingBottom:e.spacing.xxl}),eu=e=>({color:e.semanticColors.neutralsHigh}),eg=e=>({alignItems:"center",backgroundColor:e.semanticColors.neutralsLowest,borderRadius:e.radius.full,display:"flex",justifyContent:"center",overflow:"hidden",position:"relative",height:88,width:88,[`@media ${P.q.Large}`]:{height:116,width:116}}),em=e=>({alignItems:"center",display:"flex",flexDirection:"column",gap:e.spacing.xxs,justifyContent:"center",textAlign:"center",width:"100%"}),eh=e=>({color:e.semanticColors.neutralsMedHigh,marginTop:e.spacing.l,textAlign:"center",[`@media ${P.q.Large}`]:{marginTop:e.spacing.xxl}}),ef=e=>({color:e.semanticColors.neutralsHigher}),ex={margin:0},ey={position:"relative"},e_={cursor:"pointer"},eC=e=>({backgroundColor:e.shades.shade50,borderRadius:e.radius.full,height:88,left:"50%",pointerEvents:"none",position:"absolute",top:e.spacing.l,transform:"translateX(-50%)",width:88,zIndex:1,[`@media ${P.q.Large}`]:{height:116,width:116}}),eb=e=>({alignItems:"center",color:e.semanticColors.onOverlayBackground,display:"flex",height:40,justifyContent:"center",left:"50%",pointerEvents:"none",position:"absolute",top:68,transform:"translate(-50%, -50%)",width:40,zIndex:2,[`@media ${P.q.Large}`]:{top:82}}),eY=(0,p.vt)(({creationProps:e={},isShowProfileReady:i,profileReadyProps:t={},onDismiss:I,onSuccess:M})=>{let L=(0,p.hS)(),{onOpenChange:q,resolve:T}=(0,Y.T)({modal:L,onClose:I}),z=(0,s.Ym)(),R=(0,s.c3)(),{setToastAfterRefresh:E}=(0,F.useContext)(),{track:A}=(0,r.useAnalyticsContext)(),B=(0,C.Ub)(P.q.Large),{query:{data:W}}=(0,d.useRequestMe)(),{data:$}=(0,D.useRequestMeRelatedAccounts)(),U=(0,b.useKidProfiles)()??[],J=(0,c.useIsBlockedFromManagingProfiles)(),[V,H]=(0,_.useState)(!1),[G,X]=(0,_.useState)(!1);(0,l.useViewedScreen)({screen:k.J.ProfileSelector});let Q=(0,_.useCallback)(e=>{T(!0,()=>{E(R("profile_switcher_toast_title",{0:e.user.name})),M?M(e):window.location.reload(),L.hide()})},[L.hide,M,T]),{switchProfiles:Z}=(0,v.w)({onSuccess:Q}),ee=(0,_.useCallback)((e,i)=>{A({event:o.W.TappedProfileSettings,properties:{screen_name:k.J.ProfileSelector,target_account_type:i?"kids":"standard"}}),e===W?.id?window.location.assign("/settings/account"):window.location.assign(`/settings/kids/${e}`)},[W?.id,A]),ei=(0,_.useCallback)(()=>{A({event:o.W.TappedAddKidsProfile,properties:{screen_name:k.J.ProfileSelector}}),(0,p.WU)(N.Creation,{...e,onSuccess:i=>{e?.onSuccess?.(i),X(!0),(0,p.WU)(es,e?.profileReadyProps??{})}})},[e]),et=(0,_.useCallback)(({isKid:e,userId:i})=>{A({event:o.W.TappedSwitchProfile,properties:{account_type:e?"kids":"standard",screen_name:k.J.ProfileSelector}}),W?.is_kid?(0,p.WU)(j.EnterPin,{onSuccess:Q,type:j.EnterPinType.SwitchProfile,userId:i}):Z({userId:i})},[W?.is_kid,Q,Z,A]);return(0,_.useEffect)(()=>{i&&!G&&(X(!0),(0,p.WU)(es,t))},[i,G,t]),(0,n.Y)(K.n,{contentCss:ep,isOpen:L.visible,onOpenChange:q,children:(0,n.FD)("div",{css:eo,children:[(0,n.FD)("div",{css:ec,children:[(0,n.Y)(x.bm,{asChild:!0,children:(0,n.Y)(u.IconButton,{icon:(0,n.Y)(g.US,{size:20}),variant:"transparentPrimary"})}),!W?.is_kid&&!J&&(0,n.Y)(m.Button,{size:"s",variant:"neutral",onClick:()=>{V||A({event:o.W.TappedManageProfiles,properties:{screen_name:k.J.ProfileSelector}}),H(e=>!e)},children:(0,n.Y)(a.I18nMessage,{message:V?"general_word_done":"profile_switcher_manage"})})]}),(0,n.Y)(x.hE,{asChild:!0,children:(0,n.Y)(h.Text,{css:ex,size:"m",type:"headline",children:(0,n.Y)(a.I18nMessage,{message:"profile_switcher_title"})})}),(0,n.Y)(y.s6,{children:(0,n.Y)(x.VY,{children:(0,n.Y)(a.I18nMessage,{message:"profile_switcher_title"})})}),(0,n.FD)("div",{css:ed,children:[$?.map(e=>{let i=e.id!==W?.id;return(0,n.FD)("div",{css:[er,(i||V)&&el,V&&ey],onClick:V?i=>{i.stopPropagation(),ee(e.id,e.is_kid)}:i?()=>et({isKid:e.is_kid,userId:e.id}):void 0,onKeyDown:V?i=>{"Enter"===i.key&&ee(e.id,e.is_kid)}:i?i=>{"Enter"===i.key&&et({isKid:e.is_kid,userId:e.id})}:void 0,role:i||V?"button":void 0,tabIndex:i||V?0:void 0,children:[(0,n.Y)(O,{identifier:e.is_kid?e.identifier:void 0,selected:!i&&!V,imgSrc:e.image_url,metadata:e.is_kid?void 0:e.identifier,name:e.name||e.
1identifier||""}),V&&(0,n.FD)(n.FK,{children:[(0,n.Y)("span",{css:eC}),(0,n.Y)("span",{css:eb,children:(0,n.Y)(f.Lh,{size:40})})]})]},e.id)}),!W?.is_kid&&!J&&(0,S.M)(z)&&U.length<w.u&&(0,n.FD)("div",{css:[er,e_,ea],onClick:ei,onKeyDown:e=>{"Enter"===e.key&&ei()},role:"button",tabIndex:0,children:[(0,n.Y)("span",{css:eg,children:(0,n.Y)(f.c1.Simple,{css:eu,size:34})}),(0,n.FD)("span",{css:em,children:[(0,n.Y)(h.Text,{overflow:"ellipsis",size:B?"l":"m",type:"title",children:(0,n.Y)(a.I18nMessage,{message:"profile_switcher_add_kids_profile"})}),(0,n.Y)(h.Text,{css:ef,overflow:"ellipsis",size:B?"xl":"l",type:"detail",children:(0,n.Y)(a.I18nMessage,{message:"account_type_label_kids"})})]})]})]}),U.length===w.u&&(0,n.Y)(h.Text,{css:eh,size:B?"l":"m",type:"body",children:(0,n.Y)(a.I18nMessage,{message:"general_words_kids_profile_limit"})})]})})})}}]); 2//# sourceMappingURL=2528-dc4bc42c8c9ca6c6.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.