aw-wizard-forms 3.0.7 → 3.1.1

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,659 +1,102 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WizardForm={})}(this,function(t){"use strict";function e(){if("undefined"==typeof document)return;const t=document.cookie.match(/hubspotutk=([^;]+)/);return t?t[1]:void 0}function s(t){const{portalId:s,formId:i,fieldMapping:r={},mock:o=!1}=t;return{name:"hubspot",mapFields(t){const e={};for(const[s,i]of Object.entries(t))e[r[s]||s]=i;return e},async submit(t,r){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};const a=`https://api.hsforms.com/submissions/v3/integration/submit/${s}/${i}`,n=this.mapFields(t),h={fields:Object.entries(n).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:r.pageUrl,pageName:r.pageTitle,hutk:e()}};try{const t=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});return t.ok?{success:!0,data:await t.json()}:{success:!1,error:(await t.json().catch(()=>({}))).message||"HubSpot submission failed: "+t.status}}catch(l){return{success:!1,error:l instanceof Error?l.message:"Network error"}}}}}function i(t){const{url:e,method:s="POST",headers:i={},fieldMapping:r={},mock:o=!1}=t;return{name:"webhook",mapFields(t){const e={};for(const[s,i]of Object.entries(t))e[r[s]||s]=i;return e},async submit(t,r){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};if(!e)return{success:!1,error:"Webhook URL is required"};const a={formData:this.mapFields(t),context:{pageUrl:r.pageUrl,pageTitle:r.pageTitle,referrer:r.referrer,submittedAt:r.timestamp}};try{const t=await fetch(e,{method:s,headers:{"Content-Type":"application/json",...i},body:JSON.stringify(a)});if(!t.ok){const e=await t.text().catch(()=>"");return{success:!1,error:`Webhook failed: ${t.status} ${e}`.trim()}}let r;try{r=await t.json()}catch{r={status:t.status}}return{success:!0,data:r}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Network error"}}}}}function r(){return"undefined"!=typeof window&&void 0!==window.RevenueHero}function o(t){const{routerId:e,fieldMapping:s={},mock:i=!1}=t;return{name:"revenuehero",mapFields(t){const e={};for(const[i,r]of Object.entries(t))e[s[i]||i]=r;return e},async submit(t,s){if(i)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,scheduled:!0}};if(!e)return{success:!1,error:"RevenueHero router ID is required"};if(!r())return{success:!1,error:"RevenueHero SDK not loaded. Please load the SDK in your page."};const o=this.mapFields(t),a=(o.email||o.workEmail||"")+"";if(!a)return{success:!1,error:"Email is required for RevenueHero scheduling"};try{return window.RevenueHero.schedule({routerId:e,email:a,...o}),{success:!0,data:{scheduled:!0,email:a}}}catch(n){return{success:!1,error:n instanceof Error?n.message:"RevenueHero error"}}}}}const a=globalThis,n=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,h=Symbol(),l=new WeakMap;let c=class{constructor(t,e,s){if(this.i=!0,s!==h)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=l.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&l.set(e,t))}return t}toString(){return this.cssText}};const d=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,i)=>e+(t=>{if(!0===t.i)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1],t[0]);return new c(s,t,h)},f=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new c("string"==typeof t?t:t+"",void 0,h))(e)})(t):t,{is:u,defineProperty:p,getOwnPropertyDescriptor:w,getOwnPropertyNames:m,getOwnPropertySymbols:b,getPrototypeOf:g}=Object,v=globalThis,y=v.trustedTypes,x=y?y.emptyScript:"",$=v.reactiveElementPolyfillSupport,S=(t,e)=>t,k={toAttribute(t,e){switch(e){case Boolean:t=t?x:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(i){s=null}}return s}},_=(t,e)=>!u(t,e),E={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);let z=class extends HTMLElement{static addInitializer(t){this.m(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this.v&&[...this.v.keys()]}static createProperty(t,e=E){if(e.state&&(e.attribute=!1),this.m(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&p(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=w(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=i?.call(this);r?.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static m(){if(this.hasOwnProperty(S("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this.m(),this.hasOwnProperty(S("properties"))){const t=this.properties,e=[...m(t),...b(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this.v=new Map;for(const[e,s]of this.elementProperties){const t=this.S(e,s);void 0!==t&&this.v.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(f(t))}else void 0!==t&&e.push(f(t));return e}static S(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.A=null,this.N()}N(){this.M=new Promise(t=>this.enableUpdating=t),this.P=new Map,this.V(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this.q??(this.q=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this.q?.delete(t)}V(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),i=a.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this.q?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this.q?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this.I(t,s)}B(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor.S(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:k).toAttribute(e,s.type);this.A=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this.A=null}}I(t,e){const s=this.constructor,i=s.v.get(t);if(void 0!==i&&this.A!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:k;this.A=i;const o=r.fromAttribute(e,t.type);this[i]=o??this.D?.get(i)??o,this.A=null}}requestUpdate(t,e,s,i=!1,r){if(void 0!==t){const o=this.constructor;if(!1===i&&(r=this[t]),s??(s=o.getPropertyOptions(t)),!((s.hasChanged??_)(r,e)||s.useDefault&&s.reflect&&r===this.D?.get(t)&&!this.hasAttribute(o.S(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this.M=this.F())}C(t,e,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this.D??(this.D=new Map)).has(t)&&(this.D.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this.P.has(t)||(this.hasUpdated||s||(e=void 0),this.P.set(t,e)),!0===i&&this.A!==t&&(this.U??(this.U=new Set)).add(t))}async F(){this.isUpdatePending=!0;try{await this.M}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._){for(const[t,e]of this._)this[t]=e;this._=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this.P.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this.P;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this.q?.forEach(t=>t.hostUpdate?.()),this.update(e)):this.R()}catch(s){throw t=!1,this.R(),s}t&&this.L(e)}willUpdate(t){}L(t){this.q?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}R(){this.P=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.M}shouldUpdate(t){return!0}update(t){this.U&&(this.U=this.U.forEach(t=>this.B(t,this[t]))),this.R()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[S("elementProperties")]=new Map,z[S("finalized")]=new Map,$?.({ReactiveElement:z}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.1.2");const C=globalThis,T=t=>t,O=C.trustedTypes,j=O?O.createPolicy("lit-html",{createHTML:t=>t}):void 0,A="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,M="?"+N,P=`<${M}>`,V=document,q=()=>V.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,B=Array.isArray,D="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,R=/>/g,L=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),W=/'/g,H=/"/g,X=/^(?:script|style|textarea|title)$/i,Y=(t,...e)=>({W:1,strings:t,values:e}),J=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),Z=new WeakMap,G=V.createTreeWalker(V,129);function Q(t,e){if(!B(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==j?j.createHTML(e):e}class tt{constructor({strings:t,W:e},s){let i;this.parts=[];let r=0,o=0;const a=t.length-1,n=this.parts,[h,l]=((t,e)=>{const s=t.length-1,i=[];let r,o=2===e?"<svg>":3===e?"<math>":"",a=F;for(let n=0;n<s;n++){const e=t[n];let s,h,l=-1,c=0;for(;c<e.length&&(a.lastIndex=c,h=a.exec(e),null!==h);)c=a.lastIndex,a===F?"!--"===h[1]?a=U:void 0!==h[1]?a=R:void 0!==h[2]?(X.test(h[2])&&(r=RegExp("</"+h[2],"g")),a=L):void 0!==h[3]&&(a=L):a===L?">"===h[0]?(a=r??F,l=-1):void 0===h[1]?l=-2:(l=a.lastIndex-h[2].length,s=h[1],a=void 0===h[3]?L:'"'===h[3]?H:W):a===H||a===W?a=L:a===U||a===R?a=F:(a=L,r=void 0);const d=a===L&&t[n+1].startsWith("/>")?" ":"";o+=a===F?e+P:l>=0?(i.push(s),e.slice(0,l)+A+e.slice(l)+N+d):e+N+(-2===l?n:d)}return[Q(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=tt.createElement(h,s),G.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=G.nextNode())&&n.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(A)){const e=l[o++],s=i.getAttribute(t).split(N),a=/([.?@])?(.*)/.exec(e);n.push({type:1,index:r,name:a[2],strings:s,ctor:"."===a[1]?ot:"?"===a[1]?at:"@"===a[1]?nt:rt}),i.removeAttribute(t)}else t.startsWith(N)&&(n.push({type:6,index:r}),i.removeAttribute(t));if(X.test(i.tagName)){const t=i.textContent.split(N),e=t.length-1;if(e>0){i.textContent=O?O.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],q()),G.nextNode(),n.push({type:2,index:++r});i.append(t[e],q())}}}else if(8===i.nodeType)if(i.data===M)n.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(N,t+1));)n.push({type:7,index:r}),t+=N.length-1}r++}}static createElement(t,e){const s=V.createElement("template");return s.innerHTML=t,s}}function et(t,e,s=t,i){if(e===J)return e;let r=void 0!==i?s.H?.[i]:s.X;const o=I(e)?void 0:e.Y;return r?.constructor!==o&&(r?.J?.(!1),void 0===o?r=void 0:(r=new o(t),r.K(t,s,i)),void 0!==i?(s.H??(s.H=[]))[i]=r:s.X=r),void 0!==r&&(e=et(t,r.Z(t,e.values),r,i)),e}class st{constructor(t,e){this.G=[],this.tt=void 0,this.et=t,this.st=e}get parentNode(){return this.st.parentNode}get it(){return this.st.it}u(t){const{el:{content:e},parts:s}=this.et,i=(t?.creationScope??V).importNode(e,!0);G.currentNode=i;let r=G.nextNode(),o=0,a=0,n=s[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new it(r,r.nextSibling,this,t):1===n.type?e=new n.ctor(r,n.name,n.strings,this,t):6===n.type&&(e=new ht(r,this,t)),this.G.push(e),n=s[++a]}o!==n?.index&&(r=G.nextNode(),o++)}return G.currentNode=V,i}p(t){let e=0;for(const s of this.G)void 0!==s&&(void 0!==s.strings?(s.rt(t,s,e),e+=s.strings.length-2):s.rt(t[e])),e++}}class it{get it(){return this.st?.it??this.ot}constructor(t,e,s,i){this.type=2,this.nt=K,this.tt=void 0,this.ht=t,this.lt=e,this.st=s,this.options=i,this.ot=i?.isConnected??!0}get parentNode(){let t=this.ht.parentNode;const e=this.st;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this.ht}get endNode(){return this.lt}rt(t,e=this){t=et(this,t,e),I(t)?t===K||null==t||""===t?(this.nt!==K&&this.ct(),this.nt=K):t!==this.nt&&t!==J&&this.dt(t):void 0!==t.W?this.$(t):void 0!==t.nodeType?this.T(t):(t=>B(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this.dt(t)}O(t){return this.ht.parentNode.insertBefore(t,this.lt)}T(t){this.nt!==t&&(this.ct(),this.nt=this.O(t))}dt(t){this.nt!==K&&I(this.nt)?this.ht.nextSibling.data=t:this.T(V.createTextNode(t)),this.nt=t}$(t){const{values:e,W:s}=t,i="number"==typeof s?this.ft(t):(void 0===s.el&&(s.el=tt.createElement(Q(s.h,s.h[0]),this.options)),s);if(this.nt?.et===i)this.nt.p(e);else{const t=new st(i,this),s=t.u(this.options);t.p(e),this.T(s),this.nt=t}}ft(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new tt(t)),e}k(t){B(this.nt)||(this.nt=[],this.ct());const e=this.nt;let s,i=0;for(const r of t)i===e.length?e.push(s=new it(this.O(q()),this.O(q()),this,this.options)):s=e[i],s.rt(r),i++;i<e.length&&(this.ct(s&&s.lt.nextSibling,i),e.length=i)}ct(t=this.ht.nextSibling,e){for(this.ut?.(!1,!0,e);t!==this.lt;){const e=T(t).nextSibling;T(t).remove(),t=e}}setConnected(t){void 0===this.st&&(this.ot=t,this.ut?.(t))}}class rt{get tagName(){return this.element.tagName}get it(){return this.st.it}constructor(t,e,s,i,r){this.type=1,this.nt=K,this.tt=void 0,this.element=t,this.name=e,this.st=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this.nt=Array(s.length-1).fill(new String),this.strings=s):this.nt=K}rt(t,e=this,s,i){const r=this.strings;let o=!1;if(void 0===r)t=et(this,t,e,0),o=!I(t)||t!==this.nt&&t!==J,o&&(this.nt=t);else{const i=t;let a,n;for(t=r[0],a=0;a<r.length-1;a++)n=et(this,i[s+a],e,a),n===J&&(n=this.nt[a]),o||(o=!I(n)||n!==this.nt[a]),n===K?t=K:t!==K&&(t+=(n??"")+r[a+1]),this.nt[a]=n}o&&!i&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ot extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class at extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class nt extends rt{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}rt(t,e=this){if((t=et(this,t,e,0)??K)===J)return;const s=this.nt,i=t===K&&s!==K||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==K&&(s===K||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this.nt=t}handleEvent(t){"function"==typeof this.nt?this.nt.call(this.options?.host??this.element,t):this.nt.handleEvent(t)}}class ht{constructor(t,e,s){this.element=t,this.type=6,this.tt=void 0,this.st=e,this.options=s}get it(){return this.st.it}rt(t){et(this,t)}}const lt=C.litHtmlPolyfillSupport;lt?.(tt,it),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.2");const ct=globalThis;class dt extends z{constructor(){super(...arguments),this.renderOptions={host:this},this.wt=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.wt=((t,e,s)=>{const i=s?.renderBefore??e;let r=i.bt;if(void 0===r){const t=s?.renderBefore??null;i.bt=r=new it(e.insertBefore(q(),t),t,void 0,s??{})}return r.rt(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.wt?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.wt?.setConnected(!1)}render(){return J}}dt.gt=!0,dt.finalized=!0,ct.litElementHydrateSupport?.({LitElement:dt});const ft=ct.litElementPolyfillSupport;ft?.({LitElement:dt}),(ct.litElementVersions??(ct.litElementVersions=[])).push("4.2.2");const ut=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},pt={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:_},wt=(t=pt,e,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t,!0,s)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t,!0,s)}}throw Error("Unsupported decorator location: "+i)};function mt(t){return(e,s)=>"object"==typeof s?wt(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}function bt(t){return mt({...t,state:!0,attribute:!1})}class gt{constructor(t){this.vt={},this.yt={},this.xt=1,this.$t=0,this.St=!1,this.kt=!1,this._t=new Map,this.Et=new Set,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this.Et.clear()}get formData(){return{...this.vt}}get validation(){return{...this.yt}}get currentStep(){return this.xt}get totalSteps(){return this.$t}get submitting(){return this.St}get submitted(){return this.kt}get error(){return this.zt}get state(){return{formData:this.formData,validation:this.validation,currentStep:this.xt,totalSteps:this.$t,submitting:this.St,submitted:this.kt,error:this.zt}}setValue(t,e){this.vt[t]=e,this.yt[t]?this.yt[t]={...this.yt[t],value:e,dirty:!0}:this.yt[t]={name:t,value:e,result:{valid:!0},touched:!1,dirty:!0},this.Ct()}getValue(t){return this.vt[t]}setValidation(t,e){const s=this.yt[t];this.yt[t]={name:t,value:s?.value??this.vt[t],result:e,touched:s?.touched??!1,dirty:s?.dirty??!1},this.Ct()}markTouched(t){this.yt[t]?this.yt[t]={...this.yt[t],touched:!0}:this.yt[t]={name:t,value:this.vt[t],result:{valid:!0},touched:!0,dirty:!1},this.Ct()}setTotalSteps(t){this.$t=t,this.Ct()}setStepConfig(t,e){this._t.set(t,e)}getStepConfig(t){return this._t.get(t)}getStepFields(t){return this._t.get(t)?.fields??[]}goToStep(t){if(t<1||t>this.$t)return!1;const e=this._t.get(t);return e?.skipIf?.(this.vt)?t>this.xt?this.goToStep(t+1):this.goToStep(t-1):(this.xt=t,this.Ct(),!0)}nextStep(){return this.goToStep(this.xt+1)}previousStep(){return this.goToStep(this.xt-1)}isFirstStep(){return 1===this.xt}isLastStep(){return this.xt===this.$t}isStepValid(t){return this.getStepFields(t).every(t=>{const e=this.yt[t];return!e||e.result.valid})}isCurrentStepValid(){return this.isStepValid(this.xt)}getFieldError(t){const e=this.yt[t];if(e?.touched&&!e.result.valid)return e.result.error}hasFieldError(t){return void 0!==this.getFieldError(t)}setSubmitting(t){this.St=t,this.Ct()}setSubmitted(t){this.kt=t,this.Ct()}setError(t){this.zt=t,this.Ct()}reset(){this.vt={},this.yt={},this.xt=1,this.St=!1,this.kt=!1,this.zt=void 0,this.Ct()}subscribe(t){return this.Et.add(t),()=>{this.Et.delete(t)}}Ct(){this.host.requestUpdate();const t=this.state;this.Et.forEach(e=>{try{e(t)}catch(s){}})}}class vt{constructor(t,e={}){this.Tt=!0,this.host=t,this.Ot={blockEnterOnTextarea:!0,...e},this.jt=this.At.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("keydown",this.jt),document.addEventListener("keydown",this.jt)}hostDisconnected(){this.host.removeEventListener("keydown",this.jt),document.removeEventListener("keydown",this.jt)}At(t){if(!this.Tt)return;const e=this.Nt(),s="TEXTAREA"===e?.tagName,i="INPUT"===e?.tagName,r="true"===e?.getAttribute("contenteditable"),o=s||i||r;switch(t.key){case"Enter":if(s&&this.Ot.blockEnterOnTextarea)return;this.Ot.onEnter&&(t.preventDefault(),this.Ot.onEnter());break;case"Escape":this.Ot.onEscape&&(t.preventDefault(),this.Ot.onEscape());break;case"ArrowUp":!o&&this.Ot.onArrowUp&&(t.preventDefault(),this.Ot.onArrowUp());break;case"ArrowDown":!o&&this.Ot.onArrowDown&&(t.preventDefault(),this.Ot.onArrowDown());break;case"ArrowLeft":!o&&this.Ot.onArrowLeft&&(t.preventDefault(),this.Ot.onArrowLeft());break;case"ArrowRight":!o&&this.Ot.onArrowRight&&(t.preventDefault(),this.Ot.onArrowRight())}}Nt(){let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}updateConfig(t){this.Ot={...this.Ot,...t}}enable(){this.Tt=!0}disable(){this.Tt=!1}get enabled(){return this.Tt}}var yt=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,$t=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?xt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&yt(e,s,o),o};t.WfBadge=class extends dt{constructor(){super(...arguments),this.shortcut="",this.variant="default"}render(){return Y`
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WizardForm={})}(this,function(t){"use strict";function e(){if("undefined"==typeof document)return;const t=document.cookie.match(/hubspotutk=([^;]+)/);return t?t[1]:void 0}function r(t){const{portalId:r,formId:s,fieldMapping:i={},mock:o=!1}=t;return{name:"hubspot",mapFields(t){const e={};for(const[r,s]of Object.entries(t))e[i[r]||r]=s;return e},async submit(t,i){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};const a=`https://api.hsforms.com/submissions/v3/integration/submit/${r}/${s}`,n=this.mapFields(t),l={fields:Object.entries(n).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:i.pageUrl,pageName:i.pageTitle,hutk:e()}};try{const t=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return t.ok?{success:!0,data:await t.json()}:{success:!1,error:(await t.json().catch(()=>({}))).message||"HubSpot submission failed: "+t.status}}catch(d){return{success:!1,error:d instanceof Error?d.message:"Network error"}}}}}function s(t){const{url:e,method:r="POST",headers:s={},fieldMapping:i={},mock:o=!1}=t;return{name:"webhook",mapFields(t){const e={};for(const[r,s]of Object.entries(t))e[i[r]||r]=s;return e},async submit(t,i){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};if(!e)return{success:!1,error:"Webhook URL is required"};const a={formData:this.mapFields(t),context:{pageUrl:i.pageUrl,pageTitle:i.pageTitle,referrer:i.referrer,submittedAt:i.timestamp}};try{const t=await fetch(e,{method:r,headers:{"Content-Type":"application/json",...s},body:JSON.stringify(a)});if(!t.ok){const e=await t.text().catch(()=>"");return{success:!1,error:`Webhook failed: ${t.status} ${e}`.trim()}}let i;try{i=await t.json()}catch{i={status:t.status}}return{success:!0,data:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Network error"}}}}}function i(){return"undefined"!=typeof window&&void 0!==window.RevenueHero}function o(t){const{routerId:e,fieldMapping:r={},mock:s=!1}=t;return{name:"revenuehero",mapFields(t){const e={};for(const[s,i]of Object.entries(t))e[r[s]||s]=i;return e},async submit(t,r){if(s)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,scheduled:!0}};if(!e)return{success:!1,error:"RevenueHero router ID is required"};if(!i())return{success:!1,error:"RevenueHero SDK not loaded. Please load the SDK in your page."};const o=this.mapFields(t),a=(o.email||o.workEmail||"")+"";if(!a)return{success:!1,error:"Email is required for RevenueHero scheduling"};try{return window.RevenueHero.schedule({routerId:e,email:a,...o}),{success:!0,data:{scheduled:!0,email:a}}}catch(n){return{success:!1,error:n instanceof Error?n.message:"RevenueHero error"}}}}}const a=globalThis,n=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),d=new WeakMap;let h=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&d.set(e,t))}return t}toString(){return this.cssText}};const c=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,l))(e)})(t):t,{is:p,defineProperty:u,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:w,getPrototypeOf:g}=Object,b=globalThis,_=b.trustedTypes,v=_?_.emptyScript:"",y=b.reactiveElementPolyfillSupport,x=(t,e)=>t,S={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(s){r=null}}return r}},$=(t,e)=>!p(t,e),E={attribute:!0,type:String,converter:S,reflect:!1,useDefault:!1,hasChanged:$};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),b.litPropertyMetadata??(b.litPropertyMetadata=new WeakMap);let k=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=E){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(t,r,e);void 0!==s&&u(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){const{get:s,set:i}=f(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);i?.call(this,e),this.requestUpdate(t,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const t=this.properties,e=[...m(t),...w(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(c(t))}else void 0!==t&&e.push(c(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const r of e){const e=document.createElement("style"),s=a.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=r.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(void 0!==s&&!0===r.reflect){const i=(void 0!==r.converter?.toAttribute?r.converter:S).toAttribute(e,r.type);this._$Em=t,null==i?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(t,e){const r=this.constructor,s=r._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=r.getPropertyOptions(s),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:S;this._$Em=s;const o=i.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,r,s=!1,i){if(void 0!==t){const o=this.constructor;if(!1===s&&(i=this[t]),r??(r=o.getPropertyOptions(t)),!((r.hasChanged??$)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:i},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==i||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,r,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[x("elementProperties")]=new Map,k[x("finalized")]=new Map,y?.({ReactiveElement:k}),(b.reactiveElementVersions??(b.reactiveElementVersions=[])).push("2.1.2");const A=globalThis,C=t=>t,z=A.trustedTypes,O=z?z.createPolicy("lit-html",{createHTML:t=>t}):void 0,W="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+P,D=`<${T}>`,M=document,L=()=>M.createComment(""),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,I="[ \t\n\f\r]",q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,R=/>/g,V=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,U=/"/g,B=/^(?:script|style|textarea|title)$/i,Y=(t,...e)=>({_$litType$:1,strings:t,values:e}),K=Symbol.for("lit-noChange"),X=Symbol.for("lit-nothing"),J=new WeakMap,G=M.createTreeWalker(M,129);function Z(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(e):e}class Q{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let i=0,o=0;const a=t.length-1,n=this.parts,[l,d]=((t,e)=>{const r=t.length-1,s=[];let i,o=2===e?"<svg>":3===e?"<math>":"",a=q;for(let n=0;n<r;n++){const e=t[n];let r,l,d=-1,h=0;for(;h<e.length&&(a.lastIndex=h,l=a.exec(e),null!==l);)h=a.lastIndex,a===q?"!--"===l[1]?a=j:void 0!==l[1]?a=R:void 0!==l[2]?(B.test(l[2])&&(i=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=i??q,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,r=l[1],a=void 0===l[3]?V:'"'===l[3]?U:H):a===U||a===H?a=V:a===j||a===R?a=q:(a=V,i=void 0);const c=a===V&&t[n+1].startsWith("/>")?" ":"";o+=a===q?e+D:d>=0?(s.push(r),e.slice(0,d)+W+e.slice(d)+P+c):e+P+(-2===d?n:c)}return[Z(t,o+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=Q.createElement(l,r),G.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=G.nextNode())&&n.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(W)){const e=d[o++],r=s.getAttribute(t).split(P),a=/([.?@])?(.*)/.exec(e);n.push({type:1,index:i,name:a[2],strings:r,ctor:"."===a[1]?it:"?"===a[1]?ot:"@"===a[1]?at:st}),s.removeAttribute(t)}else t.startsWith(P)&&(n.push({type:6,index:i}),s.removeAttribute(t));if(B.test(s.tagName)){const t=s.textContent.split(P),e=t.length-1;if(e>0){s.textContent=z?z.emptyScript:"";for(let r=0;r<e;r++)s.append(t[r],L()),G.nextNode(),n.push({type:2,index:++i});s.append(t[e],L())}}}else if(8===s.nodeType)if(s.data===T)n.push({type:2,index:i});else{let t=-1;for(;-1!==(t=s.data.indexOf(P,t+1));)n.push({type:7,index:i}),t+=P.length-1}i++}}static createElement(t,e){const r=M.createElement("template");return r.innerHTML=t,r}}function tt(t,e,r=t,s){if(e===K)return e;let i=void 0!==s?r._$Co?.[s]:r._$Cl;const o=F(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,r,s)),void 0!==s?(r._$Co??(r._$Co=[]))[s]=i:r._$Cl=i),void 0!==i&&(e=tt(t,i._$AS(t,e.values),i,s)),e}class et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??M).importNode(e,!0);G.currentNode=s;let i=G.nextNode(),o=0,a=0,n=r[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new rt(i,i.nextSibling,this,t):1===n.type?e=new n.ctor(i,n.name,n.strings,this,t):6===n.type&&(e=new nt(i,this,t)),this._$AV.push(e),n=r[++a]}o!==n?.index&&(i=G.nextNode(),o++)}return G.currentNode=M,s}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class rt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=tt(this,t,e),F(t)?t===X||null==t||""===t?(this._$AH!==X&&this._$AR(),this._$AH=X):t!==this._$AH&&t!==K&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==X&&F(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,s="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Q.createElement(Z(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new et(s,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=J.get(t.strings);return void 0===e&&J.set(t.strings,e=new Q(t)),e}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,s=0;for(const i of t)s===e.length?e.push(r=new rt(this.O(L()),this.O(L()),this,this.options)):r=e[s],r._$AI(i),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=C(t).nextSibling;C(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,i){this.type=1,this._$AH=X,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=X}_$AI(t,e=this,r,s){const i=this.strings;let o=!1;if(void 0===i)t=tt(this,t,e,0),o=!F(t)||t!==this._$AH&&t!==K,o&&(this._$AH=t);else{const s=t;let a,n;for(t=i[0],a=0;a<i.length-1;a++)n=tt(this,s[r+a],e,a),n===K&&(n=this._$AH[a]),o||(o=!F(n)||n!==this._$AH[a]),n===X?t=X:t!==X&&(t+=(n??"")+i[a+1]),this._$AH[a]=n}o&&!s&&this.j(t)}j(t){t===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===X?void 0:t}}class ot extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==X)}}class at extends st{constructor(t,e,r,s,i){super(t,e,r,s,i),this.type=5}_$AI(t,e=this){if((t=tt(this,t,e,0)??X)===K)return;const r=this._$AH,s=t===X&&r!==X||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==X&&(r===X||s);s&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){tt(this,t)}}const lt=A.litHtmlPolyfillSupport;lt?.(Q,rt),(A.litHtmlVersions??(A.litHtmlVersions=[])).push("3.3.2");const dt=globalThis;class ht extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const s=r?.renderBefore??e;let i=s._$litPart$;if(void 0===i){const t=r?.renderBefore??null;s._$litPart$=i=new rt(e.insertBefore(L(),t),t,void 0,r??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}}ht._$litElement$=!0,ht.finalized=!0,dt.litElementHydrateSupport?.({LitElement:ht});const ct=dt.litElementPolyfillSupport;ct?.({LitElement:ht}),(dt.litElementVersions??(dt.litElementVersions=[])).push("4.2.2");const pt=t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},ut={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:$},ft=(t=ut,e,r)=>{const{kind:s,metadata:i}=r;let o=globalThis.litPropertyMetadata.get(i);if(void 0===o&&globalThis.litPropertyMetadata.set(i,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(r.name,t),"accessor"===s){const{name:s}=r;return{set(r){const i=e.get.call(this);e.set.call(this,r),this.requestUpdate(s,i,t,!0,r)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=r;return function(r){const i=this[s];e.call(this,r),this.requestUpdate(s,i,t,!0,r)}}throw Error("Unsupported decorator location: "+s)};function mt(t){return(e,r)=>"object"==typeof r?ft(t,e,r):((t,e,r)=>{const s=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),s?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}function wt(t){return mt({...t,state:!0,attribute:!1})}class gt{constructor(t){this._formData={},this._validation={},this._currentStep=1,this._totalSteps=0,this._submitting=!1,this._submitted=!1,this._stepConfigs=new Map,this._subscribers=new Set,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this._subscribers.clear()}get formData(){return{...this._formData}}get validation(){return{...this._validation}}get currentStep(){return this._currentStep}get totalSteps(){return this._totalSteps}get submitting(){return this._submitting}get submitted(){return this._submitted}get error(){return this._error}get state(){return{formData:this.formData,validation:this.validation,currentStep:this._currentStep,totalSteps:this._totalSteps,submitting:this._submitting,submitted:this._submitted,error:this._error}}setValue(t,e){this._formData[t]=e,this._validation[t]?this._validation[t]={...this._validation[t],value:e,dirty:!0}:this._validation[t]={name:t,value:e,result:{valid:!0},touched:!1,dirty:!0},this._notifyChange()}getValue(t){return this._formData[t]}setValidation(t,e){const r=this._validation[t];this._validation[t]={name:t,value:r?.value??this._formData[t],result:e,touched:r?.touched??!1,dirty:r?.dirty??!1},this._notifyChange()}markTouched(t){this._validation[t]?this._validation[t]={...this._validation[t],touched:!0}:this._validation[t]={name:t,value:this._formData[t],result:{valid:!0},touched:!0,dirty:!1},this._notifyChange()}setTotalSteps(t){this._totalSteps=t,this._notifyChange()}setStepConfig(t,e){this._stepConfigs.set(t,e)}getStepConfig(t){return this._stepConfigs.get(t)}getStepFields(t){return this._stepConfigs.get(t)?.fields??[]}goToStep(t){if(t<1||t>this._totalSteps)return!1;const e=this._stepConfigs.get(t);return e?.skipIf?.(this._formData)?t>this._currentStep?this.goToStep(t+1):this.goToStep(t-1):(this._currentStep=t,this._notifyChange(),!0)}nextStep(){return this.goToStep(this._currentStep+1)}previousStep(){return this.goToStep(this._currentStep-1)}isFirstStep(){return 1===this._currentStep}isLastStep(){return this._currentStep===this._totalSteps}isStepValid(t){return this.getStepFields(t).every(t=>{const e=this._validation[t];return!e||e.result.valid})}isCurrentStepValid(){return this.isStepValid(this._currentStep)}getFieldError(t){const e=this._validation[t];if(e?.touched&&!e.result.valid)return e.result.error}hasFieldError(t){return void 0!==this.getFieldError(t)}setSubmitting(t){this._submitting=t,this._notifyChange()}setSubmitted(t){this._submitted=t,this._notifyChange()}setError(t){this._error=t,this._notifyChange()}reset(){this._formData={},this._validation={},this._currentStep=1,this._submitting=!1,this._submitted=!1,this._error=void 0,this._notifyChange()}subscribe(t){return this._subscribers.add(t),()=>{this._subscribers.delete(t)}}_notifyChange(){this.host.requestUpdate();const t=this.state;this._subscribers.forEach(e=>{try{e(t)}catch(r){}})}}class bt{constructor(t,e={}){this._enabled=!0,this.host=t,this._config={blockEnterOnTextarea:!0,...e},this._boundHandler=this._handleKeydown.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("keydown",this._boundHandler),document.addEventListener("keydown",this._boundHandler)}hostDisconnected(){this.host.removeEventListener("keydown",this._boundHandler),document.removeEventListener("keydown",this._boundHandler)}_handleKeydown(t){if(!this._enabled)return;const e=this._getActiveElement(),r="TEXTAREA"===e?.tagName,s="INPUT"===e?.tagName,i="true"===e?.getAttribute("contenteditable"),o=r||s||i;switch(t.key){case"Enter":if(r&&this._config.blockEnterOnTextarea)return;this._config.onEnter&&(t.preventDefault(),this._config.onEnter());break;case"Escape":this._config.onEscape&&(t.preventDefault(),this._config.onEscape());break;case"ArrowUp":!o&&this._config.onArrowUp&&(t.preventDefault(),this._config.onArrowUp());break;case"ArrowDown":!o&&this._config.onArrowDown&&(t.preventDefault(),this._config.onArrowDown());break;case"ArrowLeft":!o&&this._config.onArrowLeft&&(t.preventDefault(),this._config.onArrowLeft());break;case"ArrowRight":!o&&this._config.onArrowRight&&(t.preventDefault(),this._config.onArrowRight())}}_getActiveElement(){let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}updateConfig(t){this._config={...this._config,...t}}enable(){this._enabled=!0}disable(){this._enabled=!1}get enabled(){return this._enabled}}var _t=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,yt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?vt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&_t(e,r,o),o};t.WfBadge=class extends ht{constructor(){super(...arguments),this.shortcut="",this.variant="default"}createRenderRoot(){return this}render(){return Y`
2
2
  <span
3
3
  class="wf-badge wf-badge--${this.variant}"
4
4
  aria-hidden="true"
5
5
  >
6
6
  ${this.shortcut}
7
7
  </span>
8
- `}},t.WfBadge.styles=d`
9
- :host {
10
- display: inline-flex;
11
- }
12
-
13
- :host([hidden]) {
14
- display: none;
15
- }
16
-
17
- .wf-badge {
18
- display: inline-flex;
19
- align-items: center;
20
- justify-content: center;
21
- box-sizing: border-box;
22
- min-width: 24px;
23
- height: 24px;
24
- padding: var(--wf-spacing-1, 4px) var(--wf-spacing-2, 8px);
25
- font-size: var(--wf-font-size-xs, 0.75rem);
26
- font-weight: 500;
27
- font-family: inherit;
28
- text-transform: uppercase;
29
- flex-shrink: 0;
30
- line-height: 1;
31
- }
32
-
33
- /* Default variant - unselected options */
34
- .wf-badge--default {
35
- background-color: var(--wf-color-badge-bg, #fcfcfc);
36
- border: 1px solid var(--wf-color-badge-border, #d4d4d4);
37
- border-radius: var(--wf-radius-sm, 4px);
38
- color: var(--wf-color-badge-text, #5f5f5f);
39
- }
40
-
41
- /* Selected variant - selected options */
42
- .wf-badge--selected {
43
- background-color: var(--wf-color-primary, #8040f0);
44
- border: 1px solid var(--wf-color-primary, #8040f0);
45
- border-radius: var(--wf-radius-sm, 4px);
46
- color: white;
47
- }
48
-
49
- /* Button variant - primary buttons (transparent) */
50
- .wf-badge--button {
51
- background-color: transparent;
52
- border: none;
53
- border-radius: var(--wf-radius-sm, 4px);
54
- color: rgba(255, 255, 255, 0.65);
55
- }
56
-
57
- /* Button-secondary variant - back button (transparent like primary) */
58
- .wf-badge--button-secondary {
59
- background-color: transparent;
60
- border: none;
61
- border-radius: var(--wf-radius-sm, 4px);
62
- color: var(--wf-color-text-muted, #5f5f5f);
63
- }
64
- `,$t([mt({type:String})],t.WfBadge.prototype,"shortcut",2),$t([mt({type:String})],t.WfBadge.prototype,"variant",2),t.WfBadge=$t([ut("wf-badge")],t.WfBadge);var St=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,_t=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?kt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&St(e,s,o),o};t.WizardForm=class extends dt{constructor(){super(),this.hubspotPortal="",this.hubspotForm="",this.theme="light",this.mock=!1,this.showProgress=!1,this.autoAdvance=!0,this.hideBack=!0,this.Mt=[],this.xt=1,this.$t=0,this.vt={},this.St=!1,this.kt=!1,this.zt="",this.Pt=new gt(this),this.Vt=t=>{const{name:e,value:s,extraFields:i}=t.detail;this.vt[e]=s,this.Pt.setValue(e,s),i&&Object.entries(i).forEach(([t,e])=>{this.vt[t]=e,this.Pt.setValue(t,e)}),this.zt="",this.dispatchEvent(new CustomEvent("wf:field-change",{detail:{name:e,value:s,formData:{...this.vt}},bubbles:!0,composed:!0}))},this.qt=t=>{if(this.autoAdvance){const e=t.target.closest("wf-options");e&&!e.hasAttribute("multi")&&setTimeout(()=>{this.It()},300)}},new vt(this,{onEnter:()=>this.Bt(),onEscape:()=>this.Dt()})}connectedCallback(){super.connectedCallback(),this.addEventListener("wf-change",this.Vt),this.addEventListener("wf-option-select",this.qt)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-change",this.Vt),this.removeEventListener("wf-option-select",this.qt)}firstUpdated(){this.Ft(),this.Ut()}render(){return this.kt?Y`
65
- <div class="wf-container">
8
+ `}},yt([mt({type:String})],t.WfBadge.prototype,"shortcut",2),yt([mt({type:String})],t.WfBadge.prototype,"variant",2),t.WfBadge=yt([pt("wf-badge")],t.WfBadge);var xt=Object.defineProperty,St=Object.getOwnPropertyDescriptor,$t=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?St(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&xt(e,r,o),o};t.WizardForm=class extends ht{constructor(){super(),this.hubspotPortal="",this.hubspotForm="",this.theme="light",this.mock=!1,this.showProgress=!1,this.autoAdvance=!0,this.hideBack=!0,this.submitOnStep=!1,this._steps=[],this._currentStep=1,this._totalSteps=0,this._formData={},this._submitting=!1,this._submitted=!1,this._error="",this._cachedSuccessContent=null,this._stateController=new gt(this),this._handleFieldChange=t=>{const{name:e,value:r,extraFields:s}=t.detail;this._formData[e]=r,this._stateController.setValue(e,r),s&&Object.entries(s).forEach(([t,e])=>{this._formData[t]=e,this._stateController.setValue(t,e)}),this._error="",this.dispatchEvent(new CustomEvent("wf:field-change",{detail:{name:e,value:r,formData:{...this._formData}},bubbles:!0,composed:!0}))},this._handleOptionSelect=t=>{if(this.autoAdvance){const e=t.target.closest("wf-options");e&&!e.hasAttribute("multi")&&setTimeout(()=>{this._goNext()},300)}},new bt(this,{onEnter:()=>this._handleEnter(),onEscape:()=>this._handleEscape()})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("wf-change",this._handleFieldChange),this.addEventListener("wf-option-select",this._handleOptionSelect)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-change",this._handleFieldChange),this.removeEventListener("wf-option-select",this._handleOptionSelect)}firstUpdated(){this._cachedSuccessContent=this.querySelector('[slot="success"]'),this._discoverSteps(),this._showCurrentStep()}render(){return this._submitted?(this._steps.forEach(t=>{t.active=!1,t.style.display="none"}),this._cachedSuccessContent?(this._cachedSuccessContent.style.display="",Y`
9
+ <div class="wf-container wf-submitted">
10
+ <div class="wf-success-screen">
11
+ ${this._cachedSuccessContent}
12
+ </div>
13
+ </div>
14
+ `):Y`
15
+ <div class="wf-container wf-submitted">
66
16
  <div class="wf-success-screen">
67
- <slot name="success">
68
- <h2>Thank you!</h2>
69
- <p>Your submission has been received.</p>
70
- </slot>
17
+ <h2>Thank you!</h2>
18
+ <p>Your submission has been received.</p>
71
19
  </div>
72
20
  </div>
73
- `:Y`
21
+ `):(this._cachedSuccessContent&&(this._cachedSuccessContent.style.display="none"),Y`
74
22
  <div class="wf-container">
75
- ${this.zt?Y`<div class="wf-form-error" role="alert">${this.zt}</div>`:K}
76
-
77
- <div class="wf-steps-container">
78
- <slot @slotchange="${this.Rt}"></slot>
79
- </div>
23
+ ${this._error?Y`<div class="wf-form-error" role="alert">${this._error}</div>`:X}
80
24
 
81
- ${this.Lt()}
25
+ ${this._renderNavigation()}
82
26
  </div>
83
- `}Wt(){const t=[];for(let e=1;e<=this.$t;e++){const s=e<this.xt,i=e===this.xt;t.push(Y`
27
+ `)}_renderProgress(){const t=[];for(let e=1;e<=this._totalSteps;e++){const r=e<this._currentStep,s=e===this._currentStep;t.push(Y`
84
28
  <div
85
- class="wf-progress-segment ${s?"completed":""} ${i?"active":""}"
29
+ class="wf-progress-segment ${r?"completed":""} ${s?"active":""}"
86
30
  ></div>
87
- `)}return Y`<div class="wf-progress">${t}</div>`}Lt(){const t=1===this.xt,e=this.xt===this.$t,s=!this.hideBack&&!t;return Y`
31
+ `)}return Y`<div class="wf-progress">${t}</div>`}_renderNavigation(){const t=1===this._currentStep,e=this._currentStep===this._totalSteps,r=!this.hideBack&&!t;return Y`
88
32
  <div class="wf-navigation">
89
- ${s?Y`
33
+ ${r?Y`
90
34
  <button
91
35
  class="wf-btn wf-btn-back"
92
- @click="${this.Ht}"
93
- ?disabled="${this.St}"
36
+ @click="${this._goBack}"
37
+ ?disabled="${this._submitting}"
94
38
  data-testid="wf-back-btn"
95
39
  >
96
40
  <span class="wf-btn-shortcut"><wf-badge shortcut="Esc" variant="button-secondary"></wf-badge></span>
97
41
  Back
98
42
  </button>
99
- `:K}
43
+ `:X}
100
44
 
101
45
  <button
102
46
  class="wf-btn wf-btn-next"
103
- @click="${this.It}"
104
- ?disabled="${this.St}"
47
+ @click="${this._goNext}"
48
+ ?disabled="${this._submitting}"
105
49
  data-testid="wf-next-btn"
106
50
  >
107
- ${this.St?Y`<span class="wf-loading"></span>`:e?"Submit":"Continue"}
51
+ ${this._submitting?Y`<span class="wf-loading"></span>`:e?"Submit":"Continue"}
108
52
  <span class="wf-btn-shortcut"><wf-badge shortcut="Enter ↵" variant="button"></wf-badge></span>
109
53
  </button>
110
54
  </div>
111
- `}Rt(){this.Ft(),this.Ut()}Ft(){const t=this.shadowRoot?.querySelector("slot:not([name])");if(!t)return;const e=t.assignedElements({flatten:!0});this.Mt=e.filter(t=>"wf-step"===t.tagName.toLowerCase()),this.Mt.forEach((t,e)=>{t.step=e+1}),this.$t=this.Mt.length,this.Pt.setTotalSteps(this.$t),this.dispatchEvent(new CustomEvent("wf:steps-discovered",{detail:{totalSteps:this.$t,currentStep:this.xt},bubbles:!0,composed:!0}))}Ut(){this.Mt.forEach((t,e)=>{e+1===this.xt?t.show("forward"):t.active=!1})}Xt(t){const e=t-1;return this.Mt[e]}async It(){if(this.St)return;const t=this.Xt(this.xt);t&&!(await t.validate())||(this.xt>=this.$t?await this.Yt():this.Jt(this.xt+1,"forward"))}Ht(){this.St||this.xt<=1||this.Jt(this.xt-1,"backward")}async Jt(t,e){if(t<1||t>this.$t)return;const s=this.Xt(t);if(!s)return;if(s.shouldSkip(this.vt)){const s="forward"===e?t+1:t-1;return s>=1&&s<=this.$t?this.Jt(s,e):void 0}const i=this.xt,r=this.Xt(this.xt);r&&await r.hide(),this.xt=t,this.Pt.goToStep(t),s.show(e),this.dispatchEvent(new CustomEvent("wf:step-change",{detail:{from:i,to:t,direction:e},bubbles:!0,composed:!0}))}async Bt(){await this.It()}Dt(){this.Ht()}async Yt(){if(this.St)return;const t=new CustomEvent("wf:submit",{detail:{formData:{...this.vt}},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),!t.defaultPrevented){this.St=!0,this.zt="";try{let t;this.mock?(await new Promise(t=>setTimeout(t,1e3)),t={success:!0}):t=this.hubspotPortal&&this.hubspotForm?await this.Kt():{success:!0},this.kt=!0,this.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:{...this.vt},response:t},bubbles:!0,composed:!0}))}catch(e){const t=e instanceof Error?e.message:"Submission failed";this.zt=t,this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:t,formData:{...this.vt}},bubbles:!0,composed:!0}))}finally{this.St=!1}}}async Kt(){const t=`https://api.hsforms.com/submissions/v3/integration/submit/${this.hubspotPortal}/${this.hubspotForm}`,e={fields:Object.entries(this.vt).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:window.location.href,pageName:document.title}},s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const t=await s.json().catch(()=>({}));throw Error(t.message||"HubSpot submission failed: "+s.status)}return s.json()}get formData(){return{...this.vt}}get currentStep(){return this.xt}get totalSteps(){return this.$t}get isSubmitting(){return this.St}get isSubmitted(){return this.kt}goToStep(t){const e=t>this.xt?"forward":"backward";this.Jt(t,e)}next(){return this.It()}back(){this.Ht()}submit(){return this.Yt()}reset(){this.vt={},this.xt=1,this.St=!1,this.kt=!1,this.zt="",this.Pt.reset(),this.Ut(),this.Mt.forEach(t=>{t.querySelectorAll("wf-options, wf-field, wf-email").forEach(t=>{"reset"in t&&"function"==typeof t.reset&&t.reset()})})}setFormData(t){this.vt={...this.vt,...t},Object.entries(t).forEach(([t,e])=>{this.Pt.setValue(t,e)})}},t.WizardForm.styles=d`
112
- :host {
113
- display: block;
114
- --wf-color-primary: #8040f0;
115
- --wf-color-primary-border: #602cbb;
116
- --wf-color-primary-light: rgba(128, 64, 240, 0.08);
117
- --wf-color-surface: #f3f3f5;
118
- --wf-color-surface-hover: #e9e9eb;
119
- --wf-color-border: #d4d4d4;
120
- --wf-color-text: #0a0a0a;
121
- --wf-color-text-secondary: #404040;
122
- --wf-color-text-muted: #646464;
123
- --wf-color-error: #dc3545;
124
- --wf-color-badge-bg: #fcfcfc;
125
- --wf-color-badge-border: #d4d4d4;
126
- --wf-color-badge-text: #5f5f5f;
127
- --wf-color-progress-active: rgba(139, 139, 139, 0.6);
128
- --wf-color-progress-inactive: rgba(217, 217, 217, 0.6);
129
- --wf-spacing-1: 4px;
130
- --wf-spacing-2: 8px;
131
- --wf-spacing-3: 12px;
132
- --wf-spacing-4: 16px;
133
- --wf-spacing-5: 20px;
134
- --wf-spacing-6: 24px;
135
- --wf-spacing-8: 32px;
136
- --wf-radius-sm: 4px;
137
- --wf-radius-md: 8px;
138
- --wf-radius-lg: 8px;
139
- --wf-radius-full: 99px;
140
- /* Typography Scale (Major Third based, 16px = 1rem) */
141
- --wf-font-size-xs: 0.75rem; /* 12px - badges, captions */
142
- --wf-font-size-sm: 0.875rem; /* 14px - labels, hints */
143
- --wf-font-size-base: 1rem; /* 16px - body, inputs */
144
- --wf-font-size-lg: 1.25rem; /* 20px - buttons */
145
- --wf-font-size-xl: 1.5rem; /* 24px - subtitles */
146
- --wf-font-size-2xl: 2rem; /* 32px - small headings */
147
- --wf-font-size-3xl: 2.5rem; /* 40px - main headings */
148
- --wf-input-min-height: 56px;
149
- }
150
-
151
- /* Dark theme */
152
- :host([theme='dark']) {
153
- --wf-color-surface: #2d2d2d;
154
- --wf-color-surface-hover: #3d3d3d;
155
- --wf-color-border: #4d4d4d;
156
- --wf-color-text: #f8f9fa;
157
- --wf-color-text-secondary: #d0d0d0;
158
- --wf-color-text-muted: #adb5bd;
159
- --wf-color-badge-bg: #3d3d3d;
160
- --wf-color-badge-border: #4d4d4d;
161
- --wf-color-badge-text: #adb5bd;
162
- --wf-color-progress-active: rgba(200, 200, 200, 0.6);
163
- --wf-color-progress-inactive: rgba(100, 100, 100, 0.6);
164
- }
165
-
166
- /* Auto theme (respects system preference) */
167
- @media (prefers-color-scheme: dark) {
168
- :host([theme='auto']) {
169
- --wf-color-surface: #2d2d2d;
170
- --wf-color-surface-hover: #3d3d3d;
171
- --wf-color-border: #4d4d4d;
172
- --wf-color-text: #f8f9fa;
173
- --wf-color-text-secondary: #d0d0d0;
174
- --wf-color-text-muted: #adb5bd;
175
- --wf-color-badge-bg: #3d3d3d;
176
- --wf-color-badge-border: #4d4d4d;
177
- --wf-color-badge-text: #adb5bd;
178
- --wf-color-progress-active: rgba(200, 200, 200, 0.6);
179
- --wf-color-progress-inactive: rgba(100, 100, 100, 0.6);
180
- }
181
- }
182
-
183
- .wf-container {
184
- margin: 0 auto;
185
- }
186
-
187
- .wf-progress {
188
- display: flex;
189
- gap: var(--wf-spacing-4, 16px);
190
- margin-top: var(--wf-spacing-6, 24px);
191
- }
192
-
193
- .wf-progress-segment {
194
- width: 32px;
195
- height: 8px;
196
- background-color: var(--wf-color-progress-inactive, rgba(217, 217, 217, 0.6));
197
- border-radius: var(--wf-radius-full, 99px);
198
- transition: background-color 300ms ease;
199
- }
200
-
201
- .wf-progress-segment.completed {
202
- background-color: var(--wf-color-progress-active, rgba(139, 139, 139, 0.6));
203
- }
204
-
205
- .wf-progress-segment.active {
206
- background-color: var(--wf-color-progress-active, rgba(139, 139, 139, 0.6));
207
- }
208
-
209
- .wf-steps-container {
210
- min-height: 200px;
211
- }
212
-
213
- .wf-navigation {
214
- display: flex;
215
- justify-content: space-between;
216
- gap: var(--wf-spacing-4, 16px);
217
- margin-top: var(--wf-spacing-6, 24px);
218
- }
219
-
220
- .wf-btn {
221
- display: inline-flex;
222
- align-items: center;
223
- justify-content: center;
224
- gap: var(--wf-spacing-2, 8px);
225
- padding: var(--wf-spacing-3, 12px) var(--wf-spacing-4, 16px);
226
- min-height: 48px;
227
- font-size: var(--wf-font-size-base, 1rem);
228
- font-weight: 600;
229
- font-family: inherit;
230
- border-radius: var(--wf-radius-md, 8px);
231
- cursor: pointer;
232
- transition: all 150ms ease;
233
- border: 1px solid transparent;
234
- outline: none;
235
- }
236
-
237
- .wf-btn:focus-visible {
238
- box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.3);
239
- }
240
-
241
- .wf-btn-back {
242
- background-color: var(--wf-color-surface, #f3f3f5);
243
- border: 1px solid var(--wf-color-border, #d4d4d4);
244
- color: var(--wf-color-text, #0a0a0a);
245
- }
246
-
247
- .wf-btn-back:hover:not(:disabled) {
248
- background-color: var(--wf-color-surface-hover, #e9e9eb);
249
- }
250
-
251
- .wf-btn-next {
252
- flex: 1;
253
- background-color: var(--wf-color-primary, #8040f0);
254
- border: 1px solid var(--wf-color-primary-border, #602cbb);
255
- color: white;
256
- margin-left: auto;
257
- position: relative;
258
- }
259
-
260
- .wf-btn-next:hover:not(:disabled) {
261
- filter: brightness(1.1);
262
- }
263
-
264
- .wf-btn:disabled {
265
- opacity: 0.5;
266
- cursor: not-allowed;
267
- }
268
-
269
- .wf-btn-shortcut {
270
- position: absolute;
271
- right: var(--wf-spacing-4, 16px);
272
- display: inline-flex;
273
- align-items: center;
274
- gap: 2px;
275
- }
276
-
277
- .wf-btn-back .wf-btn-shortcut {
278
- position: static;
279
- }
280
-
281
- /* Success screen styles */
282
- .wf-success-screen {
283
- text-align: center;
284
- padding: var(--wf-spacing-6, 24px);
285
- }
286
-
287
- /* Loading spinner */
288
- .wf-loading {
289
- display: inline-block;
290
- width: 20px;
291
- height: 20px;
292
- border: 2px solid rgba(255, 255, 255, 0.3);
293
- border-radius: 50%;
294
- border-top-color: white;
295
- animation: spin 0.8s linear infinite;
296
- }
297
-
298
- @keyframes spin {
299
- to {
300
- transform: rotate(360deg);
301
- }
302
- }
303
-
304
- /* Error message */
305
- .wf-form-error {
306
- padding: var(--wf-spacing-4, 16px);
307
- margin-bottom: var(--wf-spacing-4, 16px);
308
- background-color: rgba(220, 53, 69, 0.1);
309
- border: 1px solid var(--wf-color-error, #dc3545);
310
- border-radius: var(--wf-radius-md, 8px);
311
- color: var(--wf-color-error, #dc3545);
312
- font-size: var(--wf-font-size-base, 1rem);
313
- }
314
- `,_t([mt({type:String,attribute:"hubspot-portal"})],t.WizardForm.prototype,"hubspotPortal",2),_t([mt({type:String,attribute:"hubspot-form"})],t.WizardForm.prototype,"hubspotForm",2),_t([mt({type:String,reflect:!0})],t.WizardForm.prototype,"theme",2),_t([mt({type:Boolean})],t.WizardForm.prototype,"mock",2),_t([mt({type:Boolean,attribute:"show-progress"})],t.WizardForm.prototype,"showProgress",2),_t([mt({type:Boolean,attribute:"auto-advance"})],t.WizardForm.prototype,"autoAdvance",2),_t([mt({type:Boolean,attribute:"hide-back"})],t.WizardForm.prototype,"hideBack",2),_t([bt()],t.WizardForm.prototype,"_steps",2),_t([bt()],t.WizardForm.prototype,"_currentStep",2),_t([bt()],t.WizardForm.prototype,"_totalSteps",2),_t([bt()],t.WizardForm.prototype,"_formData",2),_t([bt()],t.WizardForm.prototype,"_submitting",2),_t([bt()],t.WizardForm.prototype,"_submitted",2),_t([bt()],t.WizardForm.prototype,"_error",2),t.WizardForm=_t([ut("wizard-form")],t.WizardForm),t.WfSuccess=class extends dt{render(){return Y`<slot></slot>`}},t.WfSuccess.styles=d`
315
- :host {
316
- display: block;
317
- }
318
-
319
- ::slotted(h1),
320
- ::slotted(h2),
321
- ::slotted(h3) {
322
- margin: 0 0 var(--wf-spacing-4, 16px) 0;
323
- font-weight: 600;
324
- color: var(--wf-color-text, #212529);
325
- }
326
-
327
- ::slotted(p) {
328
- margin: 0;
329
- color: var(--wf-color-text-muted, #6c757d);
330
- }
331
- `,t.WfSuccess=_t([ut("wf-success")],t.WfSuccess);var Et=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,Ct=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?zt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Et(e,s,o),o};t.WfStep=class extends dt{constructor(){super(...arguments),this.step=0,this.active=!1,this.direction="forward",this.leaving=!1,this.skipIf="",this.Zt=[]}render(){return Y`
332
- <div class="wf-step-content">
333
- <slot @slotchange="${this.Rt}"></slot>
334
- </div>
335
- `}Rt(){this.Gt()}firstUpdated(){this.Gt()}updated(t){t.has("active")&&this.active&&(this.leaving=!1,this.Qt())}Gt(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:!0}),s=[],i=t=>{if(["wf-options","wf-field","wf-email","wf-input","wf-textarea"].includes(t.tagName.toLowerCase())){const e=t.getAttribute("name");e&&s.push(e)}Array.from(t.children).forEach(i)};e.forEach(i),this.Zt=s}Qt(){requestAnimationFrame(()=>{const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:!0});for(const s of e){const t=this.te(s);if(t)return void t.focus()}})}te(t){if(t instanceof HTMLElement&&"function"==typeof t.focus&&["wf-field","wf-email","wf-input","wf-textarea"].includes(t.tagName.toLowerCase()))return t;for(const e of t.children){const t=this.te(e);if(t)return t}return null}get fields(){return[...this.Zt]}shouldSkip(t){if(!this.skipIf)return!1;try{const e=this.skipIf.trim();if(e.startsWith("!"))return!t[e.slice(1)];if(e.includes("===")){const[s,i]=e.split("===").map(t=>t.trim());return t[s]===i.replace(/['"]/g,"")}if(e.includes("!==")){const[s,i]=e.split("!==").map(t=>t.trim());return t[s]!==i.replace(/['"]/g,"")}return!!t[e]}catch(e){return!1}}show(t="forward"){this.direction=t,this.leaving=!1,this.active=!0}hide(){return new Promise(t=>{this.leaving=!0;const e=()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()};this.addEventListener("animationend",e),setTimeout(()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()},300)})}async validate(){const t=this.shadowRoot?.querySelector("slot");if(!t)return!0;const e=t.assignedElements({flatten:!0}),s=[];let i=!0;const r=async t=>{"validate"in t&&"function"==typeof t.validate&&(await t.validate()||(s.push(t),i=!1));for(const e of t.children)await r(e)};for(const o of e)await r(o);if(s.length>0){const t=s[0];t.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{"focus"in t&&"function"==typeof t.focus&&t.focus()},100)}return i}},t.WfStep.styles=d`
336
- :host {
337
- display: none;
338
- width: 100%;
339
- }
340
-
341
- :host([active]) {
342
- display: block;
343
- animation: stepFadeIn 0.3s ease forwards;
344
- }
345
-
346
- :host([direction='forward'][active]) {
347
- animation: stepSlideInRight 0.3s ease forwards;
348
- }
349
-
350
- :host([direction='backward'][active]) {
351
- animation: stepSlideInLeft 0.3s ease forwards;
352
- }
353
-
354
- :host([leaving]) {
355
- display: block;
356
- animation: stepFadeOut 0.2s ease forwards;
357
- }
358
-
359
- @keyframes stepFadeIn {
360
- from {
361
- opacity: 0;
362
- transform: translateY(10px);
363
- }
364
- to {
365
- opacity: 1;
366
- transform: translateY(0);
367
- }
368
- }
369
-
370
- @keyframes stepFadeOut {
371
- from {
372
- opacity: 1;
373
- transform: translateY(0);
374
- }
375
- to {
376
- opacity: 0;
377
- transform: translateY(-10px);
378
- }
379
- }
380
-
381
- @keyframes stepSlideInRight {
382
- from {
383
- opacity: 0;
384
- transform: translateX(30px);
385
- }
386
- to {
387
- opacity: 1;
388
- transform: translateX(0);
389
- }
390
- }
391
-
392
- @keyframes stepSlideInLeft {
393
- from {
394
- opacity: 0;
395
- transform: translateX(-30px);
396
- }
397
- to {
398
- opacity: 1;
399
- transform: translateX(0);
400
- }
401
- }
402
-
403
- .wf-step-content {
404
- display: flex;
405
- flex-direction: column;
406
- gap: var(--wf-spacing-4, 16px);
407
- }
408
-
409
- /* Slotted heading styles */
410
- ::slotted(h1),
411
- ::slotted(h2),
412
- ::slotted(h3) {
413
- margin: 0;
414
- font-weight: 600;
415
- color: var(--wf-color-text, #212529);
416
- }
417
-
418
- ::slotted(h2) {
419
- font-size: var(--wf-font-size-3xl, 2rem);
420
- }
421
-
422
- ::slotted(p) {
423
- margin: 0;
424
- color: var(--wf-color-text-muted, #6c757d);
425
- font-size: var(--wf-font-size-xl, 1.375rem);
426
- }
427
- `,Ct([mt({type:Number,attribute:"data-step"})],t.WfStep.prototype,"step",2),Ct([mt({type:Boolean,reflect:!0})],t.WfStep.prototype,"active",2),Ct([mt({type:String,reflect:!0})],t.WfStep.prototype,"direction",2),Ct([mt({type:Boolean,reflect:!0})],t.WfStep.prototype,"leaving",2),Ct([mt({type:String,attribute:"data-skip-if"})],t.WfStep.prototype,"skipIf",2),Ct([bt()],t.WfStep.prototype,"_fields",2),t.WfStep=Ct([ut("wf-step")],t.WfStep);var Tt=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,jt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ot(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Tt(e,s,o),o};t.WfOptions=class extends dt{constructor(){super(...arguments),this.name="",this.multi=!1,this.required=!1,this.min=0,this.max=0,this.columns=2,this.allowOther=!1,this.otherLabel="Other, please specify:",this.otherPlaceholder="Enter your answer",this.otherRequired=!1,this.otherName="",this.otherFieldValue="Others",this.ee=new Set,this.se="",this.ie="",this.re=!1,this.oe=[],this.ae=new Map,this.ne="",this.qt=t=>{t.stopPropagation();const{value:e}=t.detail;this.he(e)},this.At=t=>{const e=this.closest("wf-step");if(!e||!e.hasAttribute("active"))return;const s=t.composedPath()[0];if("INPUT"===s?.tagName||"TEXTAREA"===s?.tagName)return;const i=this.shadowRoot?.querySelector("#wf-other-input");if(i&&i===this.shadowRoot?.activeElement)return;const r=t.key.toUpperCase();if(1===r.length&&r>="A"&&r<="Z"){if(this.allowOther&&r===this.ne){t.preventDefault();const e=this.shadowRoot?.querySelector("#wf-other-input");return void(e&&e.focus())}const e=this.ae.get(r);e&&!e.disabled&&(t.preventDefault(),e.triggerSelect())}}}connectedCallback(){super.connectedCallback(),this.ie="",this.re=!1,this.addEventListener("wf-option-select",this.qt),document.addEventListener("keydown",this.At)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-option-select",this.qt),document.removeEventListener("keydown",this.At)}firstUpdated(){this.le()}updated(t){(t.has("multi")||t.has("max"))&&this.ce()}render(){return Y`
428
- <div
429
- class="wf-options-container"
430
- role="listbox"
431
- aria-multiselectable="${this.multi}"
432
- aria-required="${this.required}"
433
- >
434
- <slot @slotchange="${this.Rt}"></slot>
435
- </div>
55
+ `}_discoverSteps(){this._steps=Array.from(this.querySelectorAll(":scope > wf-step")),this._steps.forEach((t,e)=>{t.step=e+1}),this._totalSteps=this._steps.length,this._stateController.setTotalSteps(this._totalSteps),document.dispatchEvent(new CustomEvent("wf:steps-discovered",{detail:{wizard:this,wizardId:this.id,totalSteps:this._totalSteps,currentStep:this._currentStep}}))}_showCurrentStep(){this._steps.forEach((t,e)=>{e+1===this._currentStep?t.show("forward"):t.active=!1})}_getStepByNumber(t){const e=t-1;return this._steps[e]}async _goNext(){if(this._submitting)return;const t=this._getStepByNumber(this._currentStep);t&&!(await t.validate())||(this._currentStep>=this._totalSteps?await this._submit():this._navigateToStep(this._currentStep+1,"forward"))}_goBack(){this._submitting||this._currentStep<=1||this._navigateToStep(this._currentStep-1,"backward")}async _navigateToStep(t,e){if(t<1||t>this._totalSteps)return;const r=this._getStepByNumber(t);if(!r)return;if(r.shouldSkip(this._formData)){const r="forward"===e?t+1:t-1;return r>=1&&r<=this._totalSteps?this._navigateToStep(r,e):void 0}const s=this._currentStep;let i,o=!1;if(this.submitOnStep&&this.hubspotPortal&&this.hubspotForm)try{await this._submitPartialToHubSpot(),o=!0,i="hubspot"}catch(n){return void this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:n instanceof Error?n.message:"Partial submission failed",formData:this._getFieldsUpToStep(this._currentStep)},bubbles:!0,composed:!0}))}const a=this._getStepByNumber(this._currentStep);a&&await a.hide(),this._currentStep=t,this._stateController.goToStep(t),r.show(e),this.dispatchEvent(new CustomEvent("wf:step-change",{detail:{from:s,to:t,direction:e,submitted:o,adapter:i},bubbles:!0,composed:!0}))}async _handleEnter(){await this._goNext()}_handleEscape(){this._goBack()}async _submit(){if(this._submitting)return;const t={...this._formData},e=new CustomEvent("wf:submit",{detail:{formData:t},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(e),e.defaultPrevented)return;this._submitting=!0,this._error="";let r=t;this.serialize&&(r=this.serialize(t));try{let t;this.mock?(await new Promise(t=>setTimeout(t,1e3)),t={success:!0}):t=this.hubspotPortal&&this.hubspotForm?await this._submitToHubSpot(r):{success:!0},this._submitted=!0,this.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:r,response:t},bubbles:!0,composed:!0}))}catch(s){const t=s instanceof Error?s.message:"Submission failed";this._error=t,this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:t,formData:r},bubbles:!0,composed:!0}))}finally{this._submitting=!1}}async _submitToHubSpot(t){const e=`https://api.hsforms.com/submissions/v3/integration/submit/${this.hubspotPortal}/${this.hubspotForm}`,r={fields:Object.entries(t).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:window.location.href,pageName:document.title}},s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok){const t=await s.json().catch(()=>({}));throw Error(t.message||"HubSpot submission failed: "+s.status)}return s.json()}_getFieldsUpToStep(t){const e={};for(let r=0;r<t&&r<this._steps.length;r++)this._steps[r].querySelectorAll("[name]").forEach(t=>{t.name&&void 0!==this._formData[t.name]&&(e[t.name]=this._formData[t.name])});return e}async _submitPartialToHubSpot(){let t={...this._getFieldsUpToStep(this._currentStep)};this.serialize&&(t=this.serialize(t)),await this._submitToHubSpot(t)}get formData(){return{...this._formData}}get currentStep(){return this._currentStep}get totalSteps(){return this._totalSteps}get isSubmitting(){return this._submitting}get isSubmitted(){return this._submitted}goToStep(t){const e=t>this._currentStep?"forward":"backward";this._navigateToStep(t,e)}next(){return this._goNext()}back(){this._goBack()}submit(){return this._submit()}reset(){this._formData={},this._currentStep=1,this._submitting=!1,this._submitted=!1,this._error="",this._stateController.reset(),this._showCurrentStep(),this._steps.forEach(t=>{t.querySelectorAll("wf-options, wf-field, wf-email").forEach(t=>{"reset"in t&&"function"==typeof t.reset&&t.reset()})})}setFormData(t){this._formData={...this._formData,...t},Object.entries(t).forEach(([t,e])=>{this._stateController.setValue(t,e)})}},$t([mt({type:String,attribute:"hubspot-portal"})],t.WizardForm.prototype,"hubspotPortal",2),$t([mt({type:String,attribute:"hubspot-form"})],t.WizardForm.prototype,"hubspotForm",2),$t([mt({type:String,reflect:!0})],t.WizardForm.prototype,"theme",2),$t([mt({type:Boolean})],t.WizardForm.prototype,"mock",2),$t([mt({type:Boolean,attribute:"show-progress"})],t.WizardForm.prototype,"showProgress",2),$t([mt({type:Boolean,attribute:"auto-advance"})],t.WizardForm.prototype,"autoAdvance",2),$t([mt({type:Boolean,attribute:"hide-back"})],t.WizardForm.prototype,"hideBack",2),$t([mt({attribute:!1})],t.WizardForm.prototype,"serialize",2),$t([mt({type:Boolean,attribute:"submit-on-step"})],t.WizardForm.prototype,"submitOnStep",2),$t([wt()],t.WizardForm.prototype,"_steps",2),$t([wt()],t.WizardForm.prototype,"_currentStep",2),$t([wt()],t.WizardForm.prototype,"_totalSteps",2),$t([wt()],t.WizardForm.prototype,"_formData",2),$t([wt()],t.WizardForm.prototype,"_submitting",2),$t([wt()],t.WizardForm.prototype,"_submitted",2),$t([wt()],t.WizardForm.prototype,"_error",2),t.WizardForm=$t([pt("wizard-form")],t.WizardForm),t.WfSuccess=class extends ht{createRenderRoot(){return this}render(){return Y``}},t.WfSuccess=$t([pt("wf-success")],t.WfSuccess);var Et=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,At=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?kt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Et(e,r,o),o};t.WfStep=class extends ht{constructor(){super(...arguments),this.step=0,this.active=!1,this.direction="forward",this.leaving=!1,this.skipIf="",this._fields=[]}createRenderRoot(){return this}render(){return Y`
56
+ <div class="wf-step-content"></div>
57
+ `}firstUpdated(){this._discoverFields()}updated(t){t.has("active")&&this.active&&(this.leaving=!1,this._focusFirstField())}_discoverFields(){const t=["wf-options","wf-field","wf-email","wf-input","wf-textarea","wf-number"],e=[],r=s=>{if(t.includes(s.tagName.toLowerCase())){const t=s.getAttribute("name");t&&e.push(t)}Array.from(s.children).forEach(r)};Array.from(this.children).forEach(r),this._fields=e}_focusFirstField(){requestAnimationFrame(()=>{for(const t of this.children){const e=this._findFocusable(t);if(e)return void e.focus()}})}_findFocusable(t){if(t instanceof HTMLElement&&"function"==typeof t.focus&&["wf-field","wf-email","wf-input","wf-textarea"].includes(t.tagName.toLowerCase()))return t;for(const e of t.children){const t=this._findFocusable(e);if(t)return t}return null}get fields(){return[...this._fields]}shouldSkip(t){if(!this.skipIf)return!1;try{const e=this.skipIf.trim();if(e.startsWith("!"))return!t[e.slice(1)];if(e.includes("===")){const[r,s]=e.split("===").map(t=>t.trim());return t[r]===s.replace(/['"]/g,"")}if(e.includes("!==")){const[r,s]=e.split("!==").map(t=>t.trim());return t[r]!==s.replace(/['"]/g,"")}return!!t[e]}catch(e){return!1}}show(t="forward"){this.direction=t,this.leaving=!1,this.active=!0}hide(){return new Promise(t=>{this.leaving=!0;const e=()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()};this.addEventListener("animationend",e),setTimeout(()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()},300)})}async validate(){const t=[];let e=!0;const r=async s=>{"validate"in s&&"function"==typeof s.validate&&(await s.validate()||(t.push(s),e=!1));for(const t of s.children)await r(t)};for(const s of this.children)await r(s);if(t.length>0){const e=t[0];e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{"focus"in e&&"function"==typeof e.focus&&e.focus()},100)}return e}},At([mt({type:Number,attribute:"data-step"})],t.WfStep.prototype,"step",2),At([mt({type:Boolean,reflect:!0})],t.WfStep.prototype,"active",2),At([mt({type:String,reflect:!0})],t.WfStep.prototype,"direction",2),At([mt({type:Boolean,reflect:!0})],t.WfStep.prototype,"leaving",2),At([mt({type:String,attribute:"data-skip-if"})],t.WfStep.prototype,"skipIf",2),At([wt()],t.WfStep.prototype,"_fields",2),t.WfStep=At([pt("wf-step")],t.WfStep);var Ct=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,Ot=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?zt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Ct(e,r,o),o};const Wt={none:0,xs:4,sm:8,md:16,lg:24,xl:32};t.WfLayout=class extends ht{constructor(){super(...arguments),this.mode="flex",this.direction="column",this.gap="none",this.gapX="",this.gapY="",this.align="stretch",this.justify="start",this.padding="none",this.paddingX="",this.paddingY="",this.wrap=!1,this.width="full",this.columns="auto",this.minItemWidth="200px"}createRenderRoot(){return this}_resolveSpacing(t){if(!t||"none"===t)return"0";if(t in Wt)return Wt[t]+"px";const e=parseFloat(t);return isNaN(e)?t:e+"px"}_getGapX(){return this._resolveSpacing(this.gapX||this.gap)}_getGapY(){return this._resolveSpacing(this.gapY||this.gap)}_getPadding(){const t=this._resolveSpacing(this.padding),e=this.paddingX?this._resolveSpacing(this.paddingX):t;return`${this.paddingY?this._resolveSpacing(this.paddingY):t} ${e}`}_buildStyles(){const t=[];if("grid"===this.mode){t.push("display: grid");const e=parseInt(this.columns,10);!isNaN(e)&&e>0?t.push(`grid-template-columns: repeat(${e}, 1fr)`):t.push(`grid-template-columns: repeat(auto-fit, minmax(${this.minItemWidth}, 1fr))`),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify)}else t.push("display: flex"),t.push("flex-direction: "+this.direction),this.wrap&&t.push("flex-wrap: wrap"),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify);const e=this._getGapX(),r=this._getGapY();"0"===e&&"0"===r||(t.push("column-gap: "+e),t.push("row-gap: "+r));const s=this._getPadding();return"0 0"!==s&&t.push("padding: "+s),t.join("; ")}updated(t){super.updated(t),this.style.cssText=this._buildStyles(),this.classList.remove("wf-layout--width-full","wf-layout--width-auto","wf-layout--width-fit"),this.classList.add("wf-layout--width-"+this.width)}render(){return Y``}},Ot([mt({type:String})],t.WfLayout.prototype,"mode",2),Ot([mt({type:String})],t.WfLayout.prototype,"direction",2),Ot([mt({type:String})],t.WfLayout.prototype,"gap",2),Ot([mt({type:String,attribute:"gap-x"})],t.WfLayout.prototype,"gapX",2),Ot([mt({type:String,attribute:"gap-y"})],t.WfLayout.prototype,"gapY",2),Ot([mt({type:String})],t.WfLayout.prototype,"align",2),Ot([mt({type:String})],t.WfLayout.prototype,"justify",2),Ot([mt({type:String})],t.WfLayout.prototype,"padding",2),Ot([mt({type:String,attribute:"padding-x"})],t.WfLayout.prototype,"paddingX",2),Ot([mt({type:String,attribute:"padding-y"})],t.WfLayout.prototype,"paddingY",2),Ot([mt({type:Boolean})],t.WfLayout.prototype,"wrap",2),Ot([mt({type:String})],t.WfLayout.prototype,"width",2),Ot([mt({type:String})],t.WfLayout.prototype,"columns",2),Ot([mt({type:String,attribute:"min-item-width"})],t.WfLayout.prototype,"minItemWidth",2),t.WfLayout=Ot([pt("wf-layout")],t.WfLayout);var Pt=Object.defineProperty,Tt=Object.getOwnPropertyDescriptor,Dt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Tt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Pt(e,r,o),o};t.WfOptions=class extends ht{constructor(){super(...arguments),this.name="",this.multi=!1,this.required=!1,this.min=0,this.max=0,this.columns=2,this.allowOther=!1,this.otherLabel="Other, please specify:",this.otherPlaceholder="Enter your answer",this.otherRequired=!1,this.otherName="",this.otherFieldValue="Others",this._selected=new Set,this._otherValue="",this._errorMessage="",this._validationActivated=!1,this._options=[],this._shortcutMap=new Map,this._otherShortcut="",this._handleOptionSelect=t=>{t.stopPropagation();const{value:e}=t.detail;this._selectValue(e)},this._handleKeydown=t=>{const e=this.closest("wf-step");if(!e||!e.hasAttribute("active"))return;const r=t.composedPath()[0];if("INPUT"===r?.tagName||"TEXTAREA"===r?.tagName)return;const s=this.querySelector(".wf-other-input");if(s&&document.activeElement===s)return;const i=t.key.toUpperCase();if(1===i.length&&i>="A"&&i<="Z"){if(this.allowOther&&i===this._otherShortcut){t.preventDefault();const e=this.querySelector(".wf-other-input");return void(e&&e.focus())}const e=this._shortcutMap.get(i);e&&!e.disabled&&(t.preventDefault(),e.triggerSelect())}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._errorMessage="",this._validationActivated=!1,this.addEventListener("wf-option-select",this._handleOptionSelect),document.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-option-select",this._handleOptionSelect),document.removeEventListener("keydown",this._handleKeydown)}firstUpdated(){const t=this.querySelector("wf-layout");Array.from(this.querySelectorAll(":scope > wf-option")).forEach(e=>t?.appendChild(e)),this._discoverOptions(),this.requestUpdate()}updated(t){(t.has("multi")||t.has("max"))&&this._updateOptionStates()}render(){return this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable",this.multi+""),this.setAttribute("aria-required",this.required+""),Y`
58
+ <wf-layout mode="grid" columns="${this.columns}" gap="md">
59
+ <!-- wf-option children will be moved here in firstUpdated -->
60
+ </wf-layout>
436
61
  ${this.allowOther?Y`
437
62
  <div class="wf-other-container">
438
63
  <label class="wf-other-label">${this.otherLabel}</label>
439
64
  <div class="wf-other-input-wrapper">
440
- ${this.ne?Y`<wf-badge shortcut="${this.ne}"></wf-badge>`:""}
65
+ ${this._otherShortcut?Y`<wf-badge shortcut="${this._otherShortcut}"></wf-badge>`:""}
441
66
  <input
442
67
  type="text"
443
- id="wf-other-input"
444
68
  class="wf-other-input"
445
- .value="${this.se}"
69
+ .value="${this._otherValue}"
446
70
  placeholder="${this.otherPlaceholder}"
447
71
  data-testid="wf-other-input"
448
- @input="${this.de}"
449
- @keydown="${this.fe}"
450
- @focus="${this.ue}"
72
+ @input="${this._handleOtherInput}"
73
+ @keydown="${this._handleOtherKeydown}"
74
+ @focus="${this._handleOtherFocus}"
451
75
  />
452
76
  </div>
453
77
  </div>
454
78
  `:""}
455
79
  <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
456
- ${this.ie}
80
+ ${this._errorMessage}
457
81
  </span>
458
- `}de(t){const e=t.target;this.se=e.value,this.se.trim()&&this.ee.size>0&&(this.ee.clear(),this.ce()),this.pe()}ue(){}fe(t){"Escape"===t.key&&(t.stopPropagation(),t.target.blur())}Rt(){this.le()}le(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:!0});this.oe=e.filter(t=>"wf-option"===t.tagName.toLowerCase()),this.ae.clear(),this.oe.forEach((t,e)=>{if(e<26){const s=String.fromCharCode(65+e);t.shortcut=s,this.ae.set(s,t)}t.setSelected(this.ee.has(t.value))}),this.allowOther&&this.oe.length<26&&(this.ne=String.fromCharCode(65+this.oe.length))}he(t){this.multi?this.we(t):this.me(t),this.allowOther&&this.se&&(this.se=""),this.ce(),this.be(),this.pe()}me(t){this.ee.clear(),this.ee.add(t)}we(t){if(this.ee.has(t))this.ee.delete(t);else{if(this.max>0&&this.ee.size>=this.max)return;this.ee.add(t)}}ce(){this.oe.forEach(t=>{t.setSelected(this.ee.has(t.value))})}ge(){const t=this.allowOther&&this.se.trim(),e=this.ee.size>0||t;if(this.required&&!e)return!1;if(this.multi){if(this.min>0&&this.ee.size<this.min&&!t)return!1;if(this.max>0&&this.ee.size>this.max)return!1}return!0}be(){if(!this.re)return this.ie="",this.ge();this.ie="";const t=this.allowOther&&this.se.trim(),e=this.ee.size>0||t;if(this.required&&!e)return this.ie=this.allowOther?"Please select an option or specify in the text field":"Please select an option",!1;if(this.multi){if(this.min>0&&this.ee.size<this.min&&!t)return this.ie=`Please select at least ${this.min} option${this.min>1?"s":""}`,!1;if(this.max>0&&this.ee.size>this.max)return this.ie=`Please select at most ${this.max} option${this.max>1?"s":""}`,!1}return!0}pe(){const t=Array.from(this.ee),e=this.allowOther&&this.se.trim()&&0===this.ee.size;let s;s=this.otherName&&e?this.multi?[this.otherFieldValue]:this.otherFieldValue:this.value;const i={name:this.name,value:s,selected:t};this.otherName&&(i.extraFields={[this.otherName]:e?this.se.trim():""}),this.dispatchEvent(new CustomEvent("wf-change",{detail:i,bubbles:!0,composed:!0}))}get value(){if(this.allowOther&&this.se.trim()&&0===this.ee.size)return this.multi?[this.se]:this.se;const t=Array.from(this.ee);return this.multi?t:t[0]??""}set value(t){this.ee.clear(),Array.isArray(t)?t.forEach(t=>this.ee.add(t)):t&&this.ee.add(t),this.ce(),this.be()}getSelected(){return Array.from(this.ee)}isSelected(t){return this.ee.has(t)}select(t){this.he(t)}deselect(t){this.ee.has(t)&&(this.ee.delete(t),this.ce(),this.be(),this.pe())}clear(){this.ee.clear(),this.ce(),this.be(),this.pe()}validate(){return this.re=!0,this.be()}get isValid(){return this.ge()}showError(t){this.ie=t}clearError(){this.ie=""}focus(){this.oe[0]?.focus()}reset(){this.ee.clear(),this.se="",this.ie="",this.re=!1,this.oe.forEach(t=>{t.hasAttribute("selected")&&this.ee.add(t.value),t.setSelected(this.ee.has(t.value))}),this.pe()}},t.WfOptions.styles=d`
459
- :host {
460
- display: block;
461
- }
462
-
463
- :host([hidden]) {
464
- display: none;
465
- }
466
-
467
- /* Two columns (default) */
468
- .wf-options-container {
469
- display: grid;
470
- grid-template-columns: repeat(2, 1fr);
471
- gap: var(--wf-spacing-4, 16px);
472
- }
473
-
474
- /* Single column via attribute */
475
- :host([columns='1']) .wf-options-container {
476
- grid-template-columns: 1fr;
477
- }
478
-
479
- /* Single column on mobile */
480
- @media (max-width: 600px) {
481
- .wf-options-container {
482
- grid-template-columns: 1fr;
483
- }
484
- }
485
-
486
- .wf-error-message {
487
- display: block;
488
- margin-top: var(--wf-spacing-2, 8px);
489
- font-size: var(--wf-font-size-sm, 0.875rem);
490
- color: var(--wf-color-error, #dc3545);
491
- min-height: 20px;
492
- }
493
-
494
- /* Other input styles */
495
- .wf-other-container {
496
- margin-top: var(--wf-spacing-4, 16px);
497
- }
498
-
499
- .wf-other-label {
500
- display: block;
501
- margin-bottom: var(--wf-spacing-2, 8px);
502
- font-size: var(--wf-font-size-sm, 0.875rem);
503
- font-weight: 500;
504
- color: var(--wf-color-text, #0a0a0a);
505
- }
506
-
507
- .wf-other-label span {
508
- font-weight: 400;
509
- color: var(--wf-color-text-muted, #646464);
510
- }
511
-
512
- /* Wrapper puts badge inside the input */
513
- .wf-other-input-wrapper {
514
- display: flex;
515
- align-items: center;
516
- gap: var(--wf-spacing-3, 12px);
517
- min-height: var(--wf-input-min-height, 56px);
518
- background: var(--wf-color-surface, #f3f3f5);
519
- border: 1px solid var(--wf-color-border, #d4d4d4);
520
- border-radius: var(--wf-radius-md, 8px);
521
- padding-left: var(--wf-spacing-4, 16px);
522
- transition: border-color 150ms ease, box-shadow 150ms ease;
523
- }
524
-
525
- .wf-other-input-wrapper:focus-within {
526
- border-color: var(--wf-color-primary, #8040f0);
527
- box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.1);
528
- }
529
-
530
- .wf-other-input {
531
- flex: 1;
532
- min-height: calc(var(--wf-input-min-height, 56px) - 2px);
533
- padding: var(--wf-spacing-4, 16px);
534
- padding-left: 0;
535
- font-size: var(--wf-font-size-base, 1rem);
536
- font-weight: 500;
537
- color: var(--wf-color-text, #0a0a0a);
538
- background: transparent;
539
- border: none;
540
- outline: none;
541
- box-sizing: border-box;
542
- }
543
-
544
- .wf-other-input::placeholder {
545
- color: var(--wf-color-text-muted, #646464);
546
- font-weight: 500;
547
- }
548
- `,jt([mt({type:String})],t.WfOptions.prototype,"name",2),jt([mt({type:Boolean})],t.WfOptions.prototype,"multi",2),jt([mt({type:Boolean})],t.WfOptions.prototype,"required",2),jt([mt({type:Number})],t.WfOptions.prototype,"min",2),jt([mt({type:Number})],t.WfOptions.prototype,"max",2),jt([mt({type:Number,reflect:!0})],t.WfOptions.prototype,"columns",2),jt([mt({type:Boolean,attribute:"allow-other"})],t.WfOptions.prototype,"allowOther",2),jt([mt({type:String,attribute:"other-label"})],t.WfOptions.prototype,"otherLabel",2),jt([mt({type:String,attribute:"other-placeholder"})],t.WfOptions.prototype,"otherPlaceholder",2),jt([mt({type:Boolean,attribute:"other-required"})],t.WfOptions.prototype,"otherRequired",2),jt([mt({type:String,attribute:"other-name"})],t.WfOptions.prototype,"otherName",2),jt([mt({type:String,attribute:"other-value"})],t.WfOptions.prototype,"otherFieldValue",2),jt([bt()],t.WfOptions.prototype,"_selected",2),jt([bt()],t.WfOptions.prototype,"_otherValue",2),jt([bt()],t.WfOptions.prototype,"_errorMessage",2),jt([bt()],t.WfOptions.prototype,"_otherShortcut",2),t.WfOptions=jt([ut("wf-options")],t.WfOptions);var At=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Mt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Nt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&At(e,s,o),o};t.WfOption=class extends dt{constructor(){super(...arguments),this.value="",this.selected=!1,this.disabled=!1,this.shortcut="",this.ve=!1}render(){return Y`
82
+ `}_handleOtherInput(t){const e=t.target;this._otherValue=e.value,this._otherValue.trim()&&this._selected.size>0&&(this._selected.clear(),this._updateOptionStates()),this._dispatchChange()}_handleOtherFocus(){}_handleOtherKeydown(t){"Escape"===t.key&&(t.stopPropagation(),t.target.blur())}_discoverOptions(){const t=this.querySelector("wf-layout");this._options=t?Array.from(t.querySelectorAll(":scope > wf-option")):[],this._shortcutMap.clear(),this._options.forEach((t,e)=>{if(e<26){const r=String.fromCharCode(65+e);t.shortcut=r,this._shortcutMap.set(r,t)}t.setSelected(this._selected.has(t.value))}),this.allowOther&&this._options.length<26&&(this._otherShortcut=String.fromCharCode(65+this._options.length))}_selectValue(t){this.multi?this._handleMultiSelect(t):this._handleSingleSelect(t),this.allowOther&&this._otherValue&&(this._otherValue=""),this._updateOptionStates(),this._validateSelection(),this._dispatchChange()}_handleSingleSelect(t){this._selected.clear(),this._selected.add(t)}_handleMultiSelect(t){if(this._selected.has(t))this._selected.delete(t);else{if(this.max>0&&this._selected.size>=this.max)return;this._selected.add(t)}}_updateOptionStates(){this._options.forEach(t=>{t.setSelected(this._selected.has(t.value))})}_checkValidation(){const t=this.allowOther&&this._otherValue.trim(),e=this._selected.size>0||t;if(this.required&&!e)return!1;if(this.multi){if(this.min>0&&this._selected.size<this.min&&!t)return!1;if(this.max>0&&this._selected.size>this.max)return!1}return!0}_validateSelection(){if(!this._validationActivated)return this._errorMessage="",this._checkValidation();this._errorMessage="";const t=this.allowOther&&this._otherValue.trim(),e=this._selected.size>0||t;if(this.required&&!e)return this._errorMessage=this.allowOther?"Please select an option or specify in the text field":"Please select an option",!1;if(this.multi){if(this.min>0&&this._selected.size<this.min&&!t)return this._errorMessage=`Please select at least ${this.min} option${this.min>1?"s":""}`,!1;if(this.max>0&&this._selected.size>this.max)return this._errorMessage=`Please select at most ${this.max} option${this.max>1?"s":""}`,!1}return!0}_dispatchChange(){const t=Array.from(this._selected),e=this.allowOther&&this._otherValue.trim()&&0===this._selected.size;let r;r=this.otherName&&e?this.multi?[this.otherFieldValue]:this.otherFieldValue:this.value;const s={name:this.name,value:r,selected:t};this.otherName&&(s.extraFields={[this.otherName]:e?this._otherValue.trim():""}),this.dispatchEvent(new CustomEvent("wf-change",{detail:s,bubbles:!0,composed:!0}))}get value(){if(this.allowOther&&this._otherValue.trim()&&0===this._selected.size)return this.multi?[this._otherValue]:this._otherValue;const t=Array.from(this._selected);return this.multi?t:t[0]??""}set value(t){this._selected.clear(),Array.isArray(t)?t.forEach(t=>this._selected.add(t)):t&&this._selected.add(t),this._updateOptionStates(),this._validateSelection()}getSelected(){return Array.from(this._selected)}isSelected(t){return this._selected.has(t)}select(t){this._selectValue(t)}deselect(t){this._selected.has(t)&&(this._selected.delete(t),this._updateOptionStates(),this._validateSelection(),this._dispatchChange())}clear(){this._selected.clear(),this._updateOptionStates(),this._validateSelection(),this._dispatchChange()}validate(){return this._validationActivated=!0,this._validateSelection()}get isValid(){return this._checkValidation()}showError(t){this._errorMessage=t}clearError(){this._errorMessage=""}focus(){this._options[0]?.focus()}reset(){this._selected.clear(),this._otherValue="",this._errorMessage="",this._validationActivated=!1,this._options.forEach(t=>{t.hasAttribute("selected")&&this._selected.add(t.value),t.setSelected(this._selected.has(t.value))}),this._dispatchChange()}},Dt([mt({type:String})],t.WfOptions.prototype,"name",2),Dt([mt({type:Boolean})],t.WfOptions.prototype,"multi",2),Dt([mt({type:Boolean})],t.WfOptions.prototype,"required",2),Dt([mt({type:Number})],t.WfOptions.prototype,"min",2),Dt([mt({type:Number})],t.WfOptions.prototype,"max",2),Dt([mt({type:Number,reflect:!0})],t.WfOptions.prototype,"columns",2),Dt([mt({type:Boolean,attribute:"allow-other"})],t.WfOptions.prototype,"allowOther",2),Dt([mt({type:String,attribute:"other-label"})],t.WfOptions.prototype,"otherLabel",2),Dt([mt({type:String,attribute:"other-placeholder"})],t.WfOptions.prototype,"otherPlaceholder",2),Dt([mt({type:Boolean,attribute:"other-required"})],t.WfOptions.prototype,"otherRequired",2),Dt([mt({type:String,attribute:"other-name"})],t.WfOptions.prototype,"otherName",2),Dt([mt({type:String,attribute:"other-value"})],t.WfOptions.prototype,"otherFieldValue",2),Dt([wt()],t.WfOptions.prototype,"_selected",2),Dt([wt()],t.WfOptions.prototype,"_otherValue",2),Dt([wt()],t.WfOptions.prototype,"_errorMessage",2),Dt([wt()],t.WfOptions.prototype,"_otherShortcut",2),t.WfOptions=Dt([pt("wf-options")],t.WfOptions);var Mt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,Ft=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Lt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Mt(e,r,o),o};t.WfOption=class extends ht{constructor(){super(...arguments),this.value="",this.selected=!1,this.disabled=!1,this.shortcut="",this._selecting=!1,this._cachedContent=[]}createRenderRoot(){return this}connectedCallback(){0===this._cachedContent.length&&(this._cachedContent=Array.from(this.childNodes).map(t=>t.cloneNode(!0)),this.textContent=""),super.connectedCallback()}render(){return Y`
549
83
  <button
550
- class="wf-option-card ${this.ve?"selecting":""}"
84
+ class="wf-option-card ${this._selecting?"selecting":""}"
551
85
  role="option"
552
86
  aria-selected="${this.selected}"
553
87
  ?disabled="${this.disabled}"
554
88
  data-testid="wf-option-btn"
555
- @click="${this.ye}"
89
+ @click="${this._handleClick}"
556
90
  >
557
91
  ${this.shortcut?Y`<wf-badge
558
92
  shortcut="${this.shortcut}"
559
93
  variant="${this.selected?"selected":"default"}"
560
- ></wf-badge>`:K}
94
+ ></wf-badge>`:X}
561
95
  <div class="wf-option-content">
562
- <slot></slot>
96
+ ${this._cachedContent}
563
97
  </div>
564
98
  </button>
565
- `}ye(t){this.disabled?t.preventDefault():this.xe()}triggerSelect(){this.disabled||this.xe()}xe(){this.ve=!0;const t={value:this.value,selected:!this.selected};this.dispatchEvent(new CustomEvent("wf-option-select",{detail:t,bubbles:!0,composed:!0})),setTimeout(()=>{this.ve=!1},300)}focus(){const t=this.shadowRoot?.querySelector("button");t?.focus()}setSelected(t){this.selected=t}},t.WfOption.styles=d`
566
- :host {
567
- display: block;
568
- }
569
-
570
- :host([hidden]) {
571
- display: none;
572
- }
573
-
574
- .wf-option-card {
575
- display: flex;
576
- align-items: center;
577
- gap: var(--wf-spacing-3, 12px);
578
- width: 100%;
579
- min-height: var(--wf-input-min-height, 56px);
580
- padding: var(--wf-spacing-3, 12px);
581
- background-color: var(--wf-color-surface, #f3f3f5);
582
- border: 1px solid var(--wf-color-border, #d4d4d4);
583
- border-radius: var(--wf-radius-md, 8px);
584
- cursor: pointer;
585
- text-align: left;
586
- font-family: inherit;
587
- font-size: var(--wf-font-size-base, 1rem);
588
- font-weight: 500;
589
- color: var(--wf-color-text, #0a0a0a);
590
- transition: border-color 150ms ease, background-color 150ms ease,
591
- transform 100ms ease;
592
- outline: none;
593
- box-sizing: border-box;
594
- }
595
-
596
- .wf-option-card:hover:not(:disabled) {
597
- border-color: var(--wf-color-primary, #8040f0);
598
- background-color: var(--wf-color-primary-light, rgba(128, 64, 240, 0.08));
599
- }
600
-
601
- .wf-option-card:focus-visible {
602
- border-color: var(--wf-color-primary, #8040f0);
603
- box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.2);
604
- }
605
-
606
- .wf-option-card[aria-selected='true'] {
607
- border-color: var(--wf-color-primary, #8040f0);
608
- background-color: var(--wf-color-primary-light, rgba(128, 64, 240, 0.1));
609
- }
610
-
611
- .wf-option-card:disabled {
612
- opacity: 0.5;
613
- cursor: not-allowed;
614
- }
615
-
616
- .wf-option-card:active:not(:disabled) {
617
- transform: scale(0.98);
618
- }
619
-
620
- /* Blink animation on selection */
621
- .wf-option-card.selecting {
622
- animation: blink 0.3s ease;
623
- }
624
-
625
- @keyframes blink {
626
- 0%,
627
- 100% {
628
- opacity: 1;
629
- }
630
- 50% {
631
- opacity: 0.5;
632
- }
633
- }
634
-
635
- .wf-option-content {
636
- flex: 1;
637
- min-width: 0;
638
- }
639
-
640
- /* Slotted content styling */
641
- ::slotted(strong),
642
- ::slotted(h3),
643
- ::slotted(h4) {
644
- display: block;
645
- font-weight: 600;
646
- margin: 0;
647
- }
648
-
649
- ::slotted(span),
650
- ::slotted(p) {
651
- display: block;
652
- font-size: var(--wf-font-size-sm, 0.875rem);
653
- color: var(--wf-color-text-muted, #646464);
654
- margin: 4px 0 0 0;
655
- }
656
- `,Mt([mt({type:String})],t.WfOption.prototype,"value",2),Mt([mt({type:Boolean,reflect:!0})],t.WfOption.prototype,"selected",2),Mt([mt({type:Boolean,reflect:!0})],t.WfOption.prototype,"disabled",2),Mt([mt({type:String})],t.WfOption.prototype,"shortcut",2),Mt([bt()],t.WfOption.prototype,"_selecting",2),t.WfOption=Mt([ut("wf-option")],t.WfOption);const Pt=["gmail.com","yahoo.com","hotmail.com","outlook.com","aol.com","icloud.com","mail.com","protonmail.com","zoho.com","yandex.com","live.com","msn.com","me.com","inbox.com","gmx.com"];class Vt{constructor(t){this.$e=new Map,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this.$e.clear()}addValidator(t,e){const s=this.$e.get(t)??[];this.$e.set(t,[...s,e])}addValidators(t,e){e.forEach(e=>this.addValidator(t,e))}removeValidator(t,e){const s=this.$e.get(t)??[];this.$e.set(t,s.filter(t=>t.name!==e))}clearValidators(t){this.$e.delete(t)}getValidators(t){return this.$e.get(t)??[]}async validate(t,e){const s=this.getValidators(t);for(const r of s)try{const t=await r.validate(e);if(!t.valid)return{valid:!1,error:t.error??r.message??"Validation failed"}}catch(i){return{valid:!1,error:"Validation error occurred"}}return{valid:!0}}validateSync(t,e){const s=this.getValidators(t);for(const i of s){const t=i.validate(e);if(!(t instanceof Promise||t.valid))return{valid:!1,error:t.error??i.message??"Validation failed"}}return{valid:!0}}static required(t="This field is required"){return{name:"required",message:t,validate:e=>null==e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length?{valid:!1,error:t}:{valid:!0}}}static email(t="Please enter a valid email address"){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return{name:"email",message:t,validate:s=>"string"!=typeof s||""===s.trim()||e.test(s)?{valid:!0}:{valid:!1,error:t}}}static workEmail(t=Pt,e="Please use your work email address"){return{name:"workEmail",message:e,validate:s=>{if("string"!=typeof s||""===s.trim())return{valid:!0};const i=s.split("@")[1]?.toLowerCase();return i&&t.includes(i)?{valid:!1,error:e}:{valid:!0}}}}static pattern(t,e="Invalid format"){return{name:"pattern",message:e,validate:s=>"string"!=typeof s||""===s.trim()||t.test(s)?{valid:!0}:{valid:!1,error:e}}}static minLength(t,e){const s=e??`Minimum ${t} characters required`;return{name:"minLength",message:s,validate:e=>"string"!=typeof e?{valid:!0}:e.length<t?{valid:!1,error:s}:{valid:!0}}}static maxLength(t,e){const s=e??`Maximum ${t} characters allowed`;return{name:"maxLength",message:s,validate:e=>"string"!=typeof e?{valid:!0}:e.length>t?{valid:!1,error:s}:{valid:!0}}}static minSelections(t,e){const s=e??`Select at least ${t} option${t>1?"s":""}`;return{name:"minSelections",message:s,validate:e=>Array.isArray(e)&&e.length<t?{valid:!1,error:s}:{valid:!0}}}static maxSelections(t,e){const s=e??`Select at most ${t} option${t>1?"s":""}`;return{name:"maxSelections",message:s,validate:e=>Array.isArray(e)&&e.length>t?{valid:!1,error:s}:{valid:!0}}}static custom(t,e,s){return{name:t,message:s,validate:e}}}var qt=Object.defineProperty,It=Object.getOwnPropertyDescriptor,Bt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?It(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&qt(e,s,o),o};t.WfField=class extends dt{constructor(){super(...arguments),this.name="",this.label="",this.required=!1,this.hint="",this.ie="",this.Se="",this.re=!1,this.ke=null,this.$e=[],this._e=null,this.Ee=t=>{const e=t.target;this.Se=e.value,this.re&&(this.ke&&clearTimeout(this.ke),this.ke=setTimeout(()=>{this.validate()},300)),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.ze=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.Ce=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("input",this.Ee),this.addEventListener("blur",this.ze,!0),this.addEventListener("focus",this.Ce,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("input",this.Ee),this.removeEventListener("blur",this.ze,!0),this.removeEventListener("focus",this.Ce,!0)}firstUpdated(){this.Te(),this.Oe()}render(){return Y`
99
+ `}_handleClick(t){this.disabled?t.preventDefault():this._triggerSelect()}triggerSelect(){this.disabled||this._triggerSelect()}_triggerSelect(){this._selecting=!0;const t={value:this.value,selected:!this.selected};this.dispatchEvent(new CustomEvent("wf-option-select",{detail:t,bubbles:!0,composed:!0})),setTimeout(()=>{this._selecting=!1},300)}focus(){const t=this.querySelector("button");t?.focus()}setSelected(t){this.selected=t}},Ft([mt({type:String})],t.WfOption.prototype,"value",2),Ft([mt({type:Boolean,reflect:!0})],t.WfOption.prototype,"selected",2),Ft([mt({type:Boolean,reflect:!0})],t.WfOption.prototype,"disabled",2),Ft([mt({type:String})],t.WfOption.prototype,"shortcut",2),Ft([wt()],t.WfOption.prototype,"_selecting",2),t.WfOption=Ft([pt("wf-option")],t.WfOption);var Nt=Object.defineProperty,It=(t,e,r,s)=>{for(var i,o=void 0,a=t.length-1;a>=0;a--)(i=t[a])&&(o=i(e,r,o)||o);return o&&Nt(e,r,o),o};class qt extends ht{constructor(){super(...arguments),this.name="",this.label="",this.required=!1,this.hint="",this._errorMessage="",this._value="",this._validationActivated=!1,this._debounceTimer=null,this._validators=[],this._handleInput=t=>{const e=t.target;this._value=e.value,this._validationActivated&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.validate()},this._getDebounceMs())),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this._value},bubbles:!0,composed:!0}))},this._handleBlur=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this._value},bubbles:!0,composed:!0}))},this._handleFocus=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._setupValidators()}updated(t){this._getValidationTriggerProperties().some(e=>t.has(e))&&this._setupValidators()}_getDebounceMs(){return 600}_getFocusableSelector(){return"input"}get value(){return this._value}set value(t){this._value=t}addValidator(t){this._validators.push(t)}async validate(){this._validationActivated=!0;const t=this.value;for(const r of this._validators)try{const e=await r.validate(t);if(!e.valid)return this._errorMessage=e.error??r.message??"Validation failed",!1}catch(e){return this._errorMessage="Validation error occurred",!1}return this._errorMessage="",!0}get isValid(){const t=this.value;for(const e of this._validators){const r=e.validate(t);if(!(r instanceof Promise||r.valid))return!1}return!0}showError(t){this._errorMessage=t}clearError(){this._errorMessage=""}focus(){const t=this.querySelector(this._getFocusableSelector());t?.focus()}reset(){this._value="",this._errorMessage="",this._validationActivated=!1,this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}}It([mt({type:String})],qt.prototype,"name"),It([mt({type:String})],qt.prototype,"label"),It([mt({type:Boolean})],qt.prototype,"required"),It([mt({type:String})],qt.prototype,"hint"),It([wt()],qt.prototype,"_errorMessage"),It([wt()],qt.prototype,"_value");const jt=["gmail.com","yahoo.com","hotmail.com","outlook.com","aol.com","icloud.com","mail.com","protonmail.com","zoho.com","yandex.com","live.com","msn.com","me.com","inbox.com","gmx.com"];class Rt{constructor(t){this._validators=new Map,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this._validators.clear()}addValidator(t,e){const r=this._validators.get(t)??[];this._validators.set(t,[...r,e])}addValidators(t,e){e.forEach(e=>this.addValidator(t,e))}removeValidator(t,e){const r=this._validators.get(t)??[];this._validators.set(t,r.filter(t=>t.name!==e))}clearValidators(t){this._validators.delete(t)}getValidators(t){return this._validators.get(t)??[]}async validate(t,e){const r=this.getValidators(t);for(const i of r)try{const t=await i.validate(e);if(!t.valid)return{valid:!1,error:t.error??i.message??"Validation failed"}}catch(s){return{valid:!1,error:"Validation error occurred"}}return{valid:!0}}validateSync(t,e){const r=this.getValidators(t);for(const s of r){const t=s.validate(e);if(!(t instanceof Promise||t.valid))return{valid:!1,error:t.error??s.message??"Validation failed"}}return{valid:!0}}static required(t="This field is required"){return{name:"required",message:t,validate:e=>null==e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length?{valid:!1,error:t}:{valid:!0}}}static email(t="Please enter a valid email address"){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return{name:"email",message:t,validate:r=>"string"!=typeof r||""===r.trim()||e.test(r)?{valid:!0}:{valid:!1,error:t}}}static workEmail(t=jt,e="Please use your work email address"){return{name:"workEmail",message:e,validate:r=>{if("string"!=typeof r||""===r.trim())return{valid:!0};const s=r.split("@")[1]?.toLowerCase();return s&&t.includes(s)?{valid:!1,error:e}:{valid:!0}}}}static pattern(t,e="Invalid format"){return{name:"pattern",message:e,validate:r=>"string"!=typeof r||""===r.trim()||t.test(r)?{valid:!0}:{valid:!1,error:e}}}static minLength(t,e){const r=e??`Minimum ${t} characters required`;return{name:"minLength",message:r,validate:e=>"string"!=typeof e?{valid:!0}:e.length<t?{valid:!1,error:r}:{valid:!0}}}static maxLength(t,e){const r=e??`Maximum ${t} characters allowed`;return{name:"maxLength",message:r,validate:e=>"string"!=typeof e?{valid:!0}:e.length>t?{valid:!1,error:r}:{valid:!0}}}static minSelections(t,e){const r=e??`Select at least ${t} option${t>1?"s":""}`;return{name:"minSelections",message:r,validate:e=>Array.isArray(e)&&e.length<t?{valid:!1,error:r}:{valid:!0}}}static maxSelections(t,e){const r=e??`Select at most ${t} option${t>1?"s":""}`;return{name:"maxSelections",message:r,validate:e=>Array.isArray(e)&&e.length>t?{valid:!1,error:r}:{valid:!0}}}static custom(t,e,r){return{name:t,message:r,validate:e}}}var Vt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Ut=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Ht(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Vt(e,r,o),o};t.WfField=class extends qt{constructor(){super(...arguments),this._inputElement=null}connectedCallback(){super.connectedCallback(),this.addEventListener("input",this._handleInput),this.addEventListener("blur",this._handleBlur,!0),this.addEventListener("focus",this._handleFocus,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("input",this._handleInput),this.removeEventListener("blur",this._handleBlur,!0),this.removeEventListener("focus",this._handleFocus,!0)}firstUpdated(){this._discoverInput(),this._setupValidators()}_getValidationTriggerProperties(){return["required"]}_getDebounceMs(){return 300}_setupValidators(){if(!this._inputElement)return;if(this._validators=[],(this.required||this._inputElement.hasAttribute("required"))&&this._validators.push(Rt.required()),"email"===this._inputElement.getAttribute("type")&&this._validators.push(Rt.email()),this._inputElement.hasAttribute("data-work-email")){const t=this._inputElement.getAttribute("data-blocked-domains"),e=t?t.split(",").map(t=>t.trim()):void 0;this._validators.push(Rt.workEmail(e))}const t=this._inputElement.getAttribute("pattern");if(t){const e=this._inputElement.getAttribute("data-pattern-message")||"Invalid format";this._validators.push(Rt.pattern(RegExp(t),e))}const e=this._inputElement.getAttribute("minlength");e&&this._validators.push(Rt.minLength(parseInt(e,10)));const r=this._inputElement.getAttribute("maxlength");r&&this._validators.push(Rt.maxLength(parseInt(r,10)))}_handleSlotChange(){this._discoverInput(),this._setupValidators()}_discoverInput(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:!0});for(const r of e)if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){this._inputElement=r,r.id||(r.id=this.name),r.name||(r.name=this.name),this._value=r.value;break}}get value(){return this._inputElement?.value??this._value}set value(t){this._value=t,this._inputElement&&(this._inputElement.value=(t??"")+"")}focus(){this._inputElement?.focus()}reset(){super.reset(),this._inputElement&&(this._inputElement.value="")}render(){return Y`
657
100
  <div class="wf-field-container">
658
101
  ${this.label?Y`<label
659
102
  class="wf-label ${this.required?"wf-label-required":""}"
@@ -662,90 +105,14 @@
662
105
  ${this.label}
663
106
  </label>`:""}
664
107
  <div class="wf-input-wrapper">
665
- <slot @slotchange="${this.Rt}"></slot>
108
+ <slot @slotchange="${this._handleSlotChange}"></slot>
666
109
  </div>
667
- ${this.hint&&!this.ie?Y`<span class="wf-hint">${this.hint}</span>`:""}
110
+ ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
668
111
  <span class="wf-error-message" role="alert" aria-live="polite">
669
- ${this.ie}
112
+ ${this._errorMessage}
670
113
  </span>
671
114
  </div>
672
- `}Rt(){this.Te(),this.Oe()}Te(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:!0});for(const s of e)if(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement){this._e=s,s.id||(s.id=this.name),s.name||(s.name=this.name),this.Se=s.value;break}}Oe(){if(!this._e)return;if(this.$e=[],(this.required||this._e.hasAttribute("required"))&&this.$e.push(Vt.required()),"email"===this._e.getAttribute("type")&&this.$e.push(Vt.email()),this._e.hasAttribute("data-work-email")){const t=this._e.getAttribute("data-blocked-domains"),e=t?t.split(",").map(t=>t.trim()):void 0;this.$e.push(Vt.workEmail(e))}const t=this._e.getAttribute("pattern");if(t){const e=this._e.getAttribute("data-pattern-message")||"Invalid format";this.$e.push(Vt.pattern(RegExp(t),e))}const e=this._e.getAttribute("minlength");e&&this.$e.push(Vt.minLength(parseInt(e,10)));const s=this._e.getAttribute("maxlength");s&&this.$e.push(Vt.maxLength(parseInt(s,10)))}get value(){return this._e?.value??this.Se}set value(t){this.Se=t,this._e&&(this._e.value=(t??"")+"")}addValidator(t){this.$e.push(t)}async validate(){this.re=!0;const t=this.value;for(const s of this.$e)try{const e=await s.validate(t);if(!e.valid)return this.ie=e.error??s.message??"Validation failed",!1}catch(e){return this.ie="Validation error occurred",!1}return this.ie="",!0}get isValid(){const t=this.value;for(const e of this.$e){const s=e.validate(t);if(!(s instanceof Promise||s.valid))return!1}return!0}showError(t){this.ie=t}clearError(){this.ie=""}focus(){this._e?.focus()}reset(){this.Se="",this.ie="",this.re=!1,this.ke&&(clearTimeout(this.ke),this.ke=null),this._e&&(this._e.value="")}},t.WfField.styles=d`
673
- :host {
674
- display: block;
675
- }
676
-
677
- :host([hidden]) {
678
- display: none;
679
- }
680
-
681
- .wf-field-container {
682
- display: flex;
683
- flex-direction: column;
684
- gap: var(--wf-spacing-2, 8px);
685
- }
686
-
687
- .wf-label {
688
- font-size: var(--wf-font-size-sm, 0.875rem);
689
- font-weight: 500;
690
- color: var(--wf-color-text, #212529);
691
- }
692
-
693
- .wf-label-required::after {
694
- content: ' *';
695
- color: var(--wf-color-error, #dc3545);
696
- }
697
-
698
- .wf-input-wrapper {
699
- position: relative;
700
- }
701
-
702
- /* Style slotted inputs */
703
- ::slotted(input),
704
- ::slotted(textarea),
705
- ::slotted(select) {
706
- width: 100%;
707
- padding: var(--wf-spacing-4, 16px);
708
- font-size: var(--wf-font-size-base, 1rem);
709
- font-family: inherit;
710
- background-color: var(--wf-color-surface, #f8f9fa);
711
- border: 2px solid var(--wf-color-border, #dee2e6);
712
- border-radius: var(--wf-radius-lg, 12px);
713
- color: var(--wf-color-text, #212529);
714
- transition: border-color 150ms ease, box-shadow 150ms ease;
715
- outline: none;
716
- box-sizing: border-box;
717
- }
718
-
719
- ::slotted(input::placeholder),
720
- ::slotted(textarea::placeholder) {
721
- color: var(--wf-color-text-muted, #6c757d);
722
- }
723
-
724
- ::slotted(input:focus),
725
- ::slotted(textarea:focus),
726
- ::slotted(select:focus) {
727
- border-color: var(--wf-color-primary, #8b5cf6);
728
- box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
729
- }
730
-
731
- ::slotted(input:disabled),
732
- ::slotted(textarea:disabled),
733
- ::slotted(select:disabled) {
734
- opacity: 0.5;
735
- cursor: not-allowed;
736
- }
737
-
738
- .wf-error-message {
739
- font-size: var(--wf-font-size-sm, 0.875rem);
740
- color: var(--wf-color-error, #dc3545);
741
- min-height: 20px;
742
- }
743
-
744
- .wf-hint {
745
- font-size: var(--wf-font-size-sm, 0.875rem);
746
- color: var(--wf-color-text-muted, #6c757d);
747
- }
748
- `,Bt([mt({type:String})],t.WfField.prototype,"name",2),Bt([mt({type:String})],t.WfField.prototype,"label",2),Bt([mt({type:Boolean})],t.WfField.prototype,"required",2),Bt([mt({type:String})],t.WfField.prototype,"hint",2),Bt([bt()],t.WfField.prototype,"_errorMessage",2),Bt([bt()],t.WfField.prototype,"_value",2),t.WfField=Bt([ut("wf-field")],t.WfField);var Dt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Ut=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ft(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Dt(e,s,o),o};t.WfEmail=class extends dt{constructor(){super(...arguments),this.name="",this.label="",this.placeholder="you@company.com",this.required=!1,this.workEmail=!1,this.blockedDomains="",this.workEmailMessage="Please use your work email address",this.disabled=!1,this.hint="",this.ie="",this.Se="",this.re=!1,this.ke=null,this.$e=[],this.Ee=t=>{const e=t.target;this.Se=e.value,this.re&&(this.ke&&clearTimeout(this.ke),this.ke=setTimeout(()=>{this.validate()},300)),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.ze=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.Ce=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.je()}updated(t){(t.has("required")||t.has("workEmail")||t.has("blockedDomains"))&&this.je()}je(){if(this.$e=[],this.required&&this.$e.push(Vt.required()),this.$e.push(Vt.email()),this.workEmail){let t=Pt;this.blockedDomains&&(t=this.blockedDomains.split(",").map(t=>t.trim().toLowerCase())),this.$e.push(Vt.workEmail(t,this.workEmailMessage))}}render(){return Y`
115
+ `}},Ut([wt()],t.WfField.prototype,"_inputElement",2),t.WfField=Ut([pt("wf-field")],t.WfField);var Bt=Object.defineProperty,Yt=Object.getOwnPropertyDescriptor,Kt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Yt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Bt(e,r,o),o};t.WfEmail=class extends qt{constructor(){super(...arguments),this.placeholder="you@company.com",this.workEmail=!1,this.blockedDomains="",this.workEmailMessage="Please use your work email address",this.disabled=!1}_getValidationTriggerProperties(){return["required","workEmail","blockedDomains"]}_getDebounceMs(){return 300}_setupValidators(){if(this._validators=[],this.required&&this._validators.push(Rt.required()),this._validators.push(Rt.email()),this.workEmail){let t=jt;this.blockedDomains&&(t=this.blockedDomains.split(",").map(t=>t.trim().toLowerCase())),this._validators.push(Rt.workEmail(t,this.workEmailMessage))}}render(){return Y`
749
116
  <div class="wf-field-container">
750
117
  ${this.label?Y`<label
751
118
  class="wf-label ${this.required?"wf-label-required":""}"
@@ -756,98 +123,24 @@
756
123
  </label>`:""}
757
124
  <input
758
125
  type="email"
759
- class="wf-input ${this.ie?"wf-input-error":""}"
126
+ class="wf-input ${this._errorMessage?"wf-input-error":""}"
760
127
  id="${this.name}"
761
128
  name="${this.name}"
762
129
  placeholder="${this.placeholder}"
763
- .value="${this.Se}"
130
+ .value="${this._value}"
764
131
  ?disabled="${this.disabled}"
765
132
  ?required="${this.required}"
766
133
  data-testid="wf-input"
767
- @input="${this.Ee}"
768
- @blur="${this.ze}"
769
- @focus="${this.Ce}"
134
+ @input="${this._handleInput}"
135
+ @blur="${this._handleBlur}"
136
+ @focus="${this._handleFocus}"
770
137
  />
771
- ${this.hint&&!this.ie?Y`<span class="wf-hint">${this.hint}</span>`:""}
138
+ ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
772
139
  <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
773
- ${this.ie}
140
+ ${this._errorMessage}
774
141
  </span>
775
142
  </div>
776
- `}get value(){return this.Se}set value(t){this.Se=t}async validate(){this.re=!0;for(const e of this.$e)try{const t=await e.validate(this.Se);if(!t.valid)return this.ie=t.error??e.message??"Validation failed",!1}catch(t){return this.ie="Validation error occurred",!1}return this.ie="",!0}get isValid(){for(const t of this.$e){const e=t.validate(this.Se);if(!(e instanceof Promise||e.valid))return!1}return!0}showError(t){this.ie=t}clearError(){this.ie=""}focus(){const t=this.shadowRoot?.querySelector("input");t?.focus()}reset(){this.Se="",this.ie="",this.re=!1,this.ke&&(clearTimeout(this.ke),this.ke=null)}},t.WfEmail.styles=d`
777
- :host {
778
- display: block;
779
- }
780
-
781
- :host([hidden]) {
782
- display: none;
783
- }
784
-
785
- .wf-field-container {
786
- display: flex;
787
- flex-direction: column;
788
- gap: var(--wf-spacing-2, 8px);
789
- }
790
-
791
- .wf-label {
792
- font-size: var(--wf-font-size-sm, 0.875rem);
793
- font-weight: 500;
794
- color: var(--wf-color-text, #0a0a0a);
795
- }
796
-
797
- .wf-label-required::after {
798
- content: ' *';
799
- color: var(--wf-color-error, #dc3545);
800
- }
801
-
802
- .wf-input {
803
- width: 100%;
804
- min-height: var(--wf-input-min-height, 56px);
805
- padding: var(--wf-spacing-4, 16px);
806
- font-size: var(--wf-font-size-base, 1rem);
807
- font-weight: 500;
808
- font-family: inherit;
809
- background-color: var(--wf-color-surface, #f3f3f5);
810
- border: 1px solid var(--wf-color-border, #d4d4d4);
811
- border-radius: var(--wf-radius-md, 8px);
812
- color: var(--wf-color-text, #0a0a0a);
813
- transition: border-color 150ms ease, box-shadow 150ms ease;
814
- outline: none;
815
- box-sizing: border-box;
816
- }
817
-
818
- .wf-input::placeholder {
819
- color: var(--wf-color-text-muted, #646464);
820
- font-weight: 500;
821
- }
822
-
823
- .wf-input:focus {
824
- border-color: var(--wf-color-primary, #8040f0);
825
- box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.2);
826
- }
827
-
828
- .wf-input:disabled {
829
- opacity: 0.5;
830
- cursor: not-allowed;
831
- }
832
-
833
- .wf-input.wf-input-error {
834
- border-color: var(--wf-color-error, #dc3545);
835
- }
836
-
837
- .wf-input.wf-input-error:focus {
838
- box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
839
- }
840
-
841
- .wf-error-message {
842
- font-size: var(--wf-font-size-sm, 0.875rem);
843
- color: var(--wf-color-error, #dc3545);
844
- }
845
-
846
- .wf-hint {
847
- font-size: var(--wf-font-size-sm, 0.875rem);
848
- color: var(--wf-color-text-muted, #646464);
849
- }
850
- `,Ut([mt({type:String})],t.WfEmail.prototype,"name",2),Ut([mt({type:String})],t.WfEmail.prototype,"label",2),Ut([mt({type:String})],t.WfEmail.prototype,"placeholder",2),Ut([mt({type:Boolean})],t.WfEmail.prototype,"required",2),Ut([mt({type:Boolean,attribute:"work-email"})],t.WfEmail.prototype,"workEmail",2),Ut([mt({type:String,attribute:"blocked-domains"})],t.WfEmail.prototype,"blockedDomains",2),Ut([mt({type:String,attribute:"work-email-message"})],t.WfEmail.prototype,"workEmailMessage",2),Ut([mt({type:Boolean})],t.WfEmail.prototype,"disabled",2),Ut([mt({type:String})],t.WfEmail.prototype,"hint",2),Ut([bt()],t.WfEmail.prototype,"_errorMessage",2),Ut([bt()],t.WfEmail.prototype,"_value",2),t.WfEmail=Ut([ut("wf-email")],t.WfEmail);var Rt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,Wt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Lt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Rt(e,s,o),o};t.WfInput=class extends dt{constructor(){super(...arguments),this.name="",this.label="",this.placeholder="",this.type="text",this.required=!1,this.patternMessage="Invalid format",this.disabled=!1,this.autocomplete="",this.hint="",this.ie="",this.Se="",this.re=!1,this.ke=null,this.$e=[],this.Ee=t=>{const e=t.target;this.Se=e.value,this.re&&(this.ke&&clearTimeout(this.ke),this.ke=setTimeout(()=>{this.validate()},600)),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.ze=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.Ce=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.je()}updated(t){(t.has("required")||t.has("minlength")||t.has("maxlength")||t.has("pattern"))&&this.je()}je(){this.$e=[],this.required&&this.$e.push(Vt.required()),void 0!==this.minlength&&this.$e.push(Vt.minLength(this.minlength)),void 0!==this.maxlength&&this.$e.push(Vt.maxLength(this.maxlength)),this.pattern&&this.$e.push(Vt.pattern(RegExp(this.pattern),this.patternMessage))}render(){return Y`
143
+ `}},Kt([mt({type:String})],t.WfEmail.prototype,"placeholder",2),Kt([mt({type:Boolean,attribute:"work-email"})],t.WfEmail.prototype,"workEmail",2),Kt([mt({type:String,attribute:"blocked-domains"})],t.WfEmail.prototype,"blockedDomains",2),Kt([mt({type:String,attribute:"work-email-message"})],t.WfEmail.prototype,"workEmailMessage",2),Kt([mt({type:Boolean})],t.WfEmail.prototype,"disabled",2),t.WfEmail=Kt([pt("wf-email")],t.WfEmail);var Xt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,Gt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Jt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Xt(e,r,o),o};t.WfInput=class extends qt{constructor(){super(...arguments),this.placeholder="",this.type="text",this.patternMessage="Invalid format",this.disabled=!1,this.autocomplete=""}_getValidationTriggerProperties(){return["required","minlength","maxlength","pattern"]}_setupValidators(){this._validators=[],this.required&&this._validators.push(Rt.required()),void 0!==this.minlength&&this._validators.push(Rt.minLength(this.minlength)),void 0!==this.maxlength&&this._validators.push(Rt.maxLength(this.maxlength)),this.pattern&&this._validators.push(Rt.pattern(RegExp(this.pattern),this.patternMessage))}render(){return Y`
851
144
  <div class="wf-field-container">
852
145
  ${this.label?Y`<label
853
146
  class="wf-label ${this.required?"wf-label-required":""}"
@@ -858,99 +151,25 @@
858
151
  </label>`:""}
859
152
  <input
860
153
  type="${this.type}"
861
- class="wf-input ${this.ie?"wf-input-error":""}"
154
+ class="wf-input ${this._errorMessage?"wf-input-error":""}"
862
155
  id="${this.name}"
863
156
  name="${this.name}"
864
157
  placeholder="${this.placeholder}"
865
- .value="${this.Se}"
158
+ .value="${this._value}"
866
159
  ?disabled="${this.disabled}"
867
160
  ?required="${this.required}"
868
161
  autocomplete="${this.autocomplete||"off"}"
869
162
  data-testid="wf-input"
870
- @input="${this.Ee}"
871
- @blur="${this.ze}"
872
- @focus="${this.Ce}"
163
+ @input="${this._handleInput}"
164
+ @blur="${this._handleBlur}"
165
+ @focus="${this._handleFocus}"
873
166
  />
874
- ${this.hint&&!this.ie?Y`<span class="wf-hint">${this.hint}</span>`:""}
167
+ ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
875
168
  <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
876
- ${this.ie}
169
+ ${this._errorMessage}
877
170
  </span>
878
171
  </div>
879
- `}get value(){return this.Se}set value(t){this.Se=t}addValidator(t){this.$e.push(t)}async validate(){this.re=!0;for(const e of this.$e)try{const t=await e.validate(this.Se);if(!t.valid)return this.ie=t.error??e.message??"Validation failed",!1}catch(t){return this.ie="Validation error occurred",!1}return this.ie="",!0}get isValid(){for(const t of this.$e){const e=t.validate(this.Se);if(!(e instanceof Promise||e.valid))return!1}return!0}showError(t){this.ie=t}clearError(){this.ie=""}focus(){const t=this.shadowRoot?.querySelector("input");t?.focus()}reset(){this.Se="",this.ie="",this.re=!1,this.ke&&(clearTimeout(this.ke),this.ke=null)}},t.WfInput.styles=d`
880
- :host {
881
- display: block;
882
- }
883
-
884
- :host([hidden]) {
885
- display: none;
886
- }
887
-
888
- .wf-field-container {
889
- display: flex;
890
- flex-direction: column;
891
- gap: var(--wf-spacing-2, 8px);
892
- }
893
-
894
- .wf-label {
895
- font-size: var(--wf-font-size-sm, 0.875rem);
896
- font-weight: 500;
897
- color: var(--wf-color-text, #0a0a0a);
898
- }
899
-
900
- .wf-label-required::after {
901
- content: ' *';
902
- color: var(--wf-color-error, #dc3545);
903
- }
904
-
905
- .wf-input {
906
- width: 100%;
907
- min-height: var(--wf-input-min-height, 56px);
908
- padding: var(--wf-spacing-4, 16px);
909
- font-size: var(--wf-font-size-base, 1rem);
910
- font-weight: 400;
911
- font-family: inherit;
912
- background-color: var(--wf-color-surface, #f3f3f5);
913
- border: 1px solid var(--wf-color-border, #d4d4d4);
914
- border-radius: var(--wf-radius-md, 8px);
915
- color: var(--wf-color-text, #0a0a0a);
916
- transition: border-color 150ms ease, box-shadow 150ms ease;
917
- outline: none;
918
- box-sizing: border-box;
919
- }
920
-
921
- .wf-input::placeholder {
922
- color: var(--wf-color-text-muted, #646464);
923
- font-weight: 500;
924
- }
925
-
926
- .wf-input:focus {
927
- border-color: var(--wf-color-primary, #8040f0);
928
- box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.2);
929
- }
930
-
931
- .wf-input:disabled {
932
- opacity: 0.5;
933
- cursor: not-allowed;
934
- }
935
-
936
- .wf-input.wf-input-error {
937
- border-color: var(--wf-color-error, #dc3545);
938
- }
939
-
940
- .wf-input.wf-input-error:focus {
941
- box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
942
- }
943
-
944
- .wf-error-message {
945
- font-size: var(--wf-font-size-sm, 0.875rem);
946
- color: var(--wf-color-error, #dc3545);
947
- }
948
-
949
- .wf-hint {
950
- font-size: var(--wf-font-size-sm, 0.875rem);
951
- color: var(--wf-color-text-muted, #646464);
952
- }
953
- `,Wt([mt({type:String})],t.WfInput.prototype,"name",2),Wt([mt({type:String})],t.WfInput.prototype,"label",2),Wt([mt({type:String})],t.WfInput.prototype,"placeholder",2),Wt([mt({type:String})],t.WfInput.prototype,"type",2),Wt([mt({type:Boolean})],t.WfInput.prototype,"required",2),Wt([mt({type:Number})],t.WfInput.prototype,"minlength",2),Wt([mt({type:Number})],t.WfInput.prototype,"maxlength",2),Wt([mt({type:String})],t.WfInput.prototype,"pattern",2),Wt([mt({type:String,attribute:"pattern-message"})],t.WfInput.prototype,"patternMessage",2),Wt([mt({type:Boolean})],t.WfInput.prototype,"disabled",2),Wt([mt({type:String})],t.WfInput.prototype,"autocomplete",2),Wt([mt({type:String})],t.WfInput.prototype,"hint",2),Wt([bt()],t.WfInput.prototype,"_errorMessage",2),Wt([bt()],t.WfInput.prototype,"_value",2),t.WfInput=Wt([ut("wf-input")],t.WfInput);var Ht=Object.defineProperty,Xt=Object.getOwnPropertyDescriptor,Yt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Xt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ht(e,s,o),o};t.WfNumber=class extends t.WfInput{constructor(){super(...arguments),this.step=1}je(){this.$e=[],this.required&&this.$e.push(Vt.required()),void 0===this.min&&void 0===this.max||this.$e.push(Vt.custom("range",t=>{if(""===t||null==t)return{valid:!0};const e=Number(t);return isNaN(e)?{valid:!1,error:"Please enter a valid number"}:void 0!==this.min&&e<this.min?{valid:!1,error:"Value must be at least "+this.min}:void 0!==this.max&&e>this.max?{valid:!1,error:"Value must be at most "+this.max}:{valid:!0}},"Value out of range"))}render(){return Y`
172
+ `}},Gt([mt({type:String})],t.WfInput.prototype,"placeholder",2),Gt([mt({type:String})],t.WfInput.prototype,"type",2),Gt([mt({type:Number})],t.WfInput.prototype,"minlength",2),Gt([mt({type:Number})],t.WfInput.prototype,"maxlength",2),Gt([mt({type:String})],t.WfInput.prototype,"pattern",2),Gt([mt({type:String,attribute:"pattern-message"})],t.WfInput.prototype,"patternMessage",2),Gt([mt({type:Boolean})],t.WfInput.prototype,"disabled",2),Gt([mt({type:String})],t.WfInput.prototype,"autocomplete",2),t.WfInput=Gt([pt("wf-input")],t.WfInput);var Zt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,te=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Qt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Zt(e,r,o),o};t.WfNumber=class extends t.WfInput{constructor(){super(...arguments),this.step=1}_setupValidators(){this._validators=[],this.required&&this._validators.push(Rt.required()),void 0===this.min&&void 0===this.max||this._validators.push(Rt.custom("range",t=>{if(""===t||null==t)return{valid:!0};const e=Number(t);return isNaN(e)?{valid:!1,error:"Please enter a valid number"}:void 0!==this.min&&e<this.min?{valid:!1,error:"Value must be at least "+this.min}:void 0!==this.max&&e>this.max?{valid:!1,error:"Value must be at most "+this.max}:{valid:!0}},"Value out of range"))}render(){return Y`
954
173
  <div class="wf-field-container">
955
174
  ${this.label?Y`<label
956
175
  class="wf-label ${this.required?"wf-label-required":""}"
@@ -961,11 +180,11 @@
961
180
  </label>`:""}
962
181
  <input
963
182
  type="number"
964
- class="wf-input ${this.ie?"wf-input-error":""}"
183
+ class="wf-input ${this._errorMessage?"wf-input-error":""}"
965
184
  id="${this.name}"
966
185
  name="${this.name}"
967
186
  placeholder="${this.placeholder}"
968
- .value="${this.Se}"
187
+ .value="${this._value}"
969
188
  ?disabled="${this.disabled}"
970
189
  ?required="${this.required}"
971
190
  min="${this.min??""}"
@@ -973,27 +192,16 @@
973
192
  step="${this.step}"
974
193
  autocomplete="${this.autocomplete||"off"}"
975
194
  data-testid="wf-input"
976
- @input="${this.Ee}"
977
- @blur="${this.ze}"
978
- @focus="${this.Ce}"
195
+ @input="${this._handleInput}"
196
+ @blur="${this._handleBlur}"
197
+ @focus="${this._handleFocus}"
979
198
  />
980
- ${this.hint&&!this.ie?Y`<span class="wf-hint">${this.hint}</span>`:""}
199
+ ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
981
200
  <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
982
- ${this.ie}
201
+ ${this._errorMessage}
983
202
  </span>
984
203
  </div>
985
- `}get valueAsNumber(){return Number(this.Se)||0}set valueAsNumber(t){this.Se=t+""}},t.WfNumber.styles=[t.WfInput.styles,d`
986
- /* Hide number input spinners */
987
- .wf-input::-webkit-outer-spin-button,
988
- .wf-input::-webkit-inner-spin-button {
989
- -webkit-appearance: none;
990
- margin: 0;
991
- }
992
-
993
- .wf-input[type='number'] {
994
- -moz-appearance: textfield;
995
- }
996
- `],Yt([mt({type:Number})],t.WfNumber.prototype,"min",2),Yt([mt({type:Number})],t.WfNumber.prototype,"max",2),Yt([mt({type:Number})],t.WfNumber.prototype,"step",2),t.WfNumber=Yt([ut("wf-number")],t.WfNumber);var Jt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,Zt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Kt(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Jt(e,s,o),o};function Gt(t){const e="string"==typeof t.container?document.querySelector(t.container):t.container;if(!e)throw Error("[WizardForm] Container not found: "+t.container);let r=e.querySelector("wizard-form");if(!r&&(r=e,"wizard-form"!==r.tagName.toLowerCase()))throw Error("[WizardForm] Container must be a <wizard-form> element or contain one");t.theme&&r.setAttribute("theme",t.theme),void 0!==t.showProgress&&(r.showProgress=t.showProgress),void 0!==t.autoAdvance&&(r.autoAdvance=t.autoAdvance),t.mock&&(r.mock=t.mock);let a=null;if("object"==typeof t.adapter)a=t.adapter;else switch(t.adapter||"json"){case"hubspot":if(!t.hubspot?.portalId||!t.hubspot?.formId)throw Error("[WizardForm] HubSpot config requires portalId and formId");a=s({portalId:t.hubspot.portalId,formId:t.hubspot.formId,fieldMapping:t.hubspot.fieldMapping,mock:t.mock}),r.setAttribute("hubspot-portal",t.hubspot.portalId),r.setAttribute("hubspot-form",t.hubspot.formId);break;case"webhook":if(!t.webhook?.url)throw Error("[WizardForm] Webhook config requires url");a=i({url:t.webhook.url,method:t.webhook.method,headers:t.webhook.headers,fieldMapping:t.webhook.fieldMapping,mock:t.mock});break;case"revenuehero":if(!t.revenuehero?.routerId)throw Error("[WizardForm] RevenueHero config requires routerId");a=o({routerId:t.revenuehero.routerId,fieldMapping:t.revenuehero.fieldMapping,mock:t.mock});break;case"json":a=null}const n=e=>{const s=e.detail.formData;let i={...s};if(t.serialize&&(i=t.serialize(i)),t.mock&&(window.__wizardFormData=i,window.__wizardFormRawData=s,window.__wizardFormInstance=f),t.onSubmit&&!1===t.onSubmit(i))e.preventDefault();else if(a){e.preventDefault();const o={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,timestamp:(new Date).toISOString()};a.submit(i,o).then(e=>{t.mock&&(window.__wizardFormResponse=e),e.success?(r.kt=!0,r.requestUpdate(),r.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:s,response:e.data},bubbles:!0,composed:!0}))):(t.mock&&(window.__wizardFormError=e.error),t.onError&&t.onError(e.error||"Submission failed",s))})}},h=e=>{t.mock&&(window.__wizardFormResponse={success:!0,data:e.detail.response}),t.onSuccess&&t.onSuccess(e.detail.formData,e.detail.response)},l=e=>{t.mock&&(window.__wizardFormError=e.detail.error),t.onError&&t.onError(e.detail.error,e.detail.formData)},c=e=>{t.onStepChange&&t.onStepChange(e.detail.from,e.detail.to,e.detail.direction)},d=e=>{t.onFieldChange&&t.onFieldChange(e.detail.name,e.detail.value,e.detail.formData)};r.addEventListener("wf:submit",n),r.addEventListener("wf:success",h),r.addEventListener("wf:error",l),r.addEventListener("wf:step-change",c),r.addEventListener("wf:field-change",d);const f={element:r,get formData(){return r.formData},get currentStep(){return r.currentStep},get totalSteps(){return r.totalSteps},next:()=>r.next(),back(){r.back()},goToStep(t){r.goToStep(t)},submit:()=>r.submit(),reset(){r.reset()},setFormData(t){r.setFormData(t)},destroy(){r.removeEventListener("wf:submit",n),r.removeEventListener("wf:success",h),r.removeEventListener("wf:error",l),r.removeEventListener("wf:step-change",c),r.removeEventListener("wf:field-change",d)},serialize:t.serialize};return f}t.WfTextarea=class extends dt{constructor(){super(...arguments),this.name="",this.label="",this.placeholder="",this.rows=4,this.required=!1,this.disabled=!1,this.showCount=!1,this.hint="",this.ie="",this.Se="",this.re=!1,this.ke=null,this.$e=[],this.Ee=t=>{const e=t.target;this.Se=e.value,this.re&&(this.ke&&clearTimeout(this.ke),this.ke=setTimeout(()=>{this.validate()},600)),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.ze=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this.Se},bubbles:!0,composed:!0}))},this.Ce=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))},this.At=t=>{"Enter"===t.key&&t.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.je()}updated(t){(t.has("required")||t.has("minlength")||t.has("maxlength"))&&this.je()}je(){this.$e=[],this.required&&this.$e.push(Vt.required()),void 0!==this.minlength&&this.$e.push(Vt.minLength(this.minlength)),void 0!==this.maxlength&&this.$e.push(Vt.maxLength(this.maxlength))}render(){const t=this.Se.length,e=void 0!==this.maxlength&&t>=this.maxlength;return Y`
204
+ `}get valueAsNumber(){return Number(this._value)||0}set valueAsNumber(t){this._value=t+""}},te([mt({type:Number})],t.WfNumber.prototype,"min",2),te([mt({type:Number})],t.WfNumber.prototype,"max",2),te([mt({type:Number})],t.WfNumber.prototype,"step",2),t.WfNumber=te([pt("wf-number")],t.WfNumber);var ee=Object.defineProperty,re=Object.getOwnPropertyDescriptor,se=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?re(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&ee(e,r,o),o};function ie(t){const e="string"==typeof t.container?document.querySelector(t.container):t.container;if(!e)throw Error("[WizardForm] Container not found: "+t.container);let i=e.querySelector("wizard-form");if(!i&&(i=e,"wizard-form"!==i.tagName.toLowerCase()))throw Error("[WizardForm] Container must be a <wizard-form> element or contain one");t.theme&&i.setAttribute("theme",t.theme),void 0!==t.showProgress&&(i.showProgress=t.showProgress),void 0!==t.autoAdvance&&(i.autoAdvance=t.autoAdvance),t.mock&&(i.mock=t.mock);let a=null;if("object"==typeof t.adapter)a=t.adapter;else switch(t.adapter||"json"){case"hubspot":if(!t.hubspot?.portalId||!t.hubspot?.formId)throw Error("[WizardForm] HubSpot config requires portalId and formId");a=r({portalId:t.hubspot.portalId,formId:t.hubspot.formId,fieldMapping:t.hubspot.fieldMapping,mock:t.mock}),i.setAttribute("hubspot-portal",t.hubspot.portalId),i.setAttribute("hubspot-form",t.hubspot.formId);break;case"webhook":if(!t.webhook?.url)throw Error("[WizardForm] Webhook config requires url");a=s({url:t.webhook.url,method:t.webhook.method,headers:t.webhook.headers,fieldMapping:t.webhook.fieldMapping,mock:t.mock});break;case"revenuehero":if(!t.revenuehero?.routerId)throw Error("[WizardForm] RevenueHero config requires routerId");a=o({routerId:t.revenuehero.routerId,fieldMapping:t.revenuehero.fieldMapping,mock:t.mock});break;case"json":a=null}const n=e=>{const r=e.detail.formData;let s={...r};if(t.serialize&&(s=t.serialize(s)),t.mock&&(window.__wizardFormData=s,window.__wizardFormRawData=r,window.__wizardFormInstance=p),t.onSubmit&&!1===t.onSubmit(s))e.preventDefault();else if(a){e.preventDefault();const o={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,timestamp:(new Date).toISOString()};a.submit(s,o).then(e=>{t.mock&&(window.__wizardFormResponse=e),e.success?(i._submitted=!0,i.requestUpdate(),i.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:r,response:e.data},bubbles:!0,composed:!0}))):(t.mock&&(window.__wizardFormError=e.error),t.onError&&t.onError(e.error||"Submission failed",r))})}},l=e=>{t.mock&&(window.__wizardFormResponse={success:!0,data:e.detail.response}),t.onSuccess&&t.onSuccess(e.detail.formData,e.detail.response)},d=e=>{t.mock&&(window.__wizardFormError=e.detail.error),t.onError&&t.onError(e.detail.error,e.detail.formData)},h=e=>{t.onStepChange&&t.onStepChange(e.detail.from,e.detail.to,e.detail.direction)},c=e=>{t.onFieldChange&&t.onFieldChange(e.detail.name,e.detail.value,e.detail.formData)};i.addEventListener("wf:submit",n),i.addEventListener("wf:success",l),i.addEventListener("wf:error",d),i.addEventListener("wf:step-change",h),i.addEventListener("wf:field-change",c);const p={element:i,get formData(){return i.formData},get currentStep(){return i.currentStep},get totalSteps(){return i.totalSteps},next:()=>i.next(),back(){i.back()},goToStep(t){i.goToStep(t)},submit:()=>i.submit(),reset(){i.reset()},setFormData(t){i.setFormData(t)},destroy(){i.removeEventListener("wf:submit",n),i.removeEventListener("wf:success",l),i.removeEventListener("wf:error",d),i.removeEventListener("wf:step-change",h),i.removeEventListener("wf:field-change",c)},serialize:t.serialize};return p}t.WfTextarea=class extends qt{constructor(){super(...arguments),this.placeholder="",this.rows=4,this.disabled=!1,this.showCount=!1,this._handleKeydown=t=>{"Enter"===t.key&&t.stopPropagation()}}_getValidationTriggerProperties(){return["required","minlength","maxlength"]}_getFocusableSelector(){return"textarea"}_setupValidators(){this._validators=[],this.required&&this._validators.push(Rt.required()),void 0!==this.minlength&&this._validators.push(Rt.minLength(this.minlength)),void 0!==this.maxlength&&this._validators.push(Rt.maxLength(this.maxlength))}render(){const t=this._value.length,e=void 0!==this.maxlength&&t>=this.maxlength;return Y`
997
205
  <div class="wf-field-container">
998
206
  ${this.label?Y`<label
999
207
  class="wf-label ${this.required?"wf-label-required":""}"
@@ -1003,183 +211,38 @@
1003
211
  ${this.label}
1004
212
  </label>`:""}
1005
213
  <textarea
1006
- class="wf-textarea ${this.ie?"wf-textarea-error":""}"
214
+ class="wf-textarea ${this._errorMessage?"wf-textarea-error":""}"
1007
215
  id="${this.name}"
1008
216
  name="${this.name}"
1009
217
  placeholder="${this.placeholder}"
1010
218
  rows="${this.rows}"
1011
- .value="${this.Se}"
219
+ .value="${this._value}"
1012
220
  ?disabled="${this.disabled}"
1013
221
  ?required="${this.required}"
1014
222
  maxlength="${this.maxlength??""}"
1015
223
  data-testid="wf-textarea"
1016
- @input="${this.Ee}"
1017
- @blur="${this.ze}"
1018
- @focus="${this.Ce}"
1019
- @keydown="${this.At}"
224
+ @input="${this._handleInput}"
225
+ @blur="${this._handleBlur}"
226
+ @focus="${this._handleFocus}"
227
+ @keydown="${this._handleKeydown}"
1020
228
  ></textarea>
1021
229
  ${this.showCount&&this.maxlength?Y`<span class="wf-char-count ${e?"wf-char-limit":""}" data-testid="wf-counter">
1022
230
  ${t}/${this.maxlength}
1023
231
  </span>`:""}
1024
- ${this.hint&&!this.ie?Y`<span class="wf-hint">${this.hint}</span>`:""}
232
+ ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
1025
233
  <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
1026
- ${this.ie}
234
+ ${this._errorMessage}
1027
235
  </span>
1028
236
  </div>
1029
- `}get value(){return this.Se}set value(t){this.Se=t}addValidator(t){this.$e.push(t)}async validate(){this.re=!0;for(const e of this.$e)try{const t=await e.validate(this.Se);if(!t.valid)return this.ie=t.error??e.message??"Validation failed",!1}catch(t){return this.ie="Validation error occurred",!1}return this.ie="",!0}get isValid(){for(const t of this.$e){const e=t.validate(this.Se);if(!(e instanceof Promise||e.valid))return!1}return!0}showError(t){this.ie=t}clearError(){this.ie=""}focus(){const t=this.shadowRoot?.querySelector("textarea");t?.focus()}reset(){this.Se="",this.ie="",this.re=!1,this.ke&&(clearTimeout(this.ke),this.ke=null)}},t.WfTextarea.styles=d`
1030
- :host {
1031
- display: block;
1032
- }
1033
-
1034
- :host([hidden]) {
1035
- display: none;
1036
- }
1037
-
1038
- .wf-field-container {
1039
- display: flex;
1040
- flex-direction: column;
1041
- gap: var(--wf-spacing-2, 8px);
1042
- }
1043
-
1044
- .wf-label {
1045
- font-size: var(--wf-font-size-sm, 0.875rem);
1046
- font-weight: 500;
1047
- color: var(--wf-color-text, #212529);
1048
- }
1049
-
1050
- .wf-label-required::after {
1051
- content: ' *';
1052
- color: var(--wf-color-error, #dc3545);
1053
- }
1054
-
1055
- .wf-textarea {
1056
- width: 100%;
1057
- padding: var(--wf-spacing-4, 16px);
1058
- font-size: var(--wf-font-size-base, 1rem);
1059
- font-family: inherit;
1060
- background-color: var(--wf-color-surface, #f8f9fa);
1061
- border: 1.5px solid var(--wf-color-border, #e5e7eb);
1062
- border-radius: var(--wf-radius-lg, 12px);
1063
- color: var(--wf-color-text, #212529);
1064
- transition: border-color 150ms ease, box-shadow 150ms ease;
1065
- outline: none;
1066
- box-sizing: border-box;
1067
- resize: vertical;
1068
- min-height: 100px;
1069
- }
1070
-
1071
- .wf-textarea::placeholder {
1072
- color: var(--wf-color-text-muted, #6c757d);
1073
- }
1074
-
1075
- .wf-textarea:focus {
1076
- border-color: var(--wf-color-primary, #8b5cf6);
1077
- box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
1078
- }
1079
-
1080
- .wf-textarea:disabled {
1081
- opacity: 0.5;
1082
- cursor: not-allowed;
1083
- }
1084
-
1085
- .wf-textarea.wf-textarea-error {
1086
- border-color: var(--wf-color-error, #dc3545);
1087
- }
1088
-
1089
- .wf-textarea.wf-textarea-error:focus {
1090
- box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
1091
- }
1092
-
1093
- .wf-error-message {
1094
- font-size: var(--wf-font-size-sm, 0.875rem);
1095
- color: var(--wf-color-error, #dc3545);
1096
- min-height: 20px;
1097
- }
1098
-
1099
- .wf-hint {
1100
- font-size: var(--wf-font-size-sm, 0.875rem);
1101
- color: var(--wf-color-text-muted, #6c757d);
1102
- }
1103
-
1104
- .wf-char-count {
1105
- font-size: var(--wf-font-size-sm, 0.875rem);
1106
- color: var(--wf-color-text-muted, #6c757d);
1107
- text-align: right;
1108
- }
1109
-
1110
- .wf-char-count.wf-char-limit {
1111
- color: var(--wf-color-error, #dc3545);
1112
- }
1113
- `,Zt([mt({type:String})],t.WfTextarea.prototype,"name",2),Zt([mt({type:String})],t.WfTextarea.prototype,"label",2),Zt([mt({type:String})],t.WfTextarea.prototype,"placeholder",2),Zt([mt({type:Number})],t.WfTextarea.prototype,"rows",2),Zt([mt({type:Boolean})],t.WfTextarea.prototype,"required",2),Zt([mt({type:Number})],t.WfTextarea.prototype,"minlength",2),Zt([mt({type:Number})],t.WfTextarea.prototype,"maxlength",2),Zt([mt({type:Boolean})],t.WfTextarea.prototype,"disabled",2),Zt([mt({type:Boolean,attribute:"show-count"})],t.WfTextarea.prototype,"showCount",2),Zt([mt({type:String})],t.WfTextarea.prototype,"hint",2),Zt([bt()],t.WfTextarea.prototype,"_errorMessage",2),Zt([bt()],t.WfTextarea.prototype,"_value",2),t.WfTextarea=Zt([ut("wf-textarea")],t.WfTextarea);const Qt={init:Gt};var te=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,se=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ee(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&te(e,s,o),o};const ie={none:0,xs:4,sm:8,md:16,lg:24,xl:32};t.WfLayout=class extends dt{constructor(){super(...arguments),this.mode="flex",this.direction="column",this.gap="none",this.gapX="",this.gapY="",this.align="stretch",this.justify="start",this.padding="none",this.paddingX="",this.paddingY="",this.wrap=!1,this.width="full",this.columns="auto",this.minItemWidth="200px"}Ae(t){if(!t||"none"===t)return"0";if(t in ie)return ie[t]+"px";const e=parseFloat(t);return isNaN(e)?t:e+"px"}Ne(){return this.Ae(this.gapX||this.gap)}Me(){return this.Ae(this.gapY||this.gap)}Pe(){const t=this.Ae(this.padding),e=this.paddingX?this.Ae(this.paddingX):t;return`${this.paddingY?this.Ae(this.paddingY):t} ${e}`}Ve(){const t=[];if("grid"===this.mode){t.push("display: grid");const e=parseInt(this.columns,10);!isNaN(e)&&e>0?t.push(`grid-template-columns: repeat(${e}, 1fr)`):t.push(`grid-template-columns: repeat(auto-fit, minmax(${this.minItemWidth}, 1fr))`),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify)}else t.push("display: flex"),t.push("flex-direction: "+this.direction),this.wrap&&t.push("flex-wrap: wrap"),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify);const e=this.Ne(),s=this.Me();"0"===e&&"0"===s||(t.push("column-gap: "+e),t.push("row-gap: "+s));const i=this.Pe();return"0 0"!==i&&t.push("padding: "+i),t.join("; ")}render(){return Y`
1114
- <div
1115
- class="wf-layout wf-layout--width-${this.width}"
1116
- style="${this.Ve()}"
1117
- >
1118
- <slot></slot>
1119
- </div>
1120
- `}},t.WfLayout.styles=d`
1121
- :host {
1122
- display: block;
1123
- }
1124
-
1125
- :host([hidden]) {
1126
- display: none;
1127
- }
1128
-
1129
- .wf-layout {
1130
- box-sizing: border-box;
1131
- }
1132
-
1133
- /* Width behaviors */
1134
- .wf-layout--width-full {
1135
- width: 100%;
1136
- }
1137
-
1138
- .wf-layout--width-auto {
1139
- width: auto;
1140
- }
1141
-
1142
- .wf-layout--width-fit {
1143
- width: fit-content;
1144
- }
1145
- `,se([mt({type:String})],t.WfLayout.prototype,"mode",2),se([mt({type:String})],t.WfLayout.prototype,"direction",2),se([mt({type:String})],t.WfLayout.prototype,"gap",2),se([mt({type:String,attribute:"gap-x"})],t.WfLayout.prototype,"gapX",2),se([mt({type:String,attribute:"gap-y"})],t.WfLayout.prototype,"gapY",2),se([mt({type:String})],t.WfLayout.prototype,"align",2),se([mt({type:String})],t.WfLayout.prototype,"justify",2),se([mt({type:String})],t.WfLayout.prototype,"padding",2),se([mt({type:String,attribute:"padding-x"})],t.WfLayout.prototype,"paddingX",2),se([mt({type:String,attribute:"padding-y"})],t.WfLayout.prototype,"paddingY",2),se([mt({type:Boolean})],t.WfLayout.prototype,"wrap",2),se([mt({type:String})],t.WfLayout.prototype,"width",2),se([mt({type:String})],t.WfLayout.prototype,"columns",2),se([mt({type:String,attribute:"min-item-width"})],t.WfLayout.prototype,"minItemWidth",2),t.WfLayout=se([ut("wf-layout")],t.WfLayout);var re=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,ae=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?oe(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&re(e,s,o),o};t.WfProgress=class extends dt{constructor(){super(...arguments),this.for="",this.xt=1,this.$t=1,this.qe=!1,this.Ie=null,this.Be=this.De.bind(this),this.Fe=this.Ue.bind(this)}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this.Re()})}disconnectedCallback(){super.disconnectedCallback(),this.Le()}Re(){this.for?this.Ie=document.getElementById(this.for):this.Ie=this.closest("wizard-form"),this.Ie&&(this.xt=this.Ie.currentStep||1,this.$t=this.Ie.totalSteps||1,this.qe=this.Ie.isSubmitted||!1,this.Ie.addEventListener("wf:step-change",this.Be),this.Ie.addEventListener("wf:success",this.Fe),this.Ie.addEventListener("wf:steps-discovered",this.We.bind(this)))}Le(){this.Ie&&(this.Ie.removeEventListener("wf:step-change",this.Be),this.Ie.removeEventListener("wf:success",this.Fe),this.Ie=null)}De(t){this.xt=t.detail.to,this.Ie&&(this.$t=this.Ie.totalSteps)}We(){this.Ie&&(this.$t=this.Ie.totalSteps,this.xt=this.Ie.currentStep)}Ue(){this.qe=!0}render(){if(this.qe)return null;const t=[];for(let e=1;e<=this.$t;e++){const s=e<this.xt,i=e===this.xt;t.push(Y`
237
+ `}},se([mt({type:String})],t.WfTextarea.prototype,"placeholder",2),se([mt({type:Number})],t.WfTextarea.prototype,"rows",2),se([mt({type:Number})],t.WfTextarea.prototype,"minlength",2),se([mt({type:Number})],t.WfTextarea.prototype,"maxlength",2),se([mt({type:Boolean})],t.WfTextarea.prototype,"disabled",2),se([mt({type:Boolean,attribute:"show-count"})],t.WfTextarea.prototype,"showCount",2),t.WfTextarea=se([pt("wf-textarea")],t.WfTextarea);const oe={init:ie};var ae=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,le=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?ne(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&ae(e,r,o),o};t.WfProgress=class extends ht{constructor(){super(...arguments),this.for="",this._currentStep=1,this._totalSteps=1,this._isComplete=!1,this._wizard=null,this._boundHandleStepChange=this._handleStepChange.bind(this),this._boundHandleSuccess=this._handleSuccess.bind(this),this._boundHandleStepsDiscovered=this._handleStepsDiscovered.bind(this)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),document.addEventListener("wf:steps-discovered",this._boundHandleStepsDiscovered),requestAnimationFrame(()=>{this._connectToWizard()})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("wf:steps-discovered",this._boundHandleStepsDiscovered),this._disconnectFromWizard()}_connectToWizard(){this.for?this._wizard=document.getElementById(this.for):this._wizard=this.closest("wizard-form"),this._wizard&&(this._currentStep=this._wizard.currentStep||1,this._totalSteps=this._wizard.totalSteps||1,this._isComplete=this._wizard.isSubmitted||!1,this._wizard.addEventListener("wf:step-change",this._boundHandleStepChange),this._wizard.addEventListener("wf:success",this._boundHandleSuccess))}_disconnectFromWizard(){this._wizard&&(this._wizard.removeEventListener("wf:step-change",this._boundHandleStepChange),this._wizard.removeEventListener("wf:success",this._boundHandleSuccess),this._wizard=null)}_handleStepChange(t){this._currentStep=t.detail.to,this._wizard&&(this._totalSteps=this._wizard.totalSteps)}_handleStepsDiscovered(t){const{wizard:e,wizardId:r,totalSteps:s,currentStep:i}=t.detail;if(this.for){if(r!==this.for)return}else{const t=this.closest("wizard-form");if(!t||t!==e)return}!this._wizard&&e&&(this._wizard=e,e.addEventListener("wf:step-change",this._boundHandleStepChange),e.addEventListener("wf:success",this._boundHandleSuccess)),this._totalSteps=s,this._currentStep=i}_handleSuccess(){this._isComplete=!0}render(){if(this._isComplete)return null;const t=[];for(let e=1;e<=this._totalSteps;e++){const r=e<this._currentStep,s=e===this._currentStep;t.push(Y`
1146
238
  <div
1147
- class="wf-progress-segment ${s?"completed":""} ${i?"active":""}"
239
+ class="wf-progress-segment ${r?"completed":""} ${s?"active":""}"
1148
240
  role="progressbar"
1149
- aria-valuenow="${this.xt}"
241
+ aria-valuenow="${this._currentStep}"
1150
242
  aria-valuemin="1"
1151
- aria-valuemax="${this.$t}"
243
+ aria-valuemax="${this._totalSteps}"
1152
244
  ></div>
1153
- `)}return Y`<div class="wf-progress" role="group" aria-label="Form progress">${t}</div>`}},t.WfProgress.styles=d`
1154
- :host {
1155
- display: block;
1156
- }
1157
-
1158
- :host([hidden]) {
1159
- display: none;
1160
- }
1161
-
1162
- .wf-progress {
1163
- display: flex;
1164
- gap: var(--wf-spacing-4, 16px);
1165
- }
1166
-
1167
- .wf-progress-segment {
1168
- width: 32px;
1169
- height: 8px;
1170
- background-color: var(--wf-color-progress-inactive, rgba(217, 217, 217, 0.6));
1171
- border-radius: var(--wf-radius-full, 99px);
1172
- transition: background-color 300ms ease;
1173
- }
1174
-
1175
- .wf-progress-segment.completed {
1176
- background-color: var(--wf-color-progress-active, rgba(139, 139, 139, 0.6));
1177
- }
1178
-
1179
- .wf-progress-segment.active {
1180
- background-color: var(--wf-color-progress-active, rgba(139, 139, 139, 0.6));
1181
- }
1182
- `,ae([mt({type:String})],t.WfProgress.prototype,"for",2),ae([bt()],t.WfProgress.prototype,"_currentStep",2),ae([bt()],t.WfProgress.prototype,"_totalSteps",2),ae([bt()],t.WfProgress.prototype,"_isComplete",2),t.WfProgress=ae([ut("wf-progress")],t.WfProgress);var ne=Object.defineProperty,he=Object.getOwnPropertyDescriptor,le=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?he(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ne(e,s,o),o};t.WfThankYou=class extends dt{constructor(){super(...arguments),this.title="Thank you!",this.subtitle="We've received your request.",this.hideIcon=!1}render(){return Y`
245
+ `)}return Y`<div class="wf-progress" role="group" aria-label="Form progress">${t}</div>`}},le([mt({type:String})],t.WfProgress.prototype,"for",2),le([wt()],t.WfProgress.prototype,"_currentStep",2),le([wt()],t.WfProgress.prototype,"_totalSteps",2),le([wt()],t.WfProgress.prototype,"_isComplete",2),t.WfProgress=le([pt("wf-progress")],t.WfProgress);var de=Object.defineProperty,he=Object.getOwnPropertyDescriptor,ce=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?he(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&de(e,r,o),o};t.WfThankYou=class extends ht{constructor(){super(...arguments),this.title="Thank you!",this.subtitle="We've received your request.",this.hideIcon=!1}createRenderRoot(){return this}render(){return Y`
1183
246
  ${this.hideIcon?"":Y`
1184
247
  <div class="wf-thank-you-icon">
1185
248
  <slot name="icon">
@@ -1203,51 +266,5 @@
1203
266
  <p class="wf-thank-you-subtitle">${this.subtitle}</p>
1204
267
  <slot></slot>
1205
268
  <slot name="footer"></slot>
1206
- `}},t.WfThankYou.styles=d`
1207
- :host {
1208
- display: block;
1209
- text-align: center;
1210
- padding: var(--wf-spacing-8, 48px) var(--wf-spacing-4, 24px);
1211
- }
1212
-
1213
- :host([hidden]) {
1214
- display: none;
1215
- }
1216
-
1217
- .wf-thank-you-icon {
1218
- width: 72px;
1219
- height: 72px;
1220
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
1221
- border-radius: 50%;
1222
- display: flex;
1223
- align-items: center;
1224
- justify-content: center;
1225
- margin: 0 auto var(--wf-spacing-4, 24px);
1226
- box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
1227
- }
1228
-
1229
- .wf-thank-you-icon svg {
1230
- width: 36px;
1231
- height: 36px;
1232
- color: white;
1233
- }
1234
-
1235
- .wf-thank-you-title {
1236
- font-size: 28px;
1237
- font-weight: 700;
1238
- color: var(--wf-color-text, #1e293b);
1239
- margin: 0 0 12px 0;
1240
- }
1241
-
1242
- .wf-thank-you-subtitle {
1243
- font-size: 16px;
1244
- color: var(--wf-color-text-muted, #64748b);
1245
- margin: 0 0 24px 0;
1246
- line-height: 1.6;
1247
- }
1248
-
1249
- ::slotted([slot="footer"]) {
1250
- margin-top: var(--wf-spacing-4, 24px);
1251
- }
1252
- `,le([mt({type:String})],t.WfThankYou.prototype,"title",2),le([mt({type:String})],t.WfThankYou.prototype,"subtitle",2),le([mt({type:Boolean,attribute:"hide-icon"})],t.WfThankYou.prototype,"hideIcon",2),t.WfThankYou=le([ut("wf-thank-you")],t.WfThankYou),t.DEFAULT_BLOCKED_DOMAINS=Pt,t.FormStateController=gt,t.KeyboardController=vt,t.ValidationController=Vt,t.createHubSpotAdapter=s,t.createRevenueHeroAdapter=o,t.createWebhookAdapter=i,t.default=Qt,t.getHubSpotCookie=e,t.init=Gt,t.isRevenueHeroLoaded=r,Object.defineProperties(t,{He:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
269
+ `}},ce([mt({type:String})],t.WfThankYou.prototype,"title",2),ce([mt({type:String})],t.WfThankYou.prototype,"subtitle",2),ce([mt({type:Boolean,attribute:"hide-icon"})],t.WfThankYou.prototype,"hideIcon",2),t.WfThankYou=ce([pt("wf-thank-you")],t.WfThankYou),function(){if("undefined"==typeof document)return;const t="wf-global-styles";if(document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.textContent='wizard-form{--wf-color-primary:#8040f0;--wf-color-primary-border:#602cbb;--wf-color-primary-light:#8040f014;--wf-color-surface:#f3f3f5;--wf-color-surface-hover:#e9e9eb;--wf-color-border:#d4d4d4;--wf-color-text:#0a0a0a;--wf-color-text-secondary:#404040;--wf-color-text-muted:#646464;--wf-color-error:#dc3545;--wf-color-badge-bg:#fcfcfc;--wf-color-badge-border:#d4d4d4;--wf-color-badge-text:#5f5f5f;--wf-color-progress-active:#8b8b8b99;--wf-color-progress-inactive:#d9d9d999;--wf-spacing-1:4px;--wf-spacing-2:8px;--wf-spacing-3:12px;--wf-spacing-4:16px;--wf-spacing-5:20px;--wf-spacing-6:24px;--wf-spacing-8:32px;--wf-radius-sm:4px;--wf-radius-md:8px;--wf-radius-lg:8px;--wf-radius-full:99px;--wf-font-size-xs:.75rem;--wf-font-size-sm:.875rem;--wf-font-size-base:1rem;--wf-font-size-lg:1.25rem;--wf-font-size-xl:1.5rem;--wf-font-size-2xl:2rem;--wf-font-size-3xl:2.5rem;--wf-input-min-height:56px;--wf-glass-bg:#ffffffb3;--wf-glass-bg-hover:#ffffffd9;--wf-glass-border:#0000001a;--wf-glass-blur:20px;--wf-glass-shadow:0 4px 6px #0000000d;display:block}wizard-form[theme=dark]{--wf-color-surface:#2d2d2d;--wf-color-surface-hover:#3d3d3d;--wf-color-border:#4d4d4d;--wf-color-text:#f8f9fa;--wf-color-text-secondary:#d0d0d0;--wf-color-text-muted:#adb5bd;--wf-color-badge-bg:#3d3d3d;--wf-color-badge-border:#4d4d4d;--wf-color-badge-text:#adb5bd;--wf-color-progress-active:#c8c8c899;--wf-color-progress-inactive:#64646499;--wf-glass-bg:#2d2d2db3;--wf-glass-bg-hover:#3c3c3ccc;--wf-glass-border:#ffffff1a}@media (prefers-color-scheme:dark){wizard-form[theme=auto]{--wf-color-surface:#2d2d2d;--wf-color-surface-hover:#3d3d3d;--wf-color-border:#4d4d4d;--wf-color-text:#f8f9fa;--wf-color-text-secondary:#d0d0d0;--wf-color-text-muted:#adb5bd;--wf-color-badge-bg:#3d3d3d;--wf-color-badge-border:#4d4d4d;--wf-color-badge-text:#adb5bd;--wf-color-progress-active:#c8c8c899;--wf-color-progress-inactive:#64646499;--wf-glass-bg:#2d2d2db3;--wf-glass-bg-hover:#3c3c3ccc;--wf-glass-border:#ffffff1a}}wizard-form .wf-container{margin:0 auto}wizard-form .wf-progress{gap:var(--wf-spacing-4,16px);margin-top:var(--wf-spacing-6,24px);display:flex}wizard-form .wf-progress-segment{background-color:var(--wf-color-progress-inactive,#d9d9d999);border-radius:var(--wf-radius-full,99px);width:32px;height:8px;transition:background-color .3s}wizard-form .wf-progress-segment.completed,wizard-form .wf-progress-segment.active{background-color:var(--wf-color-progress-active,#8b8b8b99)}wizard-form .wf-steps-container{min-height:200px}wizard-form .wf-navigation{justify-content:space-between;gap:var(--wf-spacing-4,16px);margin-top:var(--wf-spacing-6,24px);display:flex}wizard-form .wf-btn{justify-content:center;align-items:center;gap:var(--wf-spacing-2,8px);padding:var(--wf-spacing-3,12px)var(--wf-spacing-4,16px);min-height:48px;font-size:var(--wf-font-size-base,1rem);border-radius:var(--wf-radius-md,8px);cursor:pointer;border:1px solid #0000;outline:none;font-family:inherit;font-weight:600;transition:all .15s;display:inline-flex}wizard-form .wf-btn:focus-visible{box-shadow:0 0 0 3px #8040f04d}wizard-form .wf-btn-back{background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);color:var(--wf-color-text,#0a0a0a)}wizard-form .wf-btn-back:hover:not(:disabled){background:var(--wf-glass-bg-hover,#ffffffd9)}wizard-form .wf-btn-next{background-color:var(--wf-color-primary,#8040f0);border:1px solid var(--wf-color-primary-border,#602cbb);color:#fff;flex:1;margin-left:auto;position:relative}wizard-form .wf-btn-next:hover:not(:disabled){filter:brightness(1.1)}wizard-form .wf-btn:disabled{opacity:.5;cursor:not-allowed}wizard-form .wf-btn-shortcut{right:var(--wf-spacing-4,16px);align-items:center;gap:2px;display:inline-flex;position:absolute}wizard-form .wf-btn-back .wf-btn-shortcut{position:static}wizard-form .wf-success-screen{text-align:center;padding:var(--wf-spacing-6,24px)}wizard-form .wf-loading{border:2px solid #0000001a;border-top-color:#fff;border-radius:50%;width:20px;height:20px;animation:.8s linear infinite wf-spin;display:inline-block}@keyframes wf-spin{to{transform:rotate(360deg)}}wizard-form .wf-form-error{padding:var(--wf-spacing-4,16px);margin-bottom:var(--wf-spacing-4,16px);border:1px solid var(--wf-color-error,#dc3545);border-radius:var(--wf-radius-md,8px);color:var(--wf-color-error,#dc3545);font-size:var(--wf-font-size-base,1rem);background-color:#dc35451a}wf-success{display:block}wf-success h1,wf-success h2,wf-success h3{margin:0 0 var(--wf-spacing-4,16px)0;color:var(--wf-color-text,#212529);font-weight:600}wf-success p{color:var(--wf-color-text-muted,#6c757d);margin:0}wf-step{width:100%;display:none}wf-step[active]{animation:.3s forwards wf-stepFadeIn;display:block}wf-step[direction=forward][active]{animation:.3s forwards wf-stepSlideInRight}wf-step[direction=backward][active]{animation:.3s forwards wf-stepSlideInLeft}wf-step[leaving]{animation:.2s forwards wf-stepFadeOut;display:block}@keyframes wf-stepFadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes wf-stepFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}@keyframes wf-stepSlideInRight{0%{opacity:0;transform:translate(30px)}to{opacity:1;transform:translate(0)}}@keyframes wf-stepSlideInLeft{0%{opacity:0;transform:translate(-30px)}to{opacity:1;transform:translate(0)}}wf-step .wf-step-content{gap:var(--wf-spacing-4,16px);flex-direction:column;display:flex}wf-step h1,wf-step h2,wf-step h3{color:var(--wf-color-text,#212529);margin:0;font-weight:600}wf-step h2{font-size:var(--wf-font-size-3xl,2rem)}wf-step p{color:var(--wf-color-text-muted,#6c757d);font-size:var(--wf-font-size-xl,1.375rem);margin:0}wf-options{display:block}wf-options[hidden]{display:none}wf-options .wf-options-container{gap:var(--wf-spacing-4,16px);grid-template-columns:repeat(2,1fr);display:grid}wf-options[columns="1"] .wf-options-container{grid-template-columns:1fr}@media (width<=600px){wf-options .wf-options-container{grid-template-columns:1fr}}wf-options .wf-error-message{margin-top:var(--wf-spacing-2,8px);font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-error,#dc3545);min-height:20px;display:block}wf-options .wf-other-container{margin-top:var(--wf-spacing-4,16px)}wf-options .wf-other-label{margin-bottom:var(--wf-spacing-2,8px);font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text,#0a0a0a);font-weight:500;display:block}wf-options .wf-other-label span{color:var(--wf-color-text-muted,#646464);font-weight:400}wf-options .wf-other-input-wrapper{align-items:center;gap:var(--wf-spacing-3,12px);min-height:var(--wf-input-min-height,56px);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-md,8px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);padding-left:var(--wf-spacing-4,16px);transition:border-color .15s,box-shadow .15s,background .15s;display:flex}wf-options .wf-other-input-wrapper:focus-within{border-color:var(--wf-color-primary,#8040f0);box-shadow:0 0 0 3px #8040f01a}wf-options .wf-other-input{min-height:calc(var(--wf-input-min-height,56px) - 2px);padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);color:var(--wf-color-text,#0a0a0a);box-sizing:border-box;background:0 0;border:none;outline:none;flex:1;padding-left:0;font-weight:500}wf-options .wf-other-input::placeholder{color:var(--wf-color-text-muted,#646464);font-weight:500}wf-option{display:block}wf-option[hidden]{display:none}wf-option .wf-option-card{align-items:center;gap:var(--wf-spacing-3,12px);width:100%;min-height:var(--wf-input-min-height,56px);padding:var(--wf-spacing-3,12px);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-md,8px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);cursor:pointer;text-align:left;font-family:inherit;font-size:var(--wf-font-size-base,1rem);color:var(--wf-color-text,#0a0a0a);box-sizing:border-box;outline:none;font-weight:500;transition:border-color .15s,background .15s,transform .1s;display:flex}wf-option .wf-option-card:hover:not(:disabled){border-color:var(--wf-color-primary,#8040f0);background:var(--wf-glass-bg-hover,#ffffffd9)}wf-option .wf-option-card:focus-visible{border-color:var(--wf-color-primary,#8040f0);box-shadow:0 0 0 3px #8040f033}wf-option .wf-option-card[aria-selected=true]{border-color:var(--wf-color-primary,#8040f0);background-color:var(--wf-color-primary-light,#8040f01a)}wf-option .wf-option-card:disabled{opacity:.5;cursor:not-allowed}wf-option .wf-option-card:active:not(:disabled){transform:scale(.98)}wf-option .wf-option-card.selecting{animation:.3s wf-blink}@keyframes wf-blink{0%,to{opacity:1}50%{opacity:.5}}wf-option .wf-option-content{flex:1;min-width:0}wf-option .wf-option-content strong,wf-option .wf-option-content h3,wf-option .wf-option-content h4{margin:0;font-weight:600;display:block}wf-option .wf-option-content span,wf-option .wf-option-content p{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text-muted,#646464);margin:4px 0 0;display:block}wf-progress{display:block}wf-progress[hidden]{display:none}wf-progress .wf-progress{gap:var(--wf-spacing-4,16px);display:flex}wf-progress .wf-progress-segment{background-color:var(--wf-color-progress-inactive,#d9d9d999);border-radius:var(--wf-radius-full,99px);width:32px;height:8px;transition:background-color .3s}wf-progress .wf-progress-segment.completed,wf-progress .wf-progress-segment.active{background-color:var(--wf-color-progress-active,#8b8b8b99)}wf-badge{display:inline-flex}wf-badge[hidden]{display:none}wf-badge .wf-badge{box-sizing:border-box;min-width:24px;height:24px;padding:var(--wf-spacing-1,4px)var(--wf-spacing-2,8px);font-size:var(--wf-font-size-xs,.75rem);text-transform:uppercase;flex-shrink:0;justify-content:center;align-items:center;font-family:inherit;font-weight:500;line-height:1;display:inline-flex}wf-badge .wf-badge--default{background-color:var(--wf-color-badge-bg,#fcfcfc);border:1px solid var(--wf-color-badge-border,#d4d4d4);border-radius:var(--wf-radius-sm,4px);color:var(--wf-color-badge-text,#5f5f5f)}wf-badge .wf-badge--selected{background-color:var(--wf-color-primary,#8040f0);border:1px solid var(--wf-color-primary,#8040f0);border-radius:var(--wf-radius-sm,4px);color:#fff}wf-badge .wf-badge--button{border-radius:var(--wf-radius-sm,4px);color:#ffffffa6;background-color:#0000;border:none}wf-badge .wf-badge--button-secondary{border-radius:var(--wf-radius-sm,4px);color:var(--wf-color-text-muted,#5f5f5f);background-color:#0000;border:none}wf-layout{box-sizing:border-box;display:block}wf-layout[hidden]{display:none}wf-layout.wf-layout--width-full{width:100%}wf-layout.wf-layout--width-auto{width:auto}wf-layout.wf-layout--width-fit{width:fit-content}wf-thank-you{text-align:center;padding:var(--wf-spacing-8,48px)var(--wf-spacing-4,24px);display:block}wf-thank-you[hidden]{display:none}wf-thank-you .wf-thank-you-icon{width:72px;height:72px;margin:0 auto var(--wf-spacing-4,24px);background:linear-gradient(135deg,#10b981 0%,#059669 100%);border-radius:50%;justify-content:center;align-items:center;display:flex;box-shadow:0 10px 25px -5px #10b98166}wf-thank-you .wf-thank-you-icon svg{color:#fff;width:36px;height:36px}wf-thank-you .wf-thank-you-title{color:var(--wf-color-text,#1e293b);margin:0 0 12px;font-size:28px;font-weight:700}wf-thank-you .wf-thank-you-subtitle{color:var(--wf-color-text-muted,#64748b);margin:0 0 24px;font-size:16px;line-height:1.6}wf-thank-you [slot=footer]{margin-top:var(--wf-spacing-4,24px)}wf-input,wf-email,wf-textarea,wf-field,wf-number{display:block}wf-input[hidden],wf-email[hidden],wf-textarea[hidden],wf-field[hidden],wf-number[hidden]{display:none}.wf-field-container{gap:var(--wf-spacing-2,8px);flex-direction:column;display:flex}.wf-label{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text,#0a0a0a);font-weight:500}.wf-label-required:after{content:" *";color:var(--wf-color-error,#dc3545)}.wf-error-message{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-error,#dc3545)}.wf-hint{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text-muted,#646464)}.wf-input{width:100%;min-height:var(--wf-input-min-height,56px);padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-md,8px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);color:var(--wf-color-text,#0a0a0a);box-sizing:border-box;outline:none;font-family:inherit;font-weight:400;transition:border-color .15s,box-shadow .15s,background .15s}.wf-input::placeholder{color:var(--wf-color-text-muted,#646464);font-weight:500}.wf-input:focus{border-color:var(--wf-color-primary,#8040f0);box-shadow:0 0 0 3px #8040f033}.wf-input:disabled{opacity:.5;cursor:not-allowed}.wf-input.wf-input-error{border-color:var(--wf-color-error,#dc3545)}.wf-input.wf-input-error:focus{box-shadow:0 0 0 3px #dc354533}.wf-textarea{width:100%;padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-lg,12px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);color:var(--wf-color-text,#212529);box-sizing:border-box;resize:vertical;outline:none;min-height:100px;font-family:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.wf-textarea::placeholder{color:var(--wf-color-text-muted,#6c757d)}.wf-textarea:focus{border-color:var(--wf-color-primary,#8b5cf6);box-shadow:0 0 0 3px #8b5cf633}.wf-textarea:disabled{opacity:.5;cursor:not-allowed}.wf-textarea.wf-textarea-error{border-color:var(--wf-color-error,#dc3545)}.wf-textarea.wf-textarea-error:focus{box-shadow:0 0 0 3px #dc354533}.wf-char-count{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text-muted,#6c757d);text-align:right}.wf-char-count.wf-char-limit{color:var(--wf-color-error,#dc3545)}wf-field .wf-input-wrapper{position:relative}wf-field .wf-input-wrapper input,wf-field .wf-input-wrapper textarea,wf-field .wf-input-wrapper select{width:100%;padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);background-color:var(--wf-color-surface,#f8f9fa);border:2px solid var(--wf-color-border,#dee2e6);border-radius:var(--wf-radius-lg,12px);color:var(--wf-color-text,#212529);box-sizing:border-box;outline:none;font-family:inherit;transition:border-color .15s,box-shadow .15s}wf-field .wf-input-wrapper input::placeholder,wf-field .wf-input-wrapper textarea::placeholder{color:var(--wf-color-text-muted,#6c757d)}wf-field .wf-input-wrapper input:focus,wf-field .wf-input-wrapper textarea:focus,wf-field .wf-input-wrapper select:focus{border-color:var(--wf-color-primary,#8b5cf6);box-shadow:0 0 0 3px #8b5cf633}wf-field .wf-input-wrapper input:disabled,wf-field .wf-input-wrapper textarea:disabled,wf-field .wf-input-wrapper select:disabled{opacity:.5;cursor:not-allowed}wf-number .wf-input::-webkit-outer-spin-button,wf-number .wf-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}wf-number .wf-input[type=number]{-moz-appearance:textfield}',document.head.appendChild(e)}(),t.DEFAULT_BLOCKED_DOMAINS=jt,t.FormStateController=gt,t.KeyboardController=bt,t.ValidationController=Rt,t.createHubSpotAdapter=r,t.createRevenueHeroAdapter=o,t.createWebhookAdapter=s,t.default=oe,t.getHubSpotCookie=e,t.init=ie,t.isRevenueHeroLoaded=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1253
270
  //# sourceMappingURL=wizard-form.min.js.map