Webhooks-C4qtVEsF.js 17 KB

1234567891011
  1. import{a as e,n as t}from"./react-dom-stZKkA6x.js";import{a as n,d as r,r as i}from"./theme-DNlqAiGO.js";import{G as a,i as o,kt as s,n as c,st as l,t as u}from"./jsx-runtime-dm82oUI8.js";import{o as d}from"./grid-DcIFgt5N.js";import{n as ee,t as te}from"./table-CHt5qwx3.js";import{n as ne,r as re,t as f}from"./StatusPill-Bcw_ne6L.js";import{t as p}from"./descriptions-vs1os_w7.js";import{t as m}from"./form-BRrMNJiX.js";import{t as ie}from"./input-0_Xo22Fl.js";import{t as ae}from"./modal-BNBPl4Qp.js";import{t as oe}from"./popconfirm-DHzKhZl9.js";import{t as se}from"./switch-CsMGEdLR.js";import{t as ce}from"./CopyOutlined-CjLq_nuP.js";import{n as le,t as ue}from"./EditOutlined-BjvG9r8B.js";import{t as de}from"./PlusOutlined-CILz_LKx.js";import{t as h}from"./ReloadOutlined-Cq8HKCaL.js";import{t as fe}from"./ThunderboltOutlined-CMOzejTs.js";import{_ as g,b as pe,f as me,h as he,o as ge,p as _e}from"./index-CBPGvhVC.js";import{t as ve}from"./EmptyState-rI31ioMm.js";import{t as ye}from"./CodeBlock-B-NIgQUI.js";import{n as be,t as xe}from"./navigation-state-ixI_efPF.js";var _=e(t(),1),v=u(),y=[`sent`,`bounced`,`failed`,`opened`,`clicked`],Se=[...y,`received`],Ce=[`pending`,`processing`,`success`,`dead`];function b({domainId:e,mailboxId:t,domains:u=[],mailboxes:b=[],onCopy:ke}){let{message:x}=r.useApp(),{t:S}=n(),C=me(),Ae=_e(),[w,T]=he(),je=Number(w.get(`domainId`)||0)||void 0,Me=Number(w.get(`mailboxId`)||0)||void 0,E=Te(w.get(`webhookId`)),D=Ee(w.get(`deliveryStatus`)),O=De(w.get(`deliveryEvent`)),k=e??je,A=t??Me,Ne=e!=null||t!=null,[j,Pe]=(0,_.useState)([]),[Fe,Ie]=(0,_.useState)([]),[Le,Re]=(0,_.useState)([]),[ze,Be]=(0,_.useState)(!1),[Ve,M]=(0,_.useState)(``),[N,He]=(0,_.useState)(u),[Ue,We]=(0,_.useState)(b),[P,Ge]=(0,_.useState)(!0),[F,Ke]=(0,_.useState)(``),[qe,Je]=(0,_.useState)(``),[Ye,Xe]=(0,_.useState)(``),[I,L]=(0,_.useState)(``),[Ze,R]=(0,_.useState)(!1),[z,B]=(0,_.useState)(null),[V,H]=(0,_.useState)(null),[U]=m.useForm(),Qe=(0,_.useRef)(0),W=(0,_.useRef)(0),G=A!=null,K=k!=null||G,$e=G?[`received`]:y,et=(0,_.useMemo)(()=>new Map(N.map(e=>[e.id,e.domain])),[N]),tt=(0,_.useMemo)(()=>new Map(Ue.map(e=>[e.id,e.address])),[Ue]),q=(0,_.useMemo)(()=>E&&j.find(e=>e.id===E)||null,[E,j]),J=(0,_.useCallback)(async()=>{let e=++Qe.current;Ge(!0),Ke(``),Je(``),Xe(``);let t=!u.length||!b.length,[n,r,a,o]=await Promise.allSettled([i.webhooks(G?void 0:k??void 0,A),i.webhookDeliveries({limit:100}),t?i.domains():Promise.resolve(null),t?i.inboundMailboxes():Promise.resolve(null)]);if(e!==Qe.current)return;let s=[];if(n.status===`fulfilled`?(s=(n.value.webhooks||[]).filter(e=>K||e.mailboxId==null),Pe(s)):Ke(n.reason instanceof Error?n.reason.message:S(`common.error`)),r.status===`fulfilled`){let e=new Set(s.map(e=>e.id)),t=(r.value.deliveries||[]).filter(t=>K?e.has(t.webhookId):!0);Ie(t)}else Xe(r.reason instanceof Error?r.reason.message:S(`common.error`));let c=[];a.status===`fulfilled`?a.value&&He(a.value.domains||[]):c.push(a.reason instanceof Error?a.reason.message:S(`common.error`)),o.status===`fulfilled`?o.value&&We(o.value.mailboxes||[]):c.push(o.reason instanceof Error?o.reason.message:S(`common.error`)),Je(c.join(`;`)),Ge(!1)},[k,u.length,A,G,b.length,K,S]);(0,_.useEffect)(()=>{u.length&&He(u)},[u]),(0,_.useEffect)(()=>{b.length&&We(b)},[b]),(0,_.useEffect)(()=>(J(),()=>{Qe.current+=1}),[J]);let nt=(0,_.useMemo)(()=>{let e=new Map;for(let t of Fe)e.has(t.webhookId)||e.set(t.webhookId,t);return e},[Fe]),Y=(0,_.useCallback)(async()=>{let e=++W.current;if(!E){Re([]),M(``),Be(!1);return}Re([]),M(``),Be(!0);try{let t=await i.webhookDeliveries({webhookId:E,status:D===`all`?void 0:D,eventType:O===`all`?void 0:O,limit:200});e===W.current&&Re(t.deliveries||[])}catch(t){e===W.current&&M(t instanceof Error?t.message:S(`common.error`))}finally{e===W.current&&Be(!1)}},[O,D,E,S]);(0,_.useEffect)(()=>{Y()},[Y]);async function X(e){if(e){if(ke){ke(e);return}await navigator.clipboard.writeText(e),x.success(S(`common.copied`))}}function rt(){B(null),U.setFieldsValue({name:``,url:``,events:[...$e],domainId:G?void 0:k??void 0,enabled:!0}),R(!0)}function it(e){B(e),U.setFieldsValue({name:e.name,url:e.url,events:e.events?.length?[...e.events]:[...$e],domainId:e.domainId??void 0,enabled:e.enabled}),R(!0)}function Z(){R(!1),B(null),U.resetFields()}async function at(){let e=await U.validateFields(),t=z?`save:${z.id}`:`create`;L(t);try{let t={name:e.name.trim(),url:e.url.trim(),events:e.events,domainId:G?null:k??e.domainId??null,mailboxId:G?A:null,enabled:e.enabled};if(z)await i.updateWebhook(z.id,t),x.success(S(`actions.webhookUpdated`)),Z(),await J();else{let e=await i.createWebhook(t);x.success(S(`actions.webhookCreated`)),Z(),e.webhook?.secret&&H({webhook:e.webhook,mode:`created`}),await J()}}catch(e){x.error(e instanceof Error?e.message:S(`common.error`))}finally{L(``)}}async function ot(e,t){L(`toggle:${e.id}`);try{await i.updateWebhook(e.id,{enabled:t}),Pe(n=>n.map(n=>n.id===e.id?{...n,enabled:t}:n))}catch(e){x.error(e instanceof Error?e.message:S(`common.error`))}finally{L(``)}}async function st(e){L(`delete:${e.id}`);try{await i.deleteWebhook(e.id),x.success(S(`actions.webhookDeleted`)),E===e.id&&ft(),await J()}catch(e){x.error(e instanceof Error?e.message:S(`common.error`))}finally{L(``)}}async function ct(e){L(`rotate:${e.id}`);try{let t=await i.rotateWebhookSecret(e.id);x.success(S(`actions.webhookSecretRotated`)),t.webhook?.secret&&H({webhook:t.webhook,mode:`rotated`}),await J()}catch(e){x.error(e instanceof Error?e.message:S(`common.error`))}finally{L(``)}}async function lt(e){L(`test:${e.id}`);try{await i.testWebhook(e.id),x.success(S(`actions.webhookTestQueued`)),await J(),dt(e)}catch(e){x.error(e instanceof Error?e.message:S(`common.error`))}finally{L(``)}}async function ut(e){L(`replay:${e.id}`);try{await i.replayWebhookDelivery(e.id),x.success(S(`actions.webhookDeliveryReplayed`)),await Promise.all([J(),Y()])}catch(e){x.error(e instanceof Error?e.message:S(`common.error`))}finally{L(``)}}function dt(e){let t=new URLSearchParams(w);t.set(`webhookId`,String(e.id)),t.delete(`deliveryStatus`),t.delete(`deliveryEvent`),T(t,{state:xe(`${C.pathname}${C.search}`,1)})}function ft(){let e=be(C.state);if(e){Ae(-e.depth);return}let t=new URLSearchParams(w);t.delete(`webhookId`),t.delete(`deliveryStatus`),t.delete(`deliveryEvent`),T(t,{replace:!0,state:null})}function pt(e,t){let n=new URLSearchParams(w);t===`all`?n.delete(e):n.set(e,t);let r=be(C.state);if(!r){T(n,{replace:!0});return}let i=n.toString();Ae({pathname:C.pathname,search:i?`?${i}`:``},{state:xe(r.listPath,r.depth+1)})}function mt(e){if(e.mailboxId!=null){let t=tt.get(e.mailboxId);return t?`${S(`webhooks.scopeMailbox`)} · ${t}`:S(`webhooks.scopeMailbox`)}if(e.domainId==null)return S(`webhooks.scopeAccount`);let t=et.get(e.domainId);return t?`${S(`webhooks.scopeDomain`)} · ${t}`:S(`webhooks.scopeDomain`)}function Q(e){return e===`sent`?S(`webhooks.eventSent`):e===`bounced`?S(`webhooks.eventBounced`):e===`failed`?S(`webhooks.eventFailed`):e===`opened`?S(`webhooks.eventOpened`):e===`clicked`?S(`webhooks.eventClicked`):e===`received`?S(`webhooks.eventReceived`):e}function $(e){return e===`pending`?S(`webhooks.statusPending`):e===`processing`?S(`webhooks.statusProcessing`):e===`success`?S(`webhooks.statusSuccess`):e===`dead`?S(`webhooks.statusDead`):e}function ht(e){return e===`success`?`success`:e===`pending`?`info`:e===`processing`?`warning`:e===`dead`?`error`:`neutral`}function gt(e){let t=nt.get(e.id);if(!t)return(0,v.jsx)(c.Text,{type:`secondary`,children:`—`});let n=t.error||(t.responseStatus==null?``:`HTTP ${t.responseStatus}`)||$(String(t.status));return(0,v.jsxs)(o,{size:6,wrap:!0,children:[(0,v.jsx)(f,{tone:ht(String(t.status)),children:$(String(t.status))}),(0,v.jsxs)(c.Text,{type:`secondary`,ellipsis:!0,className:`inline-code-value`,children:[Q(String(t.eventType)),` · `,n]})]})}let _t=[{title:S(`webhooks.name`),dataIndex:`name`,render:(e,t)=>(0,v.jsxs)(o,{direction:`vertical`,size:0,children:[(0,v.jsx)(c.Text,{strong:!0,children:e}),(0,v.jsxs)(c.Text,{type:`secondary`,code:!0,children:[t.secretPrefix,`…`]})]})},{title:S(`webhooks.scope`),render:(e,t)=>mt(t)},{title:S(`webhooks.url`),dataIndex:`url`,ellipsis:!0,render:e=>(0,v.jsx)(c.Text,{code:!0,ellipsis:!0,title:e,className:`inline-code-value`,children:we(e)})},{title:S(`webhooks.events`),dataIndex:`events`,render:e=>(0,v.jsx)(o,{size:[4,4],wrap:!0,children:(e||[]).map(e=>(0,v.jsx)(g,{children:Q(e)},e))})},{title:S(`webhooks.enabled`),dataIndex:`enabled`,width:100,render:(e,t)=>(0,v.jsx)(se,{checked:e,loading:I===`toggle:${t.id}`,onChange:e=>void ot(t,e),checkedChildren:S(`webhooks.enabled`),unCheckedChildren:S(`webhooks.disabled`)})},{title:S(`webhooks.lastAttemptAt`),render:(e,t)=>gt(t)},{title:S(`webhooks.actions`),fixed:`right`,width:280,render:(e,t)=>(0,v.jsxs)(o,{wrap:!0,size:4,children:[(0,v.jsx)(s,{size:`small`,icon:(0,v.jsx)(fe,{}),loading:I===`test:${t.id}`,onClick:()=>void lt(t),children:S(`webhooks.test`)}),(0,v.jsx)(s,{size:`small`,onClick:()=>dt(t),children:S(`webhooks.viewDeliveries`)}),(0,v.jsx)(s,{size:`small`,icon:(0,v.jsx)(ue,{}),onClick:()=>it(t)}),(0,v.jsx)(oe,{title:S(`webhooks.rotateConfirm`),onConfirm:()=>void ct(t),children:(0,v.jsx)(s,{"aria-label":S(`webhooks.rotateSecret`),size:`small`,icon:(0,v.jsx)(ge,{}),loading:I===`rotate:${t.id}`})}),(0,v.jsx)(oe,{title:S(`webhooks.deleteConfirm`),onConfirm:()=>void st(t),children:(0,v.jsx)(s,{"aria-label":S(`common.delete`),size:`small`,danger:!0,icon:(0,v.jsx)(le,{}),loading:I===`delete:${t.id}`})})]})}],vt=[{title:S(`webhooks.createdAt`),dataIndex:`createdAt`,width:170,render:e=>e?new Date(e).toLocaleString():`—`},{title:S(`webhooks.events`),dataIndex:`eventType`,render:e=>(0,v.jsx)(g,{children:Q(e)})},{title:S(`common.status`),dataIndex:`status`,render:e=>(0,v.jsx)(f,{tone:ht(e),children:$(e)})},{title:S(`webhooks.attemptCount`),dataIndex:`attemptCount`,width:90},{title:S(`webhooks.responseStatus`),dataIndex:`responseStatus`,width:100,render:e=>e??`—`},{title:S(`webhooks.error`),dataIndex:`error`,ellipsis:!0,render:(e,t)=>e||t.responseBodyPreview||`—`},{title:S(`webhooks.lastAttemptAt`),dataIndex:`lastAttemptAt`,width:170,render:e=>e?new Date(e).toLocaleString():`—`},{title:S(`webhooks.actions`),fixed:`right`,width:110,render:(e,t)=>(0,v.jsx)(s,{size:`small`,disabled:t.status===`processing`,loading:I===`replay:${t.id}`,onClick:()=>void ut(t),children:S(`webhooks.replay`)})}],yt=V?.webhook.secret||``,bt=Oe(yt||`whsec_your_secret`);return(0,v.jsxs)(o,{direction:`vertical`,size:20,className:`full-width`,children:[Ne?(0,v.jsxs)(o,{direction:`vertical`,size:12,className:`full-width`,children:[(0,v.jsx)(d,{type:`info`,showIcon:!0,message:S(G?`webhooks.mailboxReceiptHelp`:`webhooks.domainOverrideHelp`)}),(0,v.jsxs)(o,{children:[(0,v.jsx)(s,{icon:(0,v.jsx)(h,{}),onClick:()=>void J(),loading:P,children:S(`common.refresh`)}),(0,v.jsx)(s,{type:`primary`,icon:(0,v.jsx)(de,{}),onClick:rt,children:S(`webhooks.create`)})]})]}):(0,v.jsx)(re,{title:S(`webhooks.title`),subtitle:S(`webhooks.subtitle`),extra:(0,v.jsxs)(o,{children:[(0,v.jsx)(s,{icon:(0,v.jsx)(h,{}),onClick:()=>void J(),loading:P,children:S(`common.refresh`)}),(0,v.jsx)(s,{type:`primary`,icon:(0,v.jsx)(de,{}),onClick:rt,children:S(`webhooks.create`)})]})}),Ne?null:(0,v.jsx)(d,{type:`info`,showIcon:!0,message:S(G?`webhooks.mailboxReceiptHelp`:`webhooks.domainOverrideHelp`)}),(0,v.jsxs)(ne,{title:S(`webhooks.listTitle`),extra:(0,v.jsx)(f,{tone:`neutral`,children:j.length}),children:[!F&&qe?(0,v.jsx)(d,{type:`warning`,showIcon:!0,message:S(`webhooks.resourcesUnavailable`),description:qe,style:{marginBottom:12}}):null,!F&&Ye&&j.length?(0,v.jsx)(d,{type:`warning`,showIcon:!0,message:S(`webhooks.recentDeliveriesUnavailable`),description:Ye,style:{marginBottom:12}}):null,F?(0,v.jsx)(d,{type:`error`,showIcon:!0,message:S(`webhooks.loadFailed`),description:F,action:(0,v.jsx)(s,{icon:(0,v.jsx)(h,{}),onClick:()=>void J(),children:S(`common.refresh`)})}):P&&!j.length?(0,v.jsx)(l,{active:!0,paragraph:{rows:6}}):j.length?(0,v.jsx)(te,{rowKey:`id`,columns:_t,dataSource:j,loading:P,scroll:{x:1200},pagination:{pageSize:10}}):(0,v.jsx)(ve,{description:S(`webhooks.empty`)})]}),(0,v.jsx)(pe,{title:S(z?`webhooks.editTitle`:`webhooks.createTitle`),width:520,open:Ze,onClose:Z,destroyOnHidden:!0,footer:(0,v.jsxs)(`div`,{className:`drawer-footer`,children:[(0,v.jsx)(s,{onClick:Z,children:S(`common.cancel`)}),(0,v.jsx)(s,{type:`primary`,loading:I===`create`||I.startsWith(`save:`),onClick:()=>void at(),children:S(z?`common.save`:`webhooks.create`)})]}),children:(0,v.jsxs)(m,{form:U,layout:`vertical`,initialValues:{enabled:!0,events:y},children:[(0,v.jsx)(m.Item,{name:`name`,label:S(`webhooks.name`),rules:[{required:!0,message:S(`webhooks.nameRequired`)}],children:(0,v.jsx)(ie,{placeholder:S(`webhooks.namePlaceholder`)})}),(0,v.jsx)(m.Item,{name:`url`,label:S(`webhooks.url`),extra:S(`webhooks.urlHint`),rules:[{required:!0,message:S(`webhooks.urlRequired`)}],children:(0,v.jsx)(ie,{placeholder:S(`webhooks.urlPlaceholder`)})}),(0,v.jsx)(m.Item,{name:`events`,label:S(`webhooks.events`),rules:[{required:!0,type:`array`,min:1,message:S(`webhooks.eventsRequired`)}],children:(0,v.jsx)(ee.Group,{options:$e.map(e=>({value:e,label:Q(e)})),disabled:G})}),K?null:(0,v.jsx)(m.Item,{name:`domainId`,label:S(`webhooks.domain`),extra:S(`webhooks.domainAccount`),children:(0,v.jsx)(a,{allowClear:!0,placeholder:S(`webhooks.domainAccount`),options:N.map(e=>({value:e.id,label:e.domain}))})}),(0,v.jsx)(m.Item,{name:`enabled`,label:S(`webhooks.enabled`),valuePropName:`checked`,children:(0,v.jsx)(se,{})})]})}),(0,v.jsx)(pe,{title:q?`${q.name} · ${S(`webhooks.deliveriesTitle`)}`:S(`webhooks.deliveriesTitle`),width:760,open:!!E,onClose:ft,children:P&&!q?(0,v.jsx)(`div`,{role:`status`,"aria-label":S(`webhooks.deliveriesTitle`),children:(0,v.jsx)(l,{active:!0,paragraph:{rows:8}})}):q?(0,v.jsxs)(o,{direction:`vertical`,size:20,className:`full-width`,children:[(0,v.jsxs)(p,{bordered:!0,column:1,size:`small`,children:[(0,v.jsx)(p.Item,{label:S(`webhooks.url`),children:(0,v.jsx)(c.Text,{code:!0,copyable:{onCopy:()=>void X(q.url)},style:{overflowWrap:`anywhere`,wordBreak:`break-word`},children:q.url})}),(0,v.jsx)(p.Item,{label:S(`webhooks.scope`),children:mt(q)}),(0,v.jsx)(p.Item,{label:S(`webhooks.events`),children:(0,v.jsx)(o,{wrap:!0,children:q.events.map(e=>(0,v.jsx)(g,{children:Q(e)},e))})}),(0,v.jsx)(p.Item,{label:S(`webhooks.secretPrefix`),children:(0,v.jsxs)(c.Text,{code:!0,children:[q.secretPrefix,`…`]})}),(0,v.jsx)(p.Item,{label:S(`common.status`),children:(0,v.jsx)(f,{tone:q.enabled?`success`:`neutral`,children:q.enabled?S(`webhooks.enabled`):S(`webhooks.disabled`)})})]}),(0,v.jsxs)(o,{wrap:!0,children:[(0,v.jsx)(a,{"aria-label":S(`webhooks.deliveriesFilterStatus`),style:{minWidth:160},value:D,onChange:e=>pt(`deliveryStatus`,e),options:[{value:`all`,label:S(`webhooks.allStatuses`)},...Ce.map(e=>({value:e,label:$(e)}))]}),(0,v.jsx)(a,{"aria-label":S(`webhooks.deliveriesFilterEvent`),style:{minWidth:160},value:O,onChange:e=>pt(`deliveryEvent`,e),options:[{value:`all`,label:S(`webhooks.allEvents`)},...Se.map(e=>({value:e,label:Q(e)}))]})]}),Ve?(0,v.jsx)(d,{type:`error`,showIcon:!0,message:Ve,action:(0,v.jsx)(s,{icon:(0,v.jsx)(h,{}),onClick:()=>void Y(),children:S(`common.refresh`)})}):ze&&!Le.length?(0,v.jsx)(`div`,{role:`status`,"aria-label":S(`webhooks.deliveriesTitle`),children:(0,v.jsx)(l,{active:!0,paragraph:{rows:6}})}):Le.length?(0,v.jsx)(te,{rowKey:`id`,columns:vt,dataSource:Le,loading:ze,scroll:{x:920},pagination:{pageSize:10}}):(0,v.jsx)(ve,{description:S(`webhooks.deliveriesEmpty`)}),(0,v.jsx)(d,{type:`info`,showIcon:!0,message:S(`webhooks.docsSignature`),description:S(`webhooks.docsEvents`)}),(0,v.jsx)(ye,{value:Oe(`whsec_your_secret`),onCopy:X})]}):F&&E?(0,v.jsx)(d,{type:`error`,showIcon:!0,message:S(`webhooks.loadFailed`),description:F,action:(0,v.jsx)(s,{icon:(0,v.jsx)(h,{}),onClick:()=>void J(),children:S(`common.refresh`)})}):E?(0,v.jsx)(ve,{description:S(`common.notFound`)}):null}),(0,v.jsx)(ae,{title:V?.mode===`rotated`?S(`webhooks.secretRotatedTitle`):S(`webhooks.secretCreatedTitle`),open:!!V,closable:!1,maskClosable:!1,keyboard:!1,destroyOnHidden:!0,footer:[(0,v.jsx)(s,{icon:(0,v.jsx)(ce,{}),onClick:()=>void X(yt),children:S(`webhooks.copySecret`)},`copy`),(0,v.jsx)(s,{type:`primary`,onClick:()=>H(null),children:S(`common.confirm`)},`done`)],children:(0,v.jsxs)(o,{direction:`vertical`,size:16,className:`full-width`,children:[(0,v.jsx)(d,{type:`error`,showIcon:!0,message:S(`webhooks.secretCreatedWarning`)}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(c.Text,{type:`secondary`,children:S(`webhooks.secret`)}),(0,v.jsx)(ye,{value:yt,onCopy:X})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(c.Text,{type:`secondary`,children:S(`webhooks.docsSignature`)}),(0,v.jsx)(ye,{value:bt,onCopy:X})]})]})})]})}function we(e,t=48){return e?e.length<=t?e:`${e.slice(0,t-1)}…`:``}function Te(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function Ee(e){return Ce.includes(e)?e:`all`}function De(e){return Se.includes(e)?e:`all`}function Oe(e){return`// Verify X-MailHub-Signature (Node.js)
  2. const crypto = require('crypto');
  3. function verify(rawBody, signatureHeader, secret = ${JSON.stringify(e)}) {
  4. const parts = Object.fromEntries(
  5. signatureHeader.split(',').map((p) => p.trim().split('='))
  6. );
  7. const signed = \`\${parts.t}.\${rawBody}\`;
  8. const expected = crypto.createHmac('sha256', secret).update(signed).digest('hex');
  9. return crypto.timingSafeEqual(Buffer.from(parts.v1, 'hex'), Buffer.from(expected, 'hex'));
  10. }`}export{b as default};