PageSourceSearch

https://static.boosty.to/js/index.DLp83Oqs.js

js boosty.to collected 2026-09-24 06:50:14 UTC 7,480 bytes, 1 lines download raw bytes

1import{j as t,d as O,r as E,u as M,f as R,l as D,q as j}from"./vendor.hUBjuXJf.js";import{a0 as F,eK as y,eL as S,C as H,O as P,j as z,eM as Z,$ as b,eN as C,X as v,dM as $,dN as B,aT as G,dR as K,ad as x,eO as W,bj as Y,L as Q}from"./app.35LU1w5v.js";import"./icons.BoQEBJ_J.js";var r=(o=>(o.LOADING="LOADING",o.UNAUTHORIZED="UNAUTHORIZED",o.AUTHORIZED="AUTHORIZED",o.USER_NOT_FOUND="USER_NOT_FOUND",o.USER_ALREADY_LINKED="USER_ALREADY_LINKED",o.ERROR="ERROR",o))(r||{}),p=(o=>(o.REQUEST="BoostyLinkRequest",o.APPROVE="BoostyLinkApprove",o.SUCCESS="BoostyLinkSuccess",o.RESIZE="BoostyLinkResize",o.LOADING="BoostyLinkLoading",o.CHANGE_MODE="BoostyLinkChangeMode",o))(p||{});const q="ModeAuthorized-scss--module_root_-79iM",V="ModeAuthorized-scss--module_loading_9A4AN",J="ModeAuthorized-scss--module_fadeIn_e2tZ2",X="ModeAuthorized-scss--module_fadeOut_iz8ow",oo="ModeAuthorized-scss--module_dropdownAnimationFadeIn_JQs1d",eo="ModeAuthorized-scss--module_flashing_xjjcn",so="ModeAuthorized-scss--module_rotating_fBenC",to="ModeAuthorized-scss--module_growIn_t7oij",no="ModeAuthorized-scss--module_closeLock_tgMbE",ro="ModeAuthorized-scss--module_shakeLock_Fiq9J",co="ModeAuthorized-scss--module_flashToHighlight_u4hMe",io="ModeAuthorized-scss--module_flash_HChWp",ao={root:q,loading:V,fadeIn:J,fadeOut:X,dropdownAnimationFadeIn:oo,flashing:eo,rotating:so,growIn:to,closeLock:no,shakeLock:ro,flashToHighlight:co,flash:io},uo=o=>{const{isLoading:e,currentUser:s,phone:d,onEnterAccount:u,onChooseOtherAccount:n}=o;return t.jsx("div",{children:e?t.jsx(F,{className:ao.loading}):t.jsx(y,{storedAcc:{phone:d,provider:s.authSource.type,name:s.name,avatarUrl:s.avatarUrl},buttonsColor:S.AZURE_RADIANCE,onEnterAccount:u,onContinue:n})})},ho="IncorrectUser-scss--module_root_kgM7V",lo="IncorrectUser-scss--module_picture_2rYcb",Ao="IncorrectUser-scss--module_title_bMZQg",Uo="IncorrectUser-scss--module_description_w6ATH",Eo="IncorrectUser-scss--module_fadeIn_1dGEr",mo="IncorrectUser-scss--module_fadeOut_tRM-F",_o="IncorrectUser-scss--module_dropdownAnimationFadeIn_Bs8U1",fo="IncorrectUser-scss--module_flashing_UDPe2",go="IncorrectUser-scss--module_loading_--1Yw",Oo="IncorrectUser-scss--module_rotating_KhWd2",po="IncorrectUser-scss--module_growIn_dBnfu",Io="IncorrectUser-scss--module_closeLock_e9Rgf",Ro="IncorrectUser-scss--module_shakeLock_KgAOB",No="IncorrectUser-scss--module_flashToHighlight_Q3h2t",Co="IncorrectUser-scss--module_flash_WBtV7",g={root:ho,picture:lo,title:Ao,description:Uo,continue:"IncorrectUser-scss--module_continue_TON5d",fadeIn:Eo,fadeOut:mo,dropdownAnimationFadeIn:_o,flashing:fo,loading:go,rotating:Oo,growIn:po,closeLock:Io,shakeLock:Ro,flashToHighlight:No,flash:Co},L=O.getTranslation("@founder/common/containers.ExternalAccountLink.components.IncorrectUser"),k=o=>{const{title:e,description:s,isContinuationPossible:d,onChooseOtherAccount:u,onContinue:n}=o;return t.jsxs("div",{className:g.root,children:[t.jsx("div",{className:g.picture}),t.jsx("div",{className:g.title,children:e}),s&&t.jsx("div",{className:g.description,children:s}),d&&t.jsx(H,{className:g.continue,bgColor:S.AZURE_RADIANCE,onClick:n,children:L.continue}),t.jsx(P,{onClick:u,children:L.chooseOtherAccount})]})},N=O.getTranslation("@founder/common/containers.ExternalAccountLink.components.ModeError"),So=o=>{const{currentUser:e,onChooseOtherAccount:s}=o;return t.jsx(k,{title:N.title,description:e!=null&&e.isTotalBaned?O.getParametrizedText(N.description.banned,{projectNameEnglishOnlyCapitalizes:z().projectName.latinCapitalized}):N.description.default,isContinuationPossible:!1,onChooseOtherAccount:s})},ko=o=>{const{isUserNotFoundByPhone:e,onEmptyUser:s,onSuccess:d,onAfterChangeStep:u,onErrorsChange:n}=o,c=a=>{var A;if(((A=a==null?void 0:a.data)==null?void 0:A.action)===b.AUTH_REDIRECT_WINDOW_SUCCESS){const h=a.data.options,{accessToken:U,refreshToken:_,expiresAt:m}=C();h.isEmptyUser&&s({accessToken:String(U),refreshToken:String(_),expiresAt:Number(m)})}};return E.useEffect(()=>(window.addEventListener("message",c),()=>window.removeEventListener("message",c)),[]),t.jsx("div",{children:t.jsx(Z,{isLastAccountDisabled:!0,isOnlyContent:!0,isExternalAccountLink:!0,isUserNotFoundByPhone:e,buttonsColor:S.AZURE_RADIANCE,onSuccess:d,onAfterChangeStep:u,onErrorsChange:n,onEmptyUser:s})})},Lo=O.getTranslation("@founder/common/containers.ExternalAccountLink.components.ModeUserAlreadyLinked"),To=o=>{const{onChooseOtherAccount:e}=o;return t.jsx(k,{title:Lo.title,isContinuationPossible:!1,onChooseOtherAccount:e})},T=O.getTranslation("@founder/common/containers.ExternalAccountLink.components.ModeUserNotFound"),Mo=o=>{const{onContinue:e,onChooseOtherAccount:s}=o;
1return t.jsx(k,{title:T.title,description:T.description,isContinuationPossible:!0,onContinue:e,onChooseOtherAccount:s})},Do=o=>{var m;const{isActive:e,onEnterAccount:s,onChooseOtherAccount:d}=o,u=M(),n=R(v),c=R($),a=R(B),A=((m=n==null?void 0:n.authSource)==null?void 0:m.type)===G.PHONE&&!a.isFetching&&!c,[h,U]=E.useState(!0),_=async()=>{U(!0),await u(D.thunkToAction(K.action)()),U(!1)};return E.useEffect(()=>{e&&(A?_():U(!1))},[e]),{phone:c,currentUser:n,isLoading:h,onEnterAccount:s,onChooseOtherAccount:d}},zo=o=>{const{onChooseOtherAccount:e}=o,{currentUser:s}=x();return{currentUser:s,onChooseOtherAccount:e}},xo=o=>{const{isUserNotFoundByPhone:e,onEmptyUser:s,onSuccess:d}=o;return{isUserNotFoundByPhone:e,onSuccess:d,onEmptyUser:s}},wo=o=>{const{onChooseOtherAccount:e}=o;return{onChooseOtherAccount:e}},jo=o=>{const{onChooseOtherAccount:e,onContinue:s}=o;return{onChooseOtherAccount:e,onContinue:s}},Fo=o=>{const{onAuthSuccess:e}=o,s=M(),{isAuthorized:d,currentUser:u}=x(),[n,c]=E.useState(r.LOADING),[a,A]=E.useState(null),[h,U]=E.useState(!1),_=()=>{const{accessToken:l}=C();e(l)},m=(l,w)=>{A(l),c(r.USER_NOT_FOUND),U(w)},I=()=>{const{accessToken:l}=C();e(l)},i=()=>c(r.UNAUTHORIZED),f=async()=>{const{accessToken:l}=a;await s(D.thunkToAction(W.action)({accessToken:l})),Y(a),h?c(r.UNAUTHORIZED):e(l)};return E.useEffect(()=>{d?u.isTotalBaned?c(r.ERROR):c(r.AUTHORIZED):c(r.UNAUTHORIZED)},[]),{mode:n,modes:{authorized:Do({isActive:n===r.AUTHORIZED,onEnterAccount:I,onChooseOtherAccount:i}),error:zo({isActive:n===r.ERROR,onChooseOtherAccount:i}),unAuthorized:xo({isActive:n===r.UNAUTHORIZED,isUserNotFoundByPhone:h,onSuccess:_,onEmptyUser:m}),userAlreadyLinked:wo({isActive:n===r.USER_ALREADY_LINKED,onChooseOtherAccount:i}),userNotFound:jo({isActive:n===r.USER_NOT_FOUND,onContinue:f,onChooseOtherAccount:i})}}},yo=[0,100,250,500,1e3],bo=()=>{const{mode:o,modes:{authorized:e,error:s,unAuthorized:d,userAlreadyLinked:u,userNotFound:n}}=Fo({onAuthSuccess:i=>_(i)}),c=E.useRef(null),a=i=>{if(window.parent)try{const{oauthAllowedOrigins:f}=z(),{from:l}=j.parse(window.location.search);window.parent.postMessage(i,f[l])}catch(f){Q.error(`Failed send postMessage "${i.type}" with data "${JSON.stringify(i.data)}"`,f)}},A=()=>{if(c.current){const i=c.current.clientHeight;a({type:p.RESIZE,data:{height:i}})}},h=()=>{A(),yo.forEach(i=>setTimeout(()=>A(),i))},U=()=>{a({type:p.CHANGE_MODE,data:{mode:o}})},_=i=>{a({type:p.REQUEST,data:{accessToken:i}})},m=()=>h(),I=()=>h();return E.useEffect(()=>{h(),U()},[o]),t.jsxs("div",{ref:c,children:[o===r.AUTHORIZED&&t.jsx(uo,{...e}),o===r.ERROR&&t.jsx(So,{...s}),o===r.UNAUTHORIZED&&t.jsx(ko,{...d,onAfterChangeStep:m,onErrorsChange:I}),o===r.USER_ALREADY_LINKED&&t.jsx(To,{...u}),o===r.USER_NOT_FOUND&&t.jsx(Mo,{...n})]})};export{bo as ExternalAccountLink};

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.