(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3747],{38397:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/notifications/templates/add-template",function(){return n(6016)}])},6016:function(e,t,n){"use strict";n.r(t);var i=n(24246),r=n(812),s=n(77830),a=n(39158),u=n(86677),l=n(77213),c=n(58754),o=n(46628),d=n(67810),p=n(47466),h=n(5058),f=n(20149),_=n(31883);t.default=()=>{let e=(0,a.pmc)(),t=(0,u.useRouter)(),{templateType:n}=t.query,[m]=(0,h.Vw)(),{data:b,isLoading:x}=(0,p.KC)(n),j=async i=>{var a;let u={is_enabled:i.is_enabled,content:{subject:i.content.subject,body:i.content.body},properties:[]};null===(a=i.properties)||void 0===a||a.forEach(e=>{var t;return null===(t=u.properties)||void 0===t?void 0:t.push(e.id)});let l=await m({templateType:n,template:u});if((0,_.D4)(l)){e((0,o.Vo)((0,r.e$)(l.error)));return}e((0,o.t5)("Messaging template created successfully")),t.push(s.Wi)};return b?x?(0,i.jsx)(a.$jN,{}):(0,i.jsx)(l.Z,{title:"Configure Message",children:(0,i.jsx)(c.Z,{heading:"Templates",breadcrumbItems:[{title:"Templates",href:s.Wi},{title:"".concat(d.Z[b.type])}],children:(0,i.jsx)(a.xuv,{maxWidth:"720px",children:(0,i.jsx)(a.xuv,{padding:2,children:(0,i.jsx)(f.Z,{template:b,handleSubmit:j})})})})}):null}}},function(e){e.O(0,[7630,2888,9774,179],function(){return e(e.s=38397)}),_N_E=e.O()}]);