| 123 |
- import{a as e,n as t,r as n}from"./react-dom-stZKkA6x.js";import{d as r,f as i,o as a,r as o}from"./theme-JEAJA3Ef.js";import{G as s,i as c,kt as l,n as u,st as d,t as f}from"./jsx-runtime-dm82oUI8.js";import{a as ee,o as p}from"./grid-oQFtU3R0.js";import{t as te}from"./table-DZMCIB4H.js";import{n as ne,t as m}from"./SectionCard-DDGEHf10.js";import{n as h,t as g}from"./row-BB_IAUfF.js";import{t as _}from"./descriptions-vs1os_w7.js";import{t as v}from"./form-lkDIWt8f.js";import{t as y}from"./input-0_Xo22Fl.js";import{t as b}from"./list-B0gNP0uN.js";import{t as x}from"./modal-DFePRHO7.js";import{t as S}from"./switch-CsMGEdLR.js";import{t as C}from"./CopyOutlined-CqLRh6yQ.js";import{n as re,t as w}from"./EditOutlined-BiwqHVQr.js";import{t as ie}from"./EllipsisOutlined-BPVXOKZP.js";import{t as T}from"./ReloadOutlined-B6H5UA27.js";import{t as E}from"./ThunderboltOutlined-CvkjA__o.js";import{a as ae,h as oe,m as se,n as ce,p as le,s as D,v as O,y as ue}from"./index-avDTLp8M.js";import{t as k}from"./EmptyState-rI31ioMm.js";import{t as A}from"./StatusPill-BM21x0ED.js";import{t as de}from"./CodeBlock-ZqtC96TH.js";import{i as j,n as fe,t as pe}from"./domain-model-BLOrIAIx.js";import{t as M}from"./StatusTag-BHQIjmW3.js";var me=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`}})),N=e(t()),P=e(me());function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F.apply(this,arguments)}var he=N.forwardRef((e,t)=>N.createElement(r,F({},e,{ref:t,icon:P.default}))),I=f();function ge({record:e,loading:t,onCopy:n,onRecheck:r}){let{t:i}=a(),o=fe(e);return(0,I.jsx)(m,{className:`dns-record-card`,title:(0,I.jsxs)(c,{wrap:!0,size:8,children:[(0,I.jsx)(`span`,{className:`dns-record-card__label`,children:e.label}),(0,I.jsx)(M,{record:e})]}),extra:(0,I.jsx)(u.Text,{code:!0,className:`dns-record-card__type`,children:e.type}),children:(0,I.jsxs)(c,{direction:`vertical`,size:14,className:`full-width`,children:[(0,I.jsx)(L,{label:i(`dnsRecord.hostname`),value:e.host,onCopy:n}),(0,I.jsx)(L,{label:i(`dnsRecord.targetValue`),value:e.value||`-`,onCopy:n}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(u.Text,{type:`secondary`,children:i(`dnsRecord.currentValue`)}),o.length?(0,I.jsx)(c,{direction:`vertical`,size:8,className:`full-width value-stack`,children:o.map(e=>(0,I.jsx)(de,{value:e,onCopy:n},e))}):(0,I.jsx)(u.Paragraph,{type:`secondary`,className:`dns-empty-value`,children:i(`dnsRecord.emptyCurrent`)})]}),e.key===`ptr`?(0,I.jsx)(p,{type:`info`,showIcon:!0,message:i(`dnsRecord.ptrHint`)}):null,(e.warnings||[]).map(e=>(0,I.jsx)(p,{type:`warning`,showIcon:!0,message:e},e)),(0,I.jsx)(l,{icon:(0,I.jsx)(T,{}),loading:t,onClick:r,children:i(`dnsRecord.recheck`)})]})})}function L({label:e,value:t,onCopy:n}){return(0,I.jsxs)(`div`,{className:`dns-value-row`,children:[(0,I.jsx)(u.Text,{type:`secondary`,children:e}),(0,I.jsx)(de,{value:t,onCopy:n})]})}var R=[`overview`,`dns`,`sending`,`inbound`,`activity`];function z(){let{id:e,section:t}=se(),n=Number(e),r=Ce(t)?t:`overview`,s=le(),[f,te]=oe(),{config:h,user:g}=ce(),{locale:_}=a(),b=_.startsWith(`en`)?Te:we,{message:S}=i.useApp(),[C,D]=(0,N.useState)(null),[k,de]=(0,N.useState)(null),[j,fe]=(0,N.useState)(void 0),[M,me]=(0,N.useState)(null),[P,F]=(0,N.useState)(null),[ge,L]=(0,N.useState)(!0),[R,z]=(0,N.useState)(!1),[B,H]=(0,N.useState)(``),[U,W]=(0,N.useState)(``),[K,Ee]=(0,N.useState)({}),[De,Oe]=(0,N.useState)(!1),[ke,Ae]=(0,N.useState)(!1),[je,Me]=(0,N.useState)(``),[Ne,Pe]=(0,N.useState)(!1),[Fe]=v.useForm(),[q]=v.useForm(),Ie=(0,N.useCallback)(async()=>{L(!0),H(``);try{let[e,t,r]=await Promise.all([o.domains(),o.dnsCredentials(),o.smtpRelays()]);D({domain:e.domains.find(e=>e.id===n)||null,dnsCredentials:t.credentials,smtpRelays:r.relays})}catch(e){H(e instanceof Error?e.message:b.loadFailed)}finally{L(!1)}},[b.loadFailed,n]);(0,N.useEffect)(()=>{Ie()},[Ie]),(0,N.useEffect)(()=>{!t||Ce(t)||s(`/domains/${e}/overview`,{replace:!0})},[e,s,t]),(0,N.useEffect)(()=>{f.get(`edit`)===`1`&&C?.domain&&$(C.domain)},[C?.domain?.id,f]);let J=(0,N.useCallback)(async()=>{if(C?.domain&&!(r===`overview`||r===`dns`)&&!(r===`activity`&&k!==null)&&!(r===`sending`&&M!==null&&j!==void 0)&&!(r===`inbound`&&P!==null)){z(!0),W(``);try{if(r===`activity`){let e=await o.events({domainId:C.domain.id,page:1,pageSize:50});de(e.events)}else if(r===`sending`){let[e,t]=await Promise.all([o.smtpCredential(),o.apiTokens()]);fe(e.credential),me(t.tokens)}else if(r===`inbound`){let e=await o.inboundMailboxes();F(e.mailboxes.filter(e=>e.domainId===C.domain?.id))}}catch(e){W(e instanceof Error?e.message:b.sectionLoadFailed)}finally{z(!1)}}},[r,M,C?.domain,b.sectionLoadFailed,k,P,j]);(0,N.useEffect)(()=>{J()},[J]);let Y=C?.domain||null,X=(0,N.useMemo)(()=>Y?pe(Y):null,[Y]);function Z(e){D(t=>t&&{...t,domain:e})}async function Q(e,t){Ee(t=>({...t,[e]:!0}));try{return await t()}finally{Ee(t=>({...t,[e]:!1}))}}async function Le(){if(Y)try{Z((await Q(`check`,()=>o.checkDomain(Y.id))).domain),S.success(b.checked)}catch(e){S.error(G(e,b.actionFailed))}}async function Re(){if(Y)try{let e=await Q(`apply`,()=>o.applyDns(Y.id));Z(e.domain),e.apply?.ok===!1?S.warning(b.dnsPartial):S.success(b.dnsApplied)}catch(e){S.error(G(e,b.actionFailed))}}async function ze(){if(!Y)return;let e;try{e=await Fe.validateFields()}catch{return}try{Z((await Q(`edit`,()=>o.patchDomain(Y.id,{...e,dnsCredentialId:e.dnsCredentialId??null,smtpRelayId:e.smtpRelayId??null}))).domain),He(),S.success(b.saved)}catch(e){S.error(G(e,b.actionFailed))}}async function Be(){if(!Y)return;let e;try{e=await q.validateFields()}catch{return}try{await Q(`test`,()=>o.sendTest(Y.id,e)),Pe(!1),q.resetFields(),S.success(b.testQueued)}catch(e){S.error(G(e,b.actionFailed))}}async function Ve(){if(!(!Y||je!==Y.domain))try{await Q(`delete`,()=>o.deleteDomain(Y.id)),S.success(b.deleted),s(`/domains`,{replace:!0})}catch(e){S.error(G(e,b.actionFailed))}}function $(e){Fe.setFieldsValue({selector:e.selector,dnsCredentialId:e.dnsCredentialId,smtpRelayId:e.smtpRelayId,senderHost:e.senderHost,sendingIp:e.sendingIp,spfExtra:e.spfExtra,dmarcPolicy:e.dmarcPolicy,dmarcRua:e.dmarcRua,catchAllAddress:e.catchAllAddress,mailboxSignupEnabled:e.mailboxSignupEnabled}),Oe(!0)}function He(){if(Oe(!1),f.has(`edit`)){let e=new URLSearchParams(f);e.delete(`edit`),te(e,{replace:!0})}}function Ue(){if(!f.has(`setup`))return;let e=new URLSearchParams(f);e.delete(`setup`),te(e,{replace:!0})}function We(){Y&&(q.setFieldsValue({subject:b.testSubject(Y.domain),text:b.testBody(Y.domain)}),Pe(!0))}async function Ge(e){try{await navigator.clipboard.writeText(e),S.success(b.copied)}catch{S.error(b.copyFailed)}}if(ge&&!C)return(0,I.jsxs)(c,{direction:`vertical`,size:20,className:`full-width`,"aria-label":b.loading,children:[(0,I.jsx)(d,{active:!0,title:{width:`36%`},paragraph:{rows:3}}),(0,I.jsx)(m,{children:(0,I.jsx)(d,{active:!0,paragraph:{rows:10}})})]});if(B&&!C)return(0,I.jsx)(O,{status:`error`,title:b.loadFailed,subTitle:B,extra:(0,I.jsxs)(c,{children:[(0,I.jsx)(l,{onClick:()=>s(`/domains`),children:b.back}),(0,I.jsx)(l,{type:`primary`,onClick:()=>void Ie(),children:b.retry})]})});if(!Number.isInteger(n)||n<=0||C&&!Y)return(0,I.jsx)(O,{status:`404`,title:b.notFound,subTitle:b.notFoundHint,extra:(0,I.jsx)(l,{type:`primary`,onClick:()=>s(`/domains`),children:b.backToDomains})});if(!Y||!C||!X)return null;let Ke=g?.role===`admin`||g?.id===Y.userId,qe=[{key:`check`,icon:(0,I.jsx)(T,{}),label:b.checkDns,onClick:()=>void Le()},{key:`apply`,icon:(0,I.jsx)(E,{}),label:b.autoDns,disabled:!Y.dnsCredentialId,onClick:()=>void Re()},{key:`edit`,icon:(0,I.jsx)(w,{}),label:b.edit,onClick:()=>$(Y)},{type:`divider`},{key:`delete`,icon:(0,I.jsx)(re,{}),danger:!0,label:b.delete,onClick:()=>{Me(``),Ae(!0)}}];return(0,I.jsxs)(c,{direction:`vertical`,size:20,className:`full-width`,children:[(0,I.jsx)(l,{icon:(0,I.jsx)(he,{}),onClick:()=>s(`/domains`),style:{width:`fit-content`,minHeight:44},children:b.backToDomains}),(0,I.jsx)(ne,{title:Y.domain,subtitle:`${Y.senderHost} · ${Y.sendingIp}`,extra:(0,I.jsxs)(c,{children:[(0,I.jsxs)(A,{tone:X.status===`success`?`success`:X.status===`warning`?`warning`:`error`,children:[X.passed,`/`,X.total,` `,X.status===`success`?b.dnsPassed:b.needsAttention]}),(0,I.jsx)(l,{type:`primary`,icon:(0,I.jsx)(ae,{}),style:{minHeight:44},onClick:We,children:b.testSend}),(0,I.jsx)(ue,{menu:{items:qe},trigger:[`click`],children:(0,I.jsx)(l,{"aria-label":b.moreActions,icon:(0,I.jsx)(ie,{}),style:{minHeight:44},loading:Object.values(K).some(Boolean)})})]})}),f.get(`setup`)===`partial`?(0,I.jsx)(p,{type:`warning`,showIcon:!0,closable:!0,message:b.setupPartialTitle,description:b.setupPartialDescription,onClose:Ue}):f.get(`setup`)===`complete`?(0,I.jsx)(p,{type:`success`,showIcon:!0,closable:!0,message:b.setupCompleteTitle,description:Y.dnsCredentialId?b.setupAutomaticDescription:b.setupManualDescription,onClose:Ue}):null,(0,I.jsx)(ee,{activeKey:r,onChange:e=>s(`/domains/${Y.id}/${e}`),className:`domain-detail-tabs`,items:[{key:`overview`,label:b.overview,children:(0,I.jsx)(_e,{domain:Y,health:X,dnsName:C.dnsCredentials.find(e=>e.id===Y.dnsCredentialId)?.name,relayName:C.smtpRelays.find(e=>e.id===Y.smtpRelayId)?.name,copy:b,onCheck:Le,onReviewDns:()=>s(`/domains/${Y.id}/dns`),onEdit:()=>$(Y),onDelete:()=>Ae(!0),loading:K})},{key:`dns`,label:b.dnsAndVerification,children:(0,I.jsx)(ve,{domain:Y,copy:b,onCopy:Ge,onCheck:Le,onApply:Re,loading:K})},{key:`sending`,label:b.sendingConfiguration,children:(0,I.jsx)(V,{loading:R,error:U,retry:J,copy:b,children:(0,I.jsx)(ye,{domain:Y,config:h,credential:j,tokens:M||[],relayName:C.smtpRelays.find(e=>e.id===Y.smtpRelayId)?.name,copy:b,onCopy:Ge,onEdit:()=>$(Y)})})},{key:`inbound`,label:b.inboundConfiguration,children:(0,I.jsx)(V,{loading:R,error:U,retry:J,copy:b,children:(0,I.jsx)(be,{domain:Y,config:h,mailboxes:P||[],copy:b,canManageMailboxSignup:Ke,onNavigate:()=>s(`/inbox`),onEdit:()=>$(Y)})})},{key:`activity`,label:b.activity,children:(0,I.jsx)(V,{loading:R,error:U,retry:J,copy:b,children:(0,I.jsx)(xe,{events:k||[],copy:b,onView:e=>s(`/activity/${e.id}?domainId=${Y.id}`)})})}]}),(0,I.jsx)(Se,{open:De,domain:Y,form:Fe,dnsCredentials:C.dnsCredentials,smtpRelays:C.smtpRelays,copy:b,canManageMailboxSignup:Ke,loading:!!K.edit,onCancel:He,onSave:ze}),(0,I.jsx)(x,{title:b.deleteTitle,open:ke,okText:b.delete,cancelText:b.cancel,okButtonProps:{danger:!0,disabled:je!==Y.domain,loading:!!K.delete},onCancel:()=>{Ae(!1),Me(``)},onOk:()=>void Ve(),children:(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsx)(p,{type:`error`,showIcon:!0,message:b.deleteWarning}),(0,I.jsxs)(u.Text,{children:[b.typeDomain,` `,(0,I.jsx)(u.Text,{code:!0,children:Y.domain})]}),(0,I.jsx)(y,{value:je,onChange:e=>Me(e.target.value),"aria-label":b.deleteConfirmation,style:{minHeight:44}})]})}),(0,I.jsx)(x,{title:b.testSend,open:Ne,okText:b.queueTest,cancelText:b.cancel,confirmLoading:!!K.test,onCancel:()=>Pe(!1),onOk:()=>void Be(),children:(0,I.jsxs)(v,{form:q,layout:`vertical`,children:[(0,I.jsx)(v.Item,{name:`to`,label:b.recipient,rules:[{required:!0,type:`email`,message:b.validRecipient}],children:(0,I.jsx)(y,{placeholder:`you@example.com`,style:{minHeight:44}})}),(0,I.jsx)(v.Item,{name:`subject`,label:b.subject,rules:[{required:!0}],children:(0,I.jsx)(y,{style:{minHeight:44}})}),(0,I.jsx)(v.Item,{name:`text`,label:b.body,rules:[{required:!0}],children:(0,I.jsx)(y.TextArea,{rows:5})})]})})]})}function _e({domain:e,health:t,dnsName:n,relayName:r,copy:i,onCheck:a,onReviewDns:o,onEdit:s,onDelete:d,loading:f}){return(0,I.jsxs)(c,{direction:`vertical`,size:20,className:`full-width`,children:[(0,I.jsxs)(g,{gutter:[16,16],children:[(0,I.jsx)(h,{xs:24,lg:15,children:(0,I.jsx)(m,{title:i.domainSummary,children:(0,I.jsxs)(_,{column:1,children:[(0,I.jsx)(_.Item,{label:i.domain,children:e.domain}),(0,I.jsx)(_.Item,{label:i.senderHost,children:e.senderHost}),(0,I.jsx)(_.Item,{label:i.sendingIp,children:e.sendingIp}),(0,I.jsx)(_.Item,{label:`DKIM selector`,children:e.selector}),(0,I.jsx)(_.Item,{label:i.dnsIntegration,children:n||i.manualDns}),(0,I.jsx)(_.Item,{label:i.relay,children:r||i.defaultDelivery}),(0,I.jsx)(_.Item,{label:i.createdAt,children:new Date(e.createdAt).toLocaleString()})]})})}),(0,I.jsx)(h,{xs:24,lg:9,children:(0,I.jsx)(m,{title:i.authenticationHealth,children:(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsxs)(u.Title,{level:2,style:{margin:0},children:[t.passed,`/`,t.total]}),(0,I.jsx)(u.Text,{type:`secondary`,children:i.recordsPassed}),(0,I.jsx)(A,{tone:t.status===`success`?`success`:t.status===`warning`?`warning`:`error`,children:t.status===`success`?i.ready:i.needsAttention}),(0,I.jsx)(l,{icon:(0,I.jsx)(T,{}),loading:f.check,onClick:a,children:i.checkDns})]})})})]}),(0,I.jsxs)(g,{gutter:[16,16],children:[(0,I.jsx)(h,{xs:24,lg:12,children:(0,I.jsx)(m,{title:i.nextActions,children:(0,I.jsxs)(c,{wrap:!0,children:[(0,I.jsx)(l,{icon:(0,I.jsx)(E,{}),onClick:o,children:i.reviewDns}),(0,I.jsx)(l,{icon:(0,I.jsx)(w,{}),onClick:s,children:i.edit})]})})}),(0,I.jsx)(h,{xs:24,lg:12,children:(0,I.jsx)(m,{title:i.dangerZone,className:`domain-danger-card`,children:(0,I.jsxs)(c,{direction:`vertical`,className:`full-width`,children:[(0,I.jsx)(u.Text,{type:`secondary`,children:i.dangerHint}),(0,I.jsx)(l,{danger:!0,icon:(0,I.jsx)(re,{}),onClick:d,children:i.delete})]})})})]})]})}function ve({domain:e,copy:t,onCopy:n,onCheck:r,onApply:i,loading:a}){let o=j(e.status?.records||[]),s=o.map(e=>`${e.host}\t${e.type}\t${e.value||``}`).join(`
- `);return(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsx)(m,{title:t.dnsAndVerification,extra:(0,I.jsxs)(c,{wrap:!0,children:[(0,I.jsx)(l,{icon:(0,I.jsx)(T,{}),loading:a.check,onClick:r,children:t.recheck}),(0,I.jsx)(l,{icon:(0,I.jsx)(E,{}),disabled:!e.dnsCredentialId,loading:a.apply,onClick:i,children:t.autoDns}),(0,I.jsx)(l,{icon:(0,I.jsx)(C,{}),disabled:!s,onClick:()=>n(s),children:t.copyAll})]}),children:(0,I.jsx)(p,{type:e.status?.verified?`success`:`warning`,showIcon:!0,message:e.status?.verified?t.domainVerified:t.domainNotVerified,description:`${t.lastChecked}: ${e.status?.checkedAt?new Date(e.status.checkedAt).toLocaleString():t.never}`})}),(0,I.jsx)(B,{apply:e.status?.apply,copy:t}),o.length?o.map(e=>(0,I.jsx)(ge,{record:e,loading:a.check,onCopy:n,onRecheck:r},e.key)):(0,I.jsx)(m,{children:(0,I.jsx)(k,{description:t.noDnsRecords,action:(0,I.jsx)(l,{onClick:r,children:t.checkNow})})}),e.status?.warnings?.length?(0,I.jsx)(p,{type:`warning`,showIcon:!0,message:t.warnings,description:e.status.warnings.join(`
- `)}):null]})}function B({apply:e,copy:t}){return e?.results?.length?(0,I.jsx)(m,{title:t.applyResults,extra:(0,I.jsx)(A,{tone:e.ok?`success`:`warning`,children:e.ok?t.applyComplete:t.applyPartial}),children:(0,I.jsx)(b,{dataSource:e.results,renderItem:e=>{let n=e.skipped?`warning`:e.ok?`success`:`error`,r=e.skipped?t.applySkipped:e.ok?t.applySucceeded:t.applyFailed,i=e.ok?e.detail||t.applySucceededHint:e.error||t.applyFailedHint;return(0,I.jsx)(b.Item,{children:(0,I.jsx)(b.Item.Meta,{title:(0,I.jsxs)(c,{wrap:!0,children:[(0,I.jsx)(A,{tone:n,children:r}),(0,I.jsx)(u.Text,{code:!0,children:e.type}),(0,I.jsx)(u.Text,{children:e.host})]}),description:(0,I.jsx)(u.Text,{type:e.ok?`secondary`:`danger`,children:i})})})}})}):null}function ye({domain:e,config:t,credential:n,tokens:r,relayName:i,copy:a,onCopy:o,onEdit:s}){let c=`${t?.appBaseUrl||window.location.origin}/api/send`;return(0,I.jsxs)(g,{gutter:[16,16],children:[(0,I.jsx)(h,{xs:24,xl:12,children:(0,I.jsx)(m,{title:`SMTP`,extra:(0,I.jsx)(l,{icon:(0,I.jsx)(w,{}),onClick:s,children:a.edit}),children:(0,I.jsxs)(_,{column:1,children:[(0,I.jsx)(_.Item,{label:a.host,children:H(t?.submission?.host||`-`,o)}),(0,I.jsx)(_.Item,{label:a.ports,children:t?.submission?.ports?.map(e=>`${e.port}/${e.protocol}`).join(`, `)||`-`}),(0,I.jsx)(_.Item,{label:a.username,children:n?.username||t?.submission?.username||`-`}),(0,I.jsx)(_.Item,{label:a.password,children:(0,I.jsx)(A,{tone:n?.passwordSet?`success`:`warning`,children:n?.passwordSet?a.configured:a.notConfigured})}),(0,I.jsx)(_.Item,{label:a.relay,children:i||a.defaultDelivery})]})})}),(0,I.jsx)(h,{xs:24,xl:12,children:(0,I.jsxs)(m,{title:`API`,extra:(0,I.jsx)(l,{href:`/integrations/api-keys`,children:a.manageKeys}),children:[(0,I.jsxs)(_,{column:1,children:[(0,I.jsx)(_.Item,{label:`Endpoint`,children:H(c,o)}),(0,I.jsx)(_.Item,{label:a.availableKeys,children:r.filter(e=>!e.revokedAt).length})]}),r.length?(0,I.jsx)(b,{size:`small`,dataSource:r.slice(0,4),renderItem:e=>(0,I.jsx)(b.Item,{children:(0,I.jsx)(b.Item.Meta,{title:e.name,description:(0,I.jsxs)(u.Text,{code:!0,children:[e.tokenPrefix,`••••`]})})})}):(0,I.jsx)(k,{description:a.noKeys})]})}),(0,I.jsx)(h,{span:24,children:(0,I.jsx)(m,{title:a.senderIdentity,children:(0,I.jsxs)(_,{column:1,children:[(0,I.jsx)(_.Item,{label:a.fromDomain,children:e.domain}),(0,I.jsx)(_.Item,{label:a.senderHost,children:e.senderHost}),(0,I.jsx)(_.Item,{label:a.verification,children:(0,I.jsx)(A,{tone:e.status?.verified?`success`:`warning`,children:e.status?.verified?a.verified:a.pending})})]})})})]})}function be({domain:e,config:t,mailboxes:n,copy:r,canManageMailboxSignup:i,onNavigate:a,onEdit:o}){return(0,I.jsxs)(g,{gutter:[16,16],children:[(0,I.jsx)(h,{xs:24,xl:9,children:(0,I.jsx)(m,{title:r.inboundStatus,children:(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsxs)(A,{tone:t?.submission?.inboundEnabled?`success`:`warning`,children:[(0,I.jsx)(D,{}),` `,t?.submission?.inboundEnabled?r.inboundEnabled:r.inboundDisabled]}),(0,I.jsx)(u.Text,{type:`secondary`,children:r.inboundHint}),(0,I.jsx)(l,{onClick:a,children:r.openMailboxRouting})]})})}),(0,I.jsx)(h,{xs:24,xl:15,children:(0,I.jsx)(m,{title:r.mailboxes,extra:(0,I.jsx)(u.Text,{type:`secondary`,children:n.length}),children:n.length?(0,I.jsx)(b,{dataSource:n,renderItem:e=>(0,I.jsxs)(b.Item,{children:[(0,I.jsx)(b.Item.Meta,{title:e.address,description:`${e.unreadCount} ${r.unread} · ${e.messageCount} ${r.messages}`}),(0,I.jsx)(A,{tone:e.status===`active`?`success`:`warning`,children:e.status})]})}):(0,I.jsx)(k,{description:r.noMailboxes,action:(0,I.jsx)(l,{onClick:a,children:r.configureMailbox})})})}),(0,I.jsx)(h,{span:24,children:(0,I.jsx)(m,{title:r.catchAll,extra:(0,I.jsx)(l,{icon:(0,I.jsx)(w,{}),onClick:o,children:r.edit}),children:(0,I.jsxs)(_,{column:1,children:[(0,I.jsx)(_.Item,{label:r.catchAllAddress,children:e.catchAllAddress||r.notConfigured}),(0,I.jsx)(_.Item,{label:r.mailboxSignupPolicy,children:(0,I.jsxs)(c,{direction:`vertical`,size:4,children:[(0,I.jsx)(A,{tone:e.mailboxSignupEnabled?`success`:`neutral`,children:e.mailboxSignupEnabled?r.mailboxSignupOpen:r.mailboxSignupOwnerOnly}),i?(0,I.jsx)(u.Text,{type:`secondary`,children:r.mailboxSignupHint}):null]})}),(0,I.jsx)(_.Item,{label:`IMAP`,children:t?.mailAccess?.imap.enabled?t.mailAccess.imap.ports.map(e=>e.port).join(`, `):r.disabled}),(0,I.jsx)(_.Item,{label:`POP3`,children:t?.mailAccess?.pop3.enabled?t.mailAccess.pop3.ports.map(e=>e.port).join(`, `):r.disabled})]})})})]})}function xe({events:e,copy:t,onView:n}){let r=[{title:t.time,dataIndex:`createdAt`,width:190,render:e=>new Date(e).toLocaleString()},{title:t.recipient,dataIndex:`recipients`,ellipsis:!0,render:e=>e.join(`, `)},{title:t.subject,dataIndex:`subject`,ellipsis:!0},{title:t.status,dataIndex:`status`,width:130,render:e=>(0,I.jsx)(A,{tone:U(e),children:W(e,t)})}];return e.length?(0,I.jsx)(m,{children:(0,I.jsx)(te,{rowKey:`id`,columns:r,dataSource:e,pagination:{pageSize:20},scroll:{x:760},onRow:e=>({onClick:()=>n(e),style:{cursor:`pointer`},"aria-label":`${t.viewActivity} ${e.id}`})})}):(0,I.jsx)(m,{children:(0,I.jsx)(k,{description:t.noActivity})})}function V({loading:e,error:t,retry:n,copy:r,children:i}){return e?(0,I.jsx)(m,{children:(0,I.jsx)(d,{active:!0,paragraph:{rows:7}})}):t?(0,I.jsx)(O,{status:`error`,title:r.sectionLoadFailed,subTitle:t,extra:(0,I.jsx)(l,{type:`primary`,onClick:n,children:r.retry})}):(0,I.jsx)(I.Fragment,{children:i})}function Se({open:e,domain:t,form:n,dnsCredentials:r,smtpRelays:i,copy:a,canManageMailboxSignup:o,loading:c,onCancel:l,onSave:u}){return(0,I.jsx)(x,{title:a.editTitle,open:e,width:640,confirmLoading:c,okText:a.save,cancelText:a.cancel,onCancel:l,onOk:u,children:(0,I.jsxs)(v,{form:n,layout:`vertical`,children:[(0,I.jsxs)(g,{gutter:16,children:[(0,I.jsx)(h,{xs:24,md:12,children:(0,I.jsx)(v.Item,{name:`dnsCredentialId`,label:a.dnsIntegration,children:(0,I.jsx)(s,{allowClear:!0,options:r.map(e=>({value:e.id,label:e.name}))})})}),(0,I.jsx)(h,{xs:24,md:12,children:(0,I.jsx)(v.Item,{name:`smtpRelayId`,label:a.relay,children:(0,I.jsx)(s,{allowClear:!0,options:i.map(e=>({value:e.id,label:e.name}))})})})]}),(0,I.jsxs)(g,{gutter:16,children:[(0,I.jsx)(h,{xs:24,md:12,children:(0,I.jsx)(v.Item,{name:`senderHost`,label:a.senderHost,rules:[{required:!0}],children:(0,I.jsx)(y,{})})}),(0,I.jsx)(h,{xs:24,md:12,children:(0,I.jsx)(v.Item,{name:`sendingIp`,label:a.sendingIp,rules:[{required:!0}],children:(0,I.jsx)(y,{})})})]}),(0,I.jsxs)(g,{gutter:16,children:[(0,I.jsx)(h,{xs:24,md:12,children:(0,I.jsx)(v.Item,{name:`selector`,label:`DKIM selector`,rules:[{required:!0}],children:(0,I.jsx)(y,{})})}),(0,I.jsx)(h,{xs:24,md:12,children:(0,I.jsx)(v.Item,{name:`dmarcPolicy`,label:`DMARC`,children:(0,I.jsx)(s,{options:[`none`,`quarantine`,`reject`].map(e=>({value:e,label:e}))})})})]}),(0,I.jsx)(v.Item,{name:`spfExtra`,label:`SPF`,children:(0,I.jsx)(y.TextArea,{rows:2})}),(0,I.jsx)(v.Item,{name:`dmarcRua`,label:`DMARC rua`,children:(0,I.jsx)(y,{})}),(0,I.jsx)(v.Item,{name:`catchAllAddress`,label:a.catchAllAddress,children:(0,I.jsx)(y,{placeholder:`inbox@${t.domain}`})}),o?(0,I.jsx)(v.Item,{name:`mailboxSignupEnabled`,label:a.mailboxSignupPolicy,valuePropName:`checked`,extra:a.mailboxSignupExtra,children:(0,I.jsx)(S,{checkedChildren:a.enabled,unCheckedChildren:a.disabled})}):null]})})}function H(e,t){return(0,I.jsxs)(c,{children:[(0,I.jsx)(u.Text,{code:!0,children:e}),(0,I.jsx)(l,{type:`text`,size:`small`,"aria-label":`Copy`,icon:(0,I.jsx)(C,{}),onClick:()=>t(e)})]})}function Ce(e){return R.includes(e)}function U(e){return e===`sent`||e===`delivered`?`success`:e===`queued`?`info`:e===`deferred`||e===`pending`?`warning`:e===`failed`||e===`bounced`?`error`:`neutral`}function W(e,t){return{sent:t.sent,delivered:t.delivered,queued:t.queued,deferred:t.deferred,pending:t.pending,failed:t.failed,bounced:t.bounced}[e]||e}function G(e,t){return e instanceof Error?e.message:t}var we={loading:`正在加载域名详情`,loadFailed:`域名详情加载失败`,sectionLoadFailed:`当前页签加载失败`,retry:`重试`,back:`返回`,backToDomains:`返回域名列表`,notFound:`未找到该域名`,notFoundHint:`域名不存在、已被删除,或当前账户没有访问权限。`,moreActions:`更多操作`,overview:`概览`,dnsAndVerification:`DNS 与验证`,sendingConfiguration:`发送配置`,inboundConfiguration:`收信配置`,activity:`活动`,domain:`域名`,senderHost:`发信主机`,sendingIp:`发信 IP`,dnsIntegration:`DNS 集成`,relay:`发送中继`,manualDns:`手动配置`,defaultDelivery:`系统默认投递`,createdAt:`创建时间`,dnsPassed:`DNS 已通过`,needsAttention:`需要处理`,testSend:`测试发送`,checkDns:`检查 DNS`,autoDns:`自动写入 DNS`,edit:`编辑配置`,delete:`删除域名`,checked:`DNS 检查已完成`,dnsApplied:`DNS 记录写入完成`,dnsPartial:`部分 DNS 记录写入失败`,saved:`配置已保存`,testQueued:`测试邮件已加入队列`,deleted:`域名已删除`,actionFailed:`操作失败`,copied:`已复制`,copyFailed:`复制失败`,setupPartialTitle:`域名已创建,但 DNS 后续操作需要处理`,setupPartialDescription:`自动写入或即时检查未完全成功。请查看下方逐条结果,修正后重新执行。`,setupCompleteTitle:`域名创建完成`,setupAutomaticDescription:`DNS 自动写入流程已执行,请核对逐条结果和当前验证状态。`,setupManualDescription:`请按下方记录完成手动 DNS 配置,并在记录生效后重新检查。`,domainSummary:`域名摘要`,authenticationHealth:`认证健康度`,recordsPassed:`项必需记录已通过`,ready:`发送就绪`,nextActions:`下一步操作`,reviewDns:`查看 DNS 记录`,dangerZone:`危险操作`,dangerHint:`删除域名会停止相关发信配置,且不可撤销。`,recheck:`重新检查`,copyAll:`复制全部`,domainVerified:`域名已验证,可用于发送`,domainNotVerified:`域名尚未完成验证`,lastChecked:`最近检查`,never:`从未检查`,noDnsRecords:`尚未生成 DNS 检查结果`,checkNow:`立即检查`,warnings:`需要注意`,applyResults:`DNS 写入结果`,applyComplete:`全部完成`,applyPartial:`部分失败`,applySucceeded:`成功`,applyFailed:`失败`,applySkipped:`已跳过`,applySucceededHint:`记录已写入或无需变更。`,applyFailedHint:`未返回具体错误,请重新执行或改为手动配置。`,host:`主机`,ports:`端口`,username:`用户名`,password:`密码`,configured:`已设置(不会返回明文)`,notConfigured:`未设置`,manageKeys:`管理 API 密钥`,availableKeys:`可用密钥`,noKeys:`尚无可用 API 密钥`,senderIdentity:`发件身份`,fromDomain:`发件域名`,verification:`验证状态`,verified:`已验证`,pending:`等待验证`,inboundStatus:`收信服务状态`,inboundEnabled:`收信服务已启用`,inboundDisabled:`收信服务未启用`,inboundHint:`邮箱、别名和路由在独立收件箱工作区管理。`,openMailboxRouting:`打开邮箱与路由`,mailboxes:`邮箱`,unread:`封未读`,messages:`封邮件`,noMailboxes:`该域名还没有邮箱`,configureMailbox:`配置邮箱`,catchAll:`默认收信路由`,catchAllAddress:`Catch-all 地址`,mailboxSignupPolicy:`邮箱创建权限`,mailboxSignupOpen:`已共享给其他用户`,mailboxSignupOwnerOnly:`仅域名拥有者`,mailboxSignupHint:`开启后,其他用户可以在该域名下创建自己的邮箱,但不能管理此域名配置。`,mailboxSignupExtra:`共享只开放邮箱创建能力,不开放 DNS、Catch-all、删除等域名管理权限。`,enabled:`开放`,disabled:`未启用`,time:`时间`,recipient:`收件人`,subject:`主题`,body:`正文`,status:`状态`,noActivity:`该域名尚无发送活动`,viewActivity:`查看发送活动`,sent:`已发送`,delivered:`已送达`,queued:`已入队`,deferred:`已延迟`,failed:`失败`,bounced:`退信`,editTitle:`编辑域名配置`,save:`保存`,cancel:`取消`,deleteTitle:`删除域名`,deleteWarning:`此操作不可撤销,域名相关发送配置将立即不可用;如仍有关联邮箱,系统会阻止删除。`,typeDomain:`请输入域名以确认:`,deleteConfirmation:`域名删除确认`,queueTest:`加入发送队列`,validRecipient:`请输入有效的收件邮箱`,testSubject:e=>`MailHub ${e} 测试邮件`,testBody:e=>`这是一封来自 ${e} 的 MailHub 投递测试邮件。`},Te={loading:`Loading domain details`,loadFailed:`Unable to load domain details`,sectionLoadFailed:`Unable to load this section`,retry:`Retry`,back:`Back`,backToDomains:`Back to domains`,notFound:`Domain not found`,notFoundHint:`The domain does not exist, was deleted, or is not available to this account.`,moreActions:`More actions`,overview:`Overview`,dnsAndVerification:`DNS & verification`,sendingConfiguration:`Sending`,inboundConfiguration:`Receiving`,activity:`Activity`,domain:`Domain`,senderHost:`Sending host`,sendingIp:`Sending IP`,dnsIntegration:`DNS integration`,relay:`Sending relay`,manualDns:`Manual`,defaultDelivery:`System delivery`,createdAt:`Created`,dnsPassed:`DNS passed`,needsAttention:`Needs attention`,testSend:`Send test`,checkDns:`Check DNS`,autoDns:`Apply DNS`,edit:`Edit configuration`,delete:`Delete domain`,checked:`DNS check completed`,dnsApplied:`DNS records applied`,dnsPartial:`Some DNS records could not be applied`,saved:`Configuration saved`,testQueued:`Test email queued`,deleted:`Domain deleted`,actionFailed:`Action failed`,copied:`Copied`,copyFailed:`Unable to copy`,setupPartialTitle:`Domain created, but DNS follow-up needs attention`,setupPartialDescription:`Automatic application or the immediate check did not fully complete. Review each result below, correct it, and retry.`,setupCompleteTitle:`Domain created`,setupAutomaticDescription:`The automatic DNS flow ran. Review each result and the current verification status.`,setupManualDescription:`Add the records below at your DNS provider, then recheck after they propagate.`,domainSummary:`Domain summary`,authenticationHealth:`Authentication health`,recordsPassed:`required records passed`,ready:`Ready to send`,nextActions:`Next actions`,reviewDns:`Review DNS records`,dangerZone:`Danger zone`,dangerHint:`Deleting the domain stops its sending configuration and cannot be undone.`,recheck:`Recheck`,copyAll:`Copy all`,domainVerified:`Domain verified and ready to send`,domainNotVerified:`Domain verification is incomplete`,lastChecked:`Last checked`,never:`Never`,noDnsRecords:`No DNS check results yet`,checkNow:`Check now`,warnings:`Attention needed`,applyResults:`DNS apply results`,applyComplete:`Complete`,applyPartial:`Partially failed`,applySucceeded:`Succeeded`,applyFailed:`Failed`,applySkipped:`Skipped`,applySucceededHint:`The record was written or already matched.`,applyFailedHint:`No detailed error was returned. Retry or configure this record manually.`,host:`Host`,ports:`Ports`,username:`Username`,password:`Password`,configured:`Set (never returned in plaintext)`,notConfigured:`Not set`,manageKeys:`Manage API keys`,availableKeys:`Available keys`,noKeys:`No API keys available`,senderIdentity:`Sender identity`,fromDomain:`From domain`,verification:`Verification`,verified:`Verified`,pending:`Pending`,inboundStatus:`Inbound service`,inboundEnabled:`Inbound service enabled`,inboundDisabled:`Inbound service disabled`,inboundHint:`Manage mailboxes, aliases, and routes in the dedicated Inbox workspace.`,openMailboxRouting:`Open mailboxes & routing`,mailboxes:`Mailboxes`,unread:`unread`,messages:`messages`,noMailboxes:`No mailboxes for this domain`,configureMailbox:`Configure mailbox`,catchAll:`Default inbound route`,catchAllAddress:`Catch-all address`,mailboxSignupPolicy:`Mailbox creation access`,mailboxSignupOpen:`Shared with other users`,mailboxSignupOwnerOnly:`Owner only`,mailboxSignupHint:`When enabled, other users can create their own mailboxes under this domain, but cannot manage the domain configuration.`,mailboxSignupExtra:`Sharing only allows mailbox creation. DNS, catch-all, deletion, and domain administration stay private to the owner.`,enabled:`Open`,disabled:`Disabled`,time:`Time`,recipient:`Recipient`,subject:`Subject`,body:`Body`,status:`Status`,noActivity:`No sending activity for this domain`,viewActivity:`View sending activity`,sent:`Sent`,delivered:`Delivered`,queued:`Queued`,deferred:`Deferred`,failed:`Failed`,bounced:`Bounced`,editTitle:`Edit domain configuration`,save:`Save`,cancel:`Cancel`,deleteTitle:`Delete domain`,deleteWarning:`This cannot be undone. Sending configuration will stop immediately; deletion is blocked while mailboxes remain attached.`,typeDomain:`Type the domain to confirm:`,deleteConfirmation:`Domain deletion confirmation`,queueTest:`Queue test`,validRecipient:`Enter a valid recipient email`,testSubject:e=>`MailHub ${e} test email`,testBody:e=>`This is a MailHub delivery test from ${e}.`};export{z as default};
|