!function(){"use strict";const t={RECEIVED_ANALYTICS:"HS_CTA_PARENT_RECEIVED_ANALYTICS",DEVICE_TYPE:"HS_CTA_PARENT_DEVICE_TYPE",PROXY_ANALYTICS_FN_CALLBACK:"HS_CTA_PARENT_PROXY_ANALYTICS_FN",INIT:"HS_CTA_PARENT_INIT",SHOWING_CTA:"HS_CTA_SHOWING_CTA",SEND_EXTRACTED_STYLES:"HS_SEND_EXTRACTED_STYLES",STARTED:"HS_CTA_STARTED",NAVIGATE_PAGE:"HS_CTA_NAVIGATE_PAGE",CLICK_EVENT:"HS_CTA_CLICK_EVENT",CLOSE_INTERACTIVE:"HS_CTA_CLOSE_INTERACTIVE",HAS_CLOSED:"HS_CTA_HAS_CLOSED",NEW_HEIGHT:"HS_CTA_NEW_HEIGHT",DISPLAY_CALL_TO_ACTION:"HS_DISPLAY_CALL_TO_ACTION",PROXY_ANALYTICS:"HS_CTA_PROXY_ANALYTICS",PROXY_ANALYTICS_FN:"HS_CTA_PROXY_ANALYTICS_FN",SEND_FORM_DEFINITION:"HS_SEND_FORM_DEFINITION",SEND_CTA_CONFIG:"HS_SEND_CTA_CONFIG",SEND_EMBED_CONTEXT:"HS_SEND_EMBED_CONTEXT",RECEIVE_FILTERED_STYLESHEETS:"RECEIVE_FILTERED_STYLESHEETS",SEND_STYLESHEETS:"SEND_STYLESHEETS",TRIGGER_CTA:"HS_CTA_TRIGGER_CTA",CTA_FORM_SUBMITTED:"HS_CTA_FORM_SUBMITTED",V4_FORM_READY:"HS_V4_FORM_READY",SEND_FORM_EXTRA_SUBMISSION_METADATA:"HS_SEND_FORM_EXTRA_SUBMISSION_METADATA",SEND_FORM_SUBMISSION_SUCCESS_INFO:"HS_SEND_FORM_SUBMISSION_SUCCESS_INFO",SEND_FORM_SUBMISSION_SUCCESS:"HS_SEND_FORM_SUBMISSION_SUCCESS",SEND_FORM_SUBMISSION_FAILED:"HS_SEND_FORM_SUBMISSION_FAILED",SEND_FORM_INTERACTION_NAVIGATE:"HS_SEND_FORM_INTERACTION_NAVIGATE",SEND_FORM_INTERACTION_NAVIGATE_NEXT:"HS_SEND_FORM_INTERACTION_NAVIGATE_NEXT",SEND_FORM_INTERACTION_NAVIGATE_PREVIOUS:"HS_SEND_FORM_INTERACTION_NAVIGATE_PREVIOUS",GET_FORM_FIELD_VALUES:"HS_GET_FORM_FIELD_VALUES",SEND_FORM_FIELD_VALUES:"HS_SEND_FORM_FIELD_VALUES",GET_FIELD_VALUE:"HS_GET_FIELD_VALUE",SET_FIELD_VALUE:"HS_SET_FIELD_VALUE",SEND_FIELD_VALUE:"HS_SEND_FIELD_VALUE",MEETINGS_BOOKING_SUCCESS:"HS_CTA_MEETINGS_BOOKING_SUCCESS"};function e(t,e={}){for(const s in e)Object.hasOwnProperty.call(e,s)&&(t.style[s]=e[s])}function s(...t){if(window.location.search.indexOf("hs_debug_interactive")>-1||window.location.host.includes("local.hsappstatic")){console.log("[web-interactives-embed]",...t);window.location.search.indexOf("hs_is_selenium")>-1&&console.log(...[...t].map((t=>JSON.stringify(t))))}}class i{constructor(){this.listeners=new Map}on(t,e){if(!this.listeners.has(t)){this.listeners.set(t,[e]);return}const s=this.listeners.get(t);this.listeners.set(t,[...s,e])}off(t){this.listeners.delete(t)}emit(t,e){const s=this.listeners.get(t);s&&s.length&&s.forEach((t=>t(e)))}reset(){this.listeners=new Map}}function n(){return new i}const a=(...t)=>{s("[GlobalIframeCommunication]",...t)};class r{constructor(){this.iframeCommunicators=new Map;this.eventEmitter=n();this.reset=()=>{this.eventEmitter.reset();this.iframeCommunicators=new Map}}registerHandler(t,e){this.eventEmitter.on(t,e)}registerHandlers(t){a("Registering handlers",t);Object.keys(t).forEach((e=>{const s=e,i=t[s];i&&this.registerHandler(s,i)}))}registerCommunicator(t,e){a("Registering communicator",e);const s=this.iframeCommunicators.get(e)||[];this.iframeCommunicators.set(e,[...s,t])}removeCommunicator(t){a("Removing Iframe Communicator from GlobalCommunication: ",t);this.iframeCommunicators.delete(t)}emit(t,e){a("Emitting event",{event:t,messagePayload:e});this.eventEmitter.emit(t,e)}broadcast(t,e){const s=this.iframeCommunicators.get(t);if(s){a("Broadcasting",s);s.forEach((t=>{t.sendMessage(e)}))}else a("Cannot find communcators array, not broadcasting",t,e)}broadcastAll(t){a("Broadcasting",t,"to all",this.iframeCommunicators);for(const[e,s]of this.iframeCommunicators)this.broadcast(e,t)}}var o=new r;function c(){return new MessageChannel}const d=(...t)=>{s("[iframeCommunication]",...t)};class l{constructor(e,s){this.queue=[];this.initialised=!1;this.events=new Map;this.eventEmitter=n();this.handleMessage=t=>{if(!t.data||!t.data.type)return;const{type:e,payload:s}=t.data;d("Handling message",{type:e,payload:s});this.eventEmitter.emit(e,s);o.emit(e,Object.assign({},s,{id:this.id}))};this.handleFrameLoaded=()=>{if(this.iframe.contentWindow){d("Iframe loaded",this.iframe);this.iframe.contentWindow.postMessage({type:t.INIT},"*",[this.channel.port2]);this.initialised=!0;this.flushQueue()}else d("Content window not there, not loading")};this.iframe=e;this.id=s;this.channel=c();this.channel.port1.onmessage=this.handleMessage;this.iframe.addEventListener("load",this.handleFrameLoaded);d("Iframe communication set up",s,e)}sendMessage({type:t,payload:e}){if(this.initialised){d("Posting message",{type:t,payload:e});this.channel.port1.postMessage({type:t,payload:e})}else{d("Queueing message",{type:t,payload:e});this.queue.push({type:t,payload:e})}}registerHandler(t,e){this.eventEmitter.on(t,e)}registerHandlers(t){d("Registering handlers in IframeCommunication",t);Object.keys(t).forEach((e=>{const s=e,i=t[s];i&&this.registerHandler(s,i)}))}removeHandler(t){d("Removing handler",t);this.eventEmitter.off(t)}remove(){d("Removing frame communicator:",this.id);this.channel.port1.close();o.removeCommunicator(this.id)}flushQueue(){if(this.initialised){d("Flushing queue",this.queue);this.queue.forEach((t=>{this.sendMessage(t)}))}else d("Not flushing queue, not initialised")}}function h(t,e){d("Creating iframe communication");const s=new l(t,e);o.registerCommunicator(s,e);return s}function m(t){const e=window.location.origin.startsWith("http:")?"http://":"https://";return t.startsWith(e)?t:`${e}${t.replace(/http(s)?:\/\//,"")}`}function u(t){t.style.border="none";t.style.height="100%";t.style.width="100%";t.style.visibility="hidden"}function p(t,e){const s=document.createElement("iframe");s.src=m(t);Object.keys(e).forEach((t=>{s.setAttribute(t,e[t])}));u(s);return s}function _(t,e,s){t.startsWith("http")||(t=`https://${t}`);const i=new URL(t);i.searchParams.set(e,s);return i.href}const f=(...t)=>{s("[FrameComponent]",...t)},E=()=>{};class S{constructor({id:t,container:e,iframeSrc:s,resizeHeight:i,onFrameReady:n,useResponsiveStyling:a,extraAttributes:r={}}){this.onFrameReady=E;this.resizeHeight=!0;this.handleHeightChange=({height:t})=>{if(!this.resizeHeight)return;const e=t+2*parseInt(getComputedStyle(this.iframe).borderTopWidth,10);f("Handle height change",this.id,{adjustedHeight:e,height:t});this.setContainerStyle({height:`${e}px`})};this.id=t;this.resizeHeight=i;if(a){f("Responsive styling is enabled",t);s=_(s,"enableResponsiveStyles","true")}this.iframe=p(s,r);this.container=e;this.iframeCommunicator=h(this.iframe,t);n&&(this.onFrameReady=n);e.appendChild(this.iframe);this.registerHandlers()}registerHandlers(){this.iframeCommunicator.registerHandlers({[t.STARTED]:this.onFrameReady,[t.NEW_HEIGHT]:this.handleHeightChange})}setStyle(t){f("Set style",this.id,t);e(this.iframe,t)}setShouldResize(t){this.resizeHeight=t}setContainerStyle(t){e(this.container,t)}}function g(t){return new S(t)}class I{constructor(t,e){this.listeners=new Set;this.batching=!1;this.queue=[];this.subscribe=t=>{this.listeners.add(t);let e=()=>{};this.options&&this.options.onSubscribe&&(e=this.options.onSubscribe(t,this));return()=>{this.listeners.delete(t);e()}};this.setState=t=>{const e=this.state;this.options&&this.options.updateFn?this.state=this.options.updateFn(e)(t):this.state=t(e);if(this.state!==e){this.queue.push((()=>{this.listeners.forEach((t=>t(this.state,e)));this.options&&this.options.onUpdate&&this.options.onUpdate(this.state,e)}));this._flush()}};this._flush=()=>{if(!this.batching){this.queue.forEach((t=>t()));this.queue=[]}};this.batch=t=>{this.batching=!0;t();this.batching=!1;this._flush()};this.state=t;this.options=e}}function b(t,e=!1){!window.navigator.userAgent.includes("Firefox")&&e?window.open(t,"_blank","noopener"):window.location.assign(t)}const C="hubspotutk",A="__hstc",v="__hssc",y=t=>{const e=document.cookie.match(`(^|[^;]+)\\s*${t}\\s*=\\s*([^;]+)`);return e?e.pop():""},F=()=>y(C),w=()=>y(A),N=()=>y(v),T=(...t)=>{s("[models/Analytics]",...t)};class O{constructor(){this._handleFetchSucceded=t=>{this.store.setState((e=>{const s={};s.path=t.path;s.referrerPath=t.referrerPath;s.referrer="";s.analyticsPageId=t.pageId;s.hsfp=t._getFingerprint();s.canonicalUrl=t.canonicalUrl;s.contentType=t.contentType;s.pageId=O.getPageId()||t.pageId;t.session&&(s.hssc=t.session.get());if(t.utk){s.hstc=t.utk.get();s.hutk=t.utk.visitor}return Object.assign({},e,s,{isLoaded:!0})}))};window._hsq=window._hsq||[];const t={isLoaded:!1,pageUrl:window.location.href,pageTitle:window.document.title,referrer:window.document.referrer,userAgent:window.navigator.userAgent,hutk:F(),hssc:N(),hstc:w(),pageId:O.getPageId()};this.store=new I(t);this.fetchAnalytics()}fetchAnalytics(){this._analyticsQueue.push(this._handleFetchSucceded)}subscribe(t){return this.store.subscribe(t)}get analytics(){return this.store.state}track(t){T("Tracking analytics",t);this._analyticsQueue.push(t)}get _analyticsQueue(){return window._hsq}static getPageId(){const t=window.hsVars;return t&&t.analytics_page_id?t.analytics_page_id:t&&t.page_id?t.page_id:null}static getLanguage(){const t=window.hsVars;return t&&t.language?t.language:null}}var R=new O;const M=(...t)=>{s("[AnalyticsProxyController]",...t)},D=["trackFormView","trackFormVisible","trackFormInteraction"];class V{constructor({applicationController:t,analyticsStore:e}){this.viewQueue=new Map;this.applicationController=t;this.analyticsStore=e;this.listenForAnalyticsUpdate();this.listenForProxyMessage()}listenForAnalyticsUpdate(){this.analyticsStore.subscribe(((e,s)=>{!s.isLoaded&&e.isLoaded&&o.broadcastAll({type:t.RECEIVED_ANALYTICS,payload:e})}))}flushViewQueue(t){const e=this.viewQueue.get(t)||[];for(const t of e)this.analyticsStore.track(t);this.viewQueue.delete(t)}handleFormView(t,e){const s=this.applicationController.viewedStore;if(s&&s.hasBeenViewed(t)){this.analyticsStore.track(e);return}const i=this.viewQueue.get(t)||[];M("Adding form view to analytics queue",{id:t,analytics:e});this.viewQueue.set(t,[...i,e])}listenForProxyMessage(){o.registerHandlers({[t.PROXY_ANALYTICS]:({analytics:t,id:e})=>{V.isFormView(t)?this.handleFormView(e,t):this.analyticsStore.track(t)}})}static isFormView(t){const[e]=t;return D.includes(e)}}class H{constructor({applicationController:t}){this.applicationController=t;this.listenForNavigation()}listenForNavigation(){o.registerHandlers({[t.NAVIGATE_PAGE]:({url:t,openNewTab:e,id:s})=>{const i=this.applicationController.getNavigationUrl({url:t,openNewTab:e},s);if(e)return;b(i,this.applicationController.getShouldOpenNewTab({url:t,openNewTab:e},s))}})}}class P{constructor(){this.extractedStyles={rules:{},keyframes:{}};this.crossOriginStyleSheets=new Set}extractStyles(){const t={rules:{},keyframes:{}};for(const e of document.styleSheets)if(!this.crossOriginStyleSheets.has(e))try{const s=e.cssRules||e.rules;for(const e of s)e instanceof CSSStyleRule?t.rules[e.selectorText]=this.extractProperties(e.style):e instanceof CSSKeyframesRule&&(t.keyframes[e.name]=this.extractKeyframes(e))}catch(t){this.crossOriginStyleSheets.add(e)}this.extractedStyles=t}extractProperties(t){const e={};for(const s of Array.from(t))e[s]=t.getPropertyValue(s);return e}extractKeyframes(t){const e=[];for(const s of t.cssRules){if(!(s instanceof CSSKeyframeRule))continue;const t=this.extractProperties(s.style);e.push({keyText:s.keyText,style:t})}return e}}class L{constructor(){this.analyticsStore=R;this.analyticsProxyController=new V({analyticsStore:this.analyticsStore,applicationController:this});this.navigationProxyController=new H({applicationController:this});this.styleExtractorController=new P}getNavigationUrl(t,e){return t.url}getShouldOpenNewTab(t,e){return t.openNewTab}}class U{constructor(){this.handleIntersection=t=>{t.forEach((t=>{if(t.isIntersecting){const e=t.target;this.onElementAppear(e);this.observedElements.delete(e);this.observer.unobserve(e)}}))};this.observer=new IntersectionObserver(this.handleIntersection,{threshold:.5});this.observedElements=new Map}onElementAppear(t){const e=this.observedElements.get(t);e&&e(t)}observe(t,e){if((()=>{const e=t.getBoundingClientRect(),s=window.innerHeight;return e.bottom>=0&&e.top!s.has(t))))}function k(t,e){const s=new Map(t);for(const[t,i]of e)s.set(t,i);return s}const j="hs-form-frame",q="data-env",B="data-form-id",Y="data-portal-id",$="data-instance-id",z="data-region",X="data-sfdc-campaign-id",W="data-go-to-webinar-webinar-key",Q="data-webinar-id",K="data-webinar-source",J="data-test-id",Z="embedded-form-",tt="title";var et=()=>Array.from(document.getElementsByClassName(j));const st="na1",it="prod";var nt=()=>"randomUUID"in crypto?crypto.randomUUID():([1e7]+-1e3+-4e3+8e3+-1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)));const at=(t,e)=>t.getAttribute(e)||"";var rt=t=>({formId:at(t,B),portalId:Number(at(t,Y)),region:at(t,z)||st,env:at(t,q)||it,sfdcCampaignId:at(t,X),goToWebinarWebinarKey:at(t,W),webinarId:at(t,Q),webinarSource:at(t,K),instanceId:at(t,$)||nt()});function ot(t,e,s=5){if(!(s<0)&&t.nodeType===Node.ELEMENT_NODE){const i=t;i.classList.contains(j)&&e.push(i);i.childNodes.forEach((t=>{ot(t,e,s-1)}))}}function ct(t){const e=new MutationObserver((e=>{const s=[];for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)ot(e,s);s.length&&t(s)}));e.observe(document.body,{childList:!0,subtree:!0});return()=>{e.disconnect()}}const dt=/^[{]?[0-9a-fA-F]{8}-?([0-9a-fA-F]{4}-?){3}[0-9a-fA-F]{12}[}]?$/,lt=["qa","prod"];var ht=t=>{const{portalId:e,formId:s,region:i,env:n,instanceId:a}=t;return!(e<1)&&(!!dt.test(s)&&(!!i&&(!!lt.includes(n)&&!!a)))};function mt(t=et()){const e=new Map,s=new Map;t.forEach((t=>{const i=rt(t);if(!ht(i)){console.error(`${i} has missing or invalid data attributes.`);return}const{formId:n}=i;e.set(n,[...e.get(n)||[],t]);s.set(t,i)}));return{formContainerElementsMap:e,embedContextsMap:s}}const ut=o;var pt=t=>{(new Image).src=t};const _t="https://forms{{region}}.hsforms{{env}}.com/embed/v3",ft=({env:t,region:e})=>{const s=e?`-${e}`:"",i="qa"===t?"qa":"";return _t.replace("{{region}}",s).replace("{{env}}",i)};var Et=(t="",e=1,s={env:"",region:""})=>{pt(`${ft(s)}/counters.gif?key=${t}&count=${e}`)};var St={FORM_FRAME_LOAD_SUCCESS:"form-frame-load-success"};class gt{constructor({embedContext:e,container:s,iframeSrc:i}){this.handleLoad=()=>{this.frameComponent.setStyle({visibility:""})};this.sendEmbedContextWithInstanceId=e=>{this.frameComponent.iframeCommunicator.sendMessage({type:t.SEND_EMBED_CONTEXT,payload:e})};this.listenForV4FormReadyEvent=()=>{ut.registerHandlers({[t.V4_FORM_READY]:({instanceId:t})=>{this.sendEmbedContextWithInstanceId(Object.assign({},this.embedContext,{instanceId:t}))}})};this.listenForLoad();this.container=s;this.initContainer();this.embedContext=e;this.frameComponent=g({iframeSrc:i,container:s,id:e.formId,onFrameReady:this.resolveFrameload,resizeHeight:!0,extraAttributes:{[J]:`${Z}${e.formId}`,[tt]:"Form",scrolling:"no"}});this.listenForV4FormReadyEvent()}initContainer(){this.container.style.height="0";this.container.replaceChildren()}listenForLoad(){const t=new Promise((t=>{this.resolveFrameload=t}));Promise.all([t]).then((()=>{this.handleLoad();Et(St.FORM_FRAME_LOAD_SUCCESS,1,{env:this.embedContext.env,region:this.embedContext.region})})).catch((()=>{}))}}function It({embedContext:t,container:e,iframeSrc:s}){return new gt({embedContext:t,container:e,iframeSrc:s})}const bt={APP:"app",APP_API:"app-api"};function Ct(t,e){const s=e&&e.hubletOverride?e.hubletOverride:t,i=e&&!0===e.hubletizeNa1;return s!==st||i?`-${s}`:""}function At(t,e,s){if(s&&s.hubletPostfixLocation&&"domain"===s.hubletPostfixLocation)return e;e===bt.APP_API&&(e=bt.APP);return`${e}${Ct(t,s)}`}function vt(t,e,s){return`${Ft(s)}${yt(e,s)}${wt(t,s)}`}function yt(t,e){return"qa"===(e&&e.envOverride?e.envOverride:t)?"qa":""}function Ft(t){return t&&t.domainOverride?t.domainOverride:"hubspot"}function wt(t,e){return e&&e.hubletPostfixLocation&&"domain"===e.hubletPostfixLocation?Ct(t,e):""}function Nt(t){return t&&t.tldOverride?t.tldOverride:"com"}function Tt(t){return t===bt.APP_API?"/api":""}function Ot(t,e,s,i){return`https://${At(e,t,i)}.${vt(e,s,i)}.${Nt(i)}${Tt(t)}`}var Rt=({subDomainPrefix:t,hublet:e,isQa:s,pathname:i="",pathValues:n={},domainOverride:a,tldOverride:r,query:o})=>{const c=Object.keys(n).reduce(((t,e)=>t.replace(RegExp(`{{${e}}}`,"g"),n[e])),i),d=Ot(t,e||st,s?"qa":"prod",{domainOverride:a,tldOverride:r}),l=new URL(c,d);if(o)for(const[t,e]of Object.entries(o))l.searchParams.append(t,e);return l.href};function Mt({portalId:t,formId:e,region:s,env:i,hutk:n,instanceId:a}){const r=Object.assign({},Object.fromEntries(new URLSearchParams(window.location.search))),o="true"===r.isLocal,c={hublet:o?st:s,isQa:!o&&"qa"===i,subDomainPrefix:o?"local":"js",domainOverride:o?"hsappstatic":"hsforms",tldOverride:"net"},d=Object.assign({_hsPortalId:`${t||""}`,_hsFormId:e||"",_hsIsQa:`${"qa"===i}`,_hsHublet:s||st,_hsDisableScriptloader:"true",_hsDisableRedirect:"true",_hsInstanceId:a},n&&{_hsUtk:n},r);return Rt(Object.assign({},c,{pathname:o?"ui-forms-embed-components-app/static/html/frame.html":"ui-forms-embed-components-app/frame.html",query:d}))}class Dt{constructor({embeddedContainers:t,environment:e,handleView:s,analyticsStore:i}){this.elementObserver=x();this.embedComponents=new Map;this.embeddedContainers=t;this.environment=e;this.handleView=s;this.analyticsStore=i;this.listenForEmbeddedContainers()}listenForEmbeddedContainers(){this.embeddedContainers.subscribe(((t,e)=>{const s=G(e.embedContextsMap,t.embedContextsMap);this.createViews([...s]);this.listenForElementViews([...s])}))}listenForElementViews(t){for(const e of t){const t=this.embeddedContainers.embedContextsMap.get(e);if(!t)return;this.elementObserver.observe(e,(()=>this.handleView(t.formId)))}}createViews(t){for(const e of t){const t=this.embeddedContainers.embedContextsMap.get(e);if(!t)continue;if(this.embedComponents.has(e))continue;const s=this.analyticsStore.analytics.hutk,i=It({embedContext:Object.assign({},t,this.environment.propsForContext(),s&&{hutk:s}),container:e,iframeSrc:Mt({hutk:s,instanceId:t.instanceId,portalId:t.portalId,formId:t.formId,region:t.region,env:t.env})});this.embedComponents.set(e,i)}}}function Vt(t){return new Dt(t)}class Ht{constructor(){const t={formContainerElementsMap:new Map,embedContextsMap:new Map};this.store=new I(t)}subscribe(t){return this.store.subscribe(t)}get formContainerElements(){return this.store.state.formContainerElementsMap}get embedContextsMap(){return this.store.state.embedContextsMap}getFrameContainerFromInstanceId(t){const e=Array.from(this.store.state.embedContextsMap.entries()).find((([,e])=>e.instanceId===t));if(!e)throw new Error(`No embed context found for instanceId: ${t}`);return e[0]}addElements(t){this.store.setState((e=>({formContainerElementsMap:k(e.formContainerElementsMap,t.formContainerElementsMap),embedContextsMap:k(e.embedContextsMap,t.embedContextsMap)})))}}class Pt{constructor(){this.markAsViewed=t=>{this.store.setState((e=>Object.assign({},e,{viewed:new Set([...e.viewed,t])})))};const t={viewed:new Set};this.store=new I(t)}subscribe(t){this.store.subscribe(t)}hasBeenViewed(t){return this.store.state.viewed.has(t)}get viewed(){return this.store.state.viewed}}function Lt(){return new Pt}const Ut="__HS__FORMS__EMBED__",xt="HubSpotFormsV4",Gt="HubspotFormsV4",kt="__SECRET_INTERNAL_DO_NOT_USE";class jt{constructor(t){this.formData=t;this.attachToWindow()}init(t){const{instanceId:e,formId:s}=t;this.createFormInstanceMethods(t);this.formData.setFormInstanceInfo({instanceId:e,formInfo:{formId:s}})}attachToWindow(){window[xt]={[kt]:{_forms:new Map,_setForm({instanceId:t,instanceMethods:e}){this[kt]._forms.set(t,e)},_getFormByInstanceId(t){return this[kt]._forms.get(t)}},getForms(){return Array.from(this[kt]._forms.values())},getFormFromEvent({detail:{instanceId:t}}){return this[kt]._getFormByInstanceId.call(this,t)}};window[Gt]=window[xt]}createFormInstanceMethods(t){const{instanceId:e,formId:s}=t,{clientApi:i,__internalApi:n}=this.getFormInternalApi()||{};i&&n&&!n._getFormByInstanceId.call(i,e)&&n._setForm.call(i,{instanceId:e,instanceMethods:{getFormId:()=>s,getInstanceId:()=>e,getRedirectUrl:()=>this.formData.getRedirectUrl(e),getConversionId:()=>this.formData.getConversionId(e),getFormFieldValues:()=>this.getFormFieldValues(t),getFieldValue:e=>this.getFieldValue(t,e),setFieldValue:(e,s)=>this.setFieldValue({baseFormInfo:t,propertyReference:e,value:s}),setExtraSubmissionMetadata:t=>this.sendExtraSubmissionMetadata({formId:s,instanceId:e,metadata:t})}})}sendExtraSubmissionMetadata(e){const{formId:s}=e;ut.broadcast(s,{type:t.SEND_FORM_EXTRA_SUBMISSION_METADATA,payload:e})}setFieldValue({baseFormInfo:e,propertyReference:s,value:i}){const{formId:n,instanceId:a}=e;ut.broadcast(n,{type:t.SET_FIELD_VALUE,payload:{instanceId:a,propertyReference:s,value:i}})}async getFormFieldValues(e){let s;const{formId:i}=e,n=new Promise((t=>{s=t}));this.listenForSendFormFieldValues(s);ut.broadcast(i,{type:t.GET_FORM_FIELD_VALUES,payload:e});return await n.then((t=>t))}async getFieldValue(e,s){let i;const{formId:n,instanceId:a}=e,r=new Promise((t=>{i=t}));this.listenForSendFieldValue(i);ut.broadcast(n,{type:t.GET_FIELD_VALUE,payload:{instanceId:a,propertyReference:s}});return await r.then((t=>t))}listenForSendFormFieldValues(e){ut.registerHandlers({[t.SEND_FORM_FIELD_VALUES]:({formFieldValues:t})=>{null==e||e(t)}})}listenForSendFieldValue(e){ut.registerHandlers({[t.SEND_FIELD_VALUE]:({fieldValue:t})=>{null==e||e(t)}})}getFormInternalApi(){const t=window[xt];if(t&&t[kt])return{clientApi:t,__internalApi:t[kt]}}}function qt(t){return new jt(t)}const Bt=t=>{if(!t)return;t.getBoundingClientRect().top<0&&t.scrollIntoView({behavior:"smooth",block:"start"})},Yt={ON_FORM_READY:"hs-form-event:on-ready",ON_FORM_SUBMISSION_SUCCESS:"hs-form-event:on-submission:success",ON_FORM_SUBMISSION_FAILED:"hs-form-event:on-submission:failed",ON_FORM_INTERACTION_NAVIGATE:"hs-form-event:on-interaction:navigate",ON_FORM_INTERACTION_NAVIGATE_NEXT:"hs-form-event:on-interaction:navigate:next",ON_FORM_INTERACTION_NAVIGATE_PREVIOUS:"hs-form-event:on-interaction:navigate:previous"};class $t{constructor(t,e){this.formData=t;this.embeddedContainers=e}init({initialiseThirdPartyApi:t}){this.listenForFormReadyEvent({initialiseThirdPartyApi:t});this.listenForFormNavigationEvent();this.listenForFormNavigationNextEvent();this.listenForFormNavigationPreviousEvent();this.listenForSubmissionSuccessEvent();this.listenForSubmissionFailedEvent()}listenForFormReadyEvent({initialiseThirdPartyApi:e}){ut.registerHandlers({[t.V4_FORM_READY]:t=>{e(t);this.triggerGlobalEvent(Object.assign({},t,{type:Yt.ON_FORM_READY}))}})}listenForSubmissionSuccessEvent(){ut.registerHandlers({[t.SEND_FORM_SUBMISSION_SUCCESS]:({formId:t,instanceId:e})=>{this.triggerGlobalEvent({type:Yt.ON_FORM_SUBMISSION_SUCCESS,instanceId:e,formId:t})}})}listenForFormNavigationEvent(){ut.registerHandlers({[t.SEND_FORM_INTERACTION_NAVIGATE]:t=>{this.triggerGlobalEvent(Object.assign({},t,{type:Yt.ON_FORM_INTERACTION_NAVIGATE}))}})}listenForFormNavigationNextEvent(){ut.registerHandlers({[t.SEND_FORM_INTERACTION_NAVIGATE_NEXT]:t=>{const e=this.embeddedContainers.getFrameContainerFromInstanceId(t.instanceId);e&&Bt(e);this.triggerGlobalEvent(Object.assign({},t,{type:Yt.ON_FORM_INTERACTION_NAVIGATE_NEXT}))}})}listenForFormNavigationPreviousEvent(){ut.registerHandlers({[t.SEND_FORM_INTERACTION_NAVIGATE_PREVIOUS]:t=>{this.triggerGlobalEvent(Object.assign({},t,{type:Yt.ON_FORM_INTERACTION_NAVIGATE_PREVIOUS}))}})}listenForSubmissionFailedEvent(){ut.registerHandlers({[t.SEND_FORM_SUBMISSION_FAILED]:({formId:t,instanceId:e})=>{this.triggerGlobalEvent({type:Yt.ON_FORM_SUBMISSION_FAILED,instanceId:e,formId:t})}})}triggerGlobalEvent({type:t,instanceId:e,formId:s}){if(document&&void 0!==typeof window&&window&&window.CustomEvent){const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:{formId:s,instanceId:e}});document.dispatchEvent(i)}}}function zt(t,e){return new $t(t,e)}class Xt{constructor(){this.formDataMap=new Map}setFormInstanceInfo({instanceId:t,formInfo:e}){const s=this.formDataMap.get(t)||{};this.formDataMap.set(t,Object.assign({},s,e))}getRedirectUrl(t){var e;return(null===(e=this.formDataMap.get(t))||void 0===e?void 0:e.redirectUrl)||""}getConversionId(t){var e;return(null===(e=this.formDataMap.get(t))||void 0===e?void 0:e.conversionId)||""}}var Wt=Xt;class Qt{constructor(){this.pageUrl=window.location.href;this.pageTitle=window.document.title;this.pageId=null;this.referrer=window.document.referrer;this.isHubSpotCmsGeneratedPage=!1;this.pageId=this._getPageId();this.isHubSpotCmsGeneratedPage=this._getIsHubSpotCmsGeneratedPage()}_getPageId(){const{analytics_page_id:t,page_id:e}=window.hsVars||{};return t||e||null}_getIsHubSpotCmsGeneratedPage(){const t=window.document;return Boolean(t&&t.querySelector&&t.querySelector('meta[name="generator"][content="HubSpot"]'))}propsForContext(){return{pageUrl:this.pageUrl,pageTitle:this.pageTitle,referrer:this.referrer,pageId:this.pageId,isHubSpotCmsGeneratedPage:this.isHubSpotCmsGeneratedPage}}}var Kt=new Qt;class Jt extends L{constructor({environment:t,embededContainers:e}){super();this.handleView=t=>{this.viewedStore.markAsViewed(t);this.analyticsProxyController.flushViewQueue(t)};this.initialiseThirdPartyApi=t=>{this.thirdPartyApiController.init(t)};this.environment=t;this.embededContainers=e;this.viewedStore=Lt();this.embeddedFormsController=Vt({embeddedContainers:this.embededContainers,environment:this.environment,handleView:this.handleView,analyticsStore:this.analyticsStore});this.formData=new Wt;this.thirdPartyApiController=qt(this.formData);this.globalEventController=zt(this.formData,this.embededContainers)}init(){this.globalEventController.init({initialiseThirdPartyApi:this.initialiseThirdPartyApi});this.listenForSubmissionSuccessInfo();this.embededContainers.addElements(mt());this.listenForAddedEmbeddedContainers()}listenForAddedEmbeddedContainers(){ct((t=>{const e=mt(t);this.embededContainers.addElements(e)}))}listenForSubmissionSuccessInfo(){ut.registerHandlers({[t.SEND_FORM_SUBMISSION_SUCCESS_INFO]:({instanceId:t,redirectUrl:e,conversionId:s})=>{this.formData.setFormInstanceInfo({instanceId:t,formInfo:{redirectUrl:e,conversionId:s}})}})}}const Zt=new Jt({environment:Kt,embededContainers:new Ht});var te=Jt,ee={mode:"compressed",staticDomainPrefix:"//static.hsappstatic.net",bender:{depVersions:{"forms-embed-parent":"static-1.3764","hs-lodash":"static-4.40","hs-test-utils":"static-1.6237",HubStyleTokens:"static-2.9764","jasmine-runner":"static-1.4637",quartz:"static-1.4991",react:"static-7.147","web-interactives-embed-framework":"static-2.3758","hubspot-url-utils":"static-1.2711",outpost:"static-1.2516","bend-plugin-trellis-migration":"static-1.1987","foundations-components":"static-1.5360","framer-motion":"static-1.38","hs-test-utils-bend-plugin":"static-1.1348",msw:"static-1.39","react-dom":"static-7.85","react-redux":"static-7.16",redux:"static-4.16","testing-library":"static-1.118","foundations-theming":"static-1.2502",jasmine:"static-4.2621",enviro:"static-4.287",PortalIdParser:"static-2.266","quartz-core-utils":"static-1.1858",StyleGuideUI:"static-3.444",csstype:"static-1.38","quartz-core":"static-1.4210","bend-plugin-foundations-components":"static-1.1628","floating-ui":"static-1.26","foundations-assets":"static-1.3145","foundations-theming-specialty":"static-1.219","hs-story-utils":"static-1.7573",I18n:"static-7.1341","metrics-js":"static-1.8017",moment:"static-3.26","react-aria":"static-1.36","react-select-plus":"static-1.65","react-utils":"static-2.3879","react-virtualized":"static-2.71","styled-components":"static-2.40","tanstack-table":"static-1.23","ui-fonts":"static-1.329","ui-images":"static-2.784","hoist-non-react-statics":"static-3.9","bend-plugin-foundations-theming":"static-1.985","foundations-theming-base":"static-1.1487","copilot-toolkit":"static-1.4360",dispatcher:"static-1.108","general-store":"static-6.20",HeadJS:"static-2.541",history:"static-4.47","hs-promise-rejection-tracking":"static-1.3732","hub-http":"static-1.4502","hub-http-janus":"static-1.611","hub-http-shared-msw-handlers":"static-1.6403","hubspotter-http":"static-1.3087","hubspotter-http-shared-msw-handlers":"static-1.6401",icons:"static-2.589","mobile-manifest-mixins":"static-1.312","platform-navigation-bootstrap":"static-1.10476","quick-fetch":"static-1.2224",raven:"static-3.4160","raven-hubspot":"static-1.4467","react-rhumb":"static-1.14854","react-router-dom":"static-5.26",UIComponents:"static-3.6713","webpack-env":"static-1.54","i18n-data":"static-1.193","moment-timezone":"static-5.51","react-input-autosize":"static-2.17",classnames:"static-2.10","chatspot-client-types":"static-1.7774","chatspot-core":"static-1.13586","ts-schema":"static-1.2699",sassPrefix:"static-1.127","platform-infra-nav-components":"static-1.6217",cssUtils:"static-1.372","head-dlb":"static-1.3234",HubStyle:"static-2.10073"},depPathPrefixes:{"forms-embed-parent":"/forms-embed-parent/static-1.3764","hs-lodash":"/hs-lodash/static-4.40","hs-test-utils":"/hs-test-utils/static-1.6237",HubStyleTokens:"/HubStyleTokens/static-2.9764","jasmine-runner":"/jasmine-runner/static-1.4637",quartz:"/quartz/static-1.4991",react:"/react/static-7.147","web-interactives-embed-framework":"/web-interactives-embed-framework/static-2.3758","hubspot-url-utils":"/hubspot-url-utils/static-1.2711",outpost:"/outpost/static-1.2516","bend-plugin-trellis-migration":"/bend-plugin-trellis-migration/static-1.1987","foundations-components":"/foundations-components/static-1.5360","framer-motion":"/framer-motion/static-1.38","hs-test-utils-bend-plugin":"/hs-test-utils-bend-plugin/static-1.1348",msw:"/msw/static-1.39","react-dom":"/react-dom/static-7.85","react-redux":"/react-redux/static-7.16",redux:"/redux/static-4.16","testing-library":"/testing-library/static-1.118","foundations-theming":"/foundations-theming/static-1.2502",jasmine:"/jasmine/static-4.2621",enviro:"/enviro/static-4.287",PortalIdParser:"/PortalIdParser/static-2.266","quartz-core-utils":"/quartz-core-utils/static-1.1858",StyleGuideUI:"/StyleGuideUI/static-3.444",csstype:"/csstype/static-1.38","quartz-core":"/quartz-core/static-1.4210","bend-plugin-foundations-components":"/bend-plugin-foundations-components/static-1.1628","floating-ui":"/floating-ui/static-1.26","foundations-assets":"/foundations-assets/static-1.3145","foundations-theming-specialty":"/foundations-theming-specialty/static-1.219","hs-story-utils":"/hs-story-utils/static-1.7573",I18n:"/I18n/static-7.1341","metrics-js":"/metrics-js/static-1.8017",moment:"/moment/static-3.26","react-aria":"/react-aria/static-1.36","react-select-plus":"/react-select-plus/static-1.65","react-utils":"/react-utils/static-2.3879","react-virtualized":"/react-virtualized/static-2.71","styled-components":"/styled-components/static-2.40","tanstack-table":"/tanstack-table/static-1.23","ui-fonts":"/ui-fonts/static-1.329","ui-images":"/ui-images/static-2.784","hoist-non-react-statics":"/hoist-non-react-statics/static-3.9","bend-plugin-foundations-theming":"/bend-plugin-foundations-theming/static-1.985","foundations-theming-base":"/foundations-theming-base/static-1.1487","copilot-toolkit":"/copilot-toolkit/static-1.4360",dispatcher:"/dispatcher/static-1.108","general-store":"/general-store/static-6.20",HeadJS:"/HeadJS/static-2.541",history:"/history/static-4.47","hs-promise-rejection-tracking":"/hs-promise-rejection-tracking/static-1.3732","hub-http":"/hub-http/static-1.4502","hub-http-janus":"/hub-http-janus/static-1.611","hub-http-shared-msw-handlers":"/hub-http-shared-msw-handlers/static-1.6403","hubspotter-http":"/hubspotter-http/static-1.3087","hubspotter-http-shared-msw-handlers":"/hubspotter-http-shared-msw-handlers/static-1.6401",icons:"/icons/static-2.589","mobile-manifest-mixins":"/mobile-manifest-mixins/static-1.312","platform-navigation-bootstrap":"/platform-navigation-bootstrap/static-1.10476","quick-fetch":"/quick-fetch/static-1.2224",raven:"/raven/static-3.4160","raven-hubspot":"/raven-hubspot/static-1.4467","react-rhumb":"/react-rhumb/static-1.14854","react-router-dom":"/react-router-dom/static-5.26",UIComponents:"/UIComponents/static-3.6713","webpack-env":"/webpack-env/static-1.54","i18n-data":"/i18n-data/static-1.193","moment-timezone":"/moment-timezone/static-5.51","react-input-autosize":"/react-input-autosize/static-2.17",classnames:"/classnames/static-2.10","chatspot-client-types":"/chatspot-client-types/static-1.7774","chatspot-core":"/chatspot-core/static-1.13586","ts-schema":"/ts-schema/static-1.2699",sassPrefix:"/sassPrefix/static-1.127","platform-infra-nav-components":"/platform-infra-nav-components/static-1.6217",cssUtils:"/cssUtils/static-1.372","head-dlb":"/head-dlb/static-1.3234",HubStyle:"/HubStyle/static-2.10073"},project:"forms-embed-parent",staticDomain:"//static.hsappstatic.net",staticDomainPrefix:"//static.hsappstatic.net"}};const se=()=>window[Ut],ie=()=>"loading"===document.readyState,ne=()=>{window[Ut]={projectName:`${ee.bender.project}`,app:`${ee.bender.project}-${ee.bender.depVersions[ee.bender.project]}`,mountedAt:window.performance.now(),mountedBy:document.currentScript,instance:te,numAttemptedScriptInits:1}},ae=t=>{document.removeEventListener("DOMContentLoaded",(()=>ae(t)));t()};function re(t){const e=se();if(e){1===e.numAttemptedScriptInits&&document.currentScript&&console.warn(`The script ${document.currentScript.getAttribute("src")} only needs to be included once on the page`);e.numAttemptedScriptInits++}else{ne();ie()?document.addEventListener("DOMContentLoaded",(()=>ae(t))):t()}}re((()=>Zt.init()))}();