PageSourceSearch

https://nationalist.social/packs/js/unauthorized-modal--k1f6YLY.js

js nationalist.social collected 2026-10-04 05:32:10 UTC 3,959 bytes, 2 lines download raw bytes

1import{G as C,d as P,b as S,u as O,e as T,dY as F,q as b,r as k,_ as e,S as x,T as r,F as t,aV as N,B as z,L as D,hi as U,a2 as V}from"../index-VMHOJWMU.js";import{u as j}from"./useRegistrationStatus-YSobWH3z.js";import{I as B}from"./input-bKk5pD2j.js";import{M as p}from"./modal-4Y7bhgPm.js";import"./eye-tv-5IEBh.js";import"./eye-off-NuujKo4r.js";import"./tooltip-SYCiS-yv.js";import"./floating-ui.react-ccaI1FQM.js";import"./arrow-left-mFFeWVp-.js";import"./icon-button-4Eh3IETG.js";const v=D({accountPlaceholder:{id:"remote_interaction.account_placeholder",defaultMessage:"Enter your username@domain you want to act from"},userNotFoundError:{id:"remote_interaction.user_not_found_error",defaultMessage:"Couldn't find given user"}}),$=M=>{let{action:a,onClose:l,account:h,ap_id:y}=M;const d=C(),c=P(),I=S(),u=O(),{isOpen:s}=j(),A=T(i=>{var o;return(o=F(i,h))==null?void 0:o.display_name}),m=b(),[f,E]=k.useState(""),L=i=>{E(i.target.value)},n=()=>{l("UNAUTHORIZED")},R=i=>{i.preventDefault(),I(U(y,f)).then(o=>{window.open(o,"_new","noopener,noreferrer"),l("UNAUTHORIZED")}).catch(o=>{o.message==="Couldn't find user"&&V.error(d.formatMessage(v.userNotFoundError))})},g=()=>{c.push("/login"),n()},_=()=>{c.push("/signup"),n()},w=()=>{let i,o;return a==="FOLLOW"?(i=e(t,{id:"remote_interaction.follow_title",defaultMessage:"Follow {user} remotely",values:{user:A}}),o=e(t,{id:"remote_interaction.follow",defaultMessage:"Proceed to follow"})):a==="REPLY"?(i=e(t,{id:"remote_interaction.reply_title",defaultMessage:"Reply to a post remotely"}),o=e(t,{id:"remote_interaction.reply",defaultMessage:"Proceed to reply"})):a==="REBLOG"?(i=e(t,{id:"remote_interaction.reblog_title",defaultMessage:"Reblog a post remotely"}),o=e(t,{id:"remote_interaction.reblog",defaultMessage:"Proceed to repost"})):a==="FAVOURITE"?(i=e(t,{id:"remote_interaction.favourite_title",defaultMessage:"Like a post remotely"}),o=e(t,{id:"remote_interaction.favourite",defaultMessage:"Proceed to like"})):a==="DISLIKE"?(i=e(t,{id:"remote_interaction.dislike_title",defaultMessage:"Dislike a post remotely"}),o=e(t,{id:"remote_interaction.dislike",defaultMessage:"Proceed to dislike"})):a==="POLL_VOTE"?(i=e(t,{id:"remote_interaction.poll_vote_title",defaultMessage:"Vote in a poll remotely"}),o=e(t,{id:"remote_interaction.poll_vote",defaultMessage:"Proceed to vote"})):a==="JOIN"&&(i=e(t,{id:"remote_interaction.event_join_title",defaultMessage:"Join an event remotely"}),o=e(t,{id:"remote_interaction.event_join",defaultMessage:"Proceed to join"})),e(p,{title:i,onClose:n,confirmationAction:g,confirmationText:e(t,{id:"account.login",defaultMessage:"Log in"}),secondaryAction:s?_:void 0,secondaryText:s?e(t,{id:"account.register",defaultMessage:"Sign up"}):void 0},void 0,e("div",{className:"remote-interaction-modal__content"},void 0,e(N,{className:"remote-interaction-modal__fields",onSubmit:R},void 0,e(B,{placeholder:d.formatMessage(v.accountPlaceholder),name:"remote_follow[acct]",value:f,autoCorrect:"off",autoCapitalize:"off",onChange:L,required:!0}),e(z,{type:"submit",theme:"primary"},void 0,o)),e("div",{className:"remote-interaction-modal__divider"},void 0,e(r,{align:"center"},void 0,e(t,{id:"remote_interaction.divider",defaultMessage:"or"}))),s&&e(r,{size:"lg",weight:"medium"},void 0,e(t,{id:"unauthorized_modal.title",defaultMessage:"Sign up for {site_title}",values:{site_title:u.title}}))))};return a&&m.remoteInteractions&&m.federating?w():e(p,{title:e(t,{id:"unauthorized_modal.title",defaultMessage:"Sign up for {site_title}",values:{site_title:u.title}}),onClose:n,confirmationAction:g,confirmationText:e(t,{id:"account.login",defaultMessage:"Log in"}),secondaryAction:s?_:void 0,secondaryText:s?e(t,{id:"account.register",defaultMessage:"Sign up"}):void 0},void 0,e(x,{},void 0,e(r,{},void 0,e(t,{id:"unauthorized_modal.text",defaultMessage:"You need to be logged in to do that."}))))};export{$ as default};
2//# sourceMappingURL=unauthorized-modal--k1f6YLY.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.