try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`02aa7169-b8eb-43a3-98ff-3ed8e8cb86d5`,e._sentryDebugIdIdentifier=`sentry-dbid-02aa7169-b8eb-43a3-98ff-3ed8e8cb86d5`)}catch{}import{X as e,it as t}from"./xds-react-components-lks62tbl.js";import{Ag as n,Ai as r,Ci as i,Di as a,Ei as o,Fg as s,Oi as c,Si as l,Ti as u,Wn as d,eh as f,hn as p,ki as m,lh as h,wi as g}from"./entry.client-dr7r6s9a.js";import{Cr as _,ot as v}from"./xds-icons-d7khcnpi.js";var y=s(),b=n(),x=e=>{let n=(0,y.c)(18),{disableButtons:r,disableNext:i,handleNext:a,handleRandom:o,nextButtonText:s}=e,{t:c}=h(`ChangeGamertagDialog`),{locNext:l}=f(),u;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={root:`flex-1`,text:`w-auto`},n[0]=u):u=n[0];let d;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,b.jsx)(v,{}),n[1]=d):d=n[1];let m;n[2]===c?m=n[3]:(m=c(`Randomize`,{shortKey:`randomize_461ef9`}),n[2]=c,n[3]=m);let g;n[4]!==r||n[5]!==o||n[6]!==m?(g=(0,b.jsx)(t,{as:`button`,autoFocus:!0,classNames:u,isDisabled:r,kind:`standard`,leadingIcon:d,onPress:o,size:`standard`,children:m}),n[4]=r,n[5]=o,n[6]=m,n[7]=g):g=n[7];let _=r||i,x;n[8]!==s||n[9]!==l?(x=s??l(),n[8]=s,n[9]=l,n[10]=x):x=n[10];let S;n[11]!==_||n[12]!==a||n[13]!==x?(S=(0,b.jsx)(p,{as:`button`,className:`flex-1`,isDisabled:_,kind:`brand`,onPress:a,size:`standard`,children:x}),n[11]=_,n[12]=a,n[13]=x,n[14]=S):S=n[14];let C;return n[15]!==g||n[16]!==S?(C=(0,b.jsxs)(`div`,{className:`flex items-start gap-layout-horizontal-gutter self-stretch pt-internal-gap-static-regular`,children:[g,S]}),n[15]=g,n[16]=S,n[17]=C):C=n[17],C},S=t=>{let n=(0,y.c)(38),{errorReservation:s,gamertag:f,maxLength:p,setGamertag:v,statusInfo:x}=t,{t:S}=h(`ChangeGamertagDialog`),C;n[0]===S?C=n[1]:(C=S(`Customize your gamertag`,{shortKey:`customize_gamertag_520c4b`}),n[0]=S,n[1]=C);let w=C,T;if(i(s,{recursive:!0})){let e;n[2]===S?e=n[3]:(e=S(`You already own this gamertag. If this is an error, sign out and back in, then try again. If not, please try a different gamertag.`,{shortKey:`gamertag_already_owned_error`}),n[2]=S,n[3]=e),T=e}else if(l(s,{recursive:!0})){let e;n[4]===S?e=n[5]:(e=S(`Gamertag contains consecutive spaces`,{shortKey:`gamertag_contains_consecutive_spaces_error`}),n[4]=S,n[5]=e),T=e}else if(r(s,{recursive:!0})){let e;n[6]===S?e=n[7]:(e=S(`This gamertag is already taken or isn't allowed`,{shortKey:`classic_gamertag_conflict_error`}),n[6]=S,n[7]=e),T=e}else if(m(s,{recursive:!0})){let e;n[8]===S?e=n[9]:(e=S(`This gamertag contains characters that aren't allowed`,{shortKey:`classic_gamertag_contains_invalid_characters_error`}),n[8]=S,n[9]=e),T=e}else if(a(s,{recursive:!0})){let e;n[10]!==s||n[11]!==S?(e=S(`Gamertag contains invalid characters: {invalidCharacters}`,{shortKey:`gamertag_contains_invalid_characters_error`,values:{invalidCharacters:o(s)?.invalidCharacters?.join(`, `)}}),n[10]=s,n[11]=S,n[12]=e):e=n[12],T=e}else if(g(s,{recursive:!0})){let e;n[13]===S?e=n[14]:(e=S(`Gamertag starts with invalid characters`,{shortKey:`gamertag_starts_with_invalid_characters_error`}),n[13]=S,n[14]=e),T=e}else if(u(s,{recursive:!0})){let e;n[15]===S?e=n[16]:(e=S(`Gamertag isn't allowed`,{shortKey:`gamertag_not_allowed_error`}),n[15]=S,n[16]=e),T=e}else if(c(s,{recursive:!0})){let e;n[17]===S?e=n[18]:(e=S(`Gamertag encountered a conflict. Please try again`,{shortKey:`gamertag_conflict_error`}),n[17]=S,n[18]=e),T=e}else{let e;n[19]===S?e=n[20]:(e=S(`There was an error with your gamertag. Please try again`,{shortKey:`gamertag_generic_error`}),n[19]=S,n[20]=e),T=e}let E=T,D;n[21]===x?D=n[22]:(D=(0,b.jsx)(`p`,{id:`change-gamertag-status-info`,className:`text-noninteractive-content-secondary-content type-caption`,children:x}),n[21]=x,n[22]=D);let O;n[23]!==s||n[24]!==E?(O=s&&(0,b.jsxs)(`div`,{className:`flex flex-row items-center gap-internal-icon-and-text-gap-regular`,children:[(0,b.jsx)(d,{icon:(0,b.jsx)(_,{}),size:`caption`,className:`text-feedback-status-standard-content-icon-error`}),(0,b.jsx)(`p`,{className:`text-noninteractive-content-primary-content type-caption`,children:E})]}),n[23]=s,n[24]=E,n[25]=O):O=n[25];let k;n[26]!==D||n[27]!==O?(k=(0,b.jsxs)(`div`,{className:`flex flex-1 flex-col items-start gap-internal-gap-tight`,children:[D,O]}),n[26]=D,n[27]=O,n[28]=k):k=n[28];let A;n[29]===S?A=n[30]:(A=S(`Custom`,{shortKey:`custom_78fb77`}),n[29]=S,n[30]=A);let j;return n[31]!==w||n[32]!==v||n[33]!==k||n[34]!==A||n[35]!==f||n[36]!==p?(j=(0,b.jsx)(e,{"aria-label":w,"aria-describedby":`change-gamertag-status-info`,className:`w-full`,onChange:v,placeholder:w,statusInfo:k,title:A,value:f,maxLength:p}),n[31]=w,n[32]=v,n[33]=k,n[34]=A,n[35]=f,n[36]=p,n[37]=j):j=n[37],j};export{x as n,S as t};