1import{o as e,r as t}from"./chunk-CMxvf4Kt.js";import{n,t as r}from"./jsx-runtime-SsSjplwM.js";import{a as i,c as a,s as o}from"./react-intl-Cop388b4.js";import{n as s}from"./prop-types-BTvjt2rf.js";import{A as c,B as l,F as u,M as d,Q as f,R as p,g as m}from"./poll-quu7nqu0.js";import{at as h,et as g,ki as _,nt as v}from"./render-CHiIZYnD.js";import{s as y}from"./react-router-BzQH59UT.js";import{o as b,s as x}from"./typed_functions-CyAHd4bl.js";import{cn as S,ln as C,p as w}from"./status_quoted-CwxV3dOE.js";import{t as T}from"./classnames-CYxIelk8.js";import{t as E}from"./account_bio-CvDFMOLD.js";import{t as D}from"./add-COFszs2T.js";import{a as O}from"./compose_form_container-Dhanlzat.js";import{t as k}from"./callout-Ct9Pfvc6.js";import"./form_fields-D59m7r6R.js";import{n as A}from"./toggle_field-Dg9896wh.js";import{n as ee}from"./useAccountId-Chz2z4M-.js";import{a as j,i as M,n as N,r as P,t as F}from"./edit_button-BULmXLh4.js";import{t as I}from"./delete-CKzzlDYo.js";var L=e(n()),R=r(),z=e=>{let{dismiss:t,wasDismissed:n}=w(e.id),{onClose:r}=e,i=(0,L.useCallback)(()=>{t(),r?.()},[t,r]);return n?null:(0,R.jsx)(k,{...e,onClose:i})},B=({onElement:e,...t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(u,{as:`h2`,htmlString:t.name,className:j.fieldName,onElement:e}),(0,R.jsx)(u,{as:`p`,htmlString:t.value,className:j.fieldValue,onElement:e})]}),V=o({edit:{id:`account_edit.field_actions.edit`,defaultMessage:`Edit field`},delete:{id:`account_edit.field_actions.delete`,defaultMessage:`Delete field`}}),H=({id:e})=>{let t=b(),n=(0,L.useCallback)(()=>{t(_({modalType:`ACCOUNT_EDIT_FIELD_EDIT`,modalProps:{fieldKey:e},ignoreFocus:!0}))},[t,e]),r=(0,L.useCallback)(()=>
1{t(_({modalType:`ACCOUNT_EDIT_FIELD_DELETE`,modalProps:{fieldKey:e}}))},[t,e]),i=a();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(N,{label:i.formatMessage(V.edit),icon:!0,onClick:n}),(0,R.jsx)(F,{label:i.formatMessage(V.delete),onClick:r})]})},U=e(T()),W=e=>(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,R.jsx)(`path`,{d:`M480-260q75 0 127.5-52.5T660-440q0-75-52.5-127.5T480-620q-75 0-127.5 52.5T300-440q0 75 52.5 127.5T480-260Zm0-80q-42 0-71-29t-29-71q0-42 29-71t71-29q42 0 71 29t29 71q0 42-29 71t-71 29ZM160-120q-33 0-56.5-23.5T80-200v-480q0-33 23.5-56.5T160-760h126l74-80h240l74 80h126q33 0 56.5 23.5T880-680v480q0 33-23.5 56.5T800-120H160Zm0-80h640v-480H638l-73-80H395l-73 80H160v480Zm320-240Z`})}),G=e=>(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,R.jsx)(`path`,{d:`M360-200h240l-79-103-58 69-39-52-64 86ZM320-80q-33 0-56.5-23.5T240-160v-320q0-33 23.5-56.5T320-560h320q33 0 56.5 23.5T720-480v320q0 33-23.5 56.5T640-80H320Zm0-80h320v-320H320v320ZM140-640q38-109 131.5-174.5T480-880q82 0 155.5 35T760-746v-134h80v240H600v-80h76q-39-39-90-59.5T480-800q-81 0-149.5 43T227-640h-87Zm180 480v-320 320Z`})}),K=o({add:{id:`account_edit.image_edit.add_button`,defaultMessage:`Add image`},replace:{id:`account_edit.image_edit.replace_button`,defaultMessage:`Replace image`},altAdd:{id:`account_edit.image_edit.alt_add_button`,defaultMessage:`Add alt text`},altEdit:{id:`account_edit.image_edit.alt_edit_button`,defaultMessage:`Edit alt text`},remove:{id:`account_edit.image_edit.remove_button`,defaultMessage:`Remove image`}}),q=({className:e,location:t})=>{let n=a(),{alt:r,src:i}=x(e=>h(e,t)),o=!!r,s=b(),c=(0,L.useCallback)(e=>{s(_({modalType:e,modalProps:{location:t}}))},[s,t]),l=(0,L.useMemo)(()=>[{text:n.formatMessage(K.replace),action:()=>{c(`ACCOUNT_EDIT_IMAGE_UPLOAD`)},icon:G},{text:n.formatMessage(o?K.altEdit:K.altAdd),action:()=>{c(`ACCOUNT_EDIT_IMAGE_ALT`)},icon:o?O:D},null,{text:n.formatMessage(K.remove),action:()=>{c(`ACCOUNT_EDIT_IMAGE_DELETE`)},icon:I,dangerous:!0}],[c,o,n]),u=(0,L.useCallback)(()=>{c(`ACCOUNT_EDIT_IMAGE_UPLOAD`)},[c]),d=(0,U.default)(j.imageButton,e);return i?(0,R.jsx)(m,{items:l,placement:t===`header`?`bottom-end`:`bottom-start`,offset:J,className:j.imageMenu,icon:`camera`,title:n.formatMessage(K.replace),iconComponent:W,iconClassName:d}):(0,R.jsx)(f,{title:n.formatMessage(K.add),icon:`camera`,iconComponent:W,className:d,onClick:u})},J=[0,6],Y=({title:e,description:t,showDescription:n,children:r,className:a,buttons:o})=>(0,R.jsxs)(`section`,{className:(0,U.default)(a,j.section),children:[(0,R.jsxs)(`header`,{className:j.sectionHeader,children:[(0,R.jsx)(`h3`,{className:j.sectionTitle,children:(0,R.jsx)(i,{...e})}),o]}),n&&(0,R.jsx)(`p`,{className:j.sectionSubtitle,children:(0,R.jsx)(i,{...t})}),r]}),X=t({AccountEdit:()=>Q,messages:()=>Z}),Z=o({columnTitle:{id:`account_edit.column_title`,defaultMessage:`Edit Profile`},displayNameTitle:{id:`account_edit.display_name.title`,defaultMessage:`Display name`},displayNamePlaceholder:{id:`account_edit.display_name.placeholder`,defaultMessage:`Your display name is how your name appears on your profile and in timelines.`},displayNameAddLabel:{id:`account_edit.display_name.add_label`,defaultMessage:`Add display name`},displayNameEditLabel:{id:`account_edit.display_name.edit_label`,defaultMessage:`Edit display name`},bioTitle:{id:`account_edit.bio.title`,defaultMessage:`Bio`},bioPlaceholder:{id:`account_edit.bio.placeholder`,defaultMessage:`Add a short introduction to help others identify you.`},bioAddLabel:{id:`account_edit.bio.add_label`,defaultMessage:`Add bio`},bioEditLabel:{id:`account_edit.bio.edit_label`,defaultMessage:`Edit bio`},customFieldsTitle:{id:`account_edit.custom_fields.title`,defaultMessage:`Custom fields`},customFieldsPlaceholder:{id:`account_edit.custom_fields.placeholder`,defaultMessage:`Add your pronouns, external links, or anything else youâd like to share.`},customFieldsAddLabel:{id:`account_edit.custom_fields.add_label`,defaultMessage:`Add f
1ield`},customFieldsEditLabel:{id:`account_edit.custom_fields.edit_label`,defaultMessage:`Edit field`},customFieldsTipTitle:{id:`account_edit.custom_fields.tip_title`,defaultMessage:`Tip: Adding verified links`},featuredHashtagsTitle:{id:`account_edit.featured_hashtags.title`,defaultMessage:`Featured hashtags`},featuredHashtagsPlaceholder:{id:`account_edit.featured_hashtags.placeholder`,defaultMessage:`Help others identify, and have quick access to, your favorite topics.`},featuredHashtagsEditLabel:{id:`account_edit.featured_hashtags.edit_label`,defaultMessage:`Add hashtags`},profileTabTitle:{id:`account_edit.profile_tab.title`,defaultMessage:`Profile display settings`},profileTabSubtitle:{id:`account_edit.profile_tab.subtitle`,defaultMessage:`Customize how your profile is displayed.`},advancedSettingsTitle:{id:`account_edit.advanced_settings.title`,defaultMessage:`Advanced settings`}}),Q=()=>{let e=ee(),t=d(e),n=a(),r=b(),{profile:o,isPending:f}=x(e=>e.profileEdit);(0,L.useEffect)(()=>{r(g())},[r]);let m=x(e=>e.server.server.item?.configuration.accounts.max_profile_fields??4),h=(0,L.useCallback)((e,{modalProps:t={},ignoreFocus:n=!1}={})=>{r(_({modalType:e,modalProps:t,ignoreFocus:n}))},[r]),w=(0,L.useCallback)(()=>{h(`ACCOUNT_EDIT_NAME`,{ignoreFocus:!0})},[h]),T=(0,L.useCallback)(()=>{h(`ACCOUNT_EDIT_BIO`,{ignoreFocus:!0})},[h]),D=(0,L.useCallback)(()=>{h(`ACCOUNT_EDIT_FIELD_EDIT`)},[h]),O=(0,L.useCallback)(()=>{h(`ACCOUNT_EDIT_FIELDS_REORDER`)},[h]),k=(0,L.useCallback)(()=>{h(`ACCOUNT_EDIT_VERIFY_LINKS`)},[h]),F=(0,L.useCallback)(()=>{h(`ACCOUNT_EDIT_PROFILE_DISPLAY`)},[h]),I=y(),V=(0,L.useCallback)(()=>{I.push(`/profile/featured_tags`)},[I]),U=(0,L.useCallback)(()=>{r(v({bot:!o?.bot}))},[r,o?.bot]),W=l(),G=C({hashtagAccountId:o?.id});if(!e||!t||!o)return(0,R.jsx)(M,{notFound:!e});let K=s?o.header:o.headerStatic,J=!!o.displayName,X=!!o.bio,Q=o.fields.length>0,$=o.featuredTags.length>0;return(0,R.jsxs)(P,{title:n.formatMessage(Z.columnTitle),to:`/@${t.acct}`,children:[(0,R.jsxs)(`header`,{children:[(0,R.jsxs)(`div`,{className:j.profileImage,children:[K&&(0,R.jsx)(`img`,{src:K,alt:``}),(0,R.jsx)(q,{location:`header`})]}),(0,R.jsxs)(`div`,{className:j.avatar,children:[(0,R.jsx)(c,{account:t,size:80}),(0,R.jsx)(q,{location:`avatar`})]})]}),(0,R.jsxs)(p,{emojis:W,children:[(0,R.jsx)(Y,{title:Z.displayNameTitle,description:Z.displayNamePlaceholder,showDescription:!J,buttons:(0,R.jsx)(N,{onClick:w,label:n.formatMessage(J?Z.displayNameEditLabel:Z.displayNameAddLabel),icon:J}),children:(0,R.jsx)(u,{htmlString:o.displayName,...G})}),(0,R.jsx)(Y,{title:Z.bioTitle,description:Z.bioPlaceholder,showDescription:!X,buttons:(0,R.jsx)(N,{onClick:T,label:n.formatMessage(X?Z.bioEditLabel:Z.bioAddLabel),icon:X}),children:(0,R.jsx)(E,{showDropdown:!0,accountId:o.id,className:j.bio})}),(0,R.jsxs)(Y,{title:Z.customFieldsTitle,description:Z.customFieldsPlaceholder,showDescription:!Q,buttons:(0,R.jsxs)(`div`,{className:j.fieldButtons,children:[o.fields.length>1&&(0,R.jsx)(S,{className:j.editButton,onClick:O,children:(0,R.jsx)(i,{id:`account_edit.custom_fields.reorder_button`,defaultMessage:`Reorder fields`})}),o.fields.length<m&&(0,R.jsx)(N,{label:n.formatMessage(Z.customFieldsAddLabel),onClick:D})]}),children:[Q&&(0,R.jsx)(`ol`,{children:o.fields.map(e=>(0,R.jsxs)(`li`,{className:j.field,children:[(0,R.jsx)(`div`,{children:(0,R.jsx)(B,{...e,...G})}),(0,R.jsx)(H,{id:e.id})]},e.id))}),(0,R.jsx)(S,{onClick:k,className:j.verifiedLinkHelpButton,plain:!0,children:(0,R.jsx)(i,{id:`account_edit.custom_fields.verified_hint`,defaultMessage:`How do I add a verified link?`})}),!Q&&(0,R.jsx)(z,{id:`profile_edit_fields_tip`,title:n.formatMessage(Z.customFieldsTipTitle),children:(0,R.jsx)(i,{id:`account_edit.custom_fields.tip_content`,defaultMessage:`You can easily add credibility to your Mastodon account by verifying links to any websites you own.`})})]}
1),(0,R.jsx)(Y,{title:Z.featuredHashtagsTitle,description:Z.featuredHashtagsPlaceholder,showDescription:!$,buttons:(0,R.jsx)(N,{onClick:V,icon:$,label:n.formatMessage(Z.featuredHashtagsEditLabel)}),children:o.featuredTags.map(e=>`#${e.name}`).join(`, `)}),(0,R.jsx)(Y,{title:Z.profileTabTitle,description:Z.profileTabSubtitle,showDescription:!0,buttons:(0,R.jsx)(S,{className:j.editButton,onClick:F,children:(0,R.jsx)(i,{id:`account_edit.profile_tab.button_label`,defaultMessage:`Customize`})})}),(0,R.jsx)(Y,{title:Z.advancedSettingsTitle,children:(0,R.jsx)(A,{checked:o.bot,onChange:U,disabled:f,label:(0,R.jsx)(i,{id:`account_edit.advanced_settings.bot_label`,defaultMessage:`Automated account`}),hint:(0,R.jsx)(i,{id:`account_edit.advanced_settings.bot_hint`,defaultMessage:`Signal to others that the account mainly performs automated actions and might not be monitored`})})})]})]})};export{Z as n,B as r,X as t}; 2//# sourceMappingURL=account_edit-LD50KlDB.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.