@rtstic.dev/pulse 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var P=Object.create;var y=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var D=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of S(t))!k.call(e,o)&&o!==r&&y(e,o,{get:()=>t[o],enumerable:!(n=M(t,o))||n.enumerable});return e};var q=(e,t,r)=>(r=e!=null?P(F(e)):{},w(t||!e||!e.__esModule?y(r,"default",{value:e,enumerable:!0}):r,e));console.log("Book a demo form script loaded");var N=["text","email","phone","checkbox","radio","select","legal"],x=["true","atleast-one","only-one"],l={REQUIRED_INPUT:"ERR_REQUIRED",REQUIRED_LEGAL:"ERR_LEGAL_REQUIRED",REQUIRED_SELECT:"ERR_SELECT_REQUIRED",ATLEAST_ONE:"ERR_ATLEAST_ONE",ONLY_ONE_NONE:"ERR_ONLY_ONE_NONE",ONLY_ONE_EXCEEDED:"ERR_ONLY_ONE_EXCEEDED",INVALID_EMAIL:"ERR_INVALID_EMAIL",INVALID_PHONE:"ERR_INVALID_PHONE",PHONE_TOO_SHORT:"ERR_PHONE_TOO_SHORT",PHONE_TOO_LONG:"ERR_PHONE_TOO_LONG",PHONE_INVALID_COUNTRY:"ERR_PHONE_INVALID_COUNTRY"},c={[l.REQUIRED_INPUT]:"This field is required.",[l.REQUIRED_LEGAL]:"You must accept this to continue.",[l.REQUIRED_SELECT]:"Please select an option.",[l.ATLEAST_ONE]:"Please select at least one option.",[l.ONLY_ONE_NONE]:"Please select one option.",[l.ONLY_ONE_EXCEEDED]:"Only one option can be selected.",[l.INVALID_EMAIL]:"Please enter a valid email address.",[l.INVALID_PHONE]:"Please enter a valid phone number.",[l.PHONE_TOO_SHORT]:"Phone number is too short.",[l.PHONE_TOO_LONG]:"Phone number is too long.",[l.PHONE_INVALID_COUNTRY]:"Invalid country code."},L="pulse-form-error",_=new Map;function b(e){try{let t=e.getSelectedCountryData?.();if(!t?.dialCode)return;document.querySelectorAll('input[pulse-form-field="country-code"]').forEach(n=>{n.value=`+${t.dialCode}`})}catch(t){console.warn("[PulseForm] Error filling country code:",t)}}function C(){let e=window.intlTelInput;if(!e){console.warn(`[PulseForm] intlTelInput not found on window. Make sure you include the intl-tel-input script before this script.
2
- e.g. <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js"><\/script>`);return}document.querySelectorAll('[pulse-form-block="phone"] input[type="tel"]').forEach(r=>{try{let n=e(r,{initialCountry:"us",separateDialCode:!0,strictMode:!1,loadUtils:()=>import("https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js")});_.set(r,n),b(n),r.addEventListener("countrychange",()=>{b(n)}),console.log(`[PulseForm] intl-tel-input initialized for "${r.closest("[pulse-form-block]")?.getAttribute("pulse-field-name")||"unknown"}"`)}catch(n){console.warn("[PulseForm] Failed to init intl-tel-input:",n)}})}var V={0:l.INVALID_PHONE,1:l.PHONE_INVALID_COUNTRY,2:l.PHONE_TOO_SHORT,3:l.PHONE_TOO_LONG,4:l.INVALID_PHONE};function U(e){return e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{code:l.INVALID_EMAIL,message:c[l.INVALID_EMAIL]}:null}function B(e){let t=e.value.trim();if(!t)return null;let r=_.get(e);if(r)try{if(r.isValidNumber())return null;let o=r.getValidationError?.()??0,s=V[o]||l.INVALID_PHONE;return{code:s,message:c[s]}}catch{return{code:l.INVALID_PHONE,message:c[l.INVALID_PHONE]}}let n=t.replace(/\D/g,"");return n.length<7?{code:l.PHONE_TOO_SHORT,message:c[l.PHONE_TOO_SHORT]}:n.length>15?{code:l.PHONE_TOO_LONG,message:c[l.PHONE_TOO_LONG]}:null}function Y(e){let t=e.querySelector("input, textarea");return t?t.value.trim():null}function Q(e){let t=e.querySelector('input[type="email"]');return t?t.value.trim():null}function G(e){let t=e.querySelector('input[type="tel"]');return t?t.value.trim():null}function $(e){let t=e.querySelectorAll('input[type="checkbox"]'),r=[];return t.forEach(n=>{if(n.checked){let o=n.getAttribute("data-name")?.trim();r.push(o||n.value||"on")}}),r}function j(e){let t=e.querySelectorAll('input[type="radio"]');for(let r of t)if(r.checked)return r.closest("label")?.textContent?.trim()||r.value||"on";return null}function W(e){let t=e.querySelector("select");if(!t)return null;let r=t.value.trim();return!r||t.selectedIndex===0?null:r}function X(e){let t=e.querySelector('input[type="checkbox"]');return t?t.checked:!1}function I(e,t){switch(e){case"text":return Y(t);case"email":return Q(t);case"phone":return G(t);case"checkbox":return $(t);case"radio":return j(t);case"select":return W(t);case"legal":return X(t);default:return null}}function A(e){let t=e.getAttribute("required-selection")?.trim().toLowerCase();return!t||!x.includes(t)?null:t}function z(e){return e.getAttribute("mirror-value")?.trim().toLowerCase()==="true"}function g(e,t,r,n){if(t)switch(t){case"true":{if(e==="legal"&&r!==!0)return{code:l.REQUIRED_LEGAL,message:c[l.REQUIRED_LEGAL]};if(e==="select"&&!r)return{code:l.REQUIRED_SELECT,message:c[l.REQUIRED_SELECT]};if((e==="text"||e==="email"||e==="phone")&&(!r||typeof r=="string"&&r===""))return{code:l.REQUIRED_INPUT,message:c[l.REQUIRED_INPUT]};break}case"atleast-one":{if(Array.isArray(r)?r.length===0:!r)return{code:l.ATLEAST_ONE,message:c[l.ATLEAST_ONE]};break}case"only-one":{if(Array.isArray(r)){if(r.length===0)return{code:l.ONLY_ONE_NONE,message:c[l.ONLY_ONE_NONE]};if(r.length>1)return{code:l.ONLY_ONE_EXCEEDED,message:c[l.ONLY_ONE_EXCEEDED]}}else if(!r)return{code:l.ONLY_ONE_NONE,message:c[l.ONLY_ONE_NONE]};break}}if(e==="email"&&typeof r=="string"&&r){let o=U(r);if(o)return o}if(e==="phone"&&typeof r=="string"&&r){let o=n.querySelector('input[type="tel"]');if(o){let s=B(o);if(s)return s}}return null}function h(e){let t=document.querySelectorAll("[pulse-form-block]"),r=[];return t.forEach(n=>{let o=n.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!o||!N.includes(o))return;let s=o,a=n.getAttribute("pulse-field-name")?.trim();if(!a)return;let u=A(n),d=z(n),T=I(s,n),H=e?g(s,u,T,n):null;r.push({"form-block":s,"field-name":a,value:T,required:u,"mirror-value":d,error:H})}),r}function R(){document.querySelectorAll(`.${L}`).forEach(e=>e.remove()),document.querySelectorAll("[pulse-form-block]").forEach(e=>e.classList.remove("has-error"))}function J(e){let t=e.querySelector(`.${L}`);t&&t.remove(),e.classList.remove("has-error")}function v(e,t){let r=e.querySelector(`.${L}`);r&&r.remove();let n=document.createElement("span");n.className=L,n.textContent=t.message,n.setAttribute("data-error-code",t.code),n.setAttribute("data-field-name",e.getAttribute("pulse-field-name")?.trim()||""),e.classList.add("has-error"),e.appendChild(n)}function K(e){R(),document.querySelectorAll("[pulse-form-block]").forEach(r=>{let n=r.getAttribute("pulse-field-name")?.trim();if(!n)return;let o=e.find(s=>s["field-name"]===n);!o||!o.error||v(r,o.error)})}function Z(){let e=document.querySelector("[pulse-form-block].has-error");if(!e)return;e.scrollIntoView({behavior:"smooth",block:"center"});let t=e.querySelector("input, textarea, select");t&&setTimeout(()=>t.focus(),400)}function m(){let e=i.filter(r=>r["mirror-value"]===!0);if(e.length===0)return;let t=document.querySelectorAll("[pulse-form-block-mirror]");e.forEach(r=>{let n=r["field-name"],o=!1;t.forEach(s=>{if(s.getAttribute("pulse-form-block-mirror")?.trim()!==n)return;o=!0;let u=s.querySelector("input, textarea, select");if(!u){console.warn(`[PulseForm] Mirror target for "${n}" found, but no input element inside it.`);return}let d=r.value;typeof d=="string"?u.value=d:typeof d=="boolean"?u instanceof HTMLInputElement&&u.type==="checkbox"?u.checked=d:u.value=String(d):Array.isArray(d)?u.value=d.join(", "):u.value=""}),o||console.warn(`[PulseForm] No mirror target found for field "${n}". Add an element with attribute pulse-form-block-mirror="${n}" to mirror this value.`)})}var ee={"Financial Services":"david",Sports:"steven",Beauty:"albany",Music:"steven","Customer Packaged Goods":"david",Other:"david"};function te(){let e=i.find(n=>n["field-name"]==="industry");if(!e||typeof e.value!="string"||!e.value)return;let t=ee[e.value];document.querySelectorAll("[hs-calender]").forEach(n=>{let o=n.getAttribute("hs-calender")?.trim();t&&o===t?n.setAttribute("hs-calender-active","true"):n.setAttribute("hs-calender-active","false")})}function E(){let e=i.find(n=>n["field-name"]==="flow-type");if(!e)return;let t=e.value;document.querySelectorAll("[form-flow]").forEach(n=>{n.getAttribute("form-flow")?.trim()===t?n.setAttribute("form-flow-active","true"):n.setAttribute("form-flow-active","false")}),t==="White Glove services"&&te()}function f(){let e=i.find(o=>o["field-name"]==="flow-type");if(!e)return;let t=e.value,r=i.findIndex(o=>o["field-name"]==="industry"),n=i.findIndex(o=>o["field-name"]==="what-are-you-looking-for");r!==-1&&(i[r]={...i[r],required:null}),n!==-1&&(i[n]={...i[n],required:null}),t==="White Glove services"&&r!==-1?i[r]={...i[r],required:"true"}:t==="Pulse demo"&&n!==-1&&(i[n]={...i[n],required:"atleast-one"}),window.PulseFormData=i}var i=[];function p(e,t,r){let n=i.findIndex(o=>o["field-name"]===e);n!==-1&&(i[n]={...i[n],value:t,error:r},window.PulseFormData=i,f(),m(),E())}function ne(e){let t=e.getAttribute("pulse-form-block")?.trim().toLowerCase(),r=e.getAttribute("pulse-field-name")?.trim();if(!r)return;let n=A(e),o=I(t,e);if(e.classList.contains("has-error")){let a=g(t,n,o,e);a?(v(e,a),p(r,o,a)):(J(e),p(r,o,null))}else p(r,o,null)}function re(){document.querySelectorAll("[pulse-form-block]").forEach(t=>{let r=t.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!r||!N.includes(r))return;let n=()=>ne(t);switch(r){case"text":case"email":{let o=t.querySelector("input, textarea");o&&(o.addEventListener("input",n),o.addEventListener("change",n));break}case"phone":{let o=t.querySelector('input[type="tel"]');o&&(o.addEventListener("input",n),o.addEventListener("change",n),o.addEventListener("keyup",n),o.addEventListener("countrychange",n));break}case"checkbox":case"legal":{t.querySelectorAll('input[type="checkbox"]').forEach(o=>o.addEventListener("change",n));break}case"radio":{t.querySelectorAll('input[type="radio"]').forEach(o=>o.addEventListener("change",n));break}case"select":{let o=t.querySelector("select");o&&o.addEventListener("change",n);break}}})}var O={get fields(){return i},refresh(){return i=h(!1),window.PulseFormData=i,f(),m(),E(),i},validate(){i=h(!0),window.PulseFormData=i,f();let t=document.querySelectorAll("[pulse-form-block]");i.forEach((n,o)=>{let s=Array.from(t).find(u=>u.getAttribute("pulse-field-name")?.trim()===n["field-name"]);if(!s)return;let a=g(n["form-block"],n.required,n.value,s);i[o]={...i[o],error:a}}),window.PulseFormData=i;let r=i.every(n=>n.error===null);return m(),E(),K(i),r||Z(),{fields:i,isValid:r}},clearErrors(){R(),i=i.map(e=>({...e,error:null})),window.PulseFormData=i,f(),m(),E()},ERROR_CODES:l,ERROR_MESSAGES:c};document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelectorAll("[pulse-form-block]").length;console.log(`[PulseForm] Initialized \u2014 found ${e} form blocks.`),C(),i=h(!1),window.PulseFormData=i,f(),m(),E(),re();let t=document.getElementById("trigger-webflow-form-submit");t&&t.addEventListener("click",r=>{r.preventDefault();let{isValid:n}=O.validate();if(!n)return;let o=document.getElementById("webflow-form-submit");o?o.click():console.warn('[PulseForm] Button with id "webflow-form-submit" not found.');let s=document.getElementById("hubspot-form-submit");s?s.click():console.warn('[PulseForm] Button with id "hubspot-form-submit" not found.')}),window.PulseForm=O});})();
1
+ "use strict";(()=>{var D=Object.create;var R=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var U=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!V.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=C(t,o))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?D(q(e)):{},B(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e));console.log("Book a demo form script loaded");var P=["text","email","phone","checkbox","radio","select","legal"],N=[{type:"pulse",name:"pulse","calender-name":"david","embed-url":"https://meetings.hubspot.com/valeria-angelini/pulse-valeria-and-alessandra?embed=true"},{type:"industry",name:"Financial Services","calender-name":"david","embed-url":"https://meetings.hubspot.com/david-zarate2?embed=true"},{type:"industry",name:"Sports","calender-name":"steven","embed-url":"https://meetings.hubspot.com/steven-campos?embed=true"},{type:"industry",name:"Beauty","calender-name":"albany","embed-url":"https://meetings.hubspot.com/david-zarate2?embed=true"},{type:"industry",name:"Music","calender-name":"steven","embed-url":"https://meetings.hubspot.com/steven-campos?embed=true"},{type:"industry",name:"Customer Packaged Goods","calender-name":"david","embed-url":"https://meetings.hubspot.com/david-zarate2?embed=true"},{type:"industry",name:"Other","calender-name":"david","embed-url":"https://meetings.hubspot.com/david-zarate2?embed=true"}],$=["true","atleast-one","only-one"],l={REQUIRED_INPUT:"ERR_REQUIRED",REQUIRED_LEGAL:"ERR_LEGAL_REQUIRED",REQUIRED_SELECT:"ERR_SELECT_REQUIRED",ATLEAST_ONE:"ERR_ATLEAST_ONE",ONLY_ONE_NONE:"ERR_ONLY_ONE_NONE",ONLY_ONE_EXCEEDED:"ERR_ONLY_ONE_EXCEEDED",INVALID_EMAIL:"ERR_INVALID_EMAIL",INVALID_PHONE:"ERR_INVALID_PHONE",PHONE_TOO_SHORT:"ERR_PHONE_TOO_SHORT",PHONE_TOO_LONG:"ERR_PHONE_TOO_LONG",PHONE_INVALID_COUNTRY:"ERR_PHONE_INVALID_COUNTRY"},d={[l.REQUIRED_INPUT]:"This field is required.",[l.REQUIRED_LEGAL]:"You must accept this to continue.",[l.REQUIRED_SELECT]:"Please select an option.",[l.ATLEAST_ONE]:"Please select at least one option.",[l.ONLY_ONE_NONE]:"Please select one option.",[l.ONLY_ONE_EXCEEDED]:"Only one option can be selected.",[l.INVALID_EMAIL]:"Please enter a valid email address.",[l.INVALID_PHONE]:"Please enter a valid phone number.",[l.PHONE_TOO_SHORT]:"Phone number is too short.",[l.PHONE_TOO_LONG]:"Phone number is too long.",[l.PHONE_INVALID_COUNTRY]:"Invalid country code."},g="pulse-form-error",_=new Map;function H(e){try{let t=e.getSelectedCountryData?.();if(!t?.dialCode)return;document.querySelectorAll('input[pulse-form-field="country-code"]').forEach(n=>{n.value=`+${t.dialCode}`})}catch(t){console.warn("[PulseForm] Error filling country code:",t)}}function Q(){let e=window.intlTelInput;if(!e){console.warn(`[PulseForm] intlTelInput not found on window. Make sure you include the intl-tel-input script before this script.
2
+ e.g. <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js"><\/script>`);return}document.querySelectorAll('[pulse-form-block="phone"] input[type="tel"]').forEach(r=>{try{let n=e(r,{initialCountry:"us",separateDialCode:!0,strictMode:!1,loadUtils:()=>import("https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js")});_.set(r,n),H(n),r.addEventListener("countrychange",()=>{H(n)}),console.log(`[PulseForm] intl-tel-input initialized for "${r.closest("[pulse-form-block]")?.getAttribute("pulse-field-name")||"unknown"}"`)}catch(n){console.warn("[PulseForm] Failed to init intl-tel-input:",n)}})}var G={0:l.INVALID_PHONE,1:l.PHONE_INVALID_COUNTRY,2:l.PHONE_TOO_SHORT,3:l.PHONE_TOO_LONG,4:l.INVALID_PHONE};function j(e){return e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{code:l.INVALID_EMAIL,message:d[l.INVALID_EMAIL]}:null}function z(e){let t=e.value.trim();if(!t)return null;let r=_.get(e);if(r)try{if(r.isValidNumber())return null;let o=r.getValidationError?.()??0,s=G[o]||l.INVALID_PHONE;return{code:s,message:d[s]}}catch{return{code:l.INVALID_PHONE,message:d[l.INVALID_PHONE]}}let n=t.replace(/\D/g,"");return n.length<7?{code:l.PHONE_TOO_SHORT,message:d[l.PHONE_TOO_SHORT]}:n.length>15?{code:l.PHONE_TOO_LONG,message:d[l.PHONE_TOO_LONG]}:null}function X(e){let t=e.querySelector("input, textarea");return t?t.value.trim():null}function W(e){let t=e.querySelector('input[type="email"]');return t?t.value.trim():null}function J(e){let t=e.querySelector('input[type="tel"]');return t?t.value.trim():null}function K(e){let t=e.querySelectorAll('input[type="checkbox"]'),r=[];return t.forEach(n=>{if(n.checked){let o=n.getAttribute("data-name")?.trim();r.push(o||n.value||"on")}}),r}function Z(e){let t=e.querySelectorAll('input[type="radio"]');for(let r of t)if(r.checked)return r.closest("label")?.textContent?.trim()||r.value||"on";return null}function ee(e){let t=e.querySelector("select");if(!t)return null;let r=t.value.trim();return!r||t.selectedIndex===0?null:r}function te(e){let t=e.querySelector('input[type="checkbox"]');return t?t.checked:!1}function M(e,t){switch(e){case"text":return X(t);case"email":return W(t);case"phone":return J(t);case"checkbox":return K(t);case"radio":return Z(t);case"select":return ee(t);case"legal":return te(t);default:return null}}function S(e){let t=e.getAttribute("required-selection")?.trim().toLowerCase();return!t||!$.includes(t)?null:t}function ne(e){return e.getAttribute("mirror-value")?.trim().toLowerCase()==="true"}function v(e,t,r,n){if(t)switch(t){case"true":{if(e==="legal"&&r!==!0)return{code:l.REQUIRED_LEGAL,message:d[l.REQUIRED_LEGAL]};if(e==="select"&&!r)return{code:l.REQUIRED_SELECT,message:d[l.REQUIRED_SELECT]};if((e==="text"||e==="email"||e==="phone")&&(!r||typeof r=="string"&&r===""))return{code:l.REQUIRED_INPUT,message:d[l.REQUIRED_INPUT]};break}case"atleast-one":{if(Array.isArray(r)?r.length===0:!r)return{code:l.ATLEAST_ONE,message:d[l.ATLEAST_ONE]};break}case"only-one":{if(Array.isArray(r)){if(r.length===0)return{code:l.ONLY_ONE_NONE,message:d[l.ONLY_ONE_NONE]};if(r.length>1)return{code:l.ONLY_ONE_EXCEEDED,message:d[l.ONLY_ONE_EXCEEDED]}}else if(!r)return{code:l.ONLY_ONE_NONE,message:d[l.ONLY_ONE_NONE]};break}}if(e==="email"&&typeof r=="string"&&r){let o=j(r);if(o)return o}if(e==="phone"&&typeof r=="string"&&r){let o=n.querySelector('input[type="tel"]');if(o){let s=z(o);if(s)return s}}return null}function I(e){let t=document.querySelectorAll("[pulse-form-block]"),r=[];return t.forEach(n=>{let o=n.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!o||!P.includes(o))return;let s=o,u=n.getAttribute("pulse-field-name")?.trim();if(!u)return;let a=S(n),c=ne(n),f=M(s,n),m=e?v(s,a,f,n):null;r.push({"form-block":s,"field-name":u,value:f,required:a,"mirror-value":c,error:m})}),r}function k(){document.querySelectorAll(`.${g}`).forEach(e=>e.remove()),document.querySelectorAll("[pulse-form-block]").forEach(e=>e.classList.remove("has-error"))}function re(e){let t=e.querySelector(`.${g}`);t&&t.remove(),e.classList.remove("has-error")}function w(e,t){let r=e.querySelector(`.${g}`);r&&r.remove();let n=document.createElement("span");n.className=g,n.textContent=t.message,n.setAttribute("data-error-code",t.code),n.setAttribute("data-field-name",e.getAttribute("pulse-field-name")?.trim()||""),e.classList.add("has-error"),e.appendChild(n)}function oe(e){k(),document.querySelectorAll("[pulse-form-block]").forEach(r=>{let n=r.getAttribute("pulse-field-name")?.trim();if(!n)return;let o=e.find(s=>s["field-name"]===n);!o||!o.error||w(r,o.error)})}function le(){let e=document.querySelector("[pulse-form-block].has-error");if(!e)return;e.scrollIntoView({behavior:"smooth",block:"center"});let t=e.querySelector("input, textarea, select");t&&setTimeout(()=>t.focus(),400)}function p(){let e=i.filter(r=>r["mirror-value"]===!0);if(e.length===0)return;let t=document.querySelectorAll("[pulse-form-block-mirror]");e.forEach(r=>{let n=r["field-name"],o=!1;t.forEach(s=>{if(s.getAttribute("pulse-form-block-mirror")?.trim()!==n)return;o=!0;let a=s.querySelector("input, textarea, select");if(!a){console.warn(`[PulseForm] Mirror target for "${n}" found, but no input element inside it.`);return}let c=r.value;typeof c=="string"?a.value=c:typeof c=="boolean"?a instanceof HTMLInputElement&&a.type==="checkbox"?a.checked=c:a.value=String(c):Array.isArray(c)?a.value=c.join(", "):a.value=""}),o||console.warn(`[PulseForm] No mirror target found for field "${n}". Add an element with attribute pulse-form-block-mirror="${n}" to mirror this value.`)})}function ie(){let e=document.querySelector("[hs-calender-block]");if(!e){console.warn("[PulseForm] No element with attribute 'hs-calender-block' found.");return}let r=i.find(u=>u["field-name"]==="flow-type")?.value,n;if(r==="Pulse demo")n=N.find(u=>u.type==="pulse");else if(r==="White Glove services"){let a=i.find(c=>c["field-name"]==="industry")?.value;typeof a=="string"&&a&&(n=N.find(c=>c.type==="industry"&&c.name.toLowerCase()===a.toLowerCase()))}if(n||(n=N.find(u=>u.type==="industry"&&u.name==="Other")),!n){console.warn("[PulseForm] No matching calendar entry found.");return}e.innerHTML="";let o=document.createElement("div");o.className="meetings-iframe-container",o.setAttribute("data-src",n["embed-url"]),e.appendChild(o);let s=document.createElement("script");s.type="text/javascript",s.src="https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js",e.appendChild(s),console.log(`[PulseForm] Loaded calendar: ${n["calender-name"]} (${n.name})`)}function h(){let e=i.find(n=>n["field-name"]==="flow-type");if(!e)return;let t=e.value;document.querySelectorAll("[form-flow]").forEach(n=>{n.getAttribute("form-flow")?.trim()===t?n.setAttribute("form-flow-active","true"):n.setAttribute("form-flow-active","false")})}function y(){let e=i.find(o=>o["field-name"]==="flow-type");if(!e)return;let t=e.value,r=i.findIndex(o=>o["field-name"]==="industry"),n=i.findIndex(o=>o["field-name"]==="what-are-you-looking-for");r!==-1&&(i[r]={...i[r],required:null}),n!==-1&&(i[n]={...i[n],required:null}),t==="White Glove services"&&r!==-1?i[r]={...i[r],required:"true"}:t==="Pulse demo"&&n!==-1&&(i[n]={...i[n],required:"atleast-one"}),window.PulseFormData=i}var i=[];function O(e,t,r){let n=i.findIndex(o=>o["field-name"]===e);n!==-1&&(i[n]={...i[n],value:t,error:r},window.PulseFormData=i,y(),p(),h())}function se(e){let t=e.getAttribute("pulse-form-block")?.trim().toLowerCase(),r=e.getAttribute("pulse-field-name")?.trim();if(!r)return;let n=S(e),o=M(t,e);if(e.classList.contains("has-error")){let u=v(t,n,o,e);u?(w(e,u),O(r,o,u)):(re(e),O(r,o,null))}else O(r,o,null)}function ue(){document.querySelectorAll("[pulse-form-block]").forEach(t=>{let r=t.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!r||!P.includes(r))return;let n=()=>se(t);switch(r){case"text":case"email":{let o=t.querySelector("input, textarea");o&&(o.addEventListener("input",n),o.addEventListener("change",n));break}case"phone":{let o=t.querySelector('input[type="tel"]');o&&(o.addEventListener("input",n),o.addEventListener("change",n),o.addEventListener("keyup",n),o.addEventListener("countrychange",n));break}case"checkbox":case"legal":{t.querySelectorAll('input[type="checkbox"]').forEach(o=>o.addEventListener("change",n));break}case"radio":{t.querySelectorAll('input[type="radio"]').forEach(o=>o.addEventListener("change",n));break}case"select":{let o=t.querySelector("select");o&&o.addEventListener("change",n);break}}})}var F={get fields(){return i},refresh(){return i=I(!1),window.PulseFormData=i,y(),p(),h(),i},validate(){i=I(!0),window.PulseFormData=i,y();let t=document.querySelectorAll("[pulse-form-block]");i.forEach((n,o)=>{let s=Array.from(t).find(a=>a.getAttribute("pulse-field-name")?.trim()===n["field-name"]);if(!s)return;let u=v(n["form-block"],n.required,n.value,s);i[o]={...i[o],error:u}}),window.PulseFormData=i;let r=i.every(n=>n.error===null);return p(),h(),oe(i),r||le(),{fields:i,isValid:r}},clearErrors(){k(),i=i.map(e=>({...e,error:null})),window.PulseFormData=i,y(),p(),h()},ERROR_CODES:l,ERROR_MESSAGES:d};document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelectorAll("[pulse-form-block]").length;console.log(`[PulseForm] Initialized \u2014 found ${e} form blocks.`),Q(),i=I(!1),window.PulseFormData=i,y(),p(),h(),ue();let t=document.getElementById("trigger-webflow-form-submit");t&&t.addEventListener("click",r=>{r.preventDefault();let{isValid:n}=F.validate();if(!n)return;let o=t.textContent;t.textContent="Submitting...",ie();let s=document.getElementById("webflow-form-submit");s?s.click():console.warn('[PulseForm] Button with id "webflow-form-submit" not found.');let u=document.getElementById("hubspot-form-submit");u?u.click():console.warn('[PulseForm] Button with id "hubspot-form-submit" not found.'),setTimeout(()=>{document.getElementById("form-anchor")?.scrollIntoView({behavior:"smooth",block:"start"})},700)}),window.PulseForm=F});function ae(){let e=["Jordan","Morgan","Riley","Avery","Quinn","Casey","Blake","Harper","Sage","Rowan"],t=["Nakamura","Lindqvist","Okafor","Brennan","Castellano","Pham","Eriksen","Moreira","Ashworth","Dubois"],r=["inbox.co","mailbox.org","zipmail.net","postly.io","demobox.dev"],n=m=>m[Math.floor(Math.random()*m.length)],o=()=>Math.random().toString(36).substring(2,8),s=n(e),u=n(t),a=`${s.toLowerCase()}.${o()}@${n(r)}`,c=`${2e9+Math.floor(Math.random()*8e9)}`,f={"first-name":s,"last-name":u,email:a,phone:c,"anything-else":"Ignore this is a test form submission"};Object.entries(f).forEach(([m,T])=>{let L=document.querySelector(`[pulse-field-name="${m}"]`);if(!L)return;if(m==="phone"){let E=L.querySelector('input[type="tel"]');if(!E)return;let A=_.get(E);A?A.setNumber(`+1${T}`):E.value=T,E.dispatchEvent(new Event("input",{bubbles:!0})),E.dispatchEvent(new Event("change",{bubbles:!0})),E.dispatchEvent(new Event("keyup",{bubbles:!0}));return}let b=m==="anything-else"?L.querySelector("textarea"):L.querySelector("input");b&&(b.value=T,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}),console.log("[PulseForm][DEV] Auto-filled:",f)}setTimeout(ae,500);})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form/book-a-demo.ts"],
4
- "sourcesContent": ["export { };\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconsole.log(\"Book a demo form script loaded\");\n\ntype FormBlockType = \"text\" | \"email\" | \"phone\" | \"checkbox\" | \"radio\" | \"select\" | \"legal\";\ntype RequiredSelection = \"true\" | \"atleast-one\" | \"only-one\";\n\ninterface PulseFormField {\n \"form-block\": FormBlockType;\n \"field-name\": string;\n value: string | string[] | boolean | null;\n required: RequiredSelection | null;\n \"mirror-value\": boolean;\n error: { code: string; message: string } | null;\n}\n\n// \u2500\u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst VALID_BLOCK_TYPES: FormBlockType[] = [\n \"text\",\n \"email\",\n \"phone\",\n \"checkbox\",\n \"radio\",\n \"select\",\n \"legal\",\n];\n\nconst VALID_REQUIRED_VALUES: RequiredSelection[] = [\n \"true\",\n \"atleast-one\",\n \"only-one\",\n];\n\n// \u2500\u2500\u2500 Error Codes & Messages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ERROR_CODES = {\n REQUIRED_INPUT: \"ERR_REQUIRED\",\n REQUIRED_LEGAL: \"ERR_LEGAL_REQUIRED\",\n REQUIRED_SELECT: \"ERR_SELECT_REQUIRED\",\n ATLEAST_ONE: \"ERR_ATLEAST_ONE\",\n ONLY_ONE_NONE: \"ERR_ONLY_ONE_NONE\",\n ONLY_ONE_EXCEEDED: \"ERR_ONLY_ONE_EXCEEDED\",\n INVALID_EMAIL: \"ERR_INVALID_EMAIL\",\n INVALID_PHONE: \"ERR_INVALID_PHONE\",\n PHONE_TOO_SHORT: \"ERR_PHONE_TOO_SHORT\",\n PHONE_TOO_LONG: \"ERR_PHONE_TOO_LONG\",\n PHONE_INVALID_COUNTRY: \"ERR_PHONE_INVALID_COUNTRY\",\n} as const;\n\nconst ERROR_MESSAGES: Record<string, string> = {\n [ERROR_CODES.REQUIRED_INPUT]: \"This field is required.\",\n [ERROR_CODES.REQUIRED_LEGAL]: \"You must accept this to continue.\",\n [ERROR_CODES.REQUIRED_SELECT]: \"Please select an option.\",\n [ERROR_CODES.ATLEAST_ONE]: \"Please select at least one option.\",\n [ERROR_CODES.ONLY_ONE_NONE]: \"Please select one option.\",\n [ERROR_CODES.ONLY_ONE_EXCEEDED]: \"Only one option can be selected.\",\n [ERROR_CODES.INVALID_EMAIL]: \"Please enter a valid email address.\",\n [ERROR_CODES.INVALID_PHONE]: \"Please enter a valid phone number.\",\n [ERROR_CODES.PHONE_TOO_SHORT]: \"Phone number is too short.\",\n [ERROR_CODES.PHONE_TOO_LONG]: \"Phone number is too long.\",\n [ERROR_CODES.PHONE_INVALID_COUNTRY]: \"Invalid country code.\",\n};\n\nconst ERROR_SPAN_CLASS = \"pulse-form-error\";\n\n// \u2500\u2500\u2500 intl-tel-input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst itiInstances = new Map<HTMLInputElement, any>();\n\nfunction fillCountryCodeInput(iti: any): void {\n try {\n const countryData = iti.getSelectedCountryData?.();\n if (!countryData?.dialCode) return;\n\n const inputs = document.querySelectorAll<HTMLInputElement>(\n 'input[pulse-form-field=\"country-code\"]'\n );\n inputs.forEach((input) => {\n input.value = `+${countryData.dialCode}`;\n });\n } catch (err) {\n console.warn(\"[PulseForm] Error filling country code:\", err);\n }\n}\n\nfunction initIntlTelInput(): void {\n const intlTelInput = (window as any).intlTelInput;\n if (!intlTelInput) {\n console.warn(\n \"[PulseForm] intlTelInput not found on window. \" +\n \"Make sure you include the intl-tel-input script before this script.\\n\" +\n 'e.g. <script src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js\"></script>'\n );\n return;\n }\n\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n '[pulse-form-block=\"phone\"] input[type=\"tel\"]'\n );\n\n phoneInputs.forEach((input) => {\n try {\n const iti = intlTelInput(input, {\n initialCountry: \"us\",\n separateDialCode: true,\n strictMode: false,\n // @ts-ignore \u2014 runtime CDN import, not a TS module\n loadUtils: () => import(\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js\"),\n });\n\n itiInstances.set(input, iti);\n\n fillCountryCodeInput(iti);\n\n input.addEventListener(\"countrychange\", () => {\n fillCountryCodeInput(iti);\n });\n\n console.log(\n `[PulseForm] intl-tel-input initialized for \"${input.closest(\"[pulse-form-block]\")?.getAttribute(\"pulse-field-name\") || \"unknown\"}\"`\n );\n } catch (err) {\n console.warn(\"[PulseForm] Failed to init intl-tel-input:\", err);\n }\n });\n}\n\n// \u2500\u2500\u2500 Format Validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PHONE_ITI_ERROR_MAP: Record<number, string> = {\n 0: ERROR_CODES.INVALID_PHONE,\n 1: ERROR_CODES.PHONE_INVALID_COUNTRY,\n 2: ERROR_CODES.PHONE_TOO_SHORT,\n 3: ERROR_CODES.PHONE_TOO_LONG,\n 4: ERROR_CODES.INVALID_PHONE,\n};\n\nfunction validateEmail(value: string): PulseFormField[\"error\"] {\n if (!value) return null;\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) {\n return { code: ERROR_CODES.INVALID_EMAIL, message: ERROR_MESSAGES[ERROR_CODES.INVALID_EMAIL] };\n }\n return null;\n}\n\nfunction validatePhone(input: HTMLInputElement): PulseFormField[\"error\"] {\n const value = input.value.trim();\n if (!value) return null;\n\n const iti = itiInstances.get(input);\n\n if (iti) {\n try {\n if (iti.isValidNumber()) return null;\n const errorCode: number = iti.getValidationError?.() ?? 0;\n const code = PHONE_ITI_ERROR_MAP[errorCode] || ERROR_CODES.INVALID_PHONE;\n return { code, message: ERROR_MESSAGES[code] };\n } catch {\n return { code: ERROR_CODES.INVALID_PHONE, message: ERROR_MESSAGES[ERROR_CODES.INVALID_PHONE] };\n }\n }\n\n // Fallback: basic digit length\n const digits = value.replace(/\\D/g, \"\");\n if (digits.length < 7)\n return { code: ERROR_CODES.PHONE_TOO_SHORT, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_SHORT] };\n if (digits.length > 15)\n return { code: ERROR_CODES.PHONE_TOO_LONG, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_LONG] };\n return null;\n}\n\n// \u2500\u2500\u2500 Value Extractors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractTextValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractEmailValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"email\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractPhoneValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractCheckboxValues(wrapper: HTMLElement): string[] {\n const checkboxes = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n const values: string[] = [];\n checkboxes.forEach((cb) => {\n if (cb.checked) {\n const name = cb.getAttribute(\"data-name\")?.trim();\n values.push(name || cb.value || \"on\");\n }\n });\n return values;\n}\n\nfunction extractRadioValue(wrapper: HTMLElement): string | null {\n const radios = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]'\n );\n for (const radio of radios) {\n if (radio.checked) {\n const label = radio.closest(\"label\")?.textContent?.trim();\n return label || radio.value || \"on\";\n }\n }\n return null;\n}\n\nfunction extractSelectValue(wrapper: HTMLElement): string | null {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (!select) return null;\n const val = select.value.trim();\n if (!val || select.selectedIndex === 0) return null;\n return val;\n}\n\nfunction extractLegalValue(wrapper: HTMLElement): boolean {\n const checkbox = wrapper.querySelector<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n if (!checkbox) return false;\n return checkbox.checked;\n}\n\n// \u2500\u2500\u2500 Core Parser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractValue(\n type: FormBlockType,\n wrapper: HTMLElement\n): PulseFormField[\"value\"] {\n switch (type) {\n case \"text\":\n return extractTextValue(wrapper);\n case \"email\":\n return extractEmailValue(wrapper);\n case \"phone\":\n return extractPhoneValue(wrapper);\n case \"checkbox\":\n return extractCheckboxValues(wrapper);\n case \"radio\":\n return extractRadioValue(wrapper);\n case \"select\":\n return extractSelectValue(wrapper);\n case \"legal\":\n return extractLegalValue(wrapper);\n default:\n return null;\n }\n}\n\nfunction parseRequired(wrapper: HTMLElement): RequiredSelection | null {\n const raw = wrapper.getAttribute(\"required-selection\")?.trim().toLowerCase();\n if (!raw || !VALID_REQUIRED_VALUES.includes(raw as RequiredSelection))\n return null;\n return raw as RequiredSelection;\n}\n\nfunction parseMirrorValue(wrapper: HTMLElement): boolean {\n return wrapper.getAttribute(\"mirror-value\")?.trim().toLowerCase() === \"true\";\n}\n\n// \u2500\u2500\u2500 Validation Logic (per field) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getFieldError(\n type: FormBlockType,\n required: RequiredSelection | null,\n value: PulseFormField[\"value\"],\n wrapper: HTMLElement\n): PulseFormField[\"error\"] {\n // 1. Required checks\n if (required) {\n switch (required) {\n case \"true\": {\n if (type === \"legal\" && value !== true)\n return { code: ERROR_CODES.REQUIRED_LEGAL, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_LEGAL] };\n if (type === \"select\" && !value)\n return { code: ERROR_CODES.REQUIRED_SELECT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_SELECT] };\n if (\n (type === \"text\" || type === \"email\" || type === \"phone\") &&\n (!value || (typeof value === \"string\" && value === \"\"))\n )\n return { code: ERROR_CODES.REQUIRED_INPUT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_INPUT] };\n break;\n }\n\n case \"atleast-one\": {\n const empty = Array.isArray(value) ? value.length === 0 : !value;\n if (empty)\n return { code: ERROR_CODES.ATLEAST_ONE, message: ERROR_MESSAGES[ERROR_CODES.ATLEAST_ONE] };\n break;\n }\n\n case \"only-one\": {\n if (Array.isArray(value)) {\n if (value.length === 0)\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n if (value.length > 1)\n return { code: ERROR_CODES.ONLY_ONE_EXCEEDED, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_EXCEEDED] };\n } else if (!value) {\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n }\n break;\n }\n }\n }\n\n // 2. Format checks (only when there's a value)\n if (type === \"email\" && typeof value === \"string\" && value) {\n const emailError = validateEmail(value);\n if (emailError) return emailError;\n }\n\n if (type === \"phone\" && typeof value === \"string\" && value) {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n const phoneError = validatePhone(phoneInput);\n if (phoneError) return phoneError;\n }\n }\n\n return null;\n}\n\n// \u2500\u2500\u2500 Collect Fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction collectFormFields(withValidation: boolean): PulseFormField[] {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n const fields: PulseFormField[] = [];\n\n wrappers.forEach((wrapper) => {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase();\n\n if (!rawType || !VALID_BLOCK_TYPES.includes(rawType as FormBlockType))\n return;\n\n const blockType = rawType as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const mirrorValue = parseMirrorValue(wrapper);\n const value = extractValue(blockType, wrapper);\n const error = withValidation\n ? getFieldError(blockType, required, value, wrapper)\n : null;\n\n fields.push({\n \"form-block\": blockType,\n \"field-name\": fieldName,\n value,\n required,\n \"mirror-value\": mirrorValue,\n error,\n });\n });\n\n return fields;\n}\n\n// \u2500\u2500\u2500 Error UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction clearAllErrors(): void {\n document\n .querySelectorAll<HTMLElement>(`.${ERROR_SPAN_CLASS}`)\n .forEach((el) => el.remove());\n\n document\n .querySelectorAll<HTMLElement>(\"[pulse-form-block]\")\n .forEach((el) => el.classList.remove(\"has-error\"));\n}\n\nfunction clearErrorOnWrapper(wrapper: HTMLElement): void {\n const span = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (span) span.remove();\n wrapper.classList.remove(\"has-error\");\n}\n\nfunction showErrorOnWrapper(\n wrapper: HTMLElement,\n error: { code: string; message: string }\n): void {\n const existing = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (existing) existing.remove();\n\n const span = document.createElement(\"span\");\n span.className = ERROR_SPAN_CLASS;\n span.textContent = error.message;\n span.setAttribute(\"data-error-code\", error.code);\n span.setAttribute(\n \"data-field-name\",\n wrapper.getAttribute(\"pulse-field-name\")?.trim() || \"\"\n );\n\n wrapper.classList.add(\"has-error\");\n wrapper.appendChild(span);\n}\n\nfunction renderErrors(fields: PulseFormField[]): void {\n clearAllErrors();\n\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const field = fields.find((f) => f[\"field-name\"] === fieldName);\n if (!field || !field.error) return;\n\n showErrorOnWrapper(wrapper, field.error);\n });\n}\n\nfunction focusFirstError(): void {\n const first = document.querySelector<HTMLElement>(\n `[pulse-form-block].has-error`\n );\n if (!first) return;\n\n first.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n const focusable = first.querySelector<HTMLElement>(\n \"input, textarea, select\"\n );\n if (focusable) setTimeout(() => focusable.focus(), 400);\n}\n\n// \u2500\u2500\u2500 Mirror Value Fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction fillMirrorValues(): void {\n // 1. Get all fields with mirror-value true\n const mirrorFields = _currentFields.filter((f) => f[\"mirror-value\"] === true);\n if (mirrorFields.length === 0) return;\n\n // 2. Select all mirror target elements\n const mirrorTargets = document.querySelectorAll<HTMLElement>(\"[pulse-form-block-mirror]\");\n\n // 3. For each mirror field, find matching target and fill\n mirrorFields.forEach((field) => {\n const fieldName = field[\"field-name\"];\n let found = false;\n\n mirrorTargets.forEach((target) => {\n const mirrorAttr = target.getAttribute(\"pulse-form-block-mirror\")?.trim();\n if (mirrorAttr !== fieldName) return;\n\n found = true;\n\n // Find the input inside the mirror target and fill it\n const input = target.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\n \"input, textarea, select\"\n );\n\n if (!input) {\n console.warn(\n `[PulseForm] Mirror target for \"${fieldName}\" found, but no input element inside it.`\n );\n return;\n }\n\n // Set value based on type\n const value = field.value;\n if (typeof value === \"string\") {\n input.value = value;\n } else if (typeof value === \"boolean\") {\n if (input instanceof HTMLInputElement && input.type === \"checkbox\") {\n input.checked = value;\n } else {\n input.value = String(value);\n }\n } else if (Array.isArray(value)) {\n input.value = value.join(\", \");\n } else {\n input.value = \"\";\n }\n });\n\n if (!found) {\n console.warn(\n `[PulseForm] No mirror target found for field \"${fieldName}\". ` +\n `Add an element with attribute pulse-form-block-mirror=\"${fieldName}\" to mirror this value.`\n );\n }\n });\n}\n\n// \u2500\u2500\u2500 Flow Type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst INDUSTRY_CALENDER_MAP: Record<string, string> = {\n \"Financial Services\": \"david\",\n \"Sports\": \"steven\",\n \"Beauty\": \"albany\",\n \"Music\": \"steven\",\n \"Customer Packaged Goods\": \"david\",\n \"Other\": \"david\",\n};\n\nfunction setWhiteGloveCalender(): void {\n // 1. Get the value of field-name=\"industry\" from the JSON\n const industryField = _currentFields.find((f) => f[\"field-name\"] === \"industry\");\n if (!industryField || typeof industryField.value !== \"string\" || !industryField.value) return;\n\n const activePerson = INDUSTRY_CALENDER_MAP[industryField.value];\n\n // 2. Select all elements with attribute \"hs-calender\"\n const calenderElements = document.querySelectorAll<HTMLElement>(\"[hs-calender]\");\n\n // 3. Set hs-calender-active based on matching person\n calenderElements.forEach((el) => {\n const elCalenderValue = el.getAttribute(\"hs-calender\")?.trim();\n if (activePerson && elCalenderValue === activePerson) {\n el.setAttribute(\"hs-calender-active\", \"true\");\n } else {\n el.setAttribute(\"hs-calender-active\", \"false\");\n }\n });\n}\n\nfunction updateFlowType(): void {\n // 1. Get the value of field-name=\"flow-type\" from the JSON\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // 2. Select all elements with attribute \"form-flow\"\n const flowElements = document.querySelectorAll<HTMLElement>(\"[form-flow]\");\n\n // 3. Set form-flow-active based on matching value\n flowElements.forEach((el) => {\n const elFlowValue = el.getAttribute(\"form-flow\")?.trim();\n if (elFlowValue === flowValue) {\n el.setAttribute(\"form-flow-active\", \"true\");\n } else {\n el.setAttribute(\"form-flow-active\", \"false\");\n }\n });\n\n // 4. If White Glove services, update calender assignments\n if (flowValue === \"White Glove services\") {\n setWhiteGloveCalender();\n }\n}\n\n// \u2500\u2500\u2500 Conditional Required \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction updateConditionalRequired(): void {\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // Reset both fields to not required first\n const industryIdx = _currentFields.findIndex((f) => f[\"field-name\"] === \"industry\");\n const lookingForIdx = _currentFields.findIndex((f) => f[\"field-name\"] === \"what-are-you-looking-for\");\n\n if (industryIdx !== -1) {\n _currentFields[industryIdx] = { ..._currentFields[industryIdx], required: null };\n }\n if (lookingForIdx !== -1) {\n _currentFields[lookingForIdx] = { ..._currentFields[lookingForIdx], required: null };\n }\n\n // Set required based on flow-type value\n if (flowValue === \"White Glove services\" && industryIdx !== -1) {\n _currentFields[industryIdx] = { ..._currentFields[industryIdx], required: \"true\" };\n } else if (flowValue === \"Pulse demo\" && lookingForIdx !== -1) {\n _currentFields[lookingForIdx] = { ..._currentFields[lookingForIdx], required: \"atleast-one\" };\n }\n\n (window as any).PulseFormData = _currentFields;\n}\n\n// \u2500\u2500\u2500 Reactive State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet _currentFields: PulseFormField[] = [];\n\nfunction updateFieldInState(\n fieldName: string,\n value: PulseFormField[\"value\"],\n error: PulseFormField[\"error\"]\n): void {\n const idx = _currentFields.findIndex((f) => f[\"field-name\"] === fieldName);\n if (idx === -1) return;\n _currentFields[idx] = { ..._currentFields[idx], value, error };\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n}\n\nfunction handleFieldChange(wrapper: HTMLElement): void {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const value = extractValue(rawType, wrapper);\n const hasError = wrapper.classList.contains(\"has-error\");\n\n if (hasError) {\n const error = getFieldError(rawType, required, value, wrapper);\n if (!error) {\n clearErrorOnWrapper(wrapper);\n updateFieldInState(fieldName, value, null);\n } else {\n showErrorOnWrapper(wrapper, error);\n updateFieldInState(fieldName, value, error);\n }\n } else {\n updateFieldInState(fieldName, value, null);\n }\n}\n\nfunction bindChangeListeners(): void {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const type = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType | undefined;\n\n if (!type || !VALID_BLOCK_TYPES.includes(type)) return;\n\n const onChange = () => handleFieldChange(wrapper);\n\n switch (type) {\n case \"text\":\n case \"email\": {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (input) {\n input.addEventListener(\"input\", onChange);\n input.addEventListener(\"change\", onChange);\n }\n break;\n }\n\n case \"phone\": {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n phoneInput.addEventListener(\"input\", onChange);\n phoneInput.addEventListener(\"change\", onChange);\n phoneInput.addEventListener(\"keyup\", onChange);\n phoneInput.addEventListener(\"countrychange\", onChange);\n }\n break;\n }\n\n case \"checkbox\":\n case \"legal\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"checkbox\"]')\n .forEach((cb) => cb.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"radio\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')\n .forEach((r) => r.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"select\": {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (select) select.addEventListener(\"change\", onChange);\n break;\n }\n }\n });\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PulseForm = {\n get fields(): PulseFormField[] {\n return _currentFields;\n },\n\n refresh(): PulseFormField[] {\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n return _currentFields;\n },\n\n validate(): { fields: PulseFormField[]; isValid: boolean } {\n const fields = collectFormFields(true);\n\n _currentFields = fields;\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n\n // Re-validate fields whose required was changed by updateConditionalRequired\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n _currentFields.forEach((field, idx) => {\n const wrapper = Array.from(wrappers).find(\n (w) => w.getAttribute(\"pulse-field-name\")?.trim() === field[\"field-name\"]\n );\n if (!wrapper) return;\n const error = getFieldError(\n field[\"form-block\"],\n field.required,\n field.value,\n wrapper\n );\n _currentFields[idx] = { ..._currentFields[idx], error };\n });\n\n (window as any).PulseFormData = _currentFields;\n const isValid = _currentFields.every((f) => f.error === null);\n\n fillMirrorValues();\n updateFlowType();\n\n renderErrors(_currentFields);\n if (!isValid) focusFirstError();\n\n return { fields: _currentFields, isValid };\n },\n\n clearErrors(): void {\n clearAllErrors();\n _currentFields = _currentFields.map((f) => ({ ...f, error: null }));\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n },\n\n ERROR_CODES,\n ERROR_MESSAGES,\n};\n\n// \u2500\u2500\u2500 Initialize on DOM Ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const count = document.querySelectorAll(\"[pulse-form-block]\").length;\n console.log(`[PulseForm] Initialized \u2014 found ${count} form blocks.`);\n\n initIntlTelInput();\n\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n\n bindChangeListeners();\n\n // \u2500\u2500\u2500 Submit Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const triggerBtn = document.getElementById(\"trigger-webflow-form-submit\");\n if (triggerBtn) {\n triggerBtn.addEventListener(\"click\", (e) => {\n e.preventDefault();\n const { isValid } = PulseForm.validate();\n if (!isValid) return;\n\n const submitBtn = document.getElementById(\"webflow-form-submit\") as HTMLButtonElement | null;\n if (submitBtn) {\n submitBtn.click();\n } else {\n console.warn('[PulseForm] Button with id \"webflow-form-submit\" not found.');\n }\n\n const hubspotBtn = document.getElementById(\"hubspot-form-submit\") as HTMLButtonElement | null;\n if (hubspotBtn) {\n hubspotBtn.click();\n } else {\n console.warn('[PulseForm] Button with id \"hubspot-form-submit\" not found.');\n }\n });\n }\n\n (window as any).PulseForm = PulseForm;\n});\n\n// \u2500\u2500\u2500 \u26A0\uFE0F DEV ONLY \u2014 Remove or disable in production \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction devAutoFill(): void {\n const firstNames = [\"Jordan\", \"Morgan\", \"Riley\", \"Avery\", \"Quinn\", \"Casey\", \"Blake\", \"Harper\", \"Sage\", \"Rowan\"];\n const lastNames = [\"Nakamura\", \"Lindqvist\", \"Okafor\", \"Brennan\", \"Castellano\", \"Pham\", \"Eriksen\", \"Moreira\", \"Ashworth\", \"Dubois\"];\n const domains = [\"inbox.co\", \"mailbox.org\", \"zipmail.net\", \"postly.io\", \"demobox.dev\"];\n\n const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];\n const rand = () => Math.random().toString(36).substring(2, 8);\n\n const firstName = pick(firstNames);\n const lastName = pick(lastNames);\n const email = `${firstName.toLowerCase()}.${rand()}@${pick(domains)}`;\n const phone = `${2000000000 + Math.floor(Math.random() * 8000000000)}`;\n\n const fieldMap: Record<string, string> = {\n \"first-name\": firstName,\n \"last-name\": lastName,\n \"email\": email,\n \"phone\": phone,\n \"anything-else\": \"Ignore this is a test form submission\",\n };\n\n Object.entries(fieldMap).forEach(([fieldName, value]) => {\n const wrapper = document.querySelector<HTMLElement>(\n `[pulse-field-name=\"${fieldName}\"]`\n );\n if (!wrapper) return;\n\n if (fieldName === \"phone\") {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!phoneInput) return;\n const iti = itiInstances.get(phoneInput);\n if (iti) {\n iti.setNumber(`+1${value}`);\n } else {\n phoneInput.value = value;\n }\n phoneInput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"keyup\", { bubbles: true }));\n return;\n }\n\n const el = fieldName === \"anything-else\"\n ? wrapper.querySelector<HTMLTextAreaElement>(\"textarea\")\n : wrapper.querySelector<HTMLInputElement>(\"input\");\n if (!el) return;\n\n el.value = value;\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n\n console.log(\"[PulseForm][DEV] Auto-filled:\", fieldMap);\n}\n\nsetTimeout(devAutoFill, 500);\n// \u2500\u2500\u2500 \u26A0\uFE0F END DEV ONLY \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,UAAQ,IAAI,gCAAgC;AAgB5C,MAAM,oBAAqC;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAE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,QAAQ,QAAQ,EAAE,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM;AACrD,YAAM,UAAU,SAAS;AAAA,QACrB,sBAAsB,SAAS;AAAA,MACnC;AACA,UAAI,CAAC,QAAS;AAEd,UAAI,cAAc,SAAS;AACvB,cAAM,aAAa,QAAQ,cAAgC,mBAAmB;AAC9E,YAAI,CAAC,WAAY;AACjB,cAAM,MAAM,aAAa,IAAI,UAAU;AACvC,YAAI,KAAK;AACL,cAAI,UAAU,KAAK,KAAK,EAAE;AAAA,QAC9B,OAAO;AACH,qBAAW,QAAQ;AAAA,QACvB;AACA,mBAAW,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AAC9D,mBAAW,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;AAC/D,mBAAW,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AAC9D;AAAA,MACJ;AAEA,YAAM,KAAK,cAAc,kBACnB,QAAQ,cAAmC,UAAU,IACrD,QAAQ,cAAgC,OAAO;AACrD,UAAI,CAAC,GAAI;AAET,SAAG,QAAQ;AACX,SAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AACtD,SAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;AAAA,IAC3D,CAAC;AAED,YAAQ,IAAI,iCAAiC,QAAQ;AAAA,EACzD;AAEA,aAAW,aAAa,GAAG;",
4
+ "sourcesContent": ["export { };\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconsole.log(\"Book a demo form script loaded\");\n\ntype FormBlockType = \"text\" | \"email\" | \"phone\" | \"checkbox\" | \"radio\" | \"select\" | \"legal\";\ntype RequiredSelection = \"true\" | \"atleast-one\" | \"only-one\";\n\ninterface PulseFormField {\n \"form-block\": FormBlockType;\n \"field-name\": string;\n value: string | string[] | boolean | null;\n required: RequiredSelection | null;\n \"mirror-value\": boolean;\n error: { code: string; message: string } | null;\n}\n\ninterface CalendarEntry {\n type: \"pulse\" | \"industry\";\n name: string;\n \"calender-name\": string;\n \"embed-url\": string;\n}\n\n// \u2500\u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst VALID_BLOCK_TYPES: FormBlockType[] = [\n \"text\",\n \"email\",\n \"phone\",\n \"checkbox\",\n \"radio\",\n \"select\",\n \"legal\",\n];\n\nconst CALENDAR_ENTRIES: CalendarEntry[] = [\n {\n type: \"pulse\",\n name: \"pulse\",\n \"calender-name\": \"david\",\n \"embed-url\": \"https://meetings.hubspot.com/valeria-angelini/pulse-valeria-and-alessandra?embed=true\",\n },\n {\n type: \"industry\",\n name: \"Financial Services\",\n \"calender-name\": \"david\",\n \"embed-url\": \"https://meetings.hubspot.com/david-zarate2?embed=true\",\n },\n {\n type: \"industry\",\n name: \"Sports\",\n \"calender-name\": \"steven\",\n \"embed-url\": \"https://meetings.hubspot.com/steven-campos?embed=true\",\n },\n {\n type: \"industry\",\n name: \"Beauty\",\n \"calender-name\": \"albany\",\n \"embed-url\": \"https://meetings.hubspot.com/david-zarate2?embed=true\",\n },\n {\n type: \"industry\",\n name: \"Music\",\n \"calender-name\": \"steven\",\n \"embed-url\": \"https://meetings.hubspot.com/steven-campos?embed=true\",\n },\n {\n type: \"industry\",\n name: \"Customer Packaged Goods\",\n \"calender-name\": \"david\",\n \"embed-url\": \"https://meetings.hubspot.com/david-zarate2?embed=true\",\n },\n {\n type: \"industry\",\n name: \"Other\",\n \"calender-name\": \"david\",\n \"embed-url\": \"https://meetings.hubspot.com/david-zarate2?embed=true\",\n },\n];\n\nconst VALID_REQUIRED_VALUES: RequiredSelection[] = [\n \"true\",\n \"atleast-one\",\n \"only-one\",\n];\n\n// \u2500\u2500\u2500 Error Codes & Messages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ERROR_CODES = {\n REQUIRED_INPUT: \"ERR_REQUIRED\",\n REQUIRED_LEGAL: \"ERR_LEGAL_REQUIRED\",\n REQUIRED_SELECT: \"ERR_SELECT_REQUIRED\",\n ATLEAST_ONE: \"ERR_ATLEAST_ONE\",\n ONLY_ONE_NONE: \"ERR_ONLY_ONE_NONE\",\n ONLY_ONE_EXCEEDED: \"ERR_ONLY_ONE_EXCEEDED\",\n INVALID_EMAIL: \"ERR_INVALID_EMAIL\",\n INVALID_PHONE: \"ERR_INVALID_PHONE\",\n PHONE_TOO_SHORT: \"ERR_PHONE_TOO_SHORT\",\n PHONE_TOO_LONG: \"ERR_PHONE_TOO_LONG\",\n PHONE_INVALID_COUNTRY: \"ERR_PHONE_INVALID_COUNTRY\",\n} as const;\n\nconst ERROR_MESSAGES: Record<string, string> = {\n [ERROR_CODES.REQUIRED_INPUT]: \"This field is required.\",\n [ERROR_CODES.REQUIRED_LEGAL]: \"You must accept this to continue.\",\n [ERROR_CODES.REQUIRED_SELECT]: \"Please select an option.\",\n [ERROR_CODES.ATLEAST_ONE]: \"Please select at least one option.\",\n [ERROR_CODES.ONLY_ONE_NONE]: \"Please select one option.\",\n [ERROR_CODES.ONLY_ONE_EXCEEDED]: \"Only one option can be selected.\",\n [ERROR_CODES.INVALID_EMAIL]: \"Please enter a valid email address.\",\n [ERROR_CODES.INVALID_PHONE]: \"Please enter a valid phone number.\",\n [ERROR_CODES.PHONE_TOO_SHORT]: \"Phone number is too short.\",\n [ERROR_CODES.PHONE_TOO_LONG]: \"Phone number is too long.\",\n [ERROR_CODES.PHONE_INVALID_COUNTRY]: \"Invalid country code.\",\n};\n\nconst ERROR_SPAN_CLASS = \"pulse-form-error\";\n\n// \u2500\u2500\u2500 intl-tel-input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst itiInstances = new Map<HTMLInputElement, any>();\n\nfunction fillCountryCodeInput(iti: any): void {\n try {\n const countryData = iti.getSelectedCountryData?.();\n if (!countryData?.dialCode) return;\n\n const inputs = document.querySelectorAll<HTMLInputElement>(\n 'input[pulse-form-field=\"country-code\"]'\n );\n inputs.forEach((input) => {\n input.value = `+${countryData.dialCode}`;\n });\n } catch (err) {\n console.warn(\"[PulseForm] Error filling country code:\", err);\n }\n}\n\nfunction initIntlTelInput(): void {\n const intlTelInput = (window as any).intlTelInput;\n if (!intlTelInput) {\n console.warn(\n \"[PulseForm] intlTelInput not found on window. \" +\n \"Make sure you include the intl-tel-input script before this script.\\n\" +\n 'e.g. <script src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js\"></script>'\n );\n return;\n }\n\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n '[pulse-form-block=\"phone\"] input[type=\"tel\"]'\n );\n\n phoneInputs.forEach((input) => {\n try {\n const iti = intlTelInput(input, {\n initialCountry: \"us\",\n separateDialCode: true,\n strictMode: false,\n // @ts-ignore \u2014 runtime CDN import, not a TS module\n loadUtils: () => import(\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js\"),\n });\n\n itiInstances.set(input, iti);\n\n fillCountryCodeInput(iti);\n\n input.addEventListener(\"countrychange\", () => {\n fillCountryCodeInput(iti);\n });\n\n console.log(\n `[PulseForm] intl-tel-input initialized for \"${input.closest(\"[pulse-form-block]\")?.getAttribute(\"pulse-field-name\") || \"unknown\"}\"`\n );\n } catch (err) {\n console.warn(\"[PulseForm] Failed to init intl-tel-input:\", err);\n }\n });\n}\n\n// \u2500\u2500\u2500 Format Validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PHONE_ITI_ERROR_MAP: Record<number, string> = {\n 0: ERROR_CODES.INVALID_PHONE,\n 1: ERROR_CODES.PHONE_INVALID_COUNTRY,\n 2: ERROR_CODES.PHONE_TOO_SHORT,\n 3: ERROR_CODES.PHONE_TOO_LONG,\n 4: ERROR_CODES.INVALID_PHONE,\n};\n\nfunction validateEmail(value: string): PulseFormField[\"error\"] {\n if (!value) return null;\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) {\n return { code: ERROR_CODES.INVALID_EMAIL, message: ERROR_MESSAGES[ERROR_CODES.INVALID_EMAIL] };\n }\n return null;\n}\n\nfunction validatePhone(input: HTMLInputElement): PulseFormField[\"error\"] {\n const value = input.value.trim();\n if (!value) return null;\n\n const iti = itiInstances.get(input);\n\n if (iti) {\n try {\n if (iti.isValidNumber()) return null;\n const errorCode: number = iti.getValidationError?.() ?? 0;\n const code = PHONE_ITI_ERROR_MAP[errorCode] || ERROR_CODES.INVALID_PHONE;\n return { code, message: ERROR_MESSAGES[code] };\n } catch {\n return { code: ERROR_CODES.INVALID_PHONE, message: ERROR_MESSAGES[ERROR_CODES.INVALID_PHONE] };\n }\n }\n\n // Fallback: basic digit length\n const digits = value.replace(/\\D/g, \"\");\n if (digits.length < 7)\n return { code: ERROR_CODES.PHONE_TOO_SHORT, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_SHORT] };\n if (digits.length > 15)\n return { code: ERROR_CODES.PHONE_TOO_LONG, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_LONG] };\n return null;\n}\n\n// \u2500\u2500\u2500 Value Extractors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractTextValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractEmailValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"email\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractPhoneValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractCheckboxValues(wrapper: HTMLElement): string[] {\n const checkboxes = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n const values: string[] = [];\n checkboxes.forEach((cb) => {\n if (cb.checked) {\n const name = cb.getAttribute(\"data-name\")?.trim();\n values.push(name || cb.value || \"on\");\n }\n });\n return values;\n}\n\nfunction extractRadioValue(wrapper: HTMLElement): string | null {\n const radios = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]'\n );\n for (const radio of radios) {\n if (radio.checked) {\n const label = radio.closest(\"label\")?.textContent?.trim();\n return label || radio.value || \"on\";\n }\n }\n return null;\n}\n\nfunction extractSelectValue(wrapper: HTMLElement): string | null {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (!select) return null;\n const val = select.value.trim();\n if (!val || select.selectedIndex === 0) return null;\n return val;\n}\n\nfunction extractLegalValue(wrapper: HTMLElement): boolean {\n const checkbox = wrapper.querySelector<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n if (!checkbox) return false;\n return checkbox.checked;\n}\n\n// \u2500\u2500\u2500 Core Parser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractValue(\n type: FormBlockType,\n wrapper: HTMLElement\n): PulseFormField[\"value\"] {\n switch (type) {\n case \"text\":\n return extractTextValue(wrapper);\n case \"email\":\n return extractEmailValue(wrapper);\n case \"phone\":\n return extractPhoneValue(wrapper);\n case \"checkbox\":\n return extractCheckboxValues(wrapper);\n case \"radio\":\n return extractRadioValue(wrapper);\n case \"select\":\n return extractSelectValue(wrapper);\n case \"legal\":\n return extractLegalValue(wrapper);\n default:\n return null;\n }\n}\n\nfunction parseRequired(wrapper: HTMLElement): RequiredSelection | null {\n const raw = wrapper.getAttribute(\"required-selection\")?.trim().toLowerCase();\n if (!raw || !VALID_REQUIRED_VALUES.includes(raw as RequiredSelection))\n return null;\n return raw as RequiredSelection;\n}\n\nfunction parseMirrorValue(wrapper: HTMLElement): boolean {\n return wrapper.getAttribute(\"mirror-value\")?.trim().toLowerCase() === \"true\";\n}\n\n// \u2500\u2500\u2500 Validation Logic (per field) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getFieldError(\n type: FormBlockType,\n required: RequiredSelection | null,\n value: PulseFormField[\"value\"],\n wrapper: HTMLElement\n): PulseFormField[\"error\"] {\n // 1. Required checks\n if (required) {\n switch (required) {\n case \"true\": {\n if (type === \"legal\" && value !== true)\n return { code: ERROR_CODES.REQUIRED_LEGAL, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_LEGAL] };\n if (type === \"select\" && !value)\n return { code: ERROR_CODES.REQUIRED_SELECT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_SELECT] };\n if (\n (type === \"text\" || type === \"email\" || type === \"phone\") &&\n (!value || (typeof value === \"string\" && value === \"\"))\n )\n return { code: ERROR_CODES.REQUIRED_INPUT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_INPUT] };\n break;\n }\n\n case \"atleast-one\": {\n const empty = Array.isArray(value) ? value.length === 0 : !value;\n if (empty)\n return { code: ERROR_CODES.ATLEAST_ONE, message: ERROR_MESSAGES[ERROR_CODES.ATLEAST_ONE] };\n break;\n }\n\n case \"only-one\": {\n if (Array.isArray(value)) {\n if (value.length === 0)\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n if (value.length > 1)\n return { code: ERROR_CODES.ONLY_ONE_EXCEEDED, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_EXCEEDED] };\n } else if (!value) {\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n }\n break;\n }\n }\n }\n\n // 2. Format checks (only when there's a value)\n if (type === \"email\" && typeof value === \"string\" && value) {\n const emailError = validateEmail(value);\n if (emailError) return emailError;\n }\n\n if (type === \"phone\" && typeof value === \"string\" && value) {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n const phoneError = validatePhone(phoneInput);\n if (phoneError) return phoneError;\n }\n }\n\n return null;\n}\n\n// \u2500\u2500\u2500 Collect Fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction collectFormFields(withValidation: boolean): PulseFormField[] {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n const fields: PulseFormField[] = [];\n\n wrappers.forEach((wrapper) => {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase();\n\n if (!rawType || !VALID_BLOCK_TYPES.includes(rawType as FormBlockType))\n return;\n\n const blockType = rawType as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const mirrorValue = parseMirrorValue(wrapper);\n const value = extractValue(blockType, wrapper);\n const error = withValidation\n ? getFieldError(blockType, required, value, wrapper)\n : null;\n\n fields.push({\n \"form-block\": blockType,\n \"field-name\": fieldName,\n value,\n required,\n \"mirror-value\": mirrorValue,\n error,\n });\n });\n\n return fields;\n}\n\n// \u2500\u2500\u2500 Error UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction clearAllErrors(): void {\n document\n .querySelectorAll<HTMLElement>(`.${ERROR_SPAN_CLASS}`)\n .forEach((el) => el.remove());\n\n document\n .querySelectorAll<HTMLElement>(\"[pulse-form-block]\")\n .forEach((el) => el.classList.remove(\"has-error\"));\n}\n\nfunction clearErrorOnWrapper(wrapper: HTMLElement): void {\n const span = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (span) span.remove();\n wrapper.classList.remove(\"has-error\");\n}\n\nfunction showErrorOnWrapper(\n wrapper: HTMLElement,\n error: { code: string; message: string }\n): void {\n const existing = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (existing) existing.remove();\n\n const span = document.createElement(\"span\");\n span.className = ERROR_SPAN_CLASS;\n span.textContent = error.message;\n span.setAttribute(\"data-error-code\", error.code);\n span.setAttribute(\n \"data-field-name\",\n wrapper.getAttribute(\"pulse-field-name\")?.trim() || \"\"\n );\n\n wrapper.classList.add(\"has-error\");\n wrapper.appendChild(span);\n}\n\nfunction renderErrors(fields: PulseFormField[]): void {\n clearAllErrors();\n\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const field = fields.find((f) => f[\"field-name\"] === fieldName);\n if (!field || !field.error) return;\n\n showErrorOnWrapper(wrapper, field.error);\n });\n}\n\nfunction focusFirstError(): void {\n const first = document.querySelector<HTMLElement>(\n `[pulse-form-block].has-error`\n );\n if (!first) return;\n\n first.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n const focusable = first.querySelector<HTMLElement>(\n \"input, textarea, select\"\n );\n if (focusable) setTimeout(() => focusable.focus(), 400);\n}\n\n// \u2500\u2500\u2500 Mirror Value Fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction fillMirrorValues(): void {\n // 1. Get all fields with mirror-value true\n const mirrorFields = _currentFields.filter((f) => f[\"mirror-value\"] === true);\n if (mirrorFields.length === 0) return;\n\n // 2. Select all mirror target elements\n const mirrorTargets = document.querySelectorAll<HTMLElement>(\"[pulse-form-block-mirror]\");\n\n // 3. For each mirror field, find matching target and fill\n mirrorFields.forEach((field) => {\n const fieldName = field[\"field-name\"];\n let found = false;\n\n mirrorTargets.forEach((target) => {\n const mirrorAttr = target.getAttribute(\"pulse-form-block-mirror\")?.trim();\n if (mirrorAttr !== fieldName) return;\n\n found = true;\n\n // Find the input inside the mirror target and fill it\n const input = target.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\n \"input, textarea, select\"\n );\n\n if (!input) {\n console.warn(\n `[PulseForm] Mirror target for \"${fieldName}\" found, but no input element inside it.`\n );\n return;\n }\n\n // Set value based on type\n const value = field.value;\n if (typeof value === \"string\") {\n input.value = value;\n } else if (typeof value === \"boolean\") {\n if (input instanceof HTMLInputElement && input.type === \"checkbox\") {\n input.checked = value;\n } else {\n input.value = String(value);\n }\n } else if (Array.isArray(value)) {\n input.value = value.join(\", \");\n } else {\n input.value = \"\";\n }\n });\n\n if (!found) {\n console.warn(\n `[PulseForm] No mirror target found for field \"${fieldName}\". ` +\n `Add an element with attribute pulse-form-block-mirror=\"${fieldName}\" to mirror this value.`\n );\n }\n });\n}\n\n\nfunction loadCalendarEmbed(): void {\n const container = document.querySelector<HTMLElement>(\"[hs-calender-block]\");\n if (!container) {\n console.warn(\"[PulseForm] No element with attribute 'hs-calender-block' found.\");\n return;\n }\n\n // Determine which entry to use based on flow-type\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n const flowValue = flowField?.value;\n\n let entry: CalendarEntry | undefined;\n\n if (flowValue === \"Pulse demo\") {\n // Use the pulse entry\n entry = CALENDAR_ENTRIES.find((e) => e.type === \"pulse\");\n } else if (flowValue === \"White Glove services\") {\n // Use the industry entry based on selected industry\n const industryField = _currentFields.find((f) => f[\"field-name\"] === \"industry\");\n const industryValue = industryField?.value;\n\n if (typeof industryValue === \"string\" && industryValue) {\n entry = CALENDAR_ENTRIES.find(\n (e) => e.type === \"industry\" && e.name.toLowerCase() === industryValue.toLowerCase()\n );\n }\n }\n\n if (!entry) {\n // Fallback to \"Other\"\n entry = CALENDAR_ENTRIES.find((e) => e.type === \"industry\" && e.name === \"Other\");\n }\n\n if (!entry) {\n console.warn(\"[PulseForm] No matching calendar entry found.\");\n return;\n }\n\n // Clear existing content\n container.innerHTML = \"\";\n\n // Add the HubSpot meetings embed\n const meetingsDiv = document.createElement(\"div\");\n meetingsDiv.className = \"meetings-iframe-container\";\n meetingsDiv.setAttribute(\"data-src\", entry[\"embed-url\"]);\n container.appendChild(meetingsDiv);\n\n // Load the HubSpot embed script\n const script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.src = \"https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js\";\n container.appendChild(script);\n\n console.log(`[PulseForm] Loaded calendar: ${entry[\"calender-name\"]} (${entry.name})`);\n}\n\nfunction updateFlowType(): void {\n // 1. Get the value of field-name=\"flow-type\" from the JSON\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // 2. Select all elements with attribute \"form-flow\"\n const flowElements = document.querySelectorAll<HTMLElement>(\"[form-flow]\");\n\n // 3. Set form-flow-active based on matching value\n flowElements.forEach((el) => {\n const elFlowValue = el.getAttribute(\"form-flow\")?.trim();\n if (elFlowValue === flowValue) {\n el.setAttribute(\"form-flow-active\", \"true\");\n } else {\n el.setAttribute(\"form-flow-active\", \"false\");\n }\n });\n\n}\n\n// \u2500\u2500\u2500 Conditional Required \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction updateConditionalRequired(): void {\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // Reset both fields to not required first\n const industryIdx = _currentFields.findIndex((f) => f[\"field-name\"] === \"industry\");\n const lookingForIdx = _currentFields.findIndex((f) => f[\"field-name\"] === \"what-are-you-looking-for\");\n\n if (industryIdx !== -1) {\n _currentFields[industryIdx] = { ..._currentFields[industryIdx], required: null };\n }\n if (lookingForIdx !== -1) {\n _currentFields[lookingForIdx] = { ..._currentFields[lookingForIdx], required: null };\n }\n\n // Set required based on flow-type value\n if (flowValue === \"White Glove services\" && industryIdx !== -1) {\n _currentFields[industryIdx] = { ..._currentFields[industryIdx], required: \"true\" };\n } else if (flowValue === \"Pulse demo\" && lookingForIdx !== -1) {\n _currentFields[lookingForIdx] = { ..._currentFields[lookingForIdx], required: \"atleast-one\" };\n }\n\n (window as any).PulseFormData = _currentFields;\n}\n\n// \u2500\u2500\u2500 Reactive State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet _currentFields: PulseFormField[] = [];\n\nfunction updateFieldInState(\n fieldName: string,\n value: PulseFormField[\"value\"],\n error: PulseFormField[\"error\"]\n): void {\n const idx = _currentFields.findIndex((f) => f[\"field-name\"] === fieldName);\n if (idx === -1) return;\n _currentFields[idx] = { ..._currentFields[idx], value, error };\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n}\n\nfunction handleFieldChange(wrapper: HTMLElement): void {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const value = extractValue(rawType, wrapper);\n const hasError = wrapper.classList.contains(\"has-error\");\n\n if (hasError) {\n const error = getFieldError(rawType, required, value, wrapper);\n if (!error) {\n clearErrorOnWrapper(wrapper);\n updateFieldInState(fieldName, value, null);\n } else {\n showErrorOnWrapper(wrapper, error);\n updateFieldInState(fieldName, value, error);\n }\n } else {\n updateFieldInState(fieldName, value, null);\n }\n}\n\nfunction bindChangeListeners(): void {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const type = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType | undefined;\n\n if (!type || !VALID_BLOCK_TYPES.includes(type)) return;\n\n const onChange = () => handleFieldChange(wrapper);\n\n switch (type) {\n case \"text\":\n case \"email\": {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (input) {\n input.addEventListener(\"input\", onChange);\n input.addEventListener(\"change\", onChange);\n }\n break;\n }\n\n case \"phone\": {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n phoneInput.addEventListener(\"input\", onChange);\n phoneInput.addEventListener(\"change\", onChange);\n phoneInput.addEventListener(\"keyup\", onChange);\n phoneInput.addEventListener(\"countrychange\", onChange);\n }\n break;\n }\n\n case \"checkbox\":\n case \"legal\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"checkbox\"]')\n .forEach((cb) => cb.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"radio\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')\n .forEach((r) => r.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"select\": {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (select) select.addEventListener(\"change\", onChange);\n break;\n }\n }\n });\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PulseForm = {\n get fields(): PulseFormField[] {\n return _currentFields;\n },\n\n refresh(): PulseFormField[] {\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n return _currentFields;\n },\n\n validate(): { fields: PulseFormField[]; isValid: boolean } {\n const fields = collectFormFields(true);\n\n _currentFields = fields;\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n\n // Re-validate fields whose required was changed by updateConditionalRequired\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n _currentFields.forEach((field, idx) => {\n const wrapper = Array.from(wrappers).find(\n (w) => w.getAttribute(\"pulse-field-name\")?.trim() === field[\"field-name\"]\n );\n if (!wrapper) return;\n const error = getFieldError(\n field[\"form-block\"],\n field.required,\n field.value,\n wrapper\n );\n _currentFields[idx] = { ..._currentFields[idx], error };\n });\n\n (window as any).PulseFormData = _currentFields;\n const isValid = _currentFields.every((f) => f.error === null);\n\n fillMirrorValues();\n updateFlowType();\n\n renderErrors(_currentFields);\n if (!isValid) focusFirstError();\n\n return { fields: _currentFields, isValid };\n },\n\n clearErrors(): void {\n clearAllErrors();\n _currentFields = _currentFields.map((f) => ({ ...f, error: null }));\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n },\n\n ERROR_CODES,\n ERROR_MESSAGES,\n};\n\n// \u2500\u2500\u2500 Initialize on DOM Ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const count = document.querySelectorAll(\"[pulse-form-block]\").length;\n console.log(`[PulseForm] Initialized \u2014 found ${count} form blocks.`);\n\n initIntlTelInput();\n\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n\n bindChangeListeners();\n\n // \u2500\u2500\u2500 Submit Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const triggerBtn = document.getElementById(\"trigger-webflow-form-submit\");\n if (triggerBtn) {\n triggerBtn.addEventListener(\"click\", (e) => {\n e.preventDefault();\n const { isValid } = PulseForm.validate();\n if (!isValid) return;\n\n\n\n // Change button text\n const originalText = triggerBtn.textContent;\n triggerBtn.textContent = \"Submitting...\";\n\n // Load the calendar embed BEFORE submitting\n loadCalendarEmbed();\n\n const submitBtn = document.getElementById(\"webflow-form-submit\") as HTMLButtonElement | null;\n if (submitBtn) {\n submitBtn.click();\n } else {\n console.warn('[PulseForm] Button with id \"webflow-form-submit\" not found.');\n }\n\n const hubspotBtn = document.getElementById(\"hubspot-form-submit\") as HTMLButtonElement | null;\n if (hubspotBtn) {\n hubspotBtn.click();\n } else {\n console.warn('[PulseForm] Button with id \"hubspot-form-submit\" not found.');\n }\n\n setTimeout(() => {\n document.getElementById(\"form-anchor\")?.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n }, 700);\n });\n }\n\n (window as any).PulseForm = PulseForm;\n});\n\n// \u2500\u2500\u2500 \u26A0\uFE0F DEV ONLY \u2014 Remove or disable in production \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction devAutoFill(): void {\n const firstNames = [\"Jordan\", \"Morgan\", \"Riley\", \"Avery\", \"Quinn\", \"Casey\", \"Blake\", \"Harper\", \"Sage\", \"Rowan\"];\n const lastNames = [\"Nakamura\", \"Lindqvist\", \"Okafor\", \"Brennan\", \"Castellano\", \"Pham\", \"Eriksen\", \"Moreira\", \"Ashworth\", \"Dubois\"];\n const domains = [\"inbox.co\", \"mailbox.org\", \"zipmail.net\", \"postly.io\", \"demobox.dev\"];\n\n const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];\n const rand = () => Math.random().toString(36).substring(2, 8);\n\n const firstName = pick(firstNames);\n const lastName = pick(lastNames);\n const email = `${firstName.toLowerCase()}.${rand()}@${pick(domains)}`;\n const phone = `${2000000000 + Math.floor(Math.random() * 8000000000)}`;\n\n const fieldMap: Record<string, string> = {\n \"first-name\": firstName,\n \"last-name\": lastName,\n \"email\": email,\n \"phone\": phone,\n \"anything-else\": \"Ignore this is a test form submission\",\n };\n\n Object.entries(fieldMap).forEach(([fieldName, value]) => {\n const wrapper = document.querySelector<HTMLElement>(\n `[pulse-field-name=\"${fieldName}\"]`\n );\n if (!wrapper) return;\n\n if (fieldName === \"phone\") {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!phoneInput) return;\n const iti = itiInstances.get(phoneInput);\n if (iti) {\n iti.setNumber(`+1${value}`);\n } else {\n phoneInput.value = value;\n }\n phoneInput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"keyup\", { bubbles: true }));\n return;\n }\n\n const el = fieldName === \"anything-else\"\n ? wrapper.querySelector<HTMLTextAreaElement>(\"textarea\")\n : wrapper.querySelector<HTMLInputElement>(\"input\");\n if (!el) return;\n\n el.value = value;\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n\n console.log(\"[PulseForm][DEV] Auto-filled:\", fieldMap);\n}\n\nsetTimeout(devAutoFill, 500);\n// \u2500\u2500\u2500 \u26A0\uFE0F END DEV ONLY \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,UAAQ,IAAI,gCAAgC;AAuB5C,MAAM,oBAAqC;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAEA,MAAM,mBAAoC;AAAA,IACtC;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,MACI,MAAM;AAAA,MACN,MAAM;AAAA,MACN,iBAAiB;AAAA,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C,CAAC;AAC9D;AAAA,MACJ;AAEA,YAAM,KAAK,cAAc,kBACnB,QAAQ,cAAmC,UAAU,IACrD,QAAQ,cAAgC,OAAO;AACrD,UAAI,CAAC,GAAI;AAET,SAAG,QAAQ;AACX,SAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AACtD,SAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;AAAA,IAC3D,CAAC;AAED,YAAQ,IAAI,iCAAiC,QAAQ;AAAA,EACzD;AAEA,aAAW,aAAa,GAAG;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form/styles.css"],
4
- "sourcesContent": [".w-form-formradioinput--inputType-custom.w--redirected-focus {\n box-shadow: none;\n}\n\n/* Hide by default */\n.radio-checked {\n display: none;\n}\n\n/* Show when the custom radio is checked */\n.w-form-formradioinput.w--redirected-checked~.radio-checked {\n display: flex;\n}\n\n.w-checkbox-input--inputType-custom.w--redirected-focus {\n box-shadow: none;\n}\n\n.w-input:focus,\n.w-select:focus {\n border-color: transparent;\n outline: 0;\n}\n\n/* Default state */\n.radio-inner-label {\n color: var(--text-colors--subtext);\n}\n\n/* When radio is checked */\ninput[type=\"radio\"]:checked+.radio-inner-label {\n color: var(--text-colors--title);\n}\n\n/* Default (unchecked) */\n.checkbox-label {\n color: var(--text-colors--subtext);\n}\n\n/* When checked */\ninput[type=\"checkbox\"]:checked+.checkbox-label {\n color: var(--text-colors--title);\n}\n\n.w-checkbox-input--inputType-custom.w--redirected-checked {\n background-color: #F66025;\n border-color: #F66025;\n}\n\n/* Change label color when checked */\ninput[type=\"checkbox\"]:checked+.checkbox-label {\n color: var(--text-colors--title);\n}\n\n/* Change parent border when checked */\n.checkbox-field:has(input[type=\"checkbox\"]:checked) {\n border-color: #F66025;\n}\n\n/* Smooth color transition for labels */\n.radio-inner-label,\n.checkbox-label {\n transition: color 300ms ease;\n}\n\n/* Smooth border transition for parent checkbox field */\n.checkbox-field {\n transition: border-color 300ms ease;\n}\n\n/* Smooth background + border transition for custom checkbox input */\n.w-checkbox-input--inputType-custom {\n transition: background-color 300ms ease, border-color 300ms ease;\n}\n\nspan.pulse-form-error {\n color: #e55757;\n font-size: var(--_text-size---body--s);\n line-height: var(--_line-height---line-height-body--s);\n font-weight: var(--_font-weight---font-weight-body--s);\n letter-spacing: var(--_letter-spacing---letter-spacing-body--s);\n}\n\n[data-error-code=\"ERR_LEGAL_REQUIRED\"] {\n padding-left: 18px;\n}\n\n[form-flow-active=\"false\"] {\n display: none;\n}\n\n[form-flow-active=\"true\"] {\n display: flex;\n}\n\n[fullwidth] {\n width: 100%;\n}\n\n[hs-calender-active=\"true\"] {\n display: block;\n width: 100%;\n}\n\n[hs-calender-active=\"false\"] {\n display: none;\n}"],
5
- "mappings": ";AAAA,CAAC,uCAAuC,CAAC;AACrC,cAAY;AAChB;AAGA,CAAC;AACG,WAAS;AACb;AAGA,CAAC,qBAAqB,CAAC,sBAAqB,EAAC,CAL5C;AAMG,WAAS;AACb;AAEA,CAAC,kCAAkC,CAdM;AAerC,cAAY;AAChB;AAEA,CAAC,OAAO;AACR,CAAC,QAAQ;AACL,gBAAc;AACd,WAAS;AACb;AAGA,CAAC;AACG,SAAO,IAAI;AACf;AAGA,KAAK,CAAC,WAAa,SAAQ,EAAC,CAL3B;AAMG,SAAO,IAAI;AACf;AAGA,CAAC;AACG,SAAO,IAAI;AACf;AAGA,KAAK,CAAC,cAAgB,SAAQ,EAAC,CAL9B;AAMG,SAAO,IAAI;AACf;AAEA,CA9BC,kCA8BkC,CAlCZ;AAmCnB,oBAAkB;AAClB,gBAAc;AAClB;AAGA,KAAK,CAAC,cAAgB,SAAQ,EAAC,CAf9B;AAgBG,SAAO,IAAI;AACf;AAGA,CAAC,cAAc,KAAK,KAAK,CAAC,cAAgB;AACtC,gBAAc;AAClB;AAGA,CAnCC;AAoCD,CA1BC;AA2BG,cAAY,MAAM,MAAM;AAC5B;AAGA,CAXC;AAYG,cAAY,aAAa,MAAM;AACnC;AAGA,CAzDC;AA0DG,cAAY,iBAAiB,MAAM,IAAI,EAAE,aAAa,MAAM;AAChE;AAEA,IAAI,CAAC;AACD,SAAO;AACP,aAAW,IAAI;AACf,eAAa,IAAI;AACjB,eAAa,IAAI;AACjB,kBAAgB,IAAI;AACxB;AAEA,CAAC;AACG,gBAAc;AAClB;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,SAAO;AACX;AAEA,CAAC;AACG,WAAS;AACT,SAAO;AACX;AAEA,CAAC;AACG,WAAS;AACb;",
4
+ "sourcesContent": [".w-form-formradioinput--inputType-custom.w--redirected-focus {\n box-shadow: none;\n}\n\n/* Hide by default */\n.radio-checked {\n display: none;\n}\n\n/* Show when the custom radio is checked */\n.w-form-formradioinput.w--redirected-checked~.radio-checked {\n display: flex;\n}\n\n.w-checkbox-input--inputType-custom.w--redirected-focus {\n box-shadow: none;\n}\n\n.w-input:focus,\n.w-select:focus {\n border-color: transparent;\n outline: 0;\n}\n\n/* Default state */\n.radio-inner-label {\n color: var(--text-colors--subtext);\n}\n\n/* When radio is checked */\ninput[type=\"radio\"]:checked+.radio-inner-label {\n color: var(--text-colors--title);\n}\n\n/* Default (unchecked) */\n.checkbox-label {\n color: var(--text-colors--subtext);\n}\n\n/* When checked */\ninput[type=\"checkbox\"]:checked+.checkbox-label {\n color: var(--text-colors--title);\n}\n\n.w-checkbox-input--inputType-custom.w--redirected-checked {\n background-color: #F66025;\n border-color: #F66025;\n}\n\n/* Change label color when checked */\ninput[type=\"checkbox\"]:checked+.checkbox-label {\n color: var(--text-colors--title);\n}\n\n/* Change parent border when checked */\n.checkbox-field:has(input[type=\"checkbox\"]:checked) {\n border-color: #F66025;\n}\n\n/* Smooth color transition for labels */\n.radio-inner-label,\n.checkbox-label {\n transition: color 300ms ease;\n}\n\n/* Smooth border transition for parent checkbox field */\n.checkbox-field {\n transition: border-color 300ms ease;\n}\n\n/* Smooth background + border transition for custom checkbox input */\n.w-checkbox-input--inputType-custom {\n transition: background-color 300ms ease, border-color 300ms ease;\n}\n\nspan.pulse-form-error {\n color: #e55757;\n font-size: var(--_text-size---body--s);\n line-height: var(--_line-height---line-height-body--s);\n font-weight: var(--_font-weight---font-weight-body--s);\n letter-spacing: var(--_letter-spacing---letter-spacing-body--s);\n}\n\n[data-error-code=\"ERR_LEGAL_REQUIRED\"] {\n padding-left: 18px;\n}\n\n[form-flow-active=\"false\"] {\n display: none;\n}\n\n[form-flow-active=\"true\"] {\n display: flex;\n}\n\n[fullwidth] {\n width: 100%;\n}\n\n[hs-calender-active=\"true\"] {\n display: block;\n width: 100%;\n}\n\n[hs-calender-active=\"false\"] {\n display: none;\n}\n\ndiv#iti-0__dropdown-content {\n background-color: #121212;\n border-color: #242424;\n}\n\n#iti-0__search-input {\n background: #242424;\n}\n\n.iti__search-input-wrapper {\n border-color: #242424;\n}"],
5
+ "mappings": ";AAAA,CAAC,uCAAuC,CAAC;AACrC,cAAY;AAChB;AAGA,CAAC;AACG,WAAS;AACb;AAGA,CAAC,qBAAqB,CAAC,sBAAqB,EAAC,CAL5C;AAMG,WAAS;AACb;AAEA,CAAC,kCAAkC,CAdM;AAerC,cAAY;AAChB;AAEA,CAAC,OAAO;AACR,CAAC,QAAQ;AACL,gBAAc;AACd,WAAS;AACb;AAGA,CAAC;AACG,SAAO,IAAI;AACf;AAGA,KAAK,CAAC,WAAa,SAAQ,EAAC,CAL3B;AAMG,SAAO,IAAI;AACf;AAGA,CAAC;AACG,SAAO,IAAI;AACf;AAGA,KAAK,CAAC,cAAgB,SAAQ,EAAC,CAL9B;AAMG,SAAO,IAAI;AACf;AAEA,CA9BC,kCA8BkC,CAlCZ;AAmCnB,oBAAkB;AAClB,gBAAc;AAClB;AAGA,KAAK,CAAC,cAAgB,SAAQ,EAAC,CAf9B;AAgBG,SAAO,IAAI;AACf;AAGA,CAAC,cAAc,KAAK,KAAK,CAAC,cAAgB;AACtC,gBAAc;AAClB;AAGA,CAnCC;AAoCD,CA1BC;AA2BG,cAAY,MAAM,MAAM;AAC5B;AAGA,CAXC;AAYG,cAAY,aAAa,MAAM;AACnC;AAGA,CAzDC;AA0DG,cAAY,iBAAiB,MAAM,IAAI,EAAE,aAAa,MAAM;AAChE;AAEA,IAAI,CAAC;AACD,SAAO;AACP,aAAW,IAAI;AACf,eAAa,IAAI;AACjB,eAAa,IAAI;AACjB,kBAAgB,IAAI;AACxB;AAEA,CAAC;AACG,gBAAc;AAClB;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,SAAO;AACX;AAEA,CAAC;AACG,WAAS;AACT,SAAO;AACX;AAEA,CAAC;AACG,WAAS;AACb;AAEA,GAAG,CAAC;AACA,oBAAkB;AAClB,gBAAc;AAClB;AAEA,CAAC;AACG,cAAY;AAChB;AAEA,CAAC;AACG,gBAAc;AAClB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/marquee/index.ts"],
4
- "sourcesContent": ["export { };\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconsole.log(\"Book a demo form script loaded\");\n\ntype FormBlockType = \"text\" | \"email\" | \"phone\" | \"checkbox\" | \"radio\" | \"select\" | \"legal\";\ntype RequiredSelection = \"true\" | \"atleast-one\" | \"only-one\";\n\ninterface PulseFormField {\n \"form-block\": FormBlockType;\n \"field-name\": string;\n value: string | string[] | boolean | null;\n required: RequiredSelection | null;\n \"mirror-value\": boolean;\n error: { code: string; message: string } | null;\n}\n\n// \u2500\u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst VALID_BLOCK_TYPES: FormBlockType[] = [\n \"text\",\n \"email\",\n \"phone\",\n \"checkbox\",\n \"radio\",\n \"select\",\n \"legal\",\n];\n\nconst VALID_REQUIRED_VALUES: RequiredSelection[] = [\n \"true\",\n \"atleast-one\",\n \"only-one\",\n];\n\n// \u2500\u2500\u2500 Error Codes & Messages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ERROR_CODES = {\n REQUIRED_INPUT: \"ERR_REQUIRED\",\n REQUIRED_LEGAL: \"ERR_LEGAL_REQUIRED\",\n REQUIRED_SELECT: \"ERR_SELECT_REQUIRED\",\n ATLEAST_ONE: \"ERR_ATLEAST_ONE\",\n ONLY_ONE_NONE: \"ERR_ONLY_ONE_NONE\",\n ONLY_ONE_EXCEEDED: \"ERR_ONLY_ONE_EXCEEDED\",\n INVALID_EMAIL: \"ERR_INVALID_EMAIL\",\n INVALID_PHONE: \"ERR_INVALID_PHONE\",\n PHONE_TOO_SHORT: \"ERR_PHONE_TOO_SHORT\",\n PHONE_TOO_LONG: \"ERR_PHONE_TOO_LONG\",\n PHONE_INVALID_COUNTRY: \"ERR_PHONE_INVALID_COUNTRY\",\n} as const;\n\nconst ERROR_MESSAGES: Record<string, string> = {\n [ERROR_CODES.REQUIRED_INPUT]: \"This field is required.\",\n [ERROR_CODES.REQUIRED_LEGAL]: \"You must accept this to continue.\",\n [ERROR_CODES.REQUIRED_SELECT]: \"Please select an option.\",\n [ERROR_CODES.ATLEAST_ONE]: \"Please select at least one option.\",\n [ERROR_CODES.ONLY_ONE_NONE]: \"Please select one option.\",\n [ERROR_CODES.ONLY_ONE_EXCEEDED]: \"Only one option can be selected.\",\n [ERROR_CODES.INVALID_EMAIL]: \"Please enter a valid email address.\",\n [ERROR_CODES.INVALID_PHONE]: \"Please enter a valid phone number.\",\n [ERROR_CODES.PHONE_TOO_SHORT]: \"Phone number is too short.\",\n [ERROR_CODES.PHONE_TOO_LONG]: \"Phone number is too long.\",\n [ERROR_CODES.PHONE_INVALID_COUNTRY]: \"Invalid country code.\",\n};\n\nconst ERROR_SPAN_CLASS = \"pulse-form-error\";\n\n// \u2500\u2500\u2500 intl-tel-input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst itiInstances = new Map<HTMLInputElement, any>();\n\nfunction fillCountryCodeInput(iti: any): void {\n try {\n const countryData = iti.getSelectedCountryData?.();\n if (!countryData?.dialCode) return;\n\n const inputs = document.querySelectorAll<HTMLInputElement>(\n 'input[pulse-form-field=\"country-code\"]'\n );\n inputs.forEach((input) => {\n input.value = `+${countryData.dialCode}`;\n });\n } catch (err) {\n console.warn(\"[PulseForm] Error filling country code:\", err);\n }\n}\n\nfunction initIntlTelInput(): void {\n const intlTelInput = (window as any).intlTelInput;\n if (!intlTelInput) {\n console.warn(\n \"[PulseForm] intlTelInput not found on window. \" +\n \"Make sure you include the intl-tel-input script before this script.\\n\" +\n 'e.g. <script src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js\"></script>'\n );\n return;\n }\n\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n '[pulse-form-block=\"phone\"] input[type=\"tel\"]'\n );\n\n phoneInputs.forEach((input) => {\n try {\n const iti = intlTelInput(input, {\n initialCountry: \"us\",\n separateDialCode: true,\n strictMode: false,\n // @ts-ignore \u2014 runtime CDN import, not a TS module\n loadUtils: () => import(\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js\"),\n });\n\n itiInstances.set(input, iti);\n\n fillCountryCodeInput(iti);\n\n input.addEventListener(\"countrychange\", () => {\n fillCountryCodeInput(iti);\n });\n\n console.log(\n `[PulseForm] intl-tel-input initialized for \"${input.closest(\"[pulse-form-block]\")?.getAttribute(\"pulse-field-name\") || \"unknown\"}\"`\n );\n } catch (err) {\n console.warn(\"[PulseForm] Failed to init intl-tel-input:\", err);\n }\n });\n}\n\n// \u2500\u2500\u2500 Format Validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PHONE_ITI_ERROR_MAP: Record<number, string> = {\n 0: ERROR_CODES.INVALID_PHONE,\n 1: ERROR_CODES.PHONE_INVALID_COUNTRY,\n 2: ERROR_CODES.PHONE_TOO_SHORT,\n 3: ERROR_CODES.PHONE_TOO_LONG,\n 4: ERROR_CODES.INVALID_PHONE,\n};\n\nfunction validateEmail(value: string): PulseFormField[\"error\"] {\n if (!value) return null;\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) {\n return { code: ERROR_CODES.INVALID_EMAIL, message: ERROR_MESSAGES[ERROR_CODES.INVALID_EMAIL] };\n }\n return null;\n}\n\nfunction validatePhone(input: HTMLInputElement): PulseFormField[\"error\"] {\n const value = input.value.trim();\n if (!value) return null;\n\n const iti = itiInstances.get(input);\n\n if (iti) {\n try {\n if (iti.isValidNumber()) return null;\n const errorCode: number = iti.getValidationError?.() ?? 0;\n const code = PHONE_ITI_ERROR_MAP[errorCode] || ERROR_CODES.INVALID_PHONE;\n return { code, message: ERROR_MESSAGES[code] };\n } catch {\n return { code: ERROR_CODES.INVALID_PHONE, message: ERROR_MESSAGES[ERROR_CODES.INVALID_PHONE] };\n }\n }\n\n // Fallback: basic digit length\n const digits = value.replace(/\\D/g, \"\");\n if (digits.length < 7)\n return { code: ERROR_CODES.PHONE_TOO_SHORT, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_SHORT] };\n if (digits.length > 15)\n return { code: ERROR_CODES.PHONE_TOO_LONG, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_LONG] };\n return null;\n}\n\n// \u2500\u2500\u2500 Value Extractors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractTextValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractEmailValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"email\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractPhoneValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractCheckboxValues(wrapper: HTMLElement): string[] {\n const checkboxes = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n const values: string[] = [];\n checkboxes.forEach((cb) => {\n if (cb.checked) {\n const name = cb.getAttribute(\"data-name\")?.trim();\n values.push(name || cb.value || \"on\");\n }\n });\n return values;\n}\n\nfunction extractRadioValue(wrapper: HTMLElement): string | null {\n const radios = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]'\n );\n for (const radio of radios) {\n if (radio.checked) {\n const label = radio.closest(\"label\")?.textContent?.trim();\n return label || radio.value || \"on\";\n }\n }\n return null;\n}\n\nfunction extractSelectValue(wrapper: HTMLElement): string | null {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (!select) return null;\n const val = select.value.trim();\n if (!val || select.selectedIndex === 0) return null;\n return val;\n}\n\nfunction extractLegalValue(wrapper: HTMLElement): boolean {\n const checkbox = wrapper.querySelector<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n if (!checkbox) return false;\n return checkbox.checked;\n}\n\n// \u2500\u2500\u2500 Core Parser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractValue(\n type: FormBlockType,\n wrapper: HTMLElement\n): PulseFormField[\"value\"] {\n switch (type) {\n case \"text\":\n return extractTextValue(wrapper);\n case \"email\":\n return extractEmailValue(wrapper);\n case \"phone\":\n return extractPhoneValue(wrapper);\n case \"checkbox\":\n return extractCheckboxValues(wrapper);\n case \"radio\":\n return extractRadioValue(wrapper);\n case \"select\":\n return extractSelectValue(wrapper);\n case \"legal\":\n return extractLegalValue(wrapper);\n default:\n return null;\n }\n}\n\nfunction parseRequired(wrapper: HTMLElement): RequiredSelection | null {\n const raw = wrapper.getAttribute(\"required-selection\")?.trim().toLowerCase();\n if (!raw || !VALID_REQUIRED_VALUES.includes(raw as RequiredSelection))\n return null;\n return raw as RequiredSelection;\n}\n\nfunction parseMirrorValue(wrapper: HTMLElement): boolean {\n return wrapper.getAttribute(\"mirror-value\")?.trim().toLowerCase() === \"true\";\n}\n\n// \u2500\u2500\u2500 Validation Logic (per field) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getFieldError(\n type: FormBlockType,\n required: RequiredSelection | null,\n value: PulseFormField[\"value\"],\n wrapper: HTMLElement\n): PulseFormField[\"error\"] {\n // 1. Required checks\n if (required) {\n switch (required) {\n case \"true\": {\n if (type === \"legal\" && value !== true)\n return { code: ERROR_CODES.REQUIRED_LEGAL, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_LEGAL] };\n if (type === \"select\" && !value)\n return { code: ERROR_CODES.REQUIRED_SELECT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_SELECT] };\n if (\n (type === \"text\" || type === \"email\" || type === \"phone\") &&\n (!value || (typeof value === \"string\" && value === \"\"))\n )\n return { code: ERROR_CODES.REQUIRED_INPUT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_INPUT] };\n break;\n }\n\n case \"atleast-one\": {\n const empty = Array.isArray(value) ? value.length === 0 : !value;\n if (empty)\n return { code: ERROR_CODES.ATLEAST_ONE, message: ERROR_MESSAGES[ERROR_CODES.ATLEAST_ONE] };\n break;\n }\n\n case \"only-one\": {\n if (Array.isArray(value)) {\n if (value.length === 0)\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n if (value.length > 1)\n return { code: ERROR_CODES.ONLY_ONE_EXCEEDED, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_EXCEEDED] };\n } else if (!value) {\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n }\n break;\n }\n }\n }\n\n // 2. Format checks (only when there's a value)\n if (type === \"email\" && typeof value === \"string\" && value) {\n const emailError = validateEmail(value);\n if (emailError) return emailError;\n }\n\n if (type === \"phone\" && typeof value === \"string\" && value) {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n const phoneError = validatePhone(phoneInput);\n if (phoneError) return phoneError;\n }\n }\n\n return null;\n}\n\n// \u2500\u2500\u2500 Collect Fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction collectFormFields(withValidation: boolean): PulseFormField[] {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n const fields: PulseFormField[] = [];\n\n wrappers.forEach((wrapper) => {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase();\n\n if (!rawType || !VALID_BLOCK_TYPES.includes(rawType as FormBlockType))\n return;\n\n const blockType = rawType as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const mirrorValue = parseMirrorValue(wrapper);\n const value = extractValue(blockType, wrapper);\n const error = withValidation\n ? getFieldError(blockType, required, value, wrapper)\n : null;\n\n fields.push({\n \"form-block\": blockType,\n \"field-name\": fieldName,\n value,\n required,\n \"mirror-value\": mirrorValue,\n error,\n });\n });\n\n return fields;\n}\n\n// \u2500\u2500\u2500 Error UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction clearAllErrors(): void {\n document\n .querySelectorAll<HTMLElement>(`.${ERROR_SPAN_CLASS}`)\n .forEach((el) => el.remove());\n\n document\n .querySelectorAll<HTMLElement>(\"[pulse-form-block]\")\n .forEach((el) => el.classList.remove(\"has-error\"));\n}\n\nfunction clearErrorOnWrapper(wrapper: HTMLElement): void {\n const span = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (span) span.remove();\n wrapper.classList.remove(\"has-error\");\n}\n\nfunction showErrorOnWrapper(\n wrapper: HTMLElement,\n error: { code: string; message: string }\n): void {\n const existing = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (existing) existing.remove();\n\n const span = document.createElement(\"span\");\n span.className = ERROR_SPAN_CLASS;\n span.textContent = error.message;\n span.setAttribute(\"data-error-code\", error.code);\n span.setAttribute(\n \"data-field-name\",\n wrapper.getAttribute(\"pulse-field-name\")?.trim() || \"\"\n );\n\n wrapper.classList.add(\"has-error\");\n wrapper.appendChild(span);\n}\n\nfunction renderErrors(fields: PulseFormField[]): void {\n clearAllErrors();\n\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const field = fields.find((f) => f[\"field-name\"] === fieldName);\n if (!field || !field.error) return;\n\n showErrorOnWrapper(wrapper, field.error);\n });\n}\n\nfunction focusFirstError(): void {\n const first = document.querySelector<HTMLElement>(\n `[pulse-form-block].has-error`\n );\n if (!first) return;\n\n first.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n const focusable = first.querySelector<HTMLElement>(\n \"input, textarea, select\"\n );\n if (focusable) setTimeout(() => focusable.focus(), 400);\n}\n\n// \u2500\u2500\u2500 Mirror Value Fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction fillMirrorValues(): void {\n // 1. Get all fields with mirror-value true\n const mirrorFields = _currentFields.filter((f) => f[\"mirror-value\"] === true);\n if (mirrorFields.length === 0) return;\n\n // 2. Select all mirror target elements\n const mirrorTargets = document.querySelectorAll<HTMLElement>(\"[pulse-form-block-mirror]\");\n\n // 3. For each mirror field, find matching target and fill\n mirrorFields.forEach((field) => {\n const fieldName = field[\"field-name\"];\n let found = false;\n\n mirrorTargets.forEach((target) => {\n const mirrorAttr = target.getAttribute(\"pulse-form-block-mirror\")?.trim();\n if (mirrorAttr !== fieldName) return;\n\n found = true;\n\n // Find the input inside the mirror target and fill it\n const input = target.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\n \"input, textarea, select\"\n );\n\n if (!input) {\n console.warn(\n `[PulseForm] Mirror target for \"${fieldName}\" found, but no input element inside it.`\n );\n return;\n }\n\n // Set value based on type\n const value = field.value;\n if (typeof value === \"string\") {\n input.value = value;\n } else if (typeof value === \"boolean\") {\n if (input instanceof HTMLInputElement && input.type === \"checkbox\") {\n input.checked = value;\n } else {\n input.value = String(value);\n }\n } else if (Array.isArray(value)) {\n input.value = value.join(\", \");\n } else {\n input.value = \"\";\n }\n });\n\n if (!found) {\n console.warn(\n `[PulseForm] No mirror target found for field \"${fieldName}\". ` +\n `Add an element with attribute pulse-form-block-mirror=\"${fieldName}\" to mirror this value.`\n );\n }\n });\n}\n\n// \u2500\u2500\u2500 Flow Type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst INDUSTRY_CALENDER_MAP: Record<string, string> = {\n \"Financial Services\": \"david\",\n \"Sports\": \"steven\",\n \"Beauty\": \"albany\",\n \"Music\": \"steven\",\n \"Customer Packaged Goods\": \"david\",\n \"Other\": \"david\",\n};\n\nfunction setWhiteGloveCalender(): void {\n // 1. Get the value of field-name=\"industry\" from the JSON\n const industryField = _currentFields.find((f) => f[\"field-name\"] === \"industry\");\n if (!industryField || typeof industryField.value !== \"string\" || !industryField.value) return;\n\n const activePerson = INDUSTRY_CALENDER_MAP[industryField.value];\n\n // 2. Select all elements with attribute \"hs-calender\"\n const calenderElements = document.querySelectorAll<HTMLElement>(\"[hs-calender]\");\n\n // 3. Set hs-calender-active based on matching person\n calenderElements.forEach((el) => {\n const elCalenderValue = el.getAttribute(\"hs-calender\")?.trim();\n if (activePerson && elCalenderValue === activePerson) {\n el.setAttribute(\"hs-calender-active\", \"true\");\n } else {\n el.setAttribute(\"hs-calender-active\", \"false\");\n }\n });\n}\n\nfunction updateFlowType(): void {\n // 1. Get the value of field-name=\"flow-type\" from the JSON\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // 2. Select all elements with attribute \"form-flow\"\n const flowElements = document.querySelectorAll<HTMLElement>(\"[form-flow]\");\n\n // 3. Set form-flow-active based on matching value\n flowElements.forEach((el) => {\n const elFlowValue = el.getAttribute(\"form-flow\")?.trim();\n if (elFlowValue === flowValue) {\n el.setAttribute(\"form-flow-active\", \"true\");\n } else {\n el.setAttribute(\"form-flow-active\", \"false\");\n }\n });\n\n // 4. If White Glove services, update calender assignments\n if (flowValue === \"White Glove services\") {\n setWhiteGloveCalender();\n }\n}\n\n// \u2500\u2500\u2500 Reactive State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet _currentFields: PulseFormField[] = [];\n\nfunction updateFieldInState(\n fieldName: string,\n value: PulseFormField[\"value\"],\n error: PulseFormField[\"error\"]\n): void {\n const idx = _currentFields.findIndex((f) => f[\"field-name\"] === fieldName);\n if (idx === -1) return;\n _currentFields[idx] = { ..._currentFields[idx], value, error };\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n}\n\nfunction handleFieldChange(wrapper: HTMLElement): void {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const value = extractValue(rawType, wrapper);\n const hasError = wrapper.classList.contains(\"has-error\");\n\n if (hasError) {\n const error = getFieldError(rawType, required, value, wrapper);\n if (!error) {\n clearErrorOnWrapper(wrapper);\n updateFieldInState(fieldName, value, null);\n } else {\n showErrorOnWrapper(wrapper, error);\n updateFieldInState(fieldName, value, error);\n }\n } else {\n updateFieldInState(fieldName, value, null);\n }\n}\n\nfunction bindChangeListeners(): void {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const type = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType | undefined;\n\n if (!type || !VALID_BLOCK_TYPES.includes(type)) return;\n\n const onChange = () => handleFieldChange(wrapper);\n\n switch (type) {\n case \"text\":\n case \"email\": {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (input) {\n input.addEventListener(\"input\", onChange);\n input.addEventListener(\"change\", onChange);\n }\n break;\n }\n\n case \"phone\": {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n phoneInput.addEventListener(\"input\", onChange);\n phoneInput.addEventListener(\"change\", onChange);\n phoneInput.addEventListener(\"keyup\", onChange);\n phoneInput.addEventListener(\"countrychange\", onChange);\n }\n break;\n }\n\n case \"checkbox\":\n case \"legal\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"checkbox\"]')\n .forEach((cb) => cb.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"radio\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')\n .forEach((r) => r.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"select\": {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (select) select.addEventListener(\"change\", onChange);\n break;\n }\n }\n });\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PulseForm = {\n get fields(): PulseFormField[] {\n return _currentFields;\n },\n\n refresh(): PulseFormField[] {\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n return _currentFields;\n },\n\n validate(): { fields: PulseFormField[]; isValid: boolean } {\n const fields = collectFormFields(true);\n const isValid = fields.every((f) => f.error === null);\n\n _currentFields = fields;\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n\n renderErrors(fields);\n if (!isValid) focusFirstError();\n\n return { fields, isValid };\n },\n\n clearErrors(): void {\n clearAllErrors();\n _currentFields = _currentFields.map((f) => ({ ...f, error: null }));\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n },\n\n ERROR_CODES,\n ERROR_MESSAGES,\n};\n\n// \u2500\u2500\u2500 Initialize on DOM Ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const count = document.querySelectorAll(\"[pulse-form-block]\").length;\n console.log(`[PulseForm] Initialized \u2014 found ${count} form blocks.`);\n\n initIntlTelInput();\n\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n\n bindChangeListeners();\n\n (window as any).PulseForm = PulseForm;\n});\n\n// \u2500\u2500\u2500 \u26A0\uFE0F DEV ONLY \u2014 Remove or disable in production \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction devAutoFill(): void {\n const firstNames = [\"Jordan\", \"Morgan\", \"Riley\", \"Avery\", \"Quinn\", \"Casey\", \"Blake\", \"Harper\", \"Sage\", \"Rowan\"];\n const lastNames = [\"Nakamura\", \"Lindqvist\", \"Okafor\", \"Brennan\", \"Castellano\", \"Pham\", \"Eriksen\", \"Moreira\", \"Ashworth\", \"Dubois\"];\n const domains = [\"inbox.co\", \"mailbox.org\", \"zipmail.net\", \"postly.io\", \"demobox.dev\"];\n\n const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];\n const rand = () => Math.random().toString(36).substring(2, 8);\n\n const firstName = pick(firstNames);\n const lastName = pick(lastNames);\n const email = `${firstName.toLowerCase()}.${rand()}@${pick(domains)}`;\n const phone = `${2000000000 + Math.floor(Math.random() * 8000000000)}`;\n\n const fieldMap: Record<string, string> = {\n \"first-name\": firstName,\n \"last-name\": lastName,\n \"email\": email,\n \"phone\": phone,\n \"anything-else\": \"Ignore this is a test form submission\",\n };\n\n Object.entries(fieldMap).forEach(([fieldName, value]) => {\n const wrapper = document.querySelector<HTMLElement>(\n `[pulse-field-name=\"${fieldName}\"]`\n );\n if (!wrapper) return;\n\n if (fieldName === \"phone\") {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!phoneInput) return;\n const iti = itiInstances.get(phoneInput);\n if (iti) {\n iti.setNumber(`+1${value}`);\n } else {\n phoneInput.value = value;\n }\n phoneInput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"keyup\", { bubbles: true }));\n return;\n }\n\n const el = fieldName === \"anything-else\"\n ? wrapper.querySelector<HTMLTextAreaElement>(\"textarea\")\n : wrapper.querySelector<HTMLInputElement>(\"input\");\n if (!el) return;\n\n el.value = value;\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n\n console.log(\"[PulseForm][DEV] Auto-filled:\", fieldMap);\n}\n\nsetTimeout(devAutoFill, 500);\n// \u2500\u2500\u2500 \u26A0\uFE0F END DEV ONLY \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,UAAQ,IAAI,gCAAgC;AAgB5C,MAAM,oBAAqC;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAEA,MAAM,wBAA6C;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAIA,MAAM,cAAc;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,mBAAm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,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AACtD,SAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;AAAA,IAC3D,CAAC;AAED,YAAQ,IAAI,iCAAiC,QAAQ;AAAA,EACzD;AAEA,aAAW,aAAa,GAAG;",
4
+ "sourcesContent": ["export { };\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconsole.log(\"Book a demo form script loaded\");\n\ntype FormBlockType = \"text\" | \"email\" | \"phone\" | \"checkbox\" | \"radio\" | \"select\" | \"legal\";\ntype RequiredSelection = \"true\" | \"atleast-one\" | \"only-one\";\n\ninterface PulseFormField {\n \"form-block\": FormBlockType;\n \"field-name\": string;\n value: string | string[] | boolean | null;\n required: RequiredSelection | null;\n \"mirror-value\": boolean;\n error: { code: string; message: string } | null;\n}\n\n// \u2500\u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst VALID_BLOCK_TYPES: FormBlockType[] = [\n \"text\",\n \"email\",\n \"phone\",\n \"checkbox\",\n \"radio\",\n \"select\",\n \"legal\",\n];\n\nconst VALID_REQUIRED_VALUES: RequiredSelection[] = [\n \"true\",\n \"atleast-one\",\n \"only-one\",\n];\n\n// \u2500\u2500\u2500 Error Codes & Messages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ERROR_CODES = {\n REQUIRED_INPUT: \"ERR_REQUIRED\",\n REQUIRED_LEGAL: \"ERR_LEGAL_REQUIRED\",\n REQUIRED_SELECT: \"ERR_SELECT_REQUIRED\",\n ATLEAST_ONE: \"ERR_ATLEAST_ONE\",\n ONLY_ONE_NONE: \"ERR_ONLY_ONE_NONE\",\n ONLY_ONE_EXCEEDED: \"ERR_ONLY_ONE_EXCEEDED\",\n INVALID_EMAIL: \"ERR_INVALID_EMAIL\",\n INVALID_PHONE: \"ERR_INVALID_PHONE\",\n PHONE_TOO_SHORT: \"ERR_PHONE_TOO_SHORT\",\n PHONE_TOO_LONG: \"ERR_PHONE_TOO_LONG\",\n PHONE_INVALID_COUNTRY: \"ERR_PHONE_INVALID_COUNTRY\",\n} as const;\n\nconst ERROR_MESSAGES: Record<string, string> = {\n [ERROR_CODES.REQUIRED_INPUT]: \"This field is required.\",\n [ERROR_CODES.REQUIRED_LEGAL]: \"You must accept this to continue.\",\n [ERROR_CODES.REQUIRED_SELECT]: \"Please select an option.\",\n [ERROR_CODES.ATLEAST_ONE]: \"Please select at least one option.\",\n [ERROR_CODES.ONLY_ONE_NONE]: \"Please select one option.\",\n [ERROR_CODES.ONLY_ONE_EXCEEDED]: \"Only one option can be selected.\",\n [ERROR_CODES.INVALID_EMAIL]: \"Please enter a valid email address.\",\n [ERROR_CODES.INVALID_PHONE]: \"Please enter a valid phone number.\",\n [ERROR_CODES.PHONE_TOO_SHORT]: \"Phone number is too short.\",\n [ERROR_CODES.PHONE_TOO_LONG]: \"Phone number is too long.\",\n [ERROR_CODES.PHONE_INVALID_COUNTRY]: \"Invalid country code.\",\n};\n\nconst ERROR_SPAN_CLASS = \"pulse-form-error\";\n\n// \u2500\u2500\u2500 intl-tel-input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst itiInstances = new Map<HTMLInputElement, any>();\n\nfunction fillCountryCodeInput(iti: any): void {\n try {\n const countryData = iti.getSelectedCountryData?.();\n if (!countryData?.dialCode) return;\n\n const inputs = document.querySelectorAll<HTMLInputElement>(\n 'input[pulse-form-field=\"country-code\"]'\n );\n inputs.forEach((input) => {\n input.value = `+${countryData.dialCode}`;\n });\n } catch (err) {\n console.warn(\"[PulseForm] Error filling country code:\", err);\n }\n}\n\nfunction initIntlTelInput(): void {\n const intlTelInput = (window as any).intlTelInput;\n if (!intlTelInput) {\n console.warn(\n \"[PulseForm] intlTelInput not found on window. \" +\n \"Make sure you include the intl-tel-input script before this script.\\n\" +\n 'e.g. <script src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js\"></script>'\n );\n return;\n }\n\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n '[pulse-form-block=\"phone\"] input[type=\"tel\"]'\n );\n\n phoneInputs.forEach((input) => {\n try {\n const iti = intlTelInput(input, {\n initialCountry: \"us\",\n separateDialCode: true,\n strictMode: false,\n // @ts-ignore \u2014 runtime CDN import, not a TS module\n loadUtils: () => import(\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js\"),\n });\n\n itiInstances.set(input, iti);\n\n fillCountryCodeInput(iti);\n\n input.addEventListener(\"countrychange\", () => {\n fillCountryCodeInput(iti);\n });\n\n console.log(\n `[PulseForm] intl-tel-input initialized for \"${input.closest(\"[pulse-form-block]\")?.getAttribute(\"pulse-field-name\") || \"unknown\"}\"`\n );\n } catch (err) {\n console.warn(\"[PulseForm] Failed to init intl-tel-input:\", err);\n }\n });\n}\n\n// \u2500\u2500\u2500 Format Validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PHONE_ITI_ERROR_MAP: Record<number, string> = {\n 0: ERROR_CODES.INVALID_PHONE,\n 1: ERROR_CODES.PHONE_INVALID_COUNTRY,\n 2: ERROR_CODES.PHONE_TOO_SHORT,\n 3: ERROR_CODES.PHONE_TOO_LONG,\n 4: ERROR_CODES.INVALID_PHONE,\n};\n\nfunction validateEmail(value: string): PulseFormField[\"error\"] {\n if (!value) return null;\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) {\n return { code: ERROR_CODES.INVALID_EMAIL, message: ERROR_MESSAGES[ERROR_CODES.INVALID_EMAIL] };\n }\n return null;\n}\n\nfunction validatePhone(input: HTMLInputElement): PulseFormField[\"error\"] {\n const value = input.value.trim();\n if (!value) return null;\n\n const iti = itiInstances.get(input);\n\n if (iti) {\n try {\n if (iti.isValidNumber()) return null;\n const errorCode: number = iti.getValidationError?.() ?? 0;\n const code = PHONE_ITI_ERROR_MAP[errorCode] || ERROR_CODES.INVALID_PHONE;\n return { code, message: ERROR_MESSAGES[code] };\n } catch {\n return { code: ERROR_CODES.INVALID_PHONE, message: ERROR_MESSAGES[ERROR_CODES.INVALID_PHONE] };\n }\n }\n\n // Fallback: basic digit length\n const digits = value.replace(/\\D/g, \"\");\n if (digits.length < 7)\n return { code: ERROR_CODES.PHONE_TOO_SHORT, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_SHORT] };\n if (digits.length > 15)\n return { code: ERROR_CODES.PHONE_TOO_LONG, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_LONG] };\n return null;\n}\n\n// \u2500\u2500\u2500 Value Extractors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractTextValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractEmailValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"email\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractPhoneValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractCheckboxValues(wrapper: HTMLElement): string[] {\n const checkboxes = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n const values: string[] = [];\n checkboxes.forEach((cb) => {\n if (cb.checked) {\n const name = cb.getAttribute(\"data-name\")?.trim();\n values.push(name || cb.value || \"on\");\n }\n });\n return values;\n}\n\nfunction extractRadioValue(wrapper: HTMLElement): string | null {\n const radios = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]'\n );\n for (const radio of radios) {\n if (radio.checked) {\n const label = radio.closest(\"label\")?.textContent?.trim();\n return label || radio.value || \"on\";\n }\n }\n return null;\n}\n\nfunction extractSelectValue(wrapper: HTMLElement): string | null {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (!select) return null;\n const val = select.value.trim();\n if (!val || select.selectedIndex === 0) return null;\n return val;\n}\n\nfunction extractLegalValue(wrapper: HTMLElement): boolean {\n const checkbox = wrapper.querySelector<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n if (!checkbox) return false;\n return checkbox.checked;\n}\n\n// \u2500\u2500\u2500 Core Parser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractValue(\n type: FormBlockType,\n wrapper: HTMLElement\n): PulseFormField[\"value\"] {\n switch (type) {\n case \"text\":\n return extractTextValue(wrapper);\n case \"email\":\n return extractEmailValue(wrapper);\n case \"phone\":\n return extractPhoneValue(wrapper);\n case \"checkbox\":\n return extractCheckboxValues(wrapper);\n case \"radio\":\n return extractRadioValue(wrapper);\n case \"select\":\n return extractSelectValue(wrapper);\n case \"legal\":\n return extractLegalValue(wrapper);\n default:\n return null;\n }\n}\n\nfunction parseRequired(wrapper: HTMLElement): RequiredSelection | null {\n const raw = wrapper.getAttribute(\"required-selection\")?.trim().toLowerCase();\n if (!raw || !VALID_REQUIRED_VALUES.includes(raw as RequiredSelection))\n return null;\n return raw as RequiredSelection;\n}\n\nfunction parseMirrorValue(wrapper: HTMLElement): boolean {\n return wrapper.getAttribute(\"mirror-value\")?.trim().toLowerCase() === \"true\";\n}\n\n// \u2500\u2500\u2500 Validation Logic (per field) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getFieldError(\n type: FormBlockType,\n required: RequiredSelection | null,\n value: PulseFormField[\"value\"],\n wrapper: HTMLElement\n): PulseFormField[\"error\"] {\n // 1. Required checks\n if (required) {\n switch (required) {\n case \"true\": {\n if (type === \"legal\" && value !== true)\n return { code: ERROR_CODES.REQUIRED_LEGAL, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_LEGAL] };\n if (type === \"select\" && !value)\n return { code: ERROR_CODES.REQUIRED_SELECT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_SELECT] };\n if (\n (type === \"text\" || type === \"email\" || type === \"phone\") &&\n (!value || (typeof value === \"string\" && value === \"\"))\n )\n return { code: ERROR_CODES.REQUIRED_INPUT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_INPUT] };\n break;\n }\n\n case \"atleast-one\": {\n const empty = Array.isArray(value) ? value.length === 0 : !value;\n if (empty)\n return { code: ERROR_CODES.ATLEAST_ONE, message: ERROR_MESSAGES[ERROR_CODES.ATLEAST_ONE] };\n break;\n }\n\n case \"only-one\": {\n if (Array.isArray(value)) {\n if (value.length === 0)\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n if (value.length > 1)\n return { code: ERROR_CODES.ONLY_ONE_EXCEEDED, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_EXCEEDED] };\n } else if (!value) {\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n }\n break;\n }\n }\n }\n\n // 2. Format checks (only when there's a value)\n if (type === \"email\" && typeof value === \"string\" && value) {\n const emailError = validateEmail(value);\n if (emailError) return emailError;\n }\n\n if (type === \"phone\" && typeof value === \"string\" && value) {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n const phoneError = validatePhone(phoneInput);\n if (phoneError) return phoneError;\n }\n }\n\n return null;\n}\n\n// \u2500\u2500\u2500 Collect Fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction collectFormFields(withValidation: boolean): PulseFormField[] {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n const fields: PulseFormField[] = [];\n\n wrappers.forEach((wrapper) => {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase();\n\n if (!rawType || !VALID_BLOCK_TYPES.includes(rawType as FormBlockType))\n return;\n\n const blockType = rawType as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const mirrorValue = parseMirrorValue(wrapper);\n const value = extractValue(blockType, wrapper);\n const error = withValidation\n ? getFieldError(blockType, required, value, wrapper)\n : null;\n\n fields.push({\n \"form-block\": blockType,\n \"field-name\": fieldName,\n value,\n required,\n \"mirror-value\": mirrorValue,\n error,\n });\n });\n\n return fields;\n}\n\n// \u2500\u2500\u2500 Error UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction clearAllErrors(): void {\n document\n .querySelectorAll<HTMLElement>(`.${ERROR_SPAN_CLASS}`)\n .forEach((el) => el.remove());\n\n document\n .querySelectorAll<HTMLElement>(\"[pulse-form-block]\")\n .forEach((el) => el.classList.remove(\"has-error\"));\n}\n\nfunction clearErrorOnWrapper(wrapper: HTMLElement): void {\n const span = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (span) span.remove();\n wrapper.classList.remove(\"has-error\");\n}\n\nfunction showErrorOnWrapper(\n wrapper: HTMLElement,\n error: { code: string; message: string }\n): void {\n const existing = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (existing) existing.remove();\n\n const span = document.createElement(\"span\");\n span.className = ERROR_SPAN_CLASS;\n span.textContent = error.message;\n span.setAttribute(\"data-error-code\", error.code);\n span.setAttribute(\n \"data-field-name\",\n wrapper.getAttribute(\"pulse-field-name\")?.trim() || \"\"\n );\n\n wrapper.classList.add(\"has-error\");\n wrapper.appendChild(span);\n}\n\nfunction renderErrors(fields: PulseFormField[]): void {\n clearAllErrors();\n\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const field = fields.find((f) => f[\"field-name\"] === fieldName);\n if (!field || !field.error) return;\n\n showErrorOnWrapper(wrapper, field.error);\n });\n}\n\nfunction focusFirstError(): void {\n const first = document.querySelector<HTMLElement>(\n `[pulse-form-block].has-error`\n );\n if (!first) return;\n\n first.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n const focusable = first.querySelector<HTMLElement>(\n \"input, textarea, select\"\n );\n if (focusable) setTimeout(() => focusable.focus(), 400);\n}\n\n// \u2500\u2500\u2500 Mirror Value Fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction fillMirrorValues(): void {\n // 1. Get all fields with mirror-value true\n const mirrorFields = _currentFields.filter((f) => f[\"mirror-value\"] === true);\n if (mirrorFields.length === 0) return;\n\n // 2. Select all mirror target elements\n const mirrorTargets = document.querySelectorAll<HTMLElement>(\"[pulse-form-block-mirror]\");\n\n // 3. For each mirror field, find matching target and fill\n mirrorFields.forEach((field) => {\n const fieldName = field[\"field-name\"];\n let found = false;\n\n mirrorTargets.forEach((target) => {\n const mirrorAttr = target.getAttribute(\"pulse-form-block-mirror\")?.trim();\n if (mirrorAttr !== fieldName) return;\n\n found = true;\n\n // Find the input inside the mirror target and fill it\n const input = target.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\n \"input, textarea, select\"\n );\n\n if (!input) {\n console.warn(\n `[PulseForm] Mirror target for \"${fieldName}\" found, but no input element inside it.`\n );\n return;\n }\n\n // Set value based on type\n const value = field.value;\n if (typeof value === \"string\") {\n input.value = value;\n } else if (typeof value === \"boolean\") {\n if (input instanceof HTMLInputElement && input.type === \"checkbox\") {\n input.checked = value;\n } else {\n input.value = String(value);\n }\n } else if (Array.isArray(value)) {\n input.value = value.join(\", \");\n } else {\n input.value = \"\";\n }\n });\n\n if (!found) {\n console.warn(\n `[PulseForm] No mirror target found for field \"${fieldName}\". ` +\n `Add an element with attribute pulse-form-block-mirror=\"${fieldName}\" to mirror this value.`\n );\n }\n });\n}\n\n// \u2500\u2500\u2500 Flow Type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst INDUSTRY_CALENDER_MAP: Record<string, string> = {\n \"Financial Services\": \"david\",\n \"Sports\": \"steven\",\n \"Beauty\": \"albany\",\n \"Music\": \"steven\",\n \"Customer Packaged Goods\": \"david\",\n \"Other\": \"david\",\n};\n\nfunction setWhiteGloveCalender(): void {\n // 1. Get the value of field-name=\"industry\" from the JSON\n const industryField = _currentFields.find((f) => f[\"field-name\"] === \"industry\");\n if (!industryField || typeof industryField.value !== \"string\" || !industryField.value) return;\n\n const activePerson = INDUSTRY_CALENDER_MAP[industryField.value];\n\n // 2. Select all elements with attribute \"hs-calender\"\n const calenderElements = document.querySelectorAll<HTMLElement>(\"[hs-calender]\");\n\n // 3. Set hs-calender-active based on matching person\n calenderElements.forEach((el) => {\n const elCalenderValue = el.getAttribute(\"hs-calender\")?.trim();\n if (activePerson && elCalenderValue === activePerson) {\n el.setAttribute(\"hs-calender-active\", \"true\");\n } else {\n el.setAttribute(\"hs-calender-active\", \"false\");\n }\n });\n}\n\nfunction updateFlowType(): void {\n // 1. Get the value of field-name=\"flow-type\" from the JSON\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // 2. Select all elements with attribute \"form-flow\"\n const flowElements = document.querySelectorAll<HTMLElement>(\"[form-flow]\");\n\n // 3. Set form-flow-active based on matching value\n flowElements.forEach((el) => {\n const elFlowValue = el.getAttribute(\"form-flow\")?.trim();\n if (elFlowValue === flowValue) {\n el.setAttribute(\"form-flow-active\", \"true\");\n } else {\n el.setAttribute(\"form-flow-active\", \"false\");\n }\n });\n\n // 4. If White Glove services, update calender assignments\n if (flowValue === \"White Glove services\") {\n setWhiteGloveCalender();\n }\n}\n\n// \u2500\u2500\u2500 Reactive State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet _currentFields: PulseFormField[] = [];\n\nfunction updateFieldInState(\n fieldName: string,\n value: PulseFormField[\"value\"],\n error: PulseFormField[\"error\"]\n): void {\n const idx = _currentFields.findIndex((f) => f[\"field-name\"] === fieldName);\n if (idx === -1) return;\n _currentFields[idx] = { ..._currentFields[idx], value, error };\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n}\n\nfunction handleFieldChange(wrapper: HTMLElement): void {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const value = extractValue(rawType, wrapper);\n const hasError = wrapper.classList.contains(\"has-error\");\n\n if (hasError) {\n const error = getFieldError(rawType, required, value, wrapper);\n if (!error) {\n clearErrorOnWrapper(wrapper);\n updateFieldInState(fieldName, value, null);\n } else {\n showErrorOnWrapper(wrapper, error);\n updateFieldInState(fieldName, value, error);\n }\n } else {\n updateFieldInState(fieldName, value, null);\n }\n}\n\nfunction bindChangeListeners(): void {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const type = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType | undefined;\n\n if (!type || !VALID_BLOCK_TYPES.includes(type)) return;\n\n const onChange = () => handleFieldChange(wrapper);\n\n switch (type) {\n case \"text\":\n case \"email\": {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (input) {\n input.addEventListener(\"input\", onChange);\n input.addEventListener(\"change\", onChange);\n }\n break;\n }\n\n case \"phone\": {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n phoneInput.addEventListener(\"input\", onChange);\n phoneInput.addEventListener(\"change\", onChange);\n phoneInput.addEventListener(\"keyup\", onChange);\n phoneInput.addEventListener(\"countrychange\", onChange);\n }\n break;\n }\n\n case \"checkbox\":\n case \"legal\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"checkbox\"]')\n .forEach((cb) => cb.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"radio\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')\n .forEach((r) => r.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"select\": {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (select) select.addEventListener(\"change\", onChange);\n break;\n }\n }\n });\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PulseForm = {\n get fields(): PulseFormField[] {\n return _currentFields;\n },\n\n refresh(): PulseFormField[] {\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n return _currentFields;\n },\n\n validate(): { fields: PulseFormField[]; isValid: boolean } {\n const fields = collectFormFields(true);\n const isValid = fields.every((f) => f.error === null);\n\n _currentFields = fields;\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n\n renderErrors(fields);\n if (!isValid) focusFirstError();\n\n return { fields, isValid };\n },\n\n clearErrors(): void {\n clearAllErrors();\n _currentFields = _currentFields.map((f) => ({ ...f, error: null }));\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n },\n\n ERROR_CODES,\n ERROR_MESSAGES,\n};\n\n// \u2500\u2500\u2500 Initialize on DOM Ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const count = document.querySelectorAll(\"[pulse-form-block]\").length;\n console.log(`[PulseForm] Initialized \u2014 found ${count} form blocks.`);\n\n initIntlTelInput();\n\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n\n bindChangeListeners();\n\n (window as any).PulseForm = PulseForm;\n});\n\n// \u2500\u2500\u2500 \u26A0\uFE0F DEV ONLY \u2014 Remove or disable in production \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// function devAutoFill(): void {\n// const firstNames = [\"Jordan\", \"Morgan\", \"Riley\", \"Avery\", \"Quinn\", \"Casey\", \"Blake\", \"Harper\", \"Sage\", \"Rowan\"];\n// const lastNames = [\"Nakamura\", \"Lindqvist\", \"Okafor\", \"Brennan\", \"Castellano\", \"Pham\", \"Eriksen\", \"Moreira\", \"Ashworth\", \"Dubois\"];\n// const domains = [\"inbox.co\", \"mailbox.org\", \"zipmail.net\", \"postly.io\", \"demobox.dev\"];\n\n// const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];\n// const rand = () => Math.random().toString(36).substring(2, 8);\n\n// const firstName = pick(firstNames);\n// const lastName = pick(lastNames);\n// const email = `${firstName.toLowerCase()}.${rand()}@${pick(domains)}`;\n// const phone = `${2000000000 + Math.floor(Math.random() * 8000000000)}`;\n\n// const fieldMap: Record<string, string> = {\n// \"first-name\": firstName,\n// \"last-name\": lastName,\n// \"email\": email,\n// \"phone\": phone,\n// \"anything-else\": \"Ignore this is a test form submission\",\n// };\n\n// Object.entries(fieldMap).forEach(([fieldName, value]) => {\n// const wrapper = document.querySelector<HTMLElement>(\n// `[pulse-field-name=\"${fieldName}\"]`\n// );\n// if (!wrapper) return;\n\n// if (fieldName === \"phone\") {\n// const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n// if (!phoneInput) return;\n// const iti = itiInstances.get(phoneInput);\n// if (iti) {\n// iti.setNumber(`+1${value}`);\n// } else {\n// phoneInput.value = value;\n// }\n// phoneInput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n// phoneInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n// phoneInput.dispatchEvent(new Event(\"keyup\", { bubbles: true }));\n// return;\n// }\n\n// const el = fieldName === \"anything-else\"\n// ? wrapper.querySelector<HTMLTextAreaElement>(\"textarea\")\n// : wrapper.querySelector<HTMLInputElement>(\"input\");\n// if (!el) return;\n\n// el.value = value;\n// el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n// el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n// });\n\n// console.log(\"[PulseForm][DEV] Auto-filled:\", fieldMap);\n// }\n\n// setTimeout(devAutoFill, 500);\n// \u2500\u2500\u2500 \u26A0\uFE0F END DEV ONLY \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,UAAQ,IAAI,gCAAgC;AAgB5C,MAAM,oBAAqC;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAEA,MAAM,wBAA6C;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAIA,MAAM,cAAc;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,EAC3B;AAEA,MAAM,iBAAyC;AAAA,IAC3C,CAAC,YAAY,cAAc,GAAG;AAAA,IAC9B,CAAC,YAAY,cAAc,GAAG;AAAA,IAC9B,CAAC,YAAY,eAAe,GAAG;AAAA,IAC/B,CAAC,YAAY,WAAW,GAAG;AAAA,IAC3B,CAAC,YAAY,aAAa,GAAG;AAAA,IAC7B,CAAC,YAAY,iBAAiB,GAAG;AAAA,IACjC,CAAC,YAAY,aAAa,GAAG;AAAA,IAC7B,CAAC,YAAY,aAAa,GAAG;AAAA,IAC7B,CAAC,YAAY,eA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,QAAQ;AAAA,IAC7B;AAAA,IAEA,cAAoB;AAChB,qBAAe;AACf,uBAAiB,eAAe,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,KAAK,EAAE;AAClE,MAAC,OAAe,gBAAgB;AAChC,uBAAiB;AACjB,qBAAe;AAAA,IACnB;AAAA,IAEA;AAAA,IACA;AAAA,EACJ;AAIA,WAAS,iBAAiB,oBAAoB,MAAM;AAChD,UAAM,QAAQ,SAAS,iBAAiB,oBAAoB,EAAE;AAC9D,YAAQ,IAAI,wCAAmC,KAAK,eAAe;AAEnE,qBAAiB;AAEjB,qBAAiB,kBAAkB,KAAK;AACxC,IAAC,OAAe,gBAAgB;AAChC,qBAAiB;AACjB,mBAAe;AAEf,wBAAoB;AAEpB,IAAC,OAAe,YAAY;AAAA,EAChC,CAAC;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtstic.dev/pulse",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "pulse website",
5
5
  "license": "license-of-your-project",
6
6
  "keywords": [],