"use strict";(()=>{var re=Object.defineProperty,ie=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var Tt=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var At=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))se.call(t,n)&&At(e,n,t[n]);if(Tt)for(var n of Tt(t))ae.call(t,n)&&At(e,n,t[n]);return e},_=(e,t)=>ie(e,oe(t));var D="https://api.unifyintent.com/analytics/v1",U=30,j={clickTrackingSelectors:[],navatticProductDemos:{["Navattic Demo Completed"]:!0,["Navattic Demo Started"]:!0,["Navattic Demo Step Viewed"]:!0},defaultForms:{["Default Form Completed"]:!0,["Default Form Page Submitted"]:!0,["Default Meeting Booked"]:!0,["Default Scheduler Closed"]:!0,["Default Scheduler Displayed"]:!0}};var le=/^[A-Za-z0-9._+%-]+@[A-Za-z0-9.-]+[.][A-Za-z]+$/,pe=["identify","page"];function S(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&pe.every(t=>t in e)}function Q(e,t){var n;return((n=t==null?void 0:t.getTime())!=null?n:new Date().getTime())+e*60*1e3}var x=e=>({path:e!=null?e:window.location.pathname,query:fe(window.location.href),referrer:document.referrer,title:document.title,url:e!==void 0?de({location:window.location,pathname:e}):window.location.href});function de({location:e,pathname:t}){let n=new URL(e.href);return n.pathname=t,n.toString()}var Y=()=>({userAgent:window.navigator.userAgent,userAgentData:typeof navigator.userAgentData!="undefined"?navigator.userAgentData:void 0}),F=e=>{if(le.test(e))return e},fe=e=>{let t=new URL(e).searchParams,n={};for(let[r,i]of t.entries())n[r]=i;return n};function b(e){try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname}catch(t){return null}}function k(e){var t;return(t=e.split("@").at(1))!=null?t:null}var vt=()=>{var n,r,i,o,s;let e=new URL(location.href),t={source:(n=e.searchParams.get("utm_source"))!=null?n:void 0,medium:(r=e.searchParams.get("utm_medium"))!=null?r:void 0,campaign:(i=e.searchParams.get("utm_campaign"))!=null?i:void 0,term:(o=e.searchParams.get("utm_term"))!=null?o:void 0,content:(s=e.searchParams.get("utm_content"))!=null?s:void 0};return _(c({locale:navigator.language},Y()),{utm:t})};var tt=class{constructor(t){this.getBaseActivityPayload=()=>({type:this.getActivityType(),visitorId:this._intentContext.identityManager.getOrCreateVisitorId(),sessionId:this._intentContext.sessionManager.getOrCreateSession().sessionId,context:vt(),timestamp:new Date().toISOString()});this._intentContext=t}track(){this._intentContext.apiClient.post(this.getActivityURL(),this.getTrackPayload())}getTrackPayload(){return c(c({},this.getBaseActivityPayload()),this.getActivityData())}},w=tt;var me=`${D}/page`,v=class extends w{constructor(n,r){super(n);this.getActivityData=()=>{var n;return{type:"page",properties:x((n=this._options)==null?void 0:n.pathname)}};this._options=r}getActivityType(){return"page"}getActivityURL(){return me}};var Ee=`${D}/identify`,C=class extends w{constructor(n,{email:r,person:i,company:o}){super(n);this.getActivityData=()=>{var o;let n=this._company&&b((o=this._company)==null?void 0:o.domain),r=k(this._email),i=n&&n===r?this._company:void 0;return c({type:"identify",person:_(c({},this._person),{email:this._email})},i&&{company:this._company})};this._email=r,this._person=i,this._company=o}getActivityType(){return"identify"}getActivityURL(){return Ee}};var ge=`${D}/track`,d=class extends w{constructor(n,{name:r,properties:i}){super(n);this.getActivityData=()=>({type:"track",name:this._name,properties:c(c({},x()),this._properties)});this._name=r,this._properties=i}getActivityType(){return"track"}getActivityURL(){return ge}};var H,ye=new Uint8Array(16);function et(){if(!H&&(H=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!H))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return H(ye)}var f=[];for(let e=0;e<256;++e)f.push((e+256).toString(16).slice(1));function Ct(e,t=0){return f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]}var _e=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nt={randomUUID:_e};function he(e,t,n){if(nt.randomUUID&&!t&&!e)return nt.randomUUID();e=e||{};let r=e.random||(e.rng||et)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Ct(r)}var N=he;function G(e){for(var t=1;t{let t={};return e.forEach((n,r)=>t[n]=r),t})(B),ve=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,m=String.fromCharCode.bind(String),Ut=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Ce=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),xt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ie=e=>{let t,n,r,i,o="",s=e.length%3;for(let a=0;a255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=B[t>>18&63]+B[t>>12&63]+B[t>>6&63]+B[t&63]}return s?o.slice(0,s-3)+"===".substring(s):o},bt=typeof btoa=="function"?e=>btoa(e):L?e=>Buffer.from(e,"binary").toString("base64"):Ie,De=L?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,i=e.length;r{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?m(192|t>>>6)+m(128|t&63):m(224|t>>>12&15)+m(128|t>>>6&63)+m(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return m(240|t>>>18&7)+m(128|t>>>12&63)+m(128|t>>>6&63)+m(128|t&63)}},Se=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,xe=e=>e.replace(Se,Ue),St=L?e=>Buffer.from(e,"utf8").toString("base64"):Dt?e=>De(Dt.encode(e)):e=>bt(xe(e)),kt=(e,t=!1)=>t?Ce(St(e)):St(e);var be=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ke=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return m((n>>>10)+55296)+m((n&1023)+56320);case 3:return m((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return m((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},we=e=>e.replace(be,ke),Le=e=>{if(e=e.replace(/\s+/g,""),!ve.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,n="",r,i;for(let o=0;o>16&255):i===64?m(t>>16&255,t>>8&255):m(t>>16&255,t>>8&255,t&255);return n},wt=typeof atob=="function"?e=>atob(xt(e)):L?e=>Buffer.from(e,"base64").toString("binary"):Le,Oe=L?e=>Ut(Buffer.from(e,"base64")):e=>Ut(wt(e).split("").map(t=>t.charCodeAt(0)));var Pe=L?e=>Buffer.from(e,"base64").toString("utf8"):It?e=>It.decode(Oe(e)):e=>we(wt(e)),Me=e=>xt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Lt=e=>Pe(Me(e));var ot="test";function st(e){try{return JSON.parse(e)}catch(t){return e}}function at(e){return kt(JSON.stringify(e))}function Ot(e){return st(Lt(e))}function Pt(){try{return localStorage.setItem(ot,ot),localStorage.removeItem(ot),!0}catch(e){return!1}}function Mt(e){return(e!=null?e:window.location.hostname).split(".").slice(-2).join(".")}var ct=class{constructor(t){this.get=t=>{let n=this.retrieveValue(t);return n?st(n):this.legacyGet(t)};this.legacyGet=t=>{let n=this.retrieveValue(this.buildKey(t));return n?Ot(n):null};this.set=(t,n)=>{this.storeValue(t,typeof n=="string"?n:JSON.stringify(n)),this.legacySet(t,n)};this.legacySet=(t,n)=>{this.storeValue(this.buildKey(t),at(n))};this.buildKey=t=>at(`${this._writeKey}_${t}`);this._writeKey=t}},W=ct;var O=class extends W{retrieveValue(t){var r;let n=(r=it.get(t))!=null?r:null;return n&&this.storeValue(t,n),n}storeValue(t,n){it.set(t,n,{domain:`.${Mt()}`,expires:400})}};var z=class extends W{constructor(n){super(n);this.retrieveValue=n=>this._localStorageAvailable?localStorage.getItem(n):null;this.storeValue=(n,r)=>{this._localStorageAvailable&&localStorage.setItem(n,r)};this._localStorageAvailable=Pt()}};var Re="anonymousUserId",ut="unify_visitor_id",X=class{constructor(t){this.getOrCreateVisitorId=()=>{if(this._visitorId)return this._visitorId;let t=this.getVisitorId()||this.createVisitorId();return this._visitorId=t,t};this.getVisitorId=()=>{let t=this._storageService.get(ut);if(t)return t;let n=this._storageService.get(Re);return n&&this._storageService.set(ut,n),n};this.createVisitorId=()=>{let t=N();return this._storageService.set(ut,t),t};this._storageService=new O(t),this._visitorId=null}};var Fe={durationMinutes:U},Ne="clientSession",Rt="unify_session",Be="unify_session_id",q=class{constructor(t,n){this.getOrCreateSession=()=>this.getAndUpdateSession()||this.createSession();this.getAndUpdateSession=()=>{let t=this._currentSession||this.getStoredSession();if(!t)return;if(t.expiration>new Date().getTime())return this.updateSessionExpiration(t)};this.createSession=()=>{var n;let t=c({sessionId:N(),startTime:new Date,expiration:Q((n=this._options.durationMinutes)!=null?n:U),initial:x()},Y());return this._currentSession=t,this.setStoredSession(t),t};this.updateSessionExpiration=t=>{var r;let n=_(c({},t),{expiration:Q((r=this._options.durationMinutes)!=null?r:U)});return this._currentSession=n,this.setStoredSession(n),n};this.getStoredSession=()=>{let t=this._storageService.get(Rt);if(t)return t;let n=this._storageService.get(Ne);return n&&this.setStoredSession(n),n};this.setStoredSession=t=>{this._storageService.set(Rt,t),this._cookieStorageService.set(Be,t.sessionId)};this._writeKey=t,this._options=n!=null?n:Fe,this._storageService=new z(this._writeKey),this._cookieStorageService=new O(this._writeKey),this._currentSession=null}};var V=class{constructor(t){this.post=(t,n)=>{let r=JSON.stringify(n);if(fetch)fetch(t,{method:"POST",body:r,headers:{"Content-type":"application/json; charset=UTF-8","X-Write-Key":this._writeKey},keepalive:!0}).catch(()=>{});else{let i=new XMLHttpRequest;i.open("POST",t,!0),i.setRequestHeader("Content-type","application/json; charset=UTF-8"),i.setRequestHeader("X-Write-Key",this._writeKey),i.send(r)}};this._writeKey=t}};var Ft="1.9.0";var Ke="https://api.unifyintent.com/analytics/v1/_internal/logs";function g({message:e,error:t,attrs:n,apiClient:r}){console.debug(`%c[Unify]: %c${e}${t?`: ${t.message}`:""}${n?`, data: ${JSON.stringify(n)}`:""}`,"font-weight: bold;","");let i=n&&Object.entries(n).reduce((o,[s,a])=>_(c({},o),{[s]:typeof a=="string"?a:JSON.stringify(a)}),{});r==null||r.post(Ke,{status:"error",message:e,attrs:i,name:t==null?void 0:t.name,stack:t==null?void 0:t.stack,version:Ft})}var Nt="data-unify-track-clicks",Bt="unifyTrackClicks",Vt="data-unify-click-event-name",Kt="unifyClickEventName",jt="unifyLabel",Ye="unifyAttr",He="unifyEventProp",Yt=[Ye,He],Ht="unifyExclude",P="https://forms.default.com",Z="https://scheduler.default.com",Gt={["default.form_completed"]:P,["deafult.form_page_submitted"]:P,["default.form_page_submitted"]:P,["default.meeting_booked"]:Z,["default.scheduler_closed"]:P,["default.scheduler_displayed"]:Z},$t="https://capture.navattic.com",Wt=["default.form_completed","deafult.form_page_submitted","default.form_page_submitted"];function zt(e){return!(!(e instanceof HTMLElement)||Ge(e)||e.matches(":disabled")||e.getAttribute("aria-disabled")==="true"||e.classList.contains("disabled")||lt(e,Ht))}function Xt(e){let t=pt(e,jt);if(t)return t;let n=Zt(e);if(n)return J(n);let r=e.getAttribute("aria-label");if(r)return J(r);let i=$e(e);if(i)return J(i);let o=We(e);return o?J(o):null}function qt(e){if(!(e instanceof HTMLElement))return{};let t={};return Object.entries(e.dataset).forEach(([n,r])=>{Yt.forEach(i=>{if(n.startsWith(i)&&r){let o=n.slice(i.length);o&&(t[`${o.charAt(0).toLowerCase()}${o.slice(1)}`]=r)}})}),t}function Ge(e){if(!(e instanceof HTMLElement))return!1;if(e.hidden||e.getAttribute("aria-hidden")==="true")return!0;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}function J(e,t=80){if(!e)return null;let n=e.replace(/\s+/g," ").trim();return n?n.length>t?n.slice(0,t-1)+"...":n:null}function Zt(e){return e.innerText||e.textContent||""}function $e(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>{let r=document.getElementById(n);return r?Zt(r):null}).filter(n=>!!n).join(" "):null}function We(e){let t=e.querySelector("img[alt]");return(t==null?void 0:t.alt)||null}function lt(e,t){if(!(e instanceof HTMLElement))return!1;let{dataset:n}=e;return n[t]!==void 0}function pt(e,t){if(!(e instanceof HTMLElement))return null;let{dataset:n}=e;return n[t]!==void 0?String(n[t]):null}function Jt(e,t){var n,r,i,o,s;try{let a=(n=e.properties)!=null?n:[],u=y("email","END_USER",a);if(!u)return;let l=y("fullName","END_USER",a),E=l?l.split(" ")[0]:y("firstName","END_USER",a),A=l?l.split(" ")[1]:y("lastName","END_USER",a),h=y("phone","END_USER",a),p=c(c(c({email:u},E&&{first_name:E}),A&&{last_name:A}),h&&{mobile_phone:h}),T=y("domain","COMPANY_ACCOUNT",a),R=T?b(T):null,K;if(R&&R===k(u)){let ft=(r=y("name","COMPANY_ACCOUNT",a))!=null?r:void 0,mt=(i=y("description","COMPANY_ACCOUNT",a))!=null?i:void 0,Et=(o=y("linkedin","COMPANY_ACCOUNT",a))!=null?o:void 0,gt=y("industry","COMPANY_ACCOUNT",a),yt=y("foundedYear","COMPANY_ACCOUNT",a),_t=(s=y("employeeCount","COMPANY_ACCOUNT",a))!=null?s:void 0,ht=isNaN(Number(_t))?void 0:Number(_t);K=c(c(c(c(c(c({domain:R},ft&&{name:ft}),mt&&{description:mt}),Et&&{linkedin_url:Et}),gt&&{industry:gt}),yt&&{founded:yt}),ht&&{employee_count:ht})}return c({person:p},K&&{company:K})}catch(a){g({message:`Error occurred while parsing attributes from Navattic event payload: ${a}`,error:a,apiClient:t});return}}function y(e,t,n){var r,i;return(i=(r=n.find(({object:o,name:s})=>o===t&&s===e))==null?void 0:r.value)!=null?i:null}function Qt({data:e,autoTrackOptions:t,intentContext:n}){var s,a,u,l;if(!t.navatticProductDemos)return;let{["Navattic Demo Started"]:r,["Navattic Demo Step Viewed"]:i,["Navattic Demo Completed"]:o}=t.navatticProductDemos===!0?{["Navattic Demo Started"]:!0,["Navattic Demo Step Viewed"]:!0,["Navattic Demo Completed"]:!0}:t.navatticProductDemos;switch(e.type){case"START_FLOW":{if(!r)return;new d(n,{name:"Navattic Demo Started",properties:{demo:(s=e.flow)==null?void 0:s.name,wasAutoTracked:!0}}).track();return}case"VIEW_STEP":{if(!i)return;new d(n,{name:"Navattic Demo Step Viewed",properties:{demo:(a=e.flow)==null?void 0:a.name,step:(u=e.step)==null?void 0:u.name,wasAutoTracked:!0}}).track();return}case"COMPLETE_FLOW":{if(!o)return;new d(n,{name:"Navattic Demo Completed",properties:{demo:(l=e.flow)==null?void 0:l.name,wasAutoTracked:!0}}).track();return}}}function dt(e){return typeof e!="string"&&Wt.includes(e.event)}function te(e,t){if(dt(e))try{let{email:n,attributes:r}=e.payload;if(!n)return;let i=c({email:n},r&&c(c(c(c({},r.first_name&&{first_name:r.first_name}),r.last_name&&{last_name:r.last_name}),r.phone&&{mobile_phone:r.phone}),r.title&&{title:r.title})),o=r!=null&&r.website?b(r.website):null,s;if(o&&o===k(n)){let a=r&&!isNaN(Number(r.head_count))?Number(r.head_count):void 0;s=c({domain:o},r&&c(c(c({},r.company&&{name:r.company}),r.industry_group&&{industry:r.industry_group}),a&&{employee_count:a}))}return c({person:i},s&&{company:s})}catch(n){g({message:`Error occurred while parsing attributes from Default event payload: ${n}`,error:n,apiClient:t});return}}function ee({data:e,autoTrackOptions:t,intentContext:n}){var u,l,E,A;if(!t.defaultForms||typeof e=="string")return null;let{["Default Form Completed"]:r,["Default Form Page Submitted"]:i,["Default Meeting Booked"]:o,["Default Scheduler Closed"]:s,["Default Scheduler Displayed"]:a}=t.defaultForms===!0?{["Default Form Completed"]:!0,["Default Form Page Submitted"]:!0,["Default Meeting Booked"]:!0,["Default Scheduler Closed"]:!0,["Default Scheduler Displayed"]:!0}:t.defaultForms;switch(e.event){case"default.form_completed":return r?(new d(n,{name:"Default Form Completed",properties:{form:e.payload.formName,formId:(u=e.payload.formId)==null?void 0:u.toString(),wasAutoTracked:!0}}).track(),"Default Form Completed"):null;case"deafult.form_page_submitted":case"default.form_page_submitted":return i?(new d(n,{name:"Default Form Page Submitted",properties:{form:e.payload.formName,formId:(l=e.payload.formId)==null?void 0:l.toString(),pageNumber:(E=e.payload.pageNumber)==null?void 0:E.toString(),wasAutoTracked:!0}}).track(),"Default Form Page Submitted"):null;case"default.meeting_booked":{if(!o)return null;let{memberName:h,memberEmail:p,durationInMinutes:T,startDateTime:R}=e.payload;return new d(n,{name:"Default Meeting Booked",properties:{memberName:h,memberEmail:p,durationInMinutes:T==null?void 0:T.toString(),startDateTime:R,wasAutoTracked:!0}}).track(),"Default Meeting Booked"}case"default.scheduler_closed":return s?(new d(n,{name:"Default Scheduler Closed",properties:{wasAutoTracked:!0}}).track(),"Default Scheduler Closed"):null;case"default.scheduler_displayed":return a?(new d(n,{name:"Default Scheduler Displayed",properties:{formId:(A=e.payload.formId)==null?void 0:A.toString(),wasAutoTracked:!0}}).track(),"Default Scheduler Displayed"):null}return null}var I=class{constructor(t){this._monitoredInputs=new Set;this._submittedEmails=new Set;this._historyMonitored=!1;this._isTrackingClicks=!1;this._isSubscribedToThirdPartyMessages=!1;this._justTrackedDefaultEventType=null;this.unmount=()=>{this.stopAutoIdentify(),this.stopAutoPage(),this.stopAutoTrack(),this.unsubscribeFromThirdPartyMessages()};this.startAutoPage=()=>{this._historyMonitored||this.monitorHistory(),this._autoPage=!0};this.stopAutoPage=()=>{this._historyMonitored&&window.removeEventListener("popstate",this.maybeTrackPage),this._autoPage=!1};this.startAutoIdentify=()=>{this._autoIdentify=!0,this.refreshMonitoredInputs(),setInterval(this.refreshMonitoredInputs,2e3)};this.stopAutoIdentify=()=>{this._monitoredInputs.forEach(t=>{t.isConnected&&(t.removeEventListener("blur",this.handleInputBlur),t.removeEventListener("keydown",this.handleInputKeydown))}),this._monitoredInputs.clear(),this._autoIdentify=!1};this.startAutoTrack=t=>{t&&(this._autoTrackOptions=t),this.startTrackingClicks()};this.stopAutoTrack=()=>{this.stopTrackingClicks()};this.monitorHistory=()=>{try{let t=history.pushState;history.pushState=(...r)=>{t.apply(history,r),this.maybeTrackPage()};let n=history.replaceState;history.replaceState=(...r)=>{n.apply(history,r),this.maybeTrackPage()},window.addEventListener("popstate",this.maybeTrackPage),this._historyMonitored=!0}catch(t){this.logError("Error occurred in monitorHistory",t)}};this.maybeTrackPage=()=>{if(this._autoPage)try{(!this._lastLocation||qe(this._lastLocation,window.location))&&(new v(this._intentContext).track(),this._lastLocation=c({},window.location))}catch(t){this.logError("Error occurred in maybeTrackPage",t)}};this.startTrackingClicks=()=>{this._isTrackingClicks||(document.addEventListener("click",this.handleDocumentClick),this._isTrackingClicks=!0)};this.stopTrackingClicks=()=>{this._isTrackingClicks&&(document.removeEventListener("click",this.handleDocumentClick),this._isTrackingClicks=!1)};this.handleDocumentClick=t=>{var n;try{let r=t.target;if(!r||typeof r.closest!="function")return;let i=`[${Nt}]`,o=`[${Vt}]`,s=(n=this._autoTrackOptions.clickTrackingSelectors)!=null?n:[],a=[i,o,...s.map(p=>typeof p=="string"?p:p.selector)],u=r.closest(a.join(", "));if(!u||!(u instanceof HTMLElement)||!zt(u))return;let l=lt(u,Bt)?"Element Clicked":null,E=pt(u,Kt),A=s.map(p=>{var T;return typeof p=="string"?l||E?null:u.matches(p)?"Element Clicked":null:u.matches(p.selector)?(l||E)&&!p.eventName?null:(T=p.eventName)!=null?T:"Element Clicked":null});[E,...A].filter(p=>!!p).forEach(p=>{this.maybeTrackClick({element:u,eventName:p})}),l&&this.maybeTrackClick({element:u,eventName:l,isLegacy:!0})}catch(r){this.logError("Error occurred in handleDocumentClick",r)}};this.refreshMonitoredInputs=()=>{if(this._autoIdentify)try{this._monitoredInputs.forEach(n=>{n.isConnected||this._monitoredInputs.delete(n)}),Array.from(document.getElementsByTagName("input")).filter(n=>!this._monitoredInputs.has(n)&&Ze(n)).forEach(n=>{n.addEventListener("blur",this.handleInputBlur),n.addEventListener("keydown",this.handleInputKeydown),this._monitoredInputs.add(n)})}catch(t){this.logError("Error occurred in refreshMonitoredInputs",t)}};this.subscribeToThirdPartyMessages=()=>{this._isSubscribedToThirdPartyMessages||window.addEventListener("message",this.handleThirdPartyMessage),this._isSubscribedToThirdPartyMessages=!0};this.unsubscribeFromThirdPartyMessages=()=>{this._isSubscribedToThirdPartyMessages&&window.removeEventListener("message",this.handleThirdPartyMessage),this._isSubscribedToThirdPartyMessages=!1};this.handleThirdPartyMessage=t=>{let n;try{switch(t.origin){case P:case Z:{n="Default",this.handleDefaultFormMessage(t);break}case $t:{n="Navattic",this.handleNavatticDemoMessage(t);break}}}catch(r){this.logError(`Error occurred in handleThirdPartyMessage for third-party ${n}`,r)}};this.handleDefaultFormMessage=t=>{try{if(typeof t.data=="string"||t.origin!==Gt[t.data.event])return;if(this._autoIdentify&&dt(t.data)){let n=t.data.payload.email;n&&this.maybeIdentifyInputEmail(n,te(t.data,this._intentContext.apiClient))}if(this._autoTrackOptions.defaultForms){if(t.data.event===this._justTrackedDefaultEventType)return;ee({data:t.data,autoTrackOptions:this._autoTrackOptions,intentContext:this._intentContext})&&(this._justTrackedDefaultEventType=t.data.event,setTimeout(()=>{this._justTrackedDefaultEventType=null},500))}}catch(n){this.logError("Error occurred in handleDefaultFormMessage",n)}};this.handleNavatticDemoMessage=t=>{var n,r;try{if(this._autoIdentify){let o=((r=(n=t.data)==null?void 0:n.properties)!=null?r:[]).find(({object:s,name:a})=>s==="END_USER"&&a==="email");o!=null&&o.value&&this.maybeIdentifyInputEmail(o.value,Jt(t.data,this._intentContext.apiClient))}this._autoTrackOptions.navatticProductDemos&&Qt({data:t.data,autoTrackOptions:this._autoTrackOptions,intentContext:this._intentContext})}catch(i){this.logError("Error occurred in handleNavatticDemoMessage",i)}};this.handleInputBlur=t=>{if(this._autoIdentify)try{t.target instanceof HTMLInputElement&&this.maybeIdentifyInputEmail(t.target.value)}catch(n){this.logError("Error occurred in handleInputBlur",n)}};this.handleInputKeydown=t=>{if(this._autoIdentify)try{t.key==="Enter"&&t.target instanceof HTMLInputElement&&this.maybeIdentifyInputEmail(t.target.value)}catch(n){this.logError("Error occurred in handleInputKeyDown",n)}};this.maybeIdentifyInputEmail=(t,n)=>{if(this._autoIdentify)try{if(t){if(!F(t)||this._submittedEmails.has(t))return;new C(this._intentContext,{email:t,person:n==null?void 0:n.person,company:n==null?void 0:n.company}).track(),this._submittedEmails.add(t)}}catch(r){this.logError("Error occurred in maybeIdentifyInputEmail",r)}};this.maybeTrackClick=({element:t,eventName:n,isLegacy:r=!1})=>{try{let i=Xt(t);if(!i)return;let o=qt(t);new d(this._intentContext,{name:n,properties:_(c(_(c({},o),{label:i}),r&&{elementName:i}),{wasAutoTracked:!0})}).track()}catch(i){this.logError("Error occurred in maybeTrackClick",i)}};this.logError=(t,n)=>{g({message:`UnifyIntentAgent: ${t}`,error:n,apiClient:this._intentContext.apiClient})};this.__getMonitoredInputs=()=>this._monitoredInputs;this.__getSubmittedEmails=()=>this._submittedEmails;var n,r;this._intentContext=t,this._autoPage=(n=t.clientConfig.autoPage)!=null?n:!1,this._autoIdentify=(r=t.clientConfig.autoIdentify)!=null?r:!1,this._autoTrackOptions=c({},t.clientConfig.autoTrackOptions),this._autoPage&&(this.startAutoPage(),this.maybeTrackPage()),this._autoIdentify&&this.startAutoIdentify(),this.startAutoTrack(),this.subscribeToThirdPartyMessages()}};function qe(e,t){return e.hostname!==t.hostname||e.pathname!==t.pathname}function Ze(e){return e.type==="email"||e.type==="text"}var Je={autoPage:!1,autoIdentify:!1,sessionDurationMinutes:U,autoTrackOptions:j};function ne(){return{identify:[],page:[],track:[]}}var M=class{constructor(t,n=Je){this._mounted=!1;this._eventBuffers=ne();this.isMounted=()=>this._mounted;this.mount=()=>{if(typeof window!="undefined")try{if(S(window.unify)||S(window.unifyBrowser)){g({message:"UnifyIntentClient already exists on window, a new one will not be created."});return}let t=new V(this._writeKey),n=new q(this._writeKey,{durationMinutes:this._config.sessionDurationMinutes});n.getOrCreateSession();let r=new X(this._writeKey);r.getOrCreateVisitorId(),this._context={writeKey:this._writeKey,clientConfig:this._config,apiClient:t,sessionManager:n,identityManager:r},this._intentAgent=new I(this._context),this._mounted=!0,Qe(this,t),this._eventBuffers.identify.forEach(i=>this.identify(...i)),this._eventBuffers.page.forEach(i=>this.page(...i)),this._eventBuffers.track.forEach(i=>this.track(...i)),this._eventBuffers=ne(),window.unify=this,window.unifyBrowser=this}catch(t){this.logError("Error occurred in mount",t)}};this.unmount=()=>{var t;if(typeof window!="undefined")try{this._config.autoPage&&this.stopAutoPage(),this._config.autoIdentify&&this.stopAutoIdentify(),this.stopAutoTrack(),(t=this._intentAgent)==null||t.unmount(),this._mounted=!1,window.unify=void 0,window.unifyBrowser=void 0}catch(n){this.logError("Error occurred in unmount",n)}};this.page=t=>{if(!this._mounted){this._eventBuffers.page.push([t]);return}try{new v(this._context,t).track()}catch(n){this.logError("Error occurred in page",n)}};this.getPagePayload=t=>{if(this._mounted)try{return new v(this._context,t).getTrackPayload()}catch(n){this.logError("Error occurred in getPagePayload",n)}};this.identify=(t,n)=>{try{let r=F(t);if(r)return this._mounted?(new C(this._context,{email:r,person:n==null?void 0:n.person,company:n==null?void 0:n.company}).track(),!0):(this._eventBuffers.identify.push([t,n]),!0)}catch(r){this.logError("Error occurred in identify",r)}return!1};this.getIdentifyPayload=(t,n)=>{if(!this._mounted)return!1;try{let r=F(t);if(r)return new C(this._context,{email:r,person:n==null?void 0:n.person,company:n==null?void 0:n.company}).getTrackPayload()}catch(r){this.logError("Error occurred in getIdentifyPayload",r)}};this.track=(t,n)=>{if(!this._mounted){this._eventBuffers.track.push([t,n]);return}try{new d(this._context,{name:t,properties:n}).track()}catch(r){this.logError("Error occurred in track",r)}};this.getTrackPayload=(t,n)=>{if(this._mounted)try{return new d(this._context,{name:t,properties:n}).getTrackPayload()}catch(r){this.logError("Error occurred in getTrackPayload",r)}};this.startAutoPage=()=>{if(this._mounted)try{this._intentAgent||(this._intentAgent=new I(this._context)),this._intentAgent.startAutoPage()}catch(t){this.logError("Error occurred in startAutoPage",t)}};this.stopAutoPage=()=>{var t;if(this._mounted)try{(t=this._intentAgent)==null||t.stopAutoPage()}catch(n){this.logError("Error occurred in stopAutoPage",n)}};this.startAutoIdentify=()=>{if(this._mounted)try{this._intentAgent||(this._intentAgent=new I(this._context)),this._intentAgent.startAutoIdentify()}catch(t){this.logError("Error occurred in startAutoIdentify",t)}};this.stopAutoIdentify=()=>{var t;if(this._mounted)try{(t=this._intentAgent)==null||t.stopAutoIdentify()}catch(n){this.logError("Error occurred in stopAutoIdentify",n)}};this.startAutoTrack=t=>{if(this._mounted)try{t&&(this._config.autoTrackOptions=t),this._intentAgent||(this._intentAgent=new I(this._context)),this._intentAgent.startAutoTrack(t)}catch(n){this.logError("Error occurred in startAutoTrack",n)}};this.stopAutoTrack=()=>{var t;if(this._mounted)try{(t=this._intentAgent)==null||t.stopAutoTrack()}catch(n){this.logError("Error occurred in stopAutoTrack",n)}};this.logError=(t,n)=>{g({message:`UnifyIntentClient: ${t}`,error:n,apiClient:this._context.apiClient})};this.__getEventBuffers=()=>this._eventBuffers;this._writeKey=t,this._config=n}};function Qe(e,t){(Array.isArray(window.unify)?[...window.unify]:Array.isArray(window.unifyBrowser)?[...window.unifyBrowser]:[]).forEach(([r,i])=>{if(typeof e[r]=="function")try{Array.isArray(i)?e[r].call(e,...i):e[r].call(e)}catch(o){g({message:`Error occurred while flushing queue: ${o==null?void 0:o.message}`,error:o,apiClient:t})}})}var tn=function(){var n;if(typeof window=="undefined")return;if(S(window.unify)||S(window.unifyBrowser)){g({message:"UnifyIntentClient already exists on window, a new one will not be created."});return}let e=document.getElementById("unifytag"),t=(n=e==null?void 0:e.getAttribute("data-write-key"))!=null?n:e==null?void 0:e.getAttribute("data-api-key");t&&new M(t,{autoPage:!0,autoIdentify:!0,autoTrackOptions:j}).mount()};tn();})(); /*! Bundled license information: js-cookie/dist/js.cookie.mjs: (*! js-cookie v3.0.5 | MIT *) */