PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.2 3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 All 139 releases
bit-form / assets / bf-771-65.js

bf-771-65.js in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder V3.3.2, at assets/bf-771-65.js

2 lines 5.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var J=Object.defineProperty;var O=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var R=(d,r,l)=>r in d?J(d,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):d[r]=l,u=(d,r)=>{for(var l in r||(r={}))W.call(r,l)&&R(d,l,r[l]);if(O)for(var l of O(r))Q.call(r,l)&&R(d,l,r[l]);return d};import{r as _,dK as X,a as Y,j as e,_ as n,G as Z,I as S,bu as H,L as ee,dL as ae,b as w,K as se,c as te}from"./main-96.js";/* empty css */import{B as C,m as le,l as ne}from"./bf-781-46.js";function oe({formID:d,formFields:r,webHooks:l,setWebHooks:o,step:re,setstep:U,setSnackbar:v,create:V,isInfo:i}){var E;const[$]=_.useState(()=>r.filter(a=>!X.includes(a.typ))),P=a=>{if(!a)return null;const s=[],c=/(\?|&)([^=&#]*)=?([^&#]*)/g;let t;for(;(t=c.exec(a))!==null;)s.push(`${t[1]}${t[2]}=${t[3]}`);return s.length?s:null},[A,g]=_.useState(!1),B=["GET","POST","PUT","PATCH","OPTION","DELETE","TRACE","CONNECT"],{css:z}=Y(),T=_.useRef(null),D=a=>{try{return JSON.stringify(a,null,2)}catch(s){return a}},I=a=>{g(!0),te({hookDetails:a},"bitforms_test_webhook").then(s=>{if(s&&s.success)T.current.innerHTML=`<pre>${D(s.data.response)}</pre>`,v({show:!0,msg:n(s.data.msg)}),g(!1);else if(s&&s.data){const c=typeof s.data=="string"?s.data:"Unknown error";v({show:!0,msg:`${c}. ${n("please try again")}`}),g(!1)}else v({show:!0,msg:n("Webhook tests failed. please try again")}),g(!1)})},k=(a,s,c,t)=>{const m=u({},l),{url:f}=m,[N,F=""]=f.split("?");if(!F){m.url=N,o(m);return}const h=F.split("&").map(p=>{const[j,y]=p.split("=");return{[j]:y}}),x=t;if(x!==-1)if(a==="key"){const p=Object.keys(h[x])[0],j=h[x][p];h[x]={[s]:j}}else{const p=Object.keys(h[x])[0];h[x]={[p]:s}}const L=h.map(p=>{const j=Object.keys(p)[0],y=p[j];return`${j}=${y}`}).join("&");m.url=L?`${N}?${L}`:N,o(m)},b=a=>{const s=u({},l);s[a.target.name]=a.target.value,o(u({},s))},K=(a,s)=>{const c=u({},l),t=s.split("=");t[1]=a,c.url=c.url.replace(s,t.join("=")),o(c)},q=()=>{const a=u({},l);a.url.match(/\?/g)!==null?a.url+="&key=value":a.url+="?key=value",o(a)},G=a=>{const s=u({},l),{url:c}=s,[t,m]=c.split("?");if(!m){s.url=t,o(s);return}const f=m.split("&");f.splice(a,1);const N=f.length>0?`${t}?${f.join("&")}`:t;s.url=N,o(s)},M=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),U(2)};return e.jsxs("div",{style:{width:i&&900},children:[e.jsx("div",{className:"flx ",children:e.jsxs("div",{className:"w-7 mr-2 mb-4 mt-2",children:[e.jsx("div",{className:"f-m",children:n("Integration name")}),e.jsx("input",{name:"name",onChange:a=>b(a),className:"btcd-paper-inp mt-1",type:"text",value:l.name,disabled:i})]})}),e.jsxs("div",{className:"flx flx-start",children:[e.jsxs("div",{className:"w-7",children:[e.jsx("div",{className:"f-m",children:n("Link:")}),e.jsx("input",{name:"url",onChange:a=>b(a),className:"btcd-paper-inp mt-1",type:"text",value:l.url,disabled:i}),(l==null?void 0:l.apiConsole)&&e.jsxs("small",{className:"d-blk mt-2",children:[n("To got Webhook , Please Visit")," ",e.jsx("a",{className:"btcd-link",href:l.apiConsole,target:"_blank",rel:"noreferrer",children:n(`${l.type} Dashboard`)})]})]}),e.jsxs("div",{className:"w-3 px-1",children:[e.jsx("div",{className:"f-m",children:n("Method:")}),e.jsx("select",{name:"method",onChange:a=>b(a),defaultValue:l.method,className:"btcd-paper-inp mt-1",disabled:i,children:B.map((a,s)=>e.jsx("option",{value:a,children:a},`method-${s*2}`))})]})]}),e.jsx("br",{}),e.jsx("div",{className:"f-m",children:n("Add Url Parameter: (optional)")}),e.jsx("div",{className:"btcd-param-t-wrp mt-1",children:e.jsxs("div",{className:"btcd-param-t",children:[e.jsxs("div",{className:"tr",children:[e.jsx("div",{className:"td",children:n("Key")}),e.jsx("div",{className:"td",children:n("Value")})]}),P(l.url)!==null&&((E=P(l.url))==null?void 0:E.map((a,s)=>{var c;return e.jsxs("div",{className:"tr",children:[e.jsx("div",{className:"td",children:e.jsx("input",{className:"btcd-paper-inp p-i-sm",onChange:t=>k("key",t.target.value,a,s),type:"text",value:a.split("=")[0].substr(1),disabled:i})}),e.jsx("div",{className:"td",children:e.jsx("input",{className:"btcd-paper-inp p-i-sm",onChange:t=>k("val",t.target.value,a,s),type:"text",value:a.split("=")[1],disabled:i})}),!i&&e.jsxs("div",{className:"flx p-atn",children:[e.jsx(C,{onClick:()=>G(s),icn:!0,children:e.jsx(Z,{size:16})}),e.jsxs("select",{className:"btcd-paper-inp p-i-sm",name:"",id:"",onChange:t=>K(t.target.value,a),defaultValue:a.split("=")[1],children:[e.jsx("option",{value:"",children:n("Add field")}),e.jsx("optgroup",{label:"Form Fields",children:$!==null&&$.map(t=>!t.type.match(/^(recaptcha)$/)&&e.jsx("option",{value:`\${${t.key}}`,children:t.name},t.key))}),e.jsx("optgroup",{label:`General Smart Codes ${S?"":"(PRO)"}`,children:S&&((c=le)==null?void 0:c.map(t=>!t.name.match(/^(bf_all_data|bf_all_data.onlyValues|_bf_separator|_bf_math\(\)|_bf_concat\(\)|_bf_datetime_difference\(\)|_bf_query_param\(\))$/)&&e.jsx("option",{value:`\${${t.name}}`,children:t.label},`ff-rm-${t.name}`)))})]})]})]},`fu-1${s*3}`)})),!i&&e.jsx(C,{onClick:()=>q(),className:"add-pram",icn:!0,children:e.jsx(H,{size:"14",className:"icn-rotate-45"})})]})}),!i&&e.jsxs(e.Fragment,{children:[e.jsxs(C,{onClick:()=>I(l),className:z(w.btn,w.btn_blue_otln),children:[n("Test Webhook"),A&&e.jsx(ee,{size:14,clr:"#022217",className:"ml-2"}),e.jsx(ae,{size:18,className:"ml-1"})]}),e.jsxs("div",{className:"wh-resp-box",children:[e.jsx("div",{className:"f-m wh-resp-box-title",children:n("Response:")}),e.jsx("div",{className:"wh-resp-box-content",ref:T,children:"Test Webhook to see the response."})]})]}),e.jsxs("small",{className:"d-blk mt-2 mb-2",children:[n("Try our free webhook test website: "),e.jsx("a",{className:"btcd-link",href:"https://app.webhook.is/test",target:"_blank",rel:"noreferrer",children:"https://app.webhook.is/test"})]}),V&&e.jsxs(se,{variant:"success",onClick:()=>M(),type:"button",children:[n("Next"),e.jsx(ne,{className:"ml-1 rev-icn"})]})]})}export{oe as default};
2