PageSourceSearch

https://app.mailercloud.com/js/TransactionalWebhookEdit.822b4628.js

js mailercloud.com collected 2026-10-02 17:11:57 UTC 22,802 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"8b2370aa6a02f06cc0bfdb17a93efc5967d7fb4d"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="72702bfa-40ee-4f63-a3b9-0dc63b962172",e._sentryDebugIdIdentifier="sentry-dbid-72702bfa-40ee-4f63-a3b9-0dc63b962172")}catch(e){}}(),(self["webpackChunk_Mailercloud_vue3"]=self["webpackChunk_Mailercloud_vue3"]||[]).push([[2689],{80544:function(e,t,s){s.r(t),s.d(t,{default:function(){return we}});var o=s(61886),a=s(48081),l=s(19639),n=s(14460),i=s(80223),r=s(63483),d=s(2291),c=s(96030),u=s(16663),h=s(58582),p=s(34937),k=s(3918),b=s(43970),m=s(27608),g=s(52373),v=(s(74423),s(44114),s(56768)),f=s(24232),w=s(13851),y=s.p+"img/animation-question.00ea25bc.gif",C=s(38671),L=s(75709);const E={class:"position-fixed top-0 end-0 p-4"},S={class:"mt-md-9"},x={class:"font-24 fw-bold mb-2"},_={class:"font-13 m-0"},V={class:"text-break"},F={class:"font-13 mb-1"},W={class:"font-11 float-end mb-1"},U={class:"d-flex"},$={class:"flex-grow-1 ms-2"},A={class:"font-15 fw-bold mt-4 mb-2"},I={class:"cust-checkbox check-hover"},R={key:2,class:"text-center bg-light-gray border-radius-8 mt-3 px-5 py-7"},T={class:"d-flex align-items-start justify-content-between"},N={key:0,class:"mt-3"},X={class:"d-flex align-items-center"},P={class:"wh-secret-field flex-grow-1"},M={class:"wh-secret-val"},B={key:0,src:C,width:"16",alt:"Copied"},j={key:1,class:"copy-svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},z=["disabled"],D={key:0,class:"font-11 text-muted mt-1 mb-0"},H={class:"d-flex align-items-start justify-content-between"},Q={key:0,src:L,width:"60",alt:"loading"},q={key:1},K={class:"d-flex"},O={class:"text-900 font-20 fw-bold mb-0"},Y={class:"text-700 font-13 mb-0 mt-1"},Z={class:"wh-secret-field"},G={class:"wh-secret-val"},J={key:0,src:C,width:"16",alt:"Copied"},ee={key:1,class:"copy-svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function te(e,t,s,C,L,te){const se=(0,v.g2)("transactional-menu-bar"),oe=g.A,ae=m.t,le=b.t,ne=k.t,ie=p.t,re=h.A,de=u.n,ce=(0,v.g2)("Popper"),ue=c.A,he=d.A,pe=r.A,ke=i.t,be=n.t,me=l.A,ge=a.t,ve=o.S;return(0,v.uX)(),(0,v.CE)("div",null,[(0,v.bF)(se),(0,v.bF)(be,{fluid:"",class:""},{default:(0,v.k6)(()=>[(0,v.Lk)("div",E,[(0,v.Lk)("span",{class:"cursor-pointer b-btn-close",onClick:t[0]||(t[0]=t=>e.$router.push("/transactional/settings"))},[(0,v.bF)(oe,{size:"20"})])]),(0,v.Lk)("div",S,[(0,v.bF)(le,{class:"bg-white z-1 sticky-top"},{default:(0,v.k6)(()=>[(0,v.bF)(ae,{cols:"12",class:"mx-auto pb-4 mt-9 max-w-600"},{default:(0,v.k6)(()=>[(0,v.Lk)("h2",x,(0,f.v_)(L.webhookId?"Edit":"Create new")+" webhook ",1),(0,v.Lk)("p",_,[(0,v.Lk)("span",{class:"link-black",onClick:t[1]||(t[1]=t=>e.$router.push("/transactional/settings"))},"List"),t[19]||(t[19]=(0,v.Lk)("span",{class:"px-1"},"/",-1)),(0,v.Lk)("span",V,(0,f.v_)(L.webhookId?L.webhookName:"Create webhook"),1)])]),_:1})]),_:1}),(0,v.bF)(le,{class:""},{default:(0,v.k6)(()=>[(0,v.bF)(ae,{cols:"12",class:"mx-auto pb-9 max-w-600"},{default:(0,v.k6)(()=>[(0,v.Lk)("div",F,[t[20]||(t[20]=(0,v.Lk)("span",{class:"float-start mb-1"},"Name*",-1)),(0,v.Lk)("span",W,(0,f.v_)(L.webhookName.trim().length?L.webhookName.trim().length:0)+"/100",1)]),(0,v.bF)(ne,{ref:"webhookNameInput",id:"webhookName",class:(0,f.C4)(["frm-new-txt",{"frm-new-txt error":L.webhookName.trim().length>100}]),size:"sm",modelValue:L.webhookName,"onUpdate:modelValue":t[2]||(t[2]=e=>L.webhookName=e)},null,8,["class","modelValue"]),L.webhookName.trim().length>100?((0,v.uX)(),(0,v.Wv)(ie,{key:0,"model-value":!0,variant:"danger",class:"mc-alert border-dashed mt-2"},{default:(0,v.k6)(()=>[...t[21]||(t[21]=[(0,v.Lk)("div",{class:"d-flex"},[(0,v.Lk)("div",{class:"flex-shrink-0"},[(0,v.Lk)("img",{src:w,width:"12",alt:""})]),(0,v.Lk)("div",{class:"flex-grow-1 ms-2"}," We do not support webhook names longer than 100 characters. ")],-1)])]),_:1})):(0,v.Q3)("",!0),t[34]||(t[34]=(0,v.Lk)("div",{class:"font-13 mt-4 mb-1"},[(0,v.Lk)("span",null,"Callback URL*")],-1)),(0,v.bF)(ne,{ref:"webhookUrlInput",class:(0,f.C4)(["frm-new-txt",{"frm-new-txt error":!L.isUrlValid}]),modelValue:L.callBackUrl,"onUpdate:modelValue":t[3]||(t[3]=e=>L.callBackUrl=e),onInput:t[4]||(t[4]=e=>te.validateUrl(e.target.value)),size:"sm"},null,8,["class","modelValue"]),L.isUrlValid?(0,v.Q3)("",!0):((0,v.uX)(),(0,v.Wv)(ie,{key:1,"model-value":!0,variant:"danger",class:"mc-alert border-dashed mt-2"},{default:(0,v.k6)(()=>[(0,v.Lk)("div",U,[t[22]||(t[22]=(0,v.Lk)("div",{class:"flex-shrink-0"},[(0,v.Lk)("img",{src:w,width:"12",alt:""})],-1)),(0,v.Lk)("div",$,(0,f.v_)(L.errorMessage?L.errorMessage:"The URL you entered is not a valid webhook URL. Please try again"),1)])]),_:1})),(0,v.Lk)("h2",A,[t[23]||(t[23]=(0,v.eW)(" Select event* ",-1)),(0,v.bF)(re),t[24]||(t[24]=(0,v.Lk)("span",{class:"ms-2"},[(0,v.Lk)("img",{src:y,width:"18",alt:"Q"})],-1))]),(0,v.bF)(le,null,{default:(0,v.k6)(()=>[(0,v.bF)(ae,{cols:"12",md:"6",class:"align-self-center py-1"},{default:(0,v.k6)(()=>[(0,v.Lk)("div",I,[(0,v.bF)(de,{modelValue:L.checkAllEvent,"onUpdate:modelValue":t[5]||(t[5]=e=>L.checkAllEvent=e),onClick:t[6]||(t[6]=e=>te.checkAllEvents(L.checkAllEvent)),disabled:!te.searchedEvents.length},{default:(0,v.k6)(()=>[...t[25]||(t[25]=[(0,v.eW)("Select All Event ",-1)])]),_:1},8,["modelValue","disabled"])])]),_:1})]),_:1}),t[35]||(t[35]=(0,v.Lk)("div",{class:"border-top my-2 d-none d-md-block"},null,-1)),(0,v.bF)(le,null,{default:(0,v.k6)(()=>[((0,v.uX)(!0),(0,v.CE)(v.FK,null,(0,v.pI)(te.searchedEvents,(e,s)=>((0,v.uX)(),(0,v.Wv)(ae,{key:s,md:"4",class:"py-1"},{default:(0,v.k6)(()=>[(0,v.bF)(ce,{arrow:"",hover:"",placement:"top",class:"mc-tooltip avoid-in-blok",content:""},{content:(0,v.k6)(()=>[(0,v.eW)((0,f.v_)(e.description),1)]),default:(0,v.k6)(()=>[(0,v.Lk)("div",{class:(0,f.C4)(["cust-checkbox check-hover",{active:L.allEvents.includes(e.value)}])},[(0,v.bF)(de,{value:e.value,modelValue:L.allEvents,"onUpdate:modelValue":t[7]||(t[7]=e=>L.allEvents=e)},{default:(0,v.k6)(()=>[(0,v.eW)((0,f.v_)(e.event),1)]),_:2},1032,["value","modelValue"])],2)]),_:2},1024)]),_:2},1024))),128))]),_:1}),te.searchedEvents.length?(0,v.Q3)("",!0):((0,v.uX)(),(0,v.CE)("div",R,[t[26]||(t[26]=(0,v.Lk)("p",{class:"font-13 mb-2"}," We couldn't find any events matching your search query. ",-1)),(0,v.Lk)("p",{class:"font-13 link-primary mb-0",onClick:t[8]||(t[8]=e=>L.searchVal="")}," Click here to see all events. ")])),L.webhookId?((0,v.uX)(),(0,v.CE)(v.FK,{key:3},[t[31]||(t[31]=(0,v.Lk)("div",{class:"border-top mt-6 mb-4"},null,-1)),(0,v.Lk)("div",T,[t[27]||(t[27]=(0,v.Lk)("div",{class:"pe-3"},[(0,v.Lk)("h2",{class:"font-15 fw-bold mb-1"}
1,"Payload signing"),(0,v.Lk)("p",{class:"font-13 text-muted mb-0"},[(0,v.eW)(" When enabled, every request is signed with a secret so your endpoint can verify it came from Mailercloud (adds "),(0,v.Lk)("span",{class:"fw-semibold"},"Webhook-Signature"),(0,v.eW)(" and "),(0,v.Lk)("span",{class:"fw-semibold"},"Webhook-Timestamp"),(0,v.eW)(" headers). ")])],-1)),(0,v.bF)(de,{switch:"","model-value":L.signingEnabled,disabled:L.secretLoading,"onUpdate:modelValue":te.onToggleSigning,class:"mt-1 flex-shrink-0"},null,8,["model-value","disabled","onUpdate:modelValue"])]),L.signingEnabled?((0,v.uX)(),(0,v.CE)("div",N,[t[30]||(t[30]=(0,v.Lk)("div",{class:"font-13 mb-1"},"Signing secret",-1)),(0,v.Lk)("div",X,[(0,v.Lk)("div",P,[(0,v.Lk)("span",M,(0,f.v_)(L.secretRevealed?L.signingSecret:te.maskedSecret),1),(0,v.bo)(((0,v.uX)(),(0,v.CE)("button",{type:"button",class:"wh-icon-btn",onClick:t[9]||(t[9]=e=>L.secretRevealed=!L.secretRevealed)},[L.secretRevealed?((0,v.uX)(),(0,v.Wv)(ue,{key:0,size:"16"})):((0,v.uX)(),(0,v.Wv)(he,{key:1,size:"16"}))])),[[ve,L.secretRevealed?"Hide":"Reveal",void 0,{hover:!0}]]),(0,v.bo)(((0,v.uX)(),(0,v.CE)("button",{type:"button",class:"wh-icon-btn",onClick:t[10]||(t[10]=(...e)=>te.copySecret&&te.copySecret(...e))},[L.secretCopied?((0,v.uX)(),(0,v.CE)("img",B)):((0,v.uX)(),(0,v.CE)("svg",j,[...t[28]||(t[28]=[(0,v.Lk)("path",{d:"M10 1.3335H7.33333C6.97971 1.3335 6.64057 1.47397 6.39052 1.72402C6.14048 1.97407 6 2.31321 6 2.66683V10.0002C6 10.3538 6.14048 10.6929 6.39052 10.943C6.64057 11.193 6.97971 11.3335 7.33333 11.3335H12.6667C13.0203 11.3335 13.3594 11.193 13.6095 10.943C13.8595 10.6929 14 10.3538 14 10.0002V5.3335",stroke:"currentColor","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),(0,v.Lk)("path",{d:"M11.1373 1.80417C10.9882 1.65451 10.8109 1.53587 10.6157 1.45509C10.4205 1.37431 10.2113 1.33298 10 1.3335V4.66683C10 4.84365 10.0702 5.01321 10.1953 5.13824C10.3203 5.26326 10.4899 5.3335 10.6667 5.3335H14C14.0005 5.12224 13.9592 4.91297 13.8784 4.71776C13.7976 4.52256 13.679 4.34528 13.5293 4.19617L11.1373 1.80417Z",stroke:"currentColor","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),(0,v.Lk)("path",{d:"M3.33333 4.6665C2.97971 4.6665 2.64057 4.80698 2.39052 5.05703C2.14048 5.30708 2 5.64622 2 5.99984V13.3332C2 13.6868 2.14048 14.0259 2.39052 14.276C2.64057 14.526 2.97971 14.6665 3.33333 14.6665H8.66667C8.90071 14.6665 9.13063 14.6049 9.33331 14.4879C9.536 14.3708 9.70431 14.2025 9.82133 13.9998",stroke:"currentColor","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])),[[ve,L.secretCopied?"Copied":"Copy",void 0,{hover:!0}]])]),(0,v.bo)(((0,v.uX)(),(0,v.CE)("button",{type:"button",class:"wh-icon-btn ms-2",disabled:L.secretLoading,onClick:t[11]||(t[11]=e=>te.manageSecret("rotate"))},[(0,v.bF)(pe,{size:"16"})],8,z)),[[ve,"Rotate secret",void 0,{hover:!0}]])]),L.secretRotatedAt?((0,v.uX)(),(0,v.CE)("p",D," Last rotated: "+(0,f.v_)(L.secretRotatedAt),1)):(0,v.Q3)("",!0),(0,v.bF)(ie,{"model-value":!0,variant:"warning",class:"mc-alert border-dashed mt-3"},{default:(0,v.k6)(()=>[...t[29]||(t[29]=[(0,v.Lk)("div",{class:"font-12"}," Rotating generates a new secret. The previous secret keeps working for 24 hours so you can update your endpoint without downtime. ",-1)])]),_:1})])):(0,v.Q3)("",!0)],64)):((0,v.uX)(),(0,v.CE)(v.FK,{key:4},[t[33]||(t[33]=(0,v.Lk)("div",{class:"border-top mt-6 mb-4"},null,-1)),(0,v.Lk)("div",H,[t[32]||(t[32]=(0,v.Lk)("div",{class:"pe-3"},[(0,v.Lk)("h2",{class:"font-15 fw-bold mb-1"},"Payload signing"),(0,v.Lk)("p",{class:"font-13 text-muted mb-0"},[(0,v.eW)(" Sign every request with a secret so your endpoint can verify it came from Mailercloud (adds "),(0,v.Lk)("span",{class:"fw-semibold"},"Webhook-Signature"),(0,v.eW)(" and "),(0,v.Lk)("span",{class:"fw-semibold"},"Webhook-Timestamp"),(0,v.eW)(" headers). You'll get the secret to copy right after creating. ")])],-1)),(0,v.bF)(de,{switch:"",modelValue:L.signAtCreate,"onUpdate:modelValue":t[12]||(t[12]=e=>L.signAtCreate=e),class:"mt-1 flex-shrink-0"},null,8,["modelValue"])])],64))]),_:1})]),_:1})]),(0,v.bF)(le,{class:"bg-white"},{default:(0,v.k6)(()=>[(0,v.bF)(ae,{lg:"6",class:"mx-auto py-4 w-600"},{default:(0,v.k6)(()=>[(0,v.bF)(le,null,{default:(0,v.k6)(()=>[(0,v.bF)(ae,{cols:"auto",class:"pb-2 pb-sm-0"},{default:(0,v.k6)(()=>[(0,v.bF)(ke,{variant:"primary",disabled:te.disabled,class:"mc-btn py-1 px-3 py-md-2 px-md-5",onClick:te.createWebhook},{default:(0,v.k6)(()=>[L.loading?((0,v.uX)(),(0,v.CE)("img",Q)):((0,v.uX)(),(0,v.CE)("span",q,(0,f.v_)(L.webhookId?"Update":"Add"),1))]),_:1},8,["disabled","onClick"])]),_:1}),(0,v.bF)(ae,{cols:"auto",md:"",class:"px-0 px-md-2 pb-2 pb-sm-0"},{default:(0,v.k6)(()=>[(0,v.bF)(ke,{ref:"sampleData",variant:"outline-light",disabled:!L.callBackUrl.length||!L.isUrlValid,class:"mc-btn py-1 px-3 py-md-2 px-md-5",onClick:t[13]||(t[13]=e=>te.sendSampledata(L.callBackUrl,L.allEvents))},{default:(0,v.k6)(()=>[...t[36]||(t[36]=[(0,v.eW)("Send sample data",-1)])]),_:1},8,["disabled"])]),_:1}),(0,v.bF)(ae,{cols:"auto"},{default:(0,v.k6)(()=>[(0,v.bF)(ke,{variant:"outline-light",class:"mc-btn py-1 px-3 py-md-2 px-md-5",onClick:t[14]||(t[14]=t=>e.$router.push("/transactional/settings"))},{default:(0,v.k6)(()=>[...t[37]||(t[37]=[(0,v.eW)("Cancel",-1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),(0,v.bF)(me,{modelValue:L.planExceed,"onUpdate:modelValue":t[15]||(t[15]=e=>L.planExceed=e)},null,8,["modelValue"]),(0,v.bF)(ge,{modelValue:L.secretPopup,"onUpdate:modelValue":t[18]||(t[18]=e=>L.secretPopup=e),"no-header-close":"","no-footer":"",centered:"",size:"md",titleTag:"div",headerClass:"d-block pb-2",bodyClass:"pt-0",contentClass:"wh-signing-modal","no-close-on-backdrop":!0,"no-close-on-esc":!0},{title:(0,v.k6)(()=>[(0,v.Lk)("div",K,[(0,v.Lk)("h5",O,(0,f.v_)(L.popupIsRotate?"Signing secret rotated":"Signing secret"),1),(0,v.Lk)("div",{class:"pop-close",onClick:t[16]||(t[16]=(...e)=>te.closeSecretPopup&&te.closeSecretPopup(...e))},[(0,v.bF)(oe,{size:"16"})])]),(0,v.Lk)("p",Y," Copy this secret now and store it securely. "+(0,f.v_)(L.popupIsRotate?"The previous secret keeps working for 24 hours.":"You can reveal or rotate it anytime from the webhook's Edit page."),1)]),default:(0,v.k6)(()=>[(0,v.Lk)("div",null,[(0,v.Lk)("div",Z,[(0,v.Lk)("span",G,(0,f.v_)(L.popupSecret),1),(0,v.bo)(((0,v.uX)(),(0,v.CE)("button",{type:"button",class:"wh-icon-btn",onClick:t[17]||(t[17]=(...e)=>te.copyPopupSecret&&te.copyPopupSecret(...e))},[L.popupCopied?((0,v.uX)(),(0,v.CE)("img",J)):((0,v.uX)(),(0,v.CE)("svg",ee,[...t[38]||(t[38]=[(0,v.Lk)("path",{d:"M10 1.3335H7.33333C6.97971 1.3335 6.64057 1.47397 6.39052 1.72402C6.14048 1.97407 6 2.31321 6 2.66683V10.0002C6 10.3538 6.14048 10.6929 6.39052 10.943C6.64057 11.193 6.97971 11.3335 7.33333 11.3335H12.6667C13.0203 11.3335 13.3594 11.193 13.6095 10.943C13.8595 10.6929 14 10.3538 14 10.0002V5.3335",stroke:"currentColor","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),(0,v.Lk)("path",{d:"M11.1373 1.80417C10.9882 1.65451 10.8109 1.53587 10.6157 1.45
1509C10.4205 1.37431 10.2113 1.33298 10 1.3335V4.66683C10 4.84365 10.0702 5.01321 10.1953 5.13824C10.3203 5.26326 10.4899 5.3335 10.6667 5.3335H14C14.0005 5.12224 13.9592 4.91297 13.8784 4.71776C13.7976 4.52256 13.679 4.34528 13.5293 4.19617L11.1373 1.80417Z",stroke:"currentColor","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),(0,v.Lk)("path",{d:"M3.33333 4.6665C2.97971 4.6665 2.64057 4.80698 2.39052 5.05703C2.14048 5.30708 2 5.64622 2 5.99984V13.3332C2 13.6868 2.14048 14.0259 2.39052 14.276C2.64057 14.526 2.97971 14.6665 3.33333 14.6665H8.66667C8.90071 14.6665 9.13063 14.6049 9.33331 14.4879C9.536 14.3708 9.70431 14.2025 9.82133 13.9998",stroke:"currentColor","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])),[[ve,L.popupCopied?"Copied":"Copy",void 0,{hover:!0}]])])])]),_:1},8,["modelValue"])])}s(18111),s(22489),s(7588);var se=s(99496),oe=s(42132);const ae={class:"ms-2"},le={class:"font-13 fw-bold mb-0"},ne={class:"font-13 mb-0 mt-1"},ie={class:"font-13 mb-0"};function re(e,t,s,o,l,n){const i=oe.t,r=a.t;return(0,v.uX)(),(0,v.CE)("span",ae,[(0,v.Lk)("span",{onClick:t[0]||(t[0]=e=>l.modalShow=!l.modalShow),class:"link-primary font-13"},"Need help?"),(0,v.bF)(r,{modelValue:l.modalShow,"onUpdate:modelValue":t[1]||(t[1]=e=>l.modalShow=e),modalClass:"right new-modal bg-light-blur",bodyClass:"pt-0",headerClass:"pb-5"},{title:(0,v.k6)(()=>[...t[2]||(t[2]=[(0,v.Lk)("span",{class:"font-20 fw-bold"},"Webhook Event Overview",-1)])]),footer:(0,v.k6)(()=>[(0,v.Lk)("p",ie,[t[4]||(t[4]=(0,v.eW)(" Learn more about ",-1)),(0,v.bF)(i,{href:"https://help.mailercloud.com/en/articles/132-getting-started-with-webhooks",target:"_blank"},{default:(0,v.k6)(()=>[...t[3]||(t[3]=[(0,v.eW)("webhook",-1)])]),_:1})])]),default:(0,v.k6)(()=>[((0,v.uX)(!0),(0,v.CE)(v.FK,null,(0,v.pI)(l.overview,e=>((0,v.uX)(),(0,v.CE)("div",{class:"mb-3",key:e.id},[(0,v.Lk)("p",le,(0,f.v_)(e.title),1),(0,v.Lk)("p",ne,(0,f.v_)(e.description),1)]))),128))]),_:1},8,["modelValue"])])}var de={data(){return{modalShow:!1,overview:[{title:"Sent",description:"This event is triggered when a campaign is sent."},{title:"Delivery",description:"This event is triggered when a campaign is delivered."},{title:"Bounce",description:"This event is triggered when your email is returned due to a permanent failure."},{title:"Spam",description:"This event is triggered when your email is marked as spam."},{title:"Reject",description:"This event is triggered when a send is rejected, for example when the recipient is on the suppression list."}]}}},ce=s(71241);const ue=(0,ce.A)(de,[["render",re]]);var he=ue,pe=s(28510),ke=s(44113),be=s(9086),me=s(62087),ge=s(42197),ve={setup(){const e=(0,me.S)();return{store:e}},mounted(){this.focusField("webhookNameInput")},components:{EventOverviewModal:he,Popper:pe.A,WebhookCountExceed:be.A,TransactionalMenuBar:se.A},created(){this.webhookId=this.$route.params.id,this.webhookId&&this.store.getWebhook(this.webhookId).then(e=>{this.webhookName=e.webhook.name,this.callBackUrl=e.webhook.url,this.allEvents=e.webhook.event,this.signingEnabled=!!e.webhook.signing_enabled,this.signingSecret=e.webhook.secret||"",this.secretRotatedAt=e.webhook.secret_rotated_at||""}),this.eventSources=(0,ke.N0)(),this.triggerEvents=(0,ke.XD)()},computed:{disabled(){return!(this.webhookName.trim().length&&this.allEvents.length&&this.callBackUrl.length&&this.isUrlValid)},searchedEvents(){return this.triggerEvents.filter(e=>e.event.toLowerCase().includes(this.searchVal.toLowerCase()))},maskedSecret(){return this.signingSecret?"•".repeat(32):""}},data(){return{loading:!1,webhookId:"",callBackUrl:"",allEvents:[],checkAllEvent:!1,webhookName:"",selectedSources:["adminuser"],eventSources:[],triggerEvents:[],searchVal:"",isUrlValid:!0,planExceed:!1,errorMessage:"",signingEnabled:!1,signingSecret:"",secretRotatedAt:"",secretRevealed:!1,secretLoading:!1,secretPopup:!1,popupSecret:"",popupIsRotate:!1,signAtCreate:!0,secretCopied:!1,popupCopied:!1,pendingNavigate:!1}},watch:{allEvents:{deep:!0,handler(e){e.length===this.triggerEvents.length?this.checkAllEvent=!0:this.checkAllEvent=!1}}},methods:{focusField(e){this.$refs[e].focus()},onToggleSigning(e){this.signingEnabled=e,this.manageSecret(e?"enable":"disable")},manageSecret(e){this.secretLoading=!0,this.store.manageWebhookSecret(this.webhookId,e).then(t=>{this.signingEnabled=!!t.signing_enabled,this.signingSecret=t.secret||"","rotate"!==e&&"disable"!==e||(this.secretRotatedAt=t.signing_enabled?(new Date).toISOString().slice(0,19).replace("T"," "):""),this.secretRevealed=!1,"enable"!==e&&"rotate"!==e||(this.popupSecret=t.secret||"",this.popupIsRotate="rotate"===e,this.secretPopup=!!this.popupSecret);const s={enable:"Payload signing enabled",rotate:"Signing secret rotated",disable:"Payload signing disabled"};
1this.$notify({text:s[e],type:"success"})}).catch(()=>{"enable"===e?this.signingEnabled=!1:"disable"===e&&(this.signingEnabled=!0),this.$notify({text:"Could not update payload signing. Please try again.",type:"error"})}).finally(()=>{this.secretLoading=!1})},copySecret(){this.copyToClipboard(this.signingSecret,"secretCopied")},copyPopupSecret(){this.copyToClipboard(this.popupSecret,"popupCopied")},copyToClipboard(e,t){e&&navigator.clipboard.writeText(e).then(()=>{t&&(this[t]=!0,setTimeout(()=>{this[t]=!1},2e3))}).catch(()=>{this.$notify({text:"Could not copy secret",type:"error"})})},closeSecretPopup(){this.secretPopup=!1,this.pendingNavigate&&(this.pendingNavigate=!1,this.$router.push("/transactional/settings"))},createWebhook(){const e={name:this.webhookName.trim(),url:this.callBackUrl,events:this.allEvents};this.loading=!0,this.webhookId?this.store.updateWebhook(this.webhookId,e).then(()=>{this.loading=!1,this.$router.push("/transactional/settings"),this.$notify({text:"Webhook updated successfully",type:"success"})}).catch(e=>{"Webhook URL already exists"===e.error?this.errorMessage="This URL is already in use by another webhook. Please choose a different URL.":"url"==e.error[0].field&&(this.errorMessage=e.error[0].message),this.loading=!1,this.isUrlValid=!1,this.focusField("webhookUrlInput")}):this.store.createWebhook(e).then(e=>{this.loading=!1,this.$notify({text:"Webhook created successfully",type:"success"});const t=e&&e.id?e.id:"";this.signAtCreate&&t?(this.pendingNavigate=!0,this.store.manageWebhookSecret(t,"enable").then(e=>{this.popupSecret=e.secret||"",this.popupIsRotate=!1,this.secretPopup=!!this.popupSecret,this.popupSecret||this.closeSecretPopup()}).catch(()=>{this.pendingNavigate=!1,this.$router.push("/transactional/settings")})):this.$router.push("/transactional/settings")}).catch(e=>{"Webhook quota exceeded."===e.error?this.planExceed=!0:"Webhook URL already exists"===e.error?this.errorMessage="This URL is already in use by another webhook. Please choose a different URL.":"url"==e.error[0].field&&(this.errorMessage=e.error[0].message),this.isUrlValid=!!this.planExceed,this.focusField("webhookUrlInput"),this.loading=!1})},checkAllEvents(e){e?this.allEvents=[]:this.triggerEvents.forEach(e=>{this.allEvents.includes(e.value)||this.allEvents.push(e.value)})},validateUrl(e){const t=/^(https?:\/\/)?([\w.\u00C0-\u024F-]+)\.([a-z\u00C0-\u024F]{2,6}\.?)(\/[\w\u002D~.@#$%&*+?:_/=]*)?$/i;this.isUrlValid=t.test(e)},focusName(){document.getElementById("webhookName").focus()},sendSampledata(e,t){setTimeout(()=>{this.$refs.sampleData.$el.blur()},200);let s="sampToast";this.$notify({id:s,text:"Sending sample data, please wait...",type:"loading",duration:3e4});const o={identifier:e,events:t};ge.A.testWebhook(o).then(()=>
1{this.$notify.close(s),this.$notify({text:"Sample data sent successfully",type:"success"})}).catch(()=>{this.$notify.close(s),this.$notify({text:"Sample data sent failed",type:"error"})})}}};const fe=(0,ce.A)(ve,[["render",te],["__scopeId","data-v-8a6e3a9a"]]);var we=fe},20666:function(e,t,s){s.d(t,{t:function(){return n}});var o=s(67413),a=s(56768),l=s(90144),n=(e,t="px")=>(0,a.EW)(()=>{const s=(0,l.BA)(e),a=(0,l.BA)(t);return o.f.test(String(s))?`${Number(s)}${a}`:s})},72807:function(e,t,s){s.d(t,{t:function(){return l}});var o=s(56768),a=s(90144),l=e=>{const t=(e,t)=>{const s=null===t?"":`-${t}`;return"circle"===e?`rounded${s}-circle`:"pill"===e?`rounded${s}-pill`:"number"===typeof e||"0"===e||"1"===e||"2"===e||"3"===e||"4"===e||"5"===e?`rounded${s}-${e}`:"none"===e?`rounded${s}-0`:"sm"===e?`rounded${s}-1`:"lg"===e?`rounded${s}-5`:`rounded${s}`};return(0,o.EW)(()=>{const s=(0,a.BA)(e);return{[`${t(s.rounded,null)}`]:!!s.rounded,[`${t(s.roundedTop,"top")}`]:!!s.roundedTop,[`${t(s.roundedBottom,"bottom")}`]:!!s.roundedBottom,[`${t(s.roundedStart,"start")}`]:!!s.roundedStart,[`${t(s.roundedEnd,"end")}`]:!!s.roundedEnd}})}}}]);
2//# sourceMappingURL=TransactionalWebhookEdit.822b4628.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.