Jake Vanderwerf
2026-09-04 32ce5c542c90be348895328078e392dde2052957
1
(()=>{"use strict";var e={677(){const e=window.wp.blocks,l=window.wp.i18n,t=window.wp.blockEditor,i=window.wp.components,a=window.wp.element,s=window.ReactJSXRuntime;(0,e.registerBlockType)("jvb/forms",{edit:function({attributes:e,setAttributes:o}){const{formType:r,showLabels:b,customEmailTo:n,turnstileEnabled:d}=e,[c,v]=(0,a.useState)(!0),j=(0,t.useBlockProps)({className:"jvb-form-block "+(r?`jvb-form-block-${r}`:"")}),u="undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.formTypes?window.jvbFormsData.formTypes:[{label:(0,l.__)("Select a form type","jvb"),value:""},{label:(0,l.__)("No forms available","jvb"),value:"",disabled:!0}],p=(console.log(window.jvbFormsData),"undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.availableForms?window.jvbFormsData.availableForms:{}),m=(()=>{const e=r&&p[r]?p[r]:null;return e?{title:e.title||(0,l.__)("Form","jvb"),description:Array.isArray(e.description)?e.description.join(" "):e.description||"",button:e.submit||(0,l.__)("Submit","jvb")}:{title:(0,l.__)("Form","jvb"),description:r?(0,l.__)("Loading form configuration...","jvb"):(0,l.__)("Please select a form type in the sidebar","jvb"),button:(0,l.__)("Submit","jvb")}})();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.InspectorControls,{children:[(0,s.jsxs)(i.PanelBody,{title:(0,l.__)("Form Settings","jvb"),children:[(0,s.jsx)(i.SelectControl,{label:(0,l.__)("Form Type","jvb"),value:r,options:u,onChange:e=>o({formType:e})}),(0,s.jsx)(i.ToggleControl,{label:(0,l.__)("Show Field Labels","jvb"),checked:b,onChange:e=>o({showLabels:e}),help:(0,l.__)("Toggle to show or hide field labels.","jvb")}),(0,s.jsx)(i.TextControl,{label:(0,l.__)("Custom Recipient Email","jvb"),value:n||"",onChange:e=>o({customEmailTo:e}),help:(0,l.__)("Leave empty to use the default email.","jvb"),type:"email"})]}),(0,s.jsxs)(i.PanelBody,{title:(0,l.__)("Form Preview","jvb"),initialOpen:!1,children:[(0,s.jsx)(i.ToggleControl,{label:(0,l.__)("Show Preview","jvb"),checked:c,onChange:e=>v(e)}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,l.__)("This is just a preview. The actual form will be rendered on the frontend.","jvb")})]})]}),(0,s.jsx)("div",{...j,children:c?(()=>{if(!r)return(0,s.jsx)(i.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("Please select a form type in the block settings.","jvb")});let e=[];switch(r){case"contact":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",required:!0},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",required:!0},{id:"phone",label:(0,l.__)("Phone","jvb"),type:"tel",required:!0},{id:"instagram",label:(0,l.__)("Instagram URL","jvb"),type:"url"},{id:"contact_methods",label:(0,l.__)("Preferred Contact","jvb"),type:"checkboxes",options:[{value:"text",label:(0,l.__)("Text","jvb")},{value:"call",label:(0,l.__)("Call","jvb")},{value:"email",label:(0,l.__)("Email","jvb")},{value:"instagram",label:(0,l.__)("Instagram","jvb")}]},{id:"message",label:(0,l.__)("Your Message","jvb"),type:"textarea",required:!0}];break;case"feature_request":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"target_audience",label:(0,l.__)("This Feature is For","jvb"),type:"checkboxes",options:[{value:"artists",label:(0,l.__)("Artists","jvb")},{value:"visitors",label:(0,l.__)("Site Visitors","jvb")},{value:"partners",label:(0,l.__)("Partners","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"feature_name",label:(0,l.__)("Name your Feature","jvb"),type:"text",required:!0},{id:"message",label:(0,l.__)("Describe Your Feature","jvb"),type:"textarea",required:!0}];break;case"technical_issue":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text"},{id:"email",label:(0,l.__)("Email","jvb"),type:"email"},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"issue_type",label:(0,l.__)("Type of Issue","jvb"),type:"checkboxes",options:[{value:"visual",label:(0,l.__)("Visual","jvb")},{value:"error",label:(0,l.__)("Error Page","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"message",label:(0,l.__)("Please describe the issue.","jvb"),type:"textarea",required:!0}]}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"jvb-form-title",children:m.title}),(0,s.jsx)("p",{className:"jvb-form-description",children:m.description}),(0,s.jsxs)("div",{className:"jvb-form-preview",children:[e.map(e=>(0,s.jsxs)("div",{className:"jvb-form-field",children:[b&&(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,className:e.required?"required":"",children:e.label}),"text"===e.type&&(0,s.jsx)("input",{type:"text",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"email"===e.type&&(0,s.jsx)("input",{type:"email",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"tel"===e.type&&(0,s.jsx)("input",{type:"tel",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"url"===e.type&&(0,s.jsx)("input",{type:"url",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"textarea"===e.type&&(0,s.jsx)("textarea",{id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0,rows:"4"}),"checkbox"===e.type&&(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,children:e.label})]}),"checkboxes"===e.type&&e.options&&(0,s.jsx)("div",{className:"jvb-form-checkboxes",children:e.options.map(l=>(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}-${l.value}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}-${l.value}`,children:l.label})]},l.value))}),e.help&&(0,s.jsx)("p",{className:"jvb-form-help",children:e.help})]},e.id)),d&&(0,s.jsx)("div",{className:"jvb-form-turnstile",children:(0,s.jsx)("div",{className:"jvb-turnstile-placeholder",children:(0,s.jsx)("span",{children:(0,l.__)("Cloudflare Turnstile will appear here","jvb")})})}),(0,s.jsx)("div",{className:"jvb-form-submit",children:(0,s.jsx)("button",{type:"button",className:"jvb-form-button",children:m.button})})]})]})})():(0,s.jsxs)("div",{className:"jvb-form-placeholder",children:[(0,s.jsx)("h3",{children:m.title}),(0,s.jsx)("p",{children:(0,l.__)("Form preview is hidden. Edit settings in the sidebar.","jvb")})]})})]})},save:function(){return null}})}};const l={};function t(i){const a=l[i];if(void 0!==a)return a.exports;const s=l[i]={exports:{}};return e[i](s,s.exports,t),s.exports}t.m=e,(()=>{const e=[];t.O=(l,i,a,s)=>{if(i){s||=0;for(var o=e.length;o>0&&e[o-1][2]>s;o--)e[o]=e[o-1];return void(e[o]=[i,a,s])}let r=1/0;for(o=0;o<e.length;o++){let[i,a,s]=e[o],n=!0;for(var b=0;b<i.length;b++)1&s&&!(r>=s)||!Object.keys(t.O).every(e=>t.O[e](i[b]))?(n=!1,s<r&&(r=s)):i.splice(b--,1);if(n){e.splice(o--,1);const t=a();void 0!==t&&(l=t)}}return l}})(),t.o=(e,l)=>Object.hasOwn(e,l),(()=>{const e={637:0,705:0};t.O.j=l=>0===e[l];const l=(l,i)=>{let[a,s,o]=i;var r,b,n=0;if(a.some(l=>0!==e[l])){for(r in s)t.o(s,r)&&(t.m[r]=s[r]);if(o)var d=o(t)}for(l&&l(i);n<a.length;n++)b=a[n],t.o(e,b)&&e[b]&&e[b][0](),e[b]=0;return t.O(d)},i=globalThis.webpackChunkjvb||=[];i.forEach(l.bind(null,0)),i.push=l.bind(null,i.push.bind(i))})();let i=t.O(void 0,[705],()=>t(677));i=t.O(i)})();