# bit-form/2.10.0/assets/bf-945-192.js

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 2.10.0. 2 lines.

- Page: https://pluginprobe.com/plugins/bit-form/2.10.0/code/assets/bf-945-192.js
- Raw: https://pluginprobe.com/plugins/bit-form/2.10.0/raw/assets/bf-945-192.js
- Modified: 2024-02-12T11:55:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/2.10.0/code/assets/bf-945-192.js#L10-L20`.

```javascript
var M=Object.defineProperty,B=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var T=(t,s,l)=>s in t?M(t,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[s]=l,r=(t,s)=>{for(var l in s||(s={}))I.call(s,l)&&T(t,l,s[l]);if(j)for(var l of j(s))P.call(s,l)&&T(t,l,s[l]);return t},d=(t,s)=>B(t,A(s));import{r as y,k as _,u as $,t as H,v as R,a as D,j as e,M as G,_ as m,N as L,b as N,ak as O,c0 as V,$ as W,p as g}from"./main-162.js";import{B as q}from"./bf-644-69.js";import{S as z}from"./bf-361-122.js";import{T as J}from"./bf-399-118.js";import"./bf-917-73.js";function ee(){var x;const[t,s]=y.useState({title:"New Template",sub:"Email Subject",body:"Email Body"}),[l,f]=_(O),o=$(V),[v,w]=y.useState(!1),{formType:p,formID:n}=H(),S=R(),{css:u}=D(),F=$(W),{isPro:h}=F,k=a=>{s(i=>g(i,c=>{c.body=a}))},b=({target:{name:a,value:i}})=>{s(c=>d(r({},c),{[a]:i}))},C=()=>{const a=g(l,i=>{i.push(t),i.push({updateTem:1})});f(a),S(`/form/settings/${p}/${n}/email-templates`)},E=({target:{value:a}})=>{s(i=>d(r({},i),{sub:i.sub+a})),setTimeout(()=>{a=""},100)};return e.jsxs("div",{style:{width:900},children:[e.jsx(G,{show:v,setModal:w,title:m("Browse Template"),children:e.jsx("h4",{className:"txt-dp",children:m("Email Templates Coming soon")})}),e.jsxs(L,{to:`/form/settings/${p}/${n}/email-templates`,className:`${u(N.btn)} btcd-btn-o-gray`,children:[e.jsx(q,{className:"mr-1"}),m("Back")]}),e.jsx("button",{id:"secondary-update-btn",onClick:C,className:`${u(N.btn)} blue f-right`,type:"button",children:m("Save Template")}),e.jsxs("div",{className:"mt-3 flx",children:[e.jsxs("b",{style:{width:103},children:[m("Template Name:")," "]}),e.jsx("input",{onChange:b,name:"title",type:"text",className:"btcd-paper-inp w-9",placeholder:"Name",value:t.title})]}),e.jsxs("div",{className:"mt-3 flx",children:[e.jsx("b",{style:{width:100},children:"Subject:"}),e.jsx("input",{onChange:b,name:"sub",type:"text",className:"btcd-paper-inp w-7",placeholder:"Email Subject Here",value:t.sub}),e.jsxs("select",{onChange:E,className:"btcd-paper-inp ml-2",style:{width:150},children:[e.jsx("option",{value:"",children:m("Add field")}),e.jsx("optgroup",{label:"Form Fields",children:o!==null&&o.map(a=>!a.type.match(/^(file-up|recaptcha)$/)&&e.jsx("option",{value:`\${${a.key}}`,children:a.name},a.key))}),e.jsx("optgroup",{label:`General Smart Codes ${h?"":"(PRO)"}`,children:h&&((x=z)==null?void 0:x.map(a=>e.jsx("option",{value:`\${${a.name}}`,children:a.label},`ff-rm-${a.name}`)))})]})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("b",{children:m("Body:")}),e.jsx("label",{htmlFor:`mail-tem-${n}`,className:"mt-2 w-10",children:e.jsx(J,{id:`mail-tem-${n}`,formFields:o,value:t.body,onChangeHandler:k,width:"100%",mapAllFieldWithTable:!0,mapAllField:!0})})]})]})}export{ee as default};

```
