PageSourceSearch

https://growtherapy.com/wp-content/themes/growtherapy/dist/js/grow…apy-analytics-js-77TXBUXZ.js?ver=1790184141

js growtherapy.com collected 2026-09-24 10:24:48 UTC 86,473 bytes, 11 lines download raw bytes

1import{b as Rt}from"./chunks/chunk-JS3OBKQ4.js";import{a as Kt}from"./chunks/chunk-7OQMFQS7.js";import{a as Re,b as Pe,c as Pt,d as Le,e as oe,f as Lt,h as $,i as ue,j as Ut,k as Gt,l as le}from"./chunks/chunk-PCWQNL22.js";import{c as Nt,d as Dt,e as Ot,f as zt,g as Oe,i as Fe}from"./chunks/chunk-6JBAAP37.js";import{a as Ze,b as xe,c as Me,d as et,e as Ne,f as ae,g as se,h as De,i as xt,j as Mt,k as D,m as Ft,n as Bt}from"./chunks/chunk-MKWYXAN4.js";import{a as N,b as d,c as ke,d as m,e as g,f as P}from"./chunks/chunk-7UZTM5L4.js";import{a as z,b as Ae,c as Z,d as At,e as U}from"./chunks/chunk-LGCB6OBJ.js";import{c as It,d as Te,e as ie,f as kt,g as X,h as Ie}from"./chunks/chunk-E6G3D5ZT.js";import"./chunks/chunk-URGT6V7R.js";var pe=class{constructor(){let e=window.analyticsConfig||{};this.environment=e.environment||"development",this.isInitialized=!1,this.init()}init(){if(!this.isInitialized){if(!this.environment){console.warn("Datadog RUM: No environment configuration found");return}this.loadDatadogScript()}}loadDatadogScript(){(function(e,t,r,i,o){e=e[o]=e[o]||{q:[],onReady(a){e.q.push(a)}},o=t.createElement(r),o.async=1,o.src=i,i=t.getElementsByTagName(r)[0],i.parentNode.insertBefore(o,i)})(window,document,"script","https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js","DD_RUM"),window.DD_RUM.onReady(()=>{this.initializeRUM()})}initializeRUM(){try{window.DD_RUM.init({clientToken:"pubd775724ee6e02ad68aa80be625b421d5",applicationId:"46167f11-e6da-49e6-b22f-cb9fb02127e2",site:"datadoghq.com",service:"grow",env:this.environment,sessionSampleRate:1,sessionReplaySampleRate:0,trackUserInteractions:!0,trackResources:!0,trackLongTasks:!0,defaultPrivacyLevel:"mask-user-input"}),this.isInitialized=!0,console.log(`Datadog RUM initialized for environment: ${this.environment}`)}catch(e){console.error("Failed to initialize Datadog RUM:",e)}}};var ve=class{constructor(){let e=window.analyticsConfig||{};this.config=e.freshpaint||{},this.apiKey=this.config.apiKey,!(Ie()||!this.apiKey)&&this.initialize()}initialize(){try{this.loadFreshpaintScript(),this.initFreshpaint()}catch(e){console.error("Failed to initialize Freshpaint:",e)}}initFreshpaint(){try{window.freshpaint&&window.freshpaint.init?(window.freshpaint.init(this.apiKey),window.freshpaint.page()):console.warn("Freshpaint not loaded properly")}catch(e){console.error("Failed to initialize Freshpaint:",e)}}loadFreshpaintScript(){window.freshpaint&&window.freshpaint.__SV||(function(e,t){if(!t.__SV){let u=window;try{var r,i,o,a=u.location,s=a.hash;r=function(f,v){return(i=f.match(RegExp(v+"=([^&]*)")))?i[1]:null},s&&r(s,"fpState")&&(o=JSON.parse(decodeURIComponent(r(s,"fpState"))),o.action==="fpeditor"&&(u.sessionStorage.setItem("_fpcehash",s),history.replaceState(o.desiredHash||"",e.title,a.pathname+a.search)))}catch{}let l,c;window.freshpaint=t,t._i=[],t.init=function(f,v,h){function p(C,y){let E=y.split(".");E.length==2&&(C=C[E[0]],y=E[1]),C[y]=function(){C.push([y].concat(Array.prototype.slice.call(arguments,0)))}}let w=t;for(typeof h<"u"?w=t[h]=[]:h="freshpaint",w.people=w.people||[],w.toString=function(C){let y="freshpaint";return h!=="freshpaint"&&(y+="."+h),C||(y+=" (stub)"),y},w.people.toString=function(){return w.toString(1)+".people (stub)"},l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove people group page alias ready addEventProperties addInitialEventProperties removeEventProperty addPageviewProperties".split(" "),c=0;c<l.length;c++)p(w,l[c]);let I="set set_once union unset remove delete".split(" ");w.get_group=function(){function C(A){y[A]=function(){call2_args=arguments,call2=[A].concat(Array.prototype.slice.call(call2_args,0)),w.push([E,call2])}}for(var y={},E=["get_group"].concat(Array.prototype.slice.call(arguments,0)),k=0;k<I.length;k++)C(I[k]);return y},t._i.push([f,v,h])},t.__SV=1.4,u=e.createElement("script"),u.type="text/javascript",u.async=!0,u.src=typeof FRESHPAINT_CUSTOM_LIB_URL<"u"?FRESHPAINT_CUSTOM_LIB_URL:"https://perfalytics.com/static/js/freshpaint.js",(r=e.getElementsByTagName("script")[0])?r.parentNode.insertBefore(u,r):e.head.appendChild(u)}})(document,window.freshpaint||[])}};var me=class{constructor(){this.initialize()}initialize(){try{this.loadGTMScript(),this.loadGTMNoscript()}catch(e){console.error("Failed to initialize Google Tag Manager:",e)}}loadGTMScript(){if(window.dataLayer)return;let e=document.createElement("script");e.textContent=`
vendor: 327 bytes, lines 1-5
1(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
2new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
3j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
4'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
5})(window,document,'script','dataLayer','
5GTM-WZ7DTVH
vendor: 3 bytes, line 5
5');
5`,document.head.appendChild(e)}loadGTMNoscript(){if(document.getElementById("gtm-noscript-fallback"))return;let e=document.createElement("noscript");e.id="gtm-noscript-fallback";let t=document.createElement("iframe");t.src="https://www.googletagmanager.com/ns.html?id=GTM-WZ7DTVH",t.height="0",t.width="0",t.style.cssText="display:none;visibility:hidden",e.appendChild(t),document.body.insertBefore(e,document.body.firstChild)}};var ge=class{constructor(){this.triggerElements=document.querySelectorAll("[data-intercom-trigger]"),this.triggerElements.length!==0&&(this.initialized=!1,this.maxWaitMs=1e4,this.pollIntervalMs=500,this.initialize())}initialize(){if(!this.initialized){if(window.Intercom){this.attachKeydownListeners(),this.initialized=!0;return}this.waitForIntercom()}}waitForIntercom(){let e=Date.now(),t=()=>{if(!this.initialized){if(window.Intercom){this.attachKeydownListeners(),this.initialized=!0;return}Date.now()-e<this.maxWaitMs&&setTimeout(t,this.pollIntervalMs)}};setTimeout(t,this.pollIntervalMs)}attachKeydownListeners(){this.triggerElements.forEach(e=>{e.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),window.Intercom("showNewMessage"))})})}};var Vt=function(n,e){return Object.keys(n).filter(function(t){return e(t,n[t])}).reduce(function(t,r){return t[r]=n[r],t},{})};var Q=(function(n){N(e,n);function e(t,r){var i=n.call(this,"".concat(t," ").concat(r))||this;return i.field=t,i}return e})(Error);var tt="is not a string",rt="is not an object",Nr="is nil";function Dr(n){if(!At(n))throw new Q("Event",Nr);if(typeof n!="object")throw new Q("Event",rt)}function Or(n){if(!z(n.type))throw new Q(".type",tt)}function Fr(n){if(!z(n.event))throw new Q(".event",tt)}function Ur(n){if(!U(n.properties))throw new Q(".properties",rt)}function Br(n){if(!U(n.traits))throw new Q(".traits",rt)}function Kr(n){if(!z(n.messageId))throw new Q(".messageId",tt)}function Ht(n){Dr(n),Or(n),Kr(n),n.type==="track"&&(Fr(n),Ur(n)),["group","identify"].includes(n.type)&&Br(n)}var zr=(function(){function n(e){var t,r;this.settings=e,this.createMessageId=e.createMessageId,this.onEventMethodCall=(t=e.onEventMethodCall)!==null&&t!==void 0?t:(function(){}),this.onFinishedEvent=(r=e.onFinishedEvent)!==null&&r!==void 0?r:(function(){})}return n})(),Wt=(function(){function n(e){this.settings=new zr(e)}return n.prototype.track=function(e,t,r,i){return this.settings.onEventMethodCall({type:"track",options:r}),this.normalize(d(d({},this.baseEvent()),{event:e,type:"track",properties:t??{},options:d({},r),integrations:d({},i)}))},n.prototype.page=function(e,t,r,i,o){var a;this.settings.onEventMethodCall({type:"page",options:i});var s={type:"page",properties:d({},r),options:d({},i),integrations:d({},o)};return e!==null&&(s.category=e,s.properties=(a=s.properties)!==null&&a!==void 0?a:{},s.properties.category=e),t!==null&&(s.name=t),this.normalize(d(d({},this.baseEvent()),s))},n.prototype.screen=function(e,t,r,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var a={type:"screen",properties:d({},r),options:d({},i),integrations:d({},o)};return e!==null&&(a.category=e),t!==null&&(a.name=t),this.normalize(d(d({},this.baseEvent()),a))},n.prototype.identify=function(e,t,r,i){return this.settings.onEventMethodCall({type:"identify",options:r}),this.normalize(d(d({},this.baseEvent()),{type:"identify",userId:e,traits:t??{},options:d({},r),integrations:i}))},n.prototype.group=function(e,t,r,i){return this.settings.onEventMethodCall({type:"group",options:r}),this.normalize(d(d({},this.baseEvent()),{type:"group",traits:t??{},options:d({},r),integrations:d({},i),groupId:e}))},n.prototype.alias=function(e,t,r,i){this.settings.onEventMethodCall({type:"alias",options:r});var o={userId:e,type:"alias",options:d({},r),integrations:d({},i)};return t!==null&&(o.previousId=t),e===void 0?this.normalize(d(d({},o),this.baseEvent())):this.normalize(d(d({},this.baseEvent()),o))},n.prototype.baseEvent=function(){return{integrations:{},options:{}}},n.prototype.context=function(e){var t,r=["userId","anonymousId","timestamp","messageId"];delete e.integrations;var i=Object.keys(e),o=(t=e.context)!==null&&t!==void 0?t:{},a={};
vendor: 20,529 bytes, line 5
5return i.forEach(function(s){s!=="context"&&(r.includes(s)?Ze(a,s,e[s]):Ze(o,s,e[s]))}),[o,a]},n.prototype.normalize=function(e){var t,r,i=Object.keys((t=e.integrations)!==null&&t!==void 0?t:{}).reduce(function(v,h){var p,w;return d(d({},v),(p={},p[h]=!!(!((w=e.integrations)===null||w===void 0)&&w[h]),p))},{});e.options=Vt(e.options||{},function(v,h){return h!==void 0});var o=d(d({},i),(r=e.options)===null||r===void 0?void 0:r.integrations),a=e.options?this.context(e.options):[],s=a[0],u=a[1],l=e.options,c=ke(e,["options"]),f=d(d(d(d({timestamp:new Date},c),{context:s,integrations:o}),u),{messageId:l.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(f),Ht(f),f},n})();function $t(n,e){var t={};return n.forEach(function(r){var i,o=void 0;if(typeof e=="string"){var a=r[e];o=typeof a!="string"?JSON.stringify(a):a}else e instanceof Function&&(o=e(r));o!==void 0&&(t[o]=P(P([],(i=t[o])!==null&&i!==void 0?i:[],!0),[r],!1))}),t}var jt=function(n){return typeof n=="object"&&n!==null&&"then"in n&&typeof n.then=="function"};var qt=function(){var n,e,t=0;return{done:function(){return n},run:function(r){var i=r();return jt(i)&&(++t===1&&(n=new Promise(function(o){return e=o})),i.finally(function(){return--t===0&&e()})),i}}};var Qt=(function(n){N(e,n);function e(t){var r=n.call(this)||this;return r.criticalTasks=qt(),r.plugins=[],r.failedInitializations=[],r.flushing=!1,r.queue=t,r.queue.on(Pt,function(){r.scheduleFlush(0)}),r}return e.prototype.register=function(t,r,i){return m(this,void 0,void 0,function(){var o,a,s=this;return g(this,function(u){switch(u.label){case 0:return this.plugins.push(r),o=function(l){s.failedInitializations.push(r.name),s.emit("initialization_failure",r),console.warn(r.name,l),t.log("warn","Failed to load destination",{plugin:r.name,error:l}),s.plugins=s.plugins.filter(function(c){return c!==r})},r.type==="destination"&&r.name!=="Segment.io"?(r.load(t,i).catch(o),[3,4]):[3,1];case 1:return u.trys.push([1,3,,4]),[4,r.load(t,i)];case 2:return u.sent(),[3,4];case 3:return a=u.sent(),o(a),[3,4];case 4:return[2]}})})},e.prototype.deregister=function(t,r,i){return m(this,void 0,void 0,function(){var o;return g(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r.unload?[4,Promise.resolve(r.unload(t,i))]:[3,2];case 1:a.sent(),a.label=2;case 2:return this.plugins=this.plugins.filter(function(s){return s.name!==r.name}),[3,4];case 3:return o=a.sent(),t.log("warn","Failed to unload destination",{plugin:r.name,error:o}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return m(this,void 0,void 0,function(){var r;return g(this,function(i){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),r=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,r]})})},e.prototype.subscribeToDelivery=function(t){return m(this,void 0,void 0,function(){var r=this;return g(this,function(i){return[2,new Promise(function(o){var a=function(s,u){s.isSame(t)&&(r.off("flush",a),o(s))};r.on("flush",a)})]})})},e.prototype.dispatchSingle=function(t){return m(this,void 0,void 0,function(){var r=this;return g(this,function(i){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(o){var a=r.enqueuRetry(o,t);return a?r.subscribeToDelivery(t):(t.setFailedDelivery({reason:o}),t)})]})})},e.prototype.isEmpty=function(){return this.queue.length===0},e.prototype.scheduleFlush=function(t){var r=this;t===void 0&&(t=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){r.flush().then(function(){setTimeout(function(){r.flushing=!1,r.queue.length&&r.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){var r;return m(this,void 0,void 0,function(){var i,o,a,u,s,u;return g(this,function(l){switch(l.label){case 0:return[4,this.criticalTasks.done()];case 1:l.sent(),i=Date.now(),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=l.sent(),o=Date.now()-i,a=t.failedDelivery(),a?(u=a.reason instanceof Error?a.reason:new Error(String((r=a.reason)!==null&&r!==void 0?r:"Unknown delivery failure")),t.log("error","Failed to deliver",u),this.emit("delivery_failure",t,u),t.stats.increment("delivery_failed"),[2,t]):(this.emit("delivery_success",t),t.stats.gauge("delivered",o),t.log("debug","Delivered",t.event),[2,t]);case 4:throw s=l.sent(),u=s,t.log("error","Failed to deliver",u),this.emit("delivery_failure",t,u),t.stats.increment("delivery_failed"),s;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,r){var i=!(t instanceof Me)||t.retry;return i?this.queue.pushWithBackoff(r):!1},e.prototype.flush=function(){return m(this,void 0,void 0,function(){var t,r,i,o;return g(this,function(a){switch(a.label){case 0:if(this.queue.length===0)return[2,[]];if(t=this.queue.pop(),!t)return[2,[]];t.attempts=this.queue.getAttempts(t),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=a.sent(),r=!t.failedDelivery(),this.emit("flush",t,r),[3,4];case 3:return i=a.sent(),o=this.enqueuRetry(i,t),o||(t.setFailedDelivery({reason:i}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var r=this.plugins.filter(function(h){var p,w,I;if(h.type!=="destination"&&h.name!=="Segment.io")return!0;var C=void 0;return(p=h.alternativeNames)===null||p===void 0||p.forEach(function(y){t[y]!==void 0&&(C=t[y])}),(I=(w=t[h.name])!==null&&w!==void 0?w:C)!==null&&I!==void 0?I:(h.name==="Segment.io"?!0:t.All)!==!1}),i=$t(r,"type"),o=i.before,a=o===void 0?[]:o,s=i.enrichment,u=s===void 0?[]:s,l=i.destination,c=l===void 0?[]:l,f=i.after,v=f===void 0?[]:f;return{before:a,enrichment:u,destinations:c,after:v}},e.prototype.flushOne=function(t){var r,i;return m(this,void 0,void 0,function(){var o,a,s,u,l,c,p,f,v,h,p,w,I,C,y;return g(this,function(E){switch(E.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),o=this.availableExtensions((r=t.event.integrations)!==null&&r!==void 0?r:{}),a=o.before,s=o.enrichment,u=0,l=a,E.label=1;case 1:return u<l.length?(c=l[u],[4,Lt(t,c)]):[3,4];case 2:p=E.sent(),p instanceof et&&(t=p),this.emit("message_enriched",t,c),E.label=3;case 3:return u++,[3,1];case 4:f=0,v=s,E.label=5;case 5:return f<v.length?(h=v[f],[4,oe(t,h)]):[3,8];case 6:p=E.sent(),p instanceof et&&(t=p),this.emit("message_enriched",t,h),E.label=7;case 7:return f++,[3,5];case 8:return w=this.availableExtensions((i=t.event.integrations)!==null&&i!==void 0?i:{}),I=w.destinations,C=w.after,[4,new Promise(function(k,A){setTimeout(function(){var _=I.map(function(R){return oe(t,R)});Promise.all(_).then(k).catch(A)},0)})];case 9:return E.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),y=C.map(function(k){return oe(t,k)}),[4,Promise.all(y)];case 10:return E.sent(),[2,t]}})})},e})(Pe);var Gr=function(n,e){var t=Date.now()-n;return Math.max((e??300)-t,0)};function Yt(n,e,t,r){return m(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return t.emit("dispatch_start",n),i=Date.now(),e.isEmpty()?[4,e.dispatchSingle(n)]:[3,2];case 1:return o=a.sent(),[3,4];case 2:return[4,e.dispatch(n)];case 3:o=a.sent(),a.label=4;case 4:return r?.callback?[4,Rt(o,r.callback,Gr(i,r.timeout))]:[3,6];case 5:o=a.sent(),a.label=6;case 6:return r?.debug&&o.flush(),[2,o]}})})}function Jt(n,e,t,r){var i,o=[n,e,t,r],a=U(n)?n.event:n;if(!a||!z(a))throw new Error("Event missing");var s=U(n)?(i=n.properties)!==null&&i!==void 0?i:{}:U(e)?e:{},u={};Z(t)||(u=t??{}),U(n)&&!Z(e)&&(u=e??{});var l=o.find(Z);return[a,s,u,l]}function nt(n,e,t,r,i){var o,a,s=null,u=null,l=[n,e,t,r,i],c=l.filter(z);c.length===1?z(l[1])?(u=l[1],s=null):(u=c[0],s=null):c.length===2&&(typeof l[0]=="string"&&(s=l[0]),typeof l[1]=="string"&&(u=l[1]));var f=l.find(Z),v=l.filter(U);return v.length===1?U(l[2])?(a={},o=l[2]):U(l[3])?(o={},a=l[3]):(o=v[0],a={}):v.length===2&&(o=v[0],a=v[1]),[s,u,o??(o={}),a??(a={}),f]}var it=function(n){return function(){for(var e,t,r,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var a={},s=["callback","options","traits","id"],u=0,l=i;u<l.length;u++){var c=l[u],f=s.pop();if(f==="id"){if(z(c)||Ae(c)){a.id=c.toString();continue}if(c==null)continue;f=s.pop()}if((f==="traits"||f==="options")&&(c==null||U(c))&&(a[f]=c),Z(c)){a.callback=c;break}}return[(e=a.id)!==null&&e!==void 0?e:n.id(),(t=a.traits)!==null&&t!==void 0?t:{},(r=a.options)!==null&&r!==void 0?r:{},a.callback]}};function Xt(n,e,t,r){Ae(n)&&(n=n.toString()),Ae(e)&&(e=e.toString());var i=[n,e,t,r],o=i.filter(z),a=o[0],s=a===void 0?n:a,u=o[1],l=u===void 0?null:u,c=i.filter(U)[0],f=c===void 0?{}:c,v=i.find(Z);return[s,l,f,v]}function Vr(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()==="object"}var ot="bpc",at=function(n,e,t,r,i,o){return{__t:ot,c:e,p:r,u:n,s:t,t:i,r:o}},Hr=Object.keys(at("","","","","",""));function st(n){if(!Vr(n)||n.__t!==ot)return!1;for(var e in n)if(!Hr.includes(e))return!1;return!0}var Wr=function(n,e){return n.indexOf("?")>-1?n:n+e},$r=function(n){var e=n.indexOf("#");return e===-1?n:n.slice(0,e)},jr=function(n){try{return new URL(n).pathname}catch{return n[0]==="/"?n:"/"+n}},Ue=function(n){var e=n.c,t=n.p,r=n.s,i=n.u,o=n.r,a=n.t,s=e?jr(e):t,u=e?Wr(e,r):$r(i);return{path:s,referrer:o,search:r,title:a,url:u}},Be=function(){var n=document.querySelector("link[rel='canonical']");return at(location.href,n&&n.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},ut=function(){return Ue(Be())};function Zt(n,e){return Object.assign.apply(Object,P([{}],e.map(function(t){var r;if(n&&Object.prototype.hasOwnProperty.call(n,t))return r={},r[t]=n[t],r}),!1))}var ee=function(n,e){e===void 0&&(e=ut());var t=n.context,r;n.type==="page"&&(r=n.properties&&Zt(n.properties,Object.keys(e)),n.properties=d(d(d({},e),n.properties),n.name?{name:n.name}:{})),t.page=d(d(d({},e),r),t.page)};var er=(function(n){N(e,n);function e(t){var r=n.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(xe())},onEventMethodCall:function(i){var o=i.options;r.maybeUpdateAnonId(o)},onFinishedEvent:function(i){return r.addIdentity(i),i}})||this;return r.user=t,r}return e.prototype.maybeUpdateAnonId=function(t){t?.anonymousId&&this.user.anonymousId(t.anonymousId)},e.prototype.addIdentity=function(t){this.user.id()&&(t.userId=this.user.id()),this.user.anonymousId()&&(t.anonymousId=this.user.anonymousId())},e.prototype.track=function(t,r,i,o,a){var s=n.prototype.track.call(this,t,r,i,o);return ee(s,a),s},e.prototype.page=function(t,r,i,o,a,s){var u=n.prototype.page.call(this,t,r,i,o,a);return ee(u,s),u},e.prototype.screen=function(t,r,i,o,a,s){var u=n.prototype.screen.call(this,t,r,i,o,a);return ee(u,s),u},e.prototype.identify=function(t,r,i,o,a){var s=n.prototype.identify.call(this,t,r,i,o);return ee(s,a),s},e.prototype.group=function(t,r,i,o,a){var s=n.prototype.group.call(this,t,r,i,o);return ee(s,a),s},e.prototype.alias=function(t,r,i,o,a){var s=n.prototype.alias.call(this,t,r,i,o);return ee(s,a),s},e})(Wt);var tr=function(n){return"addMiddleware"in n&&n.type==="destination"};var rr=(function(n){N(e,n);function e(t){return n.call(this,typeof t=="string"?new ue(4,t):t)||this}return e.prototype.flush=function(){return m(this,void 0,void 0,function(){return g(this,function(t){return $()?[2,[]]:[2,n.prototype.flush.call(this)]})})},e})(Qt);function ce(n){for(var e=n.constructor.prototype,t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++){var i=r[t];if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);o&&typeof o.value=="function"&&(n[i]=n[i].bind(n))}}return n}function Ke(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)r!=="__proto__"&&(n[r]=t[r])}return n}var qr={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function lt(n,e){function t(i,o,a){if(!(typeof document>"u")){a=Ke({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)a[u]&&(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+n.write(o,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),l=u.slice(1).join("=");try{var c=decodeURIComponent(u[0]);if(c in a||(a[c]=n.read(l,c)),i===c)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:r,remove:function(i,o){t(i,"",Ke({},o,{expires:-1}))},withAttributes:function(i){return lt(this.converter,Ke({},this.attributes,i))},withConverter:function(i){return lt(Ke({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var B=lt(qr,{path:"/"});function Qr(n){var e=n.hostname,t=e.split("."),r=t[t.length-1],i=[];if(t.length===4&&parseInt(r,10)>0||t.length<=1)return i;for(var o=t.length-2;o>=0;--o)i.push(t.slice(o).join("."));return i}function Yr(n){try{return new URL(n)}catch{return}}function ze(n){var e=Yr(n);if(e)for(var t=Qr(e),r=0;r<t.length;++r){var i="__tld__",o=t[r],a={domain:"."+o};try{if(B.set(i,"1",a),B.get(i))return B.remove(i,a),o}catch{return}}}var Jr=365,Ge=(function(){function n(e){e===void 0&&(e=n.defaults),this.options=d(d({},n.defaults),e)}return Object.defineProperty(n,"defaults",{get:function(){return{maxage:Jr,domain:ze(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),n.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},n.prototype.get=function(e){var t;try{var r=B.get(e);if(r==null)return null;try{return(t=JSON.parse(r))!==null&&t!==void 0?t:null}catch{return r??null}}catch{return null}},n.prototype.set=function(e,t){typeof t=="string"?B.set(e,t,this.opts()):t===null?B.remove(e,this.opts()):B.set(e,JSON.stringify(t),this.opts())},n.prototype.remove=function(e){return B.remove(e,this.opts())},n})();var nr=(function(){function n(){}return n.prototype.localStorageWarning=function(e,t){console.warn("Unable to access ".concat(e,", localStorage may be ").concat(t))},n.prototype.get=function(e){var t;try{var r=localStorage.getItem(e);if(r===null)return null;try{return(t=JSON.parse(r))!==null&&t!==void 0?t:null}catch{return r??null}}catch{return this.localStorageWarning(e,"unavailable"),null}},n.prototype.set=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{this.localStorageWarning(e,"full")}},n.prototype.remove=function(e){try{return localStorage.removeItem(e)}catch{this.localStorageWarning(e,"unavailable")}},n})();var de=(function(){function n(){this.cache={}}return n.prototype.get=function(e){var t;return(t=this.cache[e])!==null&&t!==void 0?t:null},n.prototype.set=function(e,t){this.cache[e]=t},n.prototype.remove=function(e){delete this.cache[e]},n})();var M={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function Ve(n){return n&&n.stores&&Array.isArray(n.stores)&&n.stores.every(function(e){return Object.values(M).includes(e)})}function ir(n){return typeof n=="object"&&n.name!==void 0}var ct=function(n,e,t,r){console.warn("".concat(n.constructor.name,": Can't ").concat(e,' key "').concat(t,'" | Err: ').concat(r))},G=(function(){function n(e){this.stores=e}return n.prototype.get=function(e){for(var t=null,r=0,i=this.stores;r<i.length;r++){var o=i[r];try{if(t=o.get(e),t!=null)return t}catch(a){ct(o,"get",e,a)}}return null},n.prototype.set=function(e,t){this.stores.forEach(function(r){try{r.set(e,t)}catch(i){ct(r,"set",e,i)}})},n.prototype.clear=function(e){this.stores.forEach(function(t){try{t.remove(e)}catch(r){ct(t,"remove",e,r)}})},n.prototype.getAndSync=function(e){var t=this.get(e),r=typeof t=="number"?t.toString():t;return this.set(e,r),r},n})();function ye(n){var e=n.map(function(t){var r,i;switch(ir(t)?(r=t.name,i=t.settings):r=t,r){case M.Cookie:return new Ge(i);case M.LocalStorage:return new nr;case M.Memory:return new de;default:throw new Error("Unknown Store Type: ".concat(t))}});return e}function He(n,e){return n.map(function(t){return e&&t===M.Cookie?{name:t,settings:e}:t})}var te={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},dt=(function(){function n(e,t){e===void 0&&(e=te);var r=this,i,o,a,s;this.options={},this.id=function(l){if(r.options.disable)return null;var c=r.identityStore.getAndSync(r.idKey);if(l!==void 0){r.identityStore.set(r.idKey,l);var f=l!==c&&c!==null&&l!==null;f&&r.anonymousId(null)}var v=r.identityStore.getAndSync(r.idKey);if(v)return v;var h=r.legacyUserStore.get(te.cookie.oldKey);return h?typeof h=="object"?h.id:h:null},this.anonymousId=function(l){var c,f;if(r.options.disable)return null;if(l===void 0){var v=(c=r.identityStore.getAndSync(r.anonKey))!==null&&c!==void 0?c:(f=r.legacySIO())===null||f===void 0?void 0:f[0];if(v)return v}return l===null?(r.identityStore.set(r.anonKey,null),r.identityStore.getAndSync(r.anonKey)):(r.identityStore.set(r.anonKey,l??xe()),r.identityStore.getAndSync(r.anonKey))},this.traits=function(l){var c;if(!r.options.disable)return l===null&&(l={}),l&&r.traitsStore.set(r.traitsKey,l??{}),(c=r.traitsStore.get(r.traitsKey))!==null&&c!==void 0?c:{}},this.options=d(d({},te),e),this.cookieOptions=t,this.idKey=(o=(i=e.cookie)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:te.cookie.key,this.traitsKey=(s=(a=e.localStorage)===null||a===void 0?void 0:a.key)!==null&&s!==void 0?s:te.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,t),this.legacyUserStore=this.createStorage(this.options,t,function(l){return l===M.Cookie}),this.traitsStore=this.createStorage(this.options,t,function(l){return l!==M.Cookie});var u=this.legacyUserStore.get(te.cookie.oldKey);u&&typeof u=="object"&&(u.id&&this.id(u.id),u.traits&&this.traits(u.traits)),ce(this)}return n.prototype.legacySIO=function(){var e=this.legacyUserStore.get("_sio");if(!e)return null;var t=e.split("----"),r=t[0],i=t[1];return[r,i]},n.prototype.identify=function(e,t){if(!this.options.disable){t=t??{};var r=this.id();(r===null||r===e)&&(t=d(d({},this.traits()),t)),e&&this.id(e),this.traits(t)}},n.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},n.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},n.prototype.load=function(){return new n(this.options,this.cookieOptions)},n.prototype.save=function(){return!0},n.prototype.createStorage=function(e,t,r){var i=[M.LocalStorage,M.Cookie,M.Memory];return e.disable?new G([]):e.persist?(e.storage!==void 0&&e.storage!==null&&Ve(e.storage)&&(i=e.storage.stores),e.localStorageFallbackDisabled&&(i=i.filter(function(o){return o!==M.LocalStorage})),r&&(i=i.filter(r)),new G(ye(He(i,t)))):new G([new de])},n.defaults=te,n})();var or={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},ar=(function(n){N(e,n);function e(t,r){t===void 0&&(t=or);var i=n.call(this,d(d({},or),t),r)||this;return i.anonymousId=function(o){},ce(i),i}return e})(dt);var sr=function(n){return typeof n=="object"&&n!==null&&"then"in n&&typeof n.then=="function"};var ur=function(n,e,t){t.getAndRemove(n).forEach(function(r){We(e,r).catch(console.error)})},lr=function(n,e){return m(void 0,void 0,void 0,function(){var t,r,i;return g(this,function(o){switch(o.label){case 0:t=0,r=e.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return t<r.length?(i=r[t],[4,We(n,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},cr=function(n,e){return m(void 0,void 0,void 0,function(){var t,r,i;return g(this,function(o){switch(o.label){case 0:t=0,r=e.getAndRemove("register"),o.label=1;case 1:return t<r.length?(i=r[t],[4,We(n,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},dr=ur.bind(void 0,"on"),fr=ur.bind(void 0,"setAnonymousId"),hr=function(n,e){Object.keys(e.calls).forEac
5h(function(t){e.getAndRemove(t).forEach(function(r){setTimeout(function(){We(n,r).catch(console.error)},0)})})},re=function(n){if(pr(n)){var e=n.pop();return Ue(e)}},pr=function(n){var e=n[n.length-1];return st(e)},_e=(function(){function n(e,t,r,i){r===void 0&&(r=function(){}),i===void 0&&(i=console.error),this.method=e,this.resolve=r,this.reject=i,this.called=!1,this.args=t}return n})();var Xr=(function(){function n(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._callMap={},this.add.apply(this,e)}return Object.defineProperty(n.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(e){this._callMap=e},enumerable:!1,configurable:!0}),n.prototype.get=function(e){var t;return(t=this.calls[e])!==null&&t!==void 0?t:[]},n.prototype.getAndRemove=function(e){var t=this.get(e);return this.calls[e]=[],t},n.prototype.add=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.forEach(function(i){var o=["track","screen","alias","group","page","identify"];o.includes(i.method)&&!pr(i.args)&&(i.args=P(P([],i.args,!0),[Be()],!1)),e.calls[i.method]?e.calls[i.method].push(i):e.calls[i.method]=[i]})},n.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},n.prototype.toArray=function(){var e;return(e=[]).concat.apply(e,Object.values(this.calls))},n.prototype._pushSnippetWindowBuffer=function(){if(De()!=="npm"){var e=Nt();if(Array.isArray(e)){var t=e.splice(0,e.length),r=t.map(function(i){var o=i[0],a=i.slice(1);return new _e(o,a)});this.add.apply(this,r)}}},n})();function We(n,e){return m(this,void 0,void 0,function(){var t,r;return g(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,t=n[e.method].apply(n,e.args),sr(t)?[4,t]:[3,2]);case 1:i.sent(),i.label=2;case 2:return e.resolve(t),[3,4];case 3:return r=i.sent(),e.reject(r),[3,4];case 4:return[2]}})})}var vr=(function(){function n(e){var t=this;this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=se,this._preInitBuffer=new Xr,this._promise=e(this._preInitBuffer),this._promise.then(function(r){var i=r[0],o=r[1];t.instance=i,t.ctx=o}).catch(function(){})}return n.prototype.then=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this._promise).then.apply(e,t)},n.prototype.catch=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this._promise).catch.apply(e,t)},n.prototype.finally=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this._promise).finally.apply(e,t)},n.prototype._createMethod=function(e){var t=this;return function(){for(var r,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(t.instance){var a=(r=t.instance)[e].apply(r,i);return Promise.resolve(a)}return new Promise(function(s,u){t._preInitBuffer.add(new _e(e,i,s,u))})}},n.prototype._createChainableMethod=function(e){var t=this;return function(){for(var r,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return t.instance?((r=t.instance)[e].apply(r,i),t):(t._preInitBuffer.add(new _e(e,i)),t)}},n})();var mr=function(n){var e=!1;window.addEventListener("pagehide",function(){e||(e=!0,n(e))}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(e)return;e=!0}else e=!1;n(e)})};var $e=(function(n){N(e,n);function e(t,r,i){i===void 0&&(i=!1);var o=n.call(this,t)||this;return o.retryTimeout=r,o.isRetryableWithoutCount=i,o.name="RateLimitError",o}return e})(Error);var je=function(n){return d({"Content-Type":"text/plain"},typeof n=="function"?n():n)},Zr={408:"retry",410:"retry",429:"retry",460:"retry",501:"drop",505:"drop",511:"drop"};function Y(n,e,t,r){var i=n??e;return Math.min(Math.max(i,t),r)}function qe(n,e){var t;if(n.status!==429)return null;var r=(t=n.headers)===null||t===void 0?void 0:t.get("Retry-After");if(!r)return null;var i=parseInt(r,10);if(Number.isNaN(i))return null;var o=Math.max(0,Math.min(i,e.maxRetryInterval));return{retryAfterMs:o*1e3,fromHeader:!0}}function Qe(n,e){var t=e.statusCodeOverrides[String(n)];return t||(n>=500?e.default5xxBehavior:n>=400?e.default4xxBehavior:"drop")}function gr(n,e){var t=e.baseBackoffInterval*1e3,r=e.maxBackoffInterval*1e3,i=t*Math.pow(2,n-1),o=Math.min(i,r),a=1+(Math.random()-.5)*2*(e.jitterPercent/100);return Math.max(0,o*a)}function fe(n,e){var t,r,i,o,a=n||e?{rateLimitConfig:d(d({},n?.rateLimitConfig),e?.rateLimitConfig),backoffConfig:d(d(d({},n?.backoffConfig),e?.backoffConfig),{statusCodeOverrides:d(d({},(t=n?.backoffConfig)===null||t===void 0?void 0:t.statusCodeOverrides),(r=e?.backoffConfig)===null||r===void 0?void 0:r.statusCodeOverrides)})}:void 0,s=a?.rateLimitConfig,u=a?.backoffConfig;return{rateLimitConfig:{maxRetryCount:Y(s?.maxRetryCount,10,0,100),maxRetryInterval:Y(s?.maxRetryInterval,300,.1,86400),maxRateLimitDuration:Y(s?.maxRateLimitDuration,43200,10,86400)},backoffConfig:{maxRetryCount:Y(u?.maxRetryCount,10,0,100),baseBackoffInterval:Y(u?.baseBackoffInterval,.5,.1,300),maxBackoffInterval:Y(u?.maxBackoffInterval,60,.1,86400),maxTotalBackoffDuration:Y(u?.maxTotalBackoffDuration,43200,60,604800),jitterPercent:Y(u?.jitterPercent,10,0,100),default4xxBehavior:(i=u?.default4xxBehavior)!==null&&i!==void 0?i:"drop",default5xxBehavior:(o=u?.default5xxBehavior)!==null&&o!==void 0?o:"retry",statusCodeOverrides:d(d({},Zr),u?.statusCodeOverrides)}}}var en=500,tn=64;function ft(n){var e=encodeURI(JSON.stringify(n)).split(/%..|./).length-1;return e/1024}function yr(n){return ft(n)>=en-50}function rn(n){return ft(n)>=tn-10}function nn(n){var e=[],t=0;
5return n.forEach(function(r){var i=ft(e[t]);i>=64&&t++,e[t]?e[t].push(r):e[t]=[r]}),e}function on(n){for(var e=[],t=0;t<n.length;t++){var r=n[t],i=P(P([],e,!0),[r],!1);if(e.length>0&&yr(i))return{batch:e,remaining:n.slice(t)};e.push(r)}return{batch:e,remaining:[]}}function ht(n,e,t,r){var i,o;r===void 0&&(r="https");var a=[],s=!1,u=(i=e?.size)!==null&&i!==void 0?i:10,l=(o=e?.timeout)!==null&&o!==void 0?o:5e3,c=t??fe(),f=0,v=0,h=!1,p=!1,w=0,I=0,C=0;function y(b,x){var S;if(b.length!==0){var T=(S=b[0])===null||S===void 0?void 0:S.writeKey,L=b.map(function(K){var W=K,he=W.sentAt,q=ke(W,["sentAt"]);return q}),O=je(e?.headers);if(x>0&&(O["X-Retry-Count"]=String(x)),T){var j=btoa(T+":");O.Authorization="Basic ".concat(j)}var F=n.startsWith("http://")||n.startsWith("https://")?"":"".concat(r,"://");return ae("".concat(F).concat(n,"/b"),{credentials:e?.credentials,keepalive:e?.keepalive||s,headers:O,method:"post",body:JSON.stringify({writeKey:T,batch:L,sentAt:new Date().toISOString()}),priority:e?.priority}).then(function(K){var W=K.status;if(!(W<400)){var he=Qe(W,c.backoffConfig);if(he!=="drop"){var q=qe(K,c.rateLimitConfig);if(q)throw new $e("Rate limit exceeded: ".concat(W),q.retryAfterMs,q.fromHeader)}if(he==="retry")throw new Error("Retryable error: ".concat(W))}})}}function E(){a.length>0&&_(1)}function k(b){var x;return b===void 0&&(b=1),m(this,void 0,void 0,function(){var S,T,L,O;return g(this,function(j){return h||(v=0,w=0,I=0,C=0),h=!1,p=!0,a.length?(S=on(a),T=S.batch,L=S.remaining,T.length===0?(p=!1,[2]):(a=L,O=v,v+=1,[2,(x=y(T,O))===null||x===void 0?void 0:x.then(function(F){return a.length>0&&_(1),F}).catch(function(F){var K,W=D.system();W.log("error","Error sending batch",F);var he=(K=e?.maxRetries)!==null&&K!==void 0?K:c.backoffConfig.maxRetryCount,q=F.name==="RateLimitError",Je=q&&F.isRetryableWithoutCount,Pr=Je||b<=he;if(!Pr)return E();if(Je){if(w++,w>c.rateLimitConfig.maxRetryCount)return E();var St=F.retryTimeout;C+=St;var Lr=c.rateLimitConfig.maxRateLimitDuration*1e3;if(C>Lr)return E();f=St}var Xe;if(!q){Xe=gr(b,c.backoffConfig),I+=Xe;var xr=c.backoffConfig.maxTotalBackoffDuration*1e3;if(I>xr)return E()}a=P(P([],T,!0),a,!0),T.forEach(function(bt){if("_metadata"in bt){var Tt=bt;Tt._metadata=d(d({},Tt._metadata),{retryCount:b})}});var Mr=Je?b:b+1;h=!0,_(Mr,Xe)}).finally(function(){p=!1})])):(p=!1,[2])})})}var A;function _(b,x){if(b===void 0&&(b=1),!A){var S=f||x||l;A=setTimeout(function(){A=void 0,k(b).catch(console.error)},S),f=0}}mr(function(b){if(s=b,s&&a.length){var x=nn(a).map(function(S){return y(S,0)});Promise.all(x).catch(console.error)}});function R(b,x,S){return m(this,void 0,void 0,function(){var T;return g(this,function(L){return a.push(x),h?[2]:(T=a.length>=u||yr(a)||e?.keepalive&&rn(a),!T&&!s?[2,_()]:[2,p?_():k()])})})}return{dispatch:R}}function _r(n,e){function t(r,i,o){var a=je(n?.headers),s=i?.writeKey;if(s){var u=btoa(s+":");a.Authorization="Basic ".concat(u)}return o&&(a["X-Retry-Count"]=String(o)),ae(r,{credentials:n?.credentials,keepalive:n?.keepalive,headers:a,method:"post",body:JSON.stringify(i),priority:n?.priority}).then(function(l){var c=l.status;if(!(c<400)){var f=e??fe(),v=Qe(c,f.backoffConfig);if(v!=="drop"){var h=qe(l,f.rateLimitConfig);if(h)throw new $e("Rate limit exceeded: ".concat(c),h.retryAfterMs,h.fromHeader)}if(v==="retry")throw new Error("Retryable error: ".concat(c));var p=new Error("Non-retryable error: ".concat(c));throw p.name="NonRetryableError",p}})}return{dispatch:t}}function wr(n,e,t,r,i){var o,a=n.user();delete e.options,e.writeKey=t?.apiKey,e.userId=e.userId||a.id(),e.anonymousId=e.anonymousId||a.anonymousId(),e.sentAt=new Date;var s=n.queue.failedInitializations||[];s.length>0&&(e._metadata={failedInitializations:s}),i!=null&&(i.attempts>1&&(e._metadata=d(d({},e._metadata),{retryCount:i.attempts})),i.attempts++);var u=[],l=[];for(var c in r){var f=r[c];c==="Segment.io"&&u.push(c),f.bundlingStatus==="bundled"&&u.push(c),f.bundlingStatus==="unbundled"&&l.push(c)}for(var v=0,h=t?.unbundledIntegrations||[];v<h.length;v++){var p=h[v];l.includes(p)||l.push(p)}var w=(o=t?.maybeBundledConfigIds)!==null&&o!==void 0?o:{},I=[];
vendor: 4,104 bytes, line 5
5return u.sort().forEach(function(C){var y;((y=w[C])!==null&&y!==void 0?y:[]).forEach(function(E){I.push(E)})}),t?.addBundledMetadata!==!1&&(e._metadata=d(d({},e._metadata),{bundled:u.sort(),unbundled:l.sort(),bundledIds:I})),e}function an(n,e){return m(this,void 0,void 0,function(){var t,r=this;return g(this,function(i){switch(i.label){case 0:return t=[],$()?[2,e]:[4,Ut(function(){return e.length>0&&!$()},function(){return m(r,void 0,void 0,function(){var o,a,s;return g(this,function(u){switch(u.label){case 0:return o=e.pop(),o?[4,oe(o,n)]:[2];case 1:return a=u.sent(),s=a instanceof D,s||t.push(o),[2]}})})})];case 1:return i.sent(),t.map(function(o){return e.pushWithBackoff(o)}),[2,e]}})})}function ne(n,e,t,r){var i=this;n||setTimeout(function(){return m(i,void 0,void 0,function(){var o,a;return g(this,function(s){switch(s.label){case 0:return o=!0,[4,an(t,e)];case 1:return a=s.sent(),o=!1,e.todo>0&&r(o,a,t,r),[2]}})})},Math.random()*500+100)}function sn(n,e){var t,r,i,o,a=n.user();return e.previousId=(i=(r=(t=e.previousId)!==null&&t!==void 0?t:e.from)!==null&&r!==void 0?r:a.id())!==null&&i!==void 0?i:a.anonymousId(),e.userId=(o=e.userId)!==null&&o!==void 0?o:e.to,delete e.from,delete e.to,e}var Cr=function(n){return n.name==="Segment.io"};function Er(n,e,t){var r,i,o,a;window.addEventListener("pagehide",function(){u.push.apply(u,Array.from(l)),l.clear()});var s=(r=e?.apiKey)!==null&&r!==void 0?r:"",u=n.options.disableClientPersistence?new Le(n.queue.queue.maxAttempts,[]):new ue(n.queue.queue.maxAttempts,"".concat(s,":dest-Segment.io")),l=new Set,c=new WeakMap,f=!1,v=(i=e?.apiHost)!==null&&i!==void 0?i:xt,h=(o=e?.protocol)!==null&&o!==void 0?o:"https",p="".concat(h,"://").concat(v),w=(a=t?.["Segment.io"])===null||a===void 0?void 0:a.httpConfig,I=e?.httpConfig,C=fe(I,w);n.options.retryQueue!==!1&&(u.maxAttempts=C.backoffConfig.maxRetryCount);var y=e?.deliveryStrategy,E=y&&"strategy"in y&&y.strategy==="batching"?ht(v,y.config,C,h):_r(y?.config,C);function k(_){return m(this,void 0,void 0,function(){var R,b,x,S;return g(this,function(T){return $()?(u.push(_),ne(f,u,A,ne),[2,_]):(l.add(_),R=_.event.type.charAt(0),b=Ft(_.event).json(),_.event.type==="track"&&delete b.traits,_.event.type==="alias"&&(b=sn(n,b)),x=u.getAttempts(_),x>=u.maxAttempts?(l.delete(_),S=new Error("Retry attempts exhausted (".concat(x,"/").concat(u.maxAttempts,")")),_.setFailedDelivery({reason:S}),n.emit("error",{code:"delivery_failure",reason:S,ctx:_}),[2,_]):[2,E.dispatch("".concat(p,"/").concat(R),wr(n,b,e,t,_),x).then(function(){return _}).catch(function(L){var O;if(_.log("error","Error sending event",L),L.name==="RateLimitError"){var j=((O=c.get(_))!==null&&O!==void 0?O:0)+1;if(c.set(_,j),j>C.rateLimitConfig.maxRetryCount)_.setFailedDelivery({reason:L}),n.emit("error",{code:"delivery_failure",reason:L,ctx:_});else{var F=L.retryTimeout;u.pushWithDelay(_,F)}}else L.name==="NonRetryableError"?(_.setFailedDelivery({reason:L}),n.emit("error",{code:"delivery_failure",reason:L,ctx:_})):u.pushWithBackoff(_);return ne(f,u,A,ne),_}).finally(function(){l.delete(_)})])})})}var A={metadata:{writeKey:s,apiHost:v,protocol:h},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:k,identify:k,page:k,alias:k,group:k,screen:k};return u.todo&&ne(f,u,A,ne),A}var J="This is being deprecated and will be not be available in future releases of Analytics JS",pt=Ne(),vt=pt?.analytics;function un(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=e?10:1,i=t?new Le(r,[]):new ue(r,n);return new rr(i)}var ln=(function(){function n(e,t){var r;this.timeout=300,this._getSegmentPluginMetadata=function(){var o;return(o=t.plugins.find(Cr))===null||o===void 0?void 0:o.metadata},this.writeKey=e.writeKey;var i={integrations:{"Segment.io":{apiKey:""}}};this.cdnSettings=(r=e.cdnSettings)!==null&&r!==void 0?r:i,this.cdnURL=e.cdnURL}return Object.defineProperty(n.prototype,"apiHost",{get:function(){var e,t;return(t=(e=this._getSegmentPluginMetadata)===null||e===void 0?void 0:e.call(this))===null||t===void 0?void 0:t.apiHost}
vendor: 16,790 bytes, line 5
5,enumerable:!1,configurable:!0}),n})();function V(){console.warn(J)}var mt=(function(n){N(e,n);function e(t,r,i,o,a){var s=this,u,l;s=n.call(this)||this,s._debug=!1,s.initialized=!1,s.user=function(){return s._user},s.init=s.initialize.bind(s),s.log=V,s.addIntegrationMiddleware=V,s.listeners=V,s.addEventListener=V,s.removeAllListeners=V,s.removeListener=V,s.removeEventListener=V,s.hasListeners=V,s.add=V,s.addIntegration=V;var c=r?.cookie,f=(u=r?.disableClientPersistence)!==null&&u!==void 0?u:!1;s.queue=i??un("".concat(t.writeKey,":event-queue"),r?.retryQueue,f),s.settings=new ln(t,s.queue);var v=r?.storage;return s._universalStorage=s.createStore(f,v,c),s._user=o??new dt(d({persist:!f,storage:r?.storage},r?.user),c).load(),s._group=a??new ar(d({persist:!f,storage:r?.storage},r?.group),c).load(),s.eventFactory=new er(s._user),s.integrations=(l=r?.integrations)!==null&&l!==void 0?l:{},s.options=r??{},ce(s),s}return e.prototype.createStore=function(t,r,i){return t?new G([new de]):r&&Ve(r)?new G(ye(He(r.stores,i))):new G(ye([M.LocalStorage,{name:M.Cookie,settings:i},M.Memory]))},Object.defineProperty(e.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),e.prototype.track=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a,s,u,l,c,f=this;return g(this,function(v){return i=re(t),o=Jt.apply(void 0,t),a=o[0],s=o[1],u=o[2],l=o[3],c=this.eventFactory.track(a,s,u,this.integrations,i),[2,this._dispatch(c,l).then(function(h){return f.emit("track",a,h.event.properties,h.event.options),h})]})})},e.prototype.page=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a,s,u,l,c,f,v=this;return g(this,function(h){return i=re(t),o=nt.apply(void 0,t),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],f=this.eventFactory.page(a,s,u,l,this.integrations,i),[2,this._dispatch(f,c).then(function(p){return v.emit("page",a,s,p.event.properties,p.event.options),p})]})})},e.prototype.identify=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a,s,u,l,c,f=this;return g(this,function(v){return i=re(t),o=it(this._user).apply(void 0,t),a=o[0],s=o[1],u=o[2],l=o[3],this._user.identify(a,s),c=this.eventFactory.identify(this._user.id(),this._user.traits(),u,this.integrations,i),[2,this._dispatch(c,l).then(function(h){return f.emit("identify",h.event.userId,h.event.traits,h.event.options),h})]})})},e.prototype.group=function(){for(var t=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=re(r);if(r.length===0)return this._group;var a=it(this._group).apply(void 0,r),s=a[0],u=a[1],l=a[2],c=a[3];this._group.identify(s,u);var f=this._group.id(),v=this._group.traits(),h=this.eventFactory.group(f,v,l,this.integrations,o);return this._dispatch(h,c).then(function(p){return t.emit("group",p.event.groupId,p.event.traits,p.event.options),p})},e.prototype.alias=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a,s,u,l,c,f=this;return g(this,function(v){return i=re(t),o=Xt.apply(void 0,t),a=o[0],s=o[1],u=o[2],l=o[3],c=this.eventFactory.alias(a,s,u,this.integrations,i),[2,this._dispatch(c,l).then(function(h){return f.emit("alias",a,s,h.event.options),h})]})})},e.prototype.screen=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a,s,u,l,c,f,v=this;return g(this,function(h){return i=re(t),o=nt.apply(void 0,t),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],f=this.eventFactory.screen(a,s,u,l,this.integrations,i),[2,this._dispatch(f,c).then(function(p){return v.emit("screen",a,s,p.event.properties,p.event.options),p})]})})},e.prototype.trackClick=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,import("./chunks/auto-track-H5KG754K.js")];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,P([this],t,!1))]}})})},e.prototype.trackLink=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,import("./chunks/auto-track-H5KG754K.js")];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,P([this],t,!1))]}})})},e.prototype.trackSubmit=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,import("./chunks/auto-track-H5KG754K.js")];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,P([this],t,!1))]}})})},e.prototype.trackForm=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,import("./chunks/auto-track-H5KG754K.js")];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,P([this],t,!1))]}})})},e.prototype.register=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a=this;return g(this,function(s){switch(s.label){case 0:return i=D.system(),o=t.map(function(u){return a.queue.register(i,u,a)}),[4,Promise.all(o)];case 1:return s.sent(),[2,i]}})})},e.prototype.deregister=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return m(this,void 0,void 0,function(){var i,o,a=this;return g(this,function(s){switch(s.label){case 0:return i=D.system(),o=t.map(function(u){var l=a.queue.plugins.find(function(c){return c.name===u});if(l)return a.queue.deregister(i,l,a);i.log("warn","plugin ".concat(u," not found"))}),[4,Promise.all(o)];case 1:return s.sent(),[2,i]}})})},e.prototype.debug=function(t){return t===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},e.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},e.prototype.timeout=function(t){this.settings.timeout=t},e.prototype._dispatch=function(t,r){return m(this,void 0,void 0,function(){var i;return g(this,function(o){return i=new D(t),i.stats.increment("analytics_js.invoke",1,[t.type]),$()&&!this.options.retryQueue?[2,i]:[2,Yt(i,this.queue,this,{callback:r,debug:this._debug,timeout:this.settings.timeout})]})})},e.prototype.addSourceMiddleware=function(t){return m(this,void 0,void 0,function(){var r=this;return g(this,function(i){switch(i.label){case 0:return[4,this.queue.criticalTasks.run(function(){return m(r,void 0,void 0,function(){var o,a,s;return g(this,function(u){switch(u.label){case 0:return[4,import("./chunks/middleware-IRYBL6P5.js")];case 1:return o=u.sent().sourceMiddlewarePlugin,a={},this.queue.plugins.forEach(function(l){if(l.type==="destination")return a[l.name]=!0}),s=o(t,a),[4,this.register(s)];case 2:return u.sent(),[2]}})})})];case 1:return i.sent(),[2,this]}})})},e.prototype.addDestinationMiddleware=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return this.queue.plugins.filter(tr).forEach(function(o){(t==="*"||o.name.toLowerCase()===t.toLowerCase())&&o.addMiddleware.apply(o,r)}),Promise.resolve(this)},e.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},e.prototype.queryString=function(t){return m(this,void 0,void 0,function(){var r;return g(this,function(i){switch(i.label){case 0:return this.options.useQueryString===!1?[2,[]]:[4,import("./chunks/query-string-IIXUCBCI.js")];case 1:return r=i.sent().queryString,[2,r(this,t)]}})})},e.prototype.use=function(t){return t(this),this},e.prototype.ready=function(t){return t===void 0&&(t=function(r){return r}),m(this,void 0,void 0,function(){return g(this,function(r){return[2,Promise.all(this.queue.plugins.map(function(i){return i.ready?i.ready():Promise.resolve()})).then(function(i){return t(i),i})]})})},e.prototype.noConflict=function(){return console.warn(J),Ot(vt??this),this},e.prototype.normalize=function(t){return console.warn(J),this.eventFactory.normalize(t)},Object.defineProperty(e.prototype,"failedInitializations",{get:function(){return console.warn(J),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"VERSION",{get:function(){return se},enumerable:!1,configurable:!0}),e.prototype.initialize=function(t,r){return m(this,void 0,void 0,function(){return g(this,function(i){return console.warn(J),[2,Promise.resolve(this)]})})},e.prototype.pageview=function(t){return m(this,void 0,void 0,function(){return g(this,function(r){switch(r.label){case 0:return console.warn(J),[4,this.page({path:t})];case 1:return r.sent(),[2,this]}})})},Object.defineProperty(e.prototype,"plugins",{get:function(){var t;return console.warn(J),(t=this._plugins)!==null&&t!==void 0?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Integrations",{get:function(){console.warn(J);var t=this.queue.plugins.filter(function(r){return r.type==="destination"}).reduce(function(r,i){var o="".concat(i.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),a=window[o];if(!a)return r;var s=a.Integration;return s?(r[i.name]=s,r):(r[i.name]=a,r)},{});return t},enumerable:!1,configurable:!0}),e.prototype.push=function(t){var r=this,i=t.shift();i&&!r[i]||r[i].apply(this,t)},e})(Pe);var gt=(function(n){N(e,n);function e(){var t=n.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return t.initialized=!0,t}return e})(mt);function yt(){return typeof process>"u"||!process.env?{}:process.env}function Sr(n){return m(this,void 0,void 0,function(){var e;return g(this,function(t){return e=navigator.userAgentData,e?n?[2,e.getHighEntropyValues(n).catch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}var we;function cn(){if(we)return we;var n=ze(window.location.href);return we={expires:31536e6,secure:!1,path:"/"},n&&(we.domain=n),we}function dn(n){var e={btid:"dataxu",urid:"millennial-media"};n.startsWith("?")&&(n=n.substring(1)),n=n.replace(/\?/g,"&");for(var t=n.split("&"),r=0,i=t;r<i.length;r++){var o=i[r],a=o.split("="),s=a[0],u=a[1];if(e[s])return{id:u,type:e[s]}}}function fn(n){return n.startsWith("?")&&(n=n.substring(1)),n=n.replace(/\?/g,"&"),n.split("&").reduce(function(e,t){var r=t.split("="),i=r[0],o=r[1],a=o===void 0?"":o;if(i.includes("utm_")&&i.length>4){var s=i.slice(4);s==="campaign"&&(s="name"),e[s]=Kt(a)}return e},{})}function hn(){var n=B.get("_ga");if(n&&n.startsWith("amp"))return n}function pn(n,e,t){var r,i=new G(t?[]:[new Ge(cn())]),o=i.get("s:context.referrer"),a=(r=dn(n))!==null&&r!==void 0?r:o;a&&(e&&(e.referrer=d(d({},e.referrer),a)),i.set("s:context.referrer",a))}var vn=function(n){try{var e=new URLSearchParams;return Object.entries(n).forEach(function(t){var r=t[0],i=t[1];Array.isArray(i)?i.forEach(function(o){return e.append(r,o)}):e.append(r,i)}),e.toString()}catch{return""}},mn=(function(){function n(){var e=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(t,r){return m(e,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:this.instance=r,a.label=1;case 1:return a.trys.push([1,3,,4]),i=this,[4,Sr(this.instance.options.highEntropyValuesClientHints)];case 2:return i.userAgentData=a.sent(),[3,4];case 3:return o=a.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(t){var r,i,o=t.event.context,a=o.page.search||"",s=typeof a=="object"?vn(a):a;o.userAgent=navigator.userAgent,o.userAgentData=e.userAgentData;var u=navigator.userLanguage||navigator.language;typeof o.locale>"u"&&typeof u<"u"&&(o.locale=u),(r=o.library)!==null&&r!==void 0||(o.library={name:"analytics.js",version:"".concat(De()==="web"?"next":"npm:next","-").concat(se)}),s&&!o.campaign&&(o.campaign=fn(s));var l=hn();l&&(o.amp={id:l}),pn(s,o,(i=e.instance.options.disableClientPersistence)!==null&&i!==void 0?i:!1);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}return t},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}return n})(),br=new mn;var gn=(function(){function n(e,t){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=Re(),this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=t,this.name=e,this.type=t.type,this.alternativeNames.push(t.name)}return n.prototype.addMiddleware=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.type==="destination"&&(e=this.middleware).push.apply(e,t)},n.prototype.transform=function(e){return m(this,void 0,void 0,function(){var t;return g(this,function(r){switch(r.label){case 0:return[4,Bt(this.name,e.event,this.middleware)];case 1:return t=r.sent(),t===null&&e.cancel(new Me({retry:!1,reason:"dropped by destination middleware"})),[2,new D(t)]}})})},n.prototype._createMethod=function(e){var t=this;return function(r){return m(t,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return this.action[e]?(i=r,this.type!=="destination"?[3,2]:[4,this.transform(r)]):[2,r];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!a.sent())throw new Error("Something prevented the destination from getting ready");return le(r,{integrationName:this.action.name,methodName:e,type:"action"}),[4,this.action[e](i)];case 4:return a.sent(),[3,6];case 5:throw o=a.sent(),le(r,{integrationName:this.action.name,methodName:e,type:"action",didError:!0}),o;case 6:return[2,r]}})})}},n.prototype.isLoaded=function(){return this.action.isLoaded()},n.prototype.ready=function(){return m(this,void 0,void 0,function(){var e;return g(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return t.sent(),[2,!0];case 2:return e=t.sent(),[2,!1];case 3:return[2]}})})},n.prototype.load=function(e,t){return m(this,void 0,void 0,function(){var r,i,o,a;return g(this,function(s){switch(s.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];s.label=1;case 1:return s.trys.push([1,3,,4]),le(e,{integrationName:this.action.name,methodName:"load",type:"action"}),r=this.action.load(e,t),o=(i=this.loadPromise).resolve,[4,r];case 2:return o.apply(i,[s.sent()]),[2,r];case 3:throw a=s.sent(),le(e,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(a),a;case 4:return[2]}})})},n.prototype.unload=function(e,t){var r,i;return(i=(r=this.action).unload)===null||i===void 0?void 0:i.call(r,e,t)},n})();function yn(n){if(!Array.isArray(n))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];return n.forEach(function(t){e.forEach(function(r){var i;if(t[r]===void 0)throw new Error("Plugin: ".concat((i=t.name)!==null&&i!==void 0?i:"unknown"," missing required function ").concat(r))})}),!0}function _n(n,e){var t=n[e.creationName],r=n[e.name];return n.All===!1&&!t&&!r||t===!1||r===!1}function wn(n,e){return m(this,void 0,void 0,function(){var t,r,i,o,a,s,u;return g(this,function(l){switch(l.label){case 0:if(l.trys.push([0,9,,10]),t=new RegExp("https://cdn.segment.(com|build)"),r=Oe(),!e)return[3,6];i=n.url.split("/"),o=i[i.length-2],a=n.url.replace(o,btoa(o).replace(/=/g,"")),l.label=1;case 1:return l.trys.push([1,3,,5]),[4,Fe(a.replace(t,r))];case 2:return l.sent(),[3,5];case 3:return s=l.sent(),[4,Fe(n.url.replace(t,r))];case 4:return l.sent(),[3,5];case 5:return[3,8];case 6:return[4,Fe(n.url.replace(t,r))];case 7:l.sent(),l.label=8;case 8:return typeof window[n.libraryName]=="function"?[2,window[n.libraryName]]:[3,10];case 9:throw u=l.sent(),console.error("Failed to create PluginFactory",n),u;case 10:return[2]}})})}function Tr(n,e,t,r,i,o){var a,s,u;return m(this,void 0,void 0,function(){var l,c,f,v=this;return g(this,function(h){switch(h.label){case 0:return l=[],c=(s=(a=n.middlewareSettings)===null||a===void 0?void 0:a.routingRules)!==null&&s!==void 0?s:[],f=((u=n.remotePlugins)!==null&&u!==void 0?u:[]).map(function(p){return m(v,void 0,void 0,function(){var w,I,C,y,E,k,A;return g(this,function(_){switch(_.label){case 0:if(_n(e,p))return[2];_.label=1;case 1:return _.trys.push([1,6,,7]),I=o?.find(function(R){var b=R.pluginName;return b===p.name}),I?[3,3]:[4,wn(p,r?.obfuscate)];case 2:I=_.sent(),_.label=3;case 3:return w=I,w?(C=t[p.name],[4,w(d(d({},p.settings),C))]):[3,5];case 4:y=_.sent(),E=Array.isArray(y)?y:[y],yn(E),k=c.filter(function(R){return R.destinationName===p.creationName}
vendor: 4,811 bytes, line 5
5),E.forEach(function(R){var b=new gn(p.creationName,R);k.length&&i&&b.addMiddleware(i),l.push(b)}),_.label=5;case 5:return[3,7];case 6:return A=_.sent(),console.warn("Failed to load Remote Plugin",A),le(D.system(),{integrationName:p.name,methodName:"load",type:"action",didError:!0}),[3,7];case 7:return[2]}})})}),[4,Promise.all(f)];case 1:return h.sent(),[2,l.filter(Boolean)]}})})}var _t,Ir,Cn=Ne(),kr=(_t=(Ir=Cn).__SEGMENT_INSPECTOR__)!==null&&_t!==void 0?_t:Ir.__SEGMENT_INSPECTOR__={},Ar=function(n){var e;return(e=kr.attach)===null||e===void 0?void 0:e.call(kr,n)};function En(n,e){return ae("".concat(e,"/v1/projects/").concat(n,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(r){throw new Error(r)})}).catch(function(t){throw console.error(t.message),t})}function Sn(n){return yt().NODE_ENV!=="test"&&Object.keys(n.integrations).length>1}function bn(n){var e,t,r;return yt().NODE_ENV!=="test"&&((r=(t=(e=n.middlewareSettings)===null||e===void 0?void 0:e.routingRules)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)>0}function Tn(n,e){fr(n,e),dr(n,e)}function In(n,e,t){return m(this,void 0,void 0,function(){return g(this,function(r){switch(r.label){case 0:return[4,An(n,e)];case 1:return r.sent(),hr(n,t),[2]}})})}var kn=function(){var n,e,t=(n=window.location.hash)!==null&&n!==void 0?n:"",r=(e=window.location.search)!==null&&e!==void 0?e:"",i=r.length?r:t.replace(/(?=#).*(?=\?)/,"");return i},An=function(n,e){return m(void 0,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return e.includes("ajs_")?[4,n.queryString(e).catch(console.error)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})};function Rn(n,e,t,r,i,o,a){var s,u,l;return i===void 0&&(i=[]),m(this,void 0,void 0,function(){var c,f,v,h,p,w,I,C,y,E,k,A,_,R,b,x=this;return g(this,function(S){switch(S.label){case 0:return Tn(t,a),c=i?.filter(function(T){return typeof T=="object"}),f=i?.filter(function(T){return typeof T=="function"&&typeof T.pluginName=="string"}),bn(e)?[4,import("./chunks/routing-middleware-G2VVMTS6.js").then(function(T){return T.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return h=S.sent(),[3,3];case 2:h=void 0,S.label=3;case 3:return v=h,Sn(e)||o.length>0?[4,import("./chunks/ajs-destination-VAVV3MXM.js").then(function(T){return T.ajsDestinations(n,e,t.integrations,r,v,o)})]:[3,5];case 4:return w=S.sent(),[3,6];case 5:w=[],S.label=6;case 6:return p=w,e.legacyVideoPluginsEnabled?[4,import("./chunks/legacy-video-plugins-NHBYC4IZ.js").then(function(T){return T.loadLegacyVideoPlugins(t)})]:[3,8];case 7:S.sent(),S.label=8;case 8:return!((s=r.plan)===null||s===void 0)&&s.track?[4,import("./chunks/schema-filter-2YVTL2RH.js").then(function(T){var L;return T.schemaFilter((L=r.plan)===null||L===void 0?void 0:L.track,e)})]:[3,10];case 9:return C=S.sent(),[3,11];case 10:C=void 0,S.label=11;case 11:return I=C,y=Gt(e,r),[4,Tr(e,t.integrations,y,r,v,f).catch(function(T){return console.error("Failed to load remote plugins",T),[]})];case 12:return E=S.sent(),k=P(P([br],p,!0),E,!0),I&&k.push(I),A=((u=r.integrations)===null||u===void 0?void 0:u.All)===!1&&!r.integrations["Segment.io"]||r.integrations&&r.integrations["Segment.io"]===!1,A?[3,14]:(R=(_=k).push,[4,Er(t,y["Segment.io"],e.integrations)]);case 13:R.apply(_,[S.sent()]),S.label=14;case 14:return[4,t.register.apply(t,P(P([],k,!1),c,!1))];case 15:return b=S.sent(),[4,cr(t,a)];case 16:return S.sent(),Object.entries((l=e.enabledMiddleware)!==null&&l!==void 0?l:{}).some(function(T){var L=T[1];return L})?[4,import("./chunks/remote-middleware-CFPD5N7Z.js").then(function(T){var L=T.remoteMiddlewares;return m(x,void 0,void 0,function(){var O,j;return g(this,function(F){switch(F.label){case 0:return[4,L(b,e,r.obfuscate)];case 1:return O=F.sent(),j=O.map(function(K){return t.addSourceMiddleware(K)}),[2,Promise.all(j)]}})})})]:[3,18];case 17:S.sent(),S.label=18;case 18:return[4,lr(t,a)];case 19:return S.sent(),[2,b]}})})}function Pn(n,e,t){var r,i,o,a,s,u,l,c,f;return e===void 0&&(e={}),m(this,void 0,void 0,function(){var v,h,p,w,I,C,y,E,k,A,_;return g(this,function(R){switch(R.label){case 0:return e.disable===!0?[2,[new gt,D.system()]]:(e.globalAnalyticsKey&&Dt(e.globalAnalyticsKey),n.cdnURL&&zt(n.cdnURL),e.initialPageview&&t.add(new _e("page",[])),v=kn(),h=(r=n.cdnURL)!==null&&r!==void 0?r:Oe(),(i=n.cdnSettings)!==null&&i!==void 0?(w=i,[3,3]):[3,1]);case 1:return[4,En(n.writeKey,h)];case 2:w=R.sent(),R.label=3;case 3:return p=w,e.updateCDNSettings&&(p=e.updateCDNSettings(p)),typeof e.disable!="function"?[3,5]:[4,e.disable(p)];case 4:if(I=R.sent(),I)return[2,[new gt,D.system()]];R.label=5;case 5:return C=(a=(o=p.integrations["Segment.io"])===null||o===void 0?void 0:o.retryQueue)!==null&&a!==void 0?a:!0,e=d({retryQueue:C},e),y=new mt(d(d({}
5,n),{cdnSettings:p,cdnURL:h}),e),Ar(y),E=(s=n.plugins)!==null&&s!==void 0?s:[],k=(u=n.classicIntegrations)!==null&&u!==void 0?u:[],A=(l=e.integrations)===null||l===void 0?void 0:l["Segment.io"],Mt.initRemoteMetrics(d(d({},p.metrics),{host:(c=A?.apiHost)!==null&&c!==void 0?c:(f=p.metrics)===null||f===void 0?void 0:f.host,protocol:A?.protocol})),[4,Rn(n.writeKey,p,y,e,E,k,t)];case 6:return _=R.sent(),y.initialized=!0,y.emit("initialize",n,e),[4,In(y,v,t)];case 7:return R.sent(),[2,[y,_]]}})})}var wt=(function(n){N(e,n);function e(){var t=this,r=Re(),i=r.promise,o=r.resolve;return t=n.call(this,function(a){return i.then(function(s){var u=s[0],l=s[1];return Pn(u,l,a)})})||this,t._resolveLoadStart=function(a,s){return o([a,s])},t}return e.prototype.load=function(t,r){return r===void 0&&(r={}),this._resolveLoadStart(t,r),this},e.load=function(t,r){return r===void 0&&(r={}),new e().load(t,r)},e.standalone=function(t,r){return e.load({writeKey:t},r).then(function(i){return i[0]})},e})(vr);var Ct={FORM_SUBMITTED:"Form Submitted",USER_CLICKED:"User Clicked",USER_INPUTTED:"User Inputted"},Ln=3,xn=500,Ye=()=>({isAutomatedTest:!1,isAWS:!1,isBot:!1,isCypress:!1,isDatadog:!1,isMobileDevice:!!window._GROWTHERAPY_IS_MOBILE}),Ce=class{constructor(){if(Ie())return;let e=window.analyticsConfig||{},t=e.segment||{};this.config={cookieRefreshThreshold:30,mobileBreakpoint:600,productionKey:t.writeKey,stagingKey:t.writeKey},this.mobileResizeHandler(),this.environment=e.environment,this.date=new Date,this.date.setFullYear(this.date.getFullYear()+1),this.expirationDateStringForCookies=`expires=${this.date.toUTCString()}`,this.isAmazonLP=window.location.href.includes("/benefits/amazon"),this.initialize()}mobileResizeHandler(){let e=()=>{window._GROWTHERAPY_IS_MOBILE=window.innerWidth<this.config.mobileBreakpoint};e();let t=It(e,100);window.addEventListener("resize",t)}initialize(){try{let e=this.getWriteKey();if(!e){console.warn("Segment write key not configured");return}this.loadSegmentScript(e),this.getPageViewCookies(),this.trackPageView()}catch(e){console.error("Segment initialization error:",e)}}getWriteKey(){return this.environment==="production"?this.config.productionKey:this.config.stagingKey}loadSegmentScript(e){if(window.analytics){console.warn("Segment Analytics already loaded");return}window.analytics=wt.load({writeKey:e})}getPageViewCookies(){let e=kt(["_vwo_uuid_v2","grow_universal_id"]);this.growUniversalIdCookie=this.getGrowUniversalId(e.grow_universal_id),this.statsigStableIdCookie=this.growUniversalIdCookie,this.vwoUuidCookie=e._vwo_uuid_v2}getGrowUniversalId(e){let r=new URLSearchParams(window.location.search).get("growUniversalId");return r&&r!==""?r:e}trackPageView(){this.growUniversalIdCookie?this.handleReturningUserPageView():this.handleNewUserPageView()}handleNewUserPageView(){let e=Te(),t=this.buildPageProperties(this.statsigStableIdCookie,e,this.vwoUuidCookie);this.handlePageViewEvent(t,e)}handleReturningUserPageView(){let e=this.buildPageProperties(this.statsigStableIdCookie,this.growUniversalIdCookie,this.vwoUuidCookie);this.handlePageViewEvent(e,this.growUniversalIdCookie),this.refreshCookieIfNeeded(this.growUniversalIdCookie)}buildPageProperties(e,t,r){let i={statsigCustomIDs:["stableID",e,"growUniversalId",t],statsigEnvironment:{tier:this.environment},growUniversalId:t,vwoUuid:r,isAutomatedTest:!1,isCypress:!1,isDatadog:!1,isAWS:!1,isBot:!1,isMobileDevice:!!window._GROWTHERAPY_IS_MOBILE};return this.isAmazonLP&&(i.type="Amazon EAP"),i}handlePageViewEvent(e,t){let r=this.getPageViewEventType();window.analytics.page(void 0,r,e,{anonymousId:t}),this.setCookie("grow_universal_id",t),this.setCookie("grow_universal_id_expiration",this.getFormattedDate()),this.setCookie("statsig_stable_id",t)}setCookie(e,t){document.cookie=`${e}=${t}; Secure; ${this.expirationDateStringForCookies}; domain=${X()}; path=/`}getPageViewEventType(){let e=document.querySelector("[data-multi-step-search-filter-form]");if(e)return e.getAttribute("data-multi-step-search-filter-form")==="long"?"Long Quiz Viewed":"Short Quiz Viewed";let{pathname:t}=window.location;return t==="/start/find-therapist-social/"?"Social LP Viewed":t==="/"?"organic site - homepage":t.startsWith("/start/")?"organic site - landing page":"organic site - other page"}getFormattedDate(){return this.date.toISOString().split("T")[0]}refreshCookieIfNeeded(e){let t=ie("grow_universal_id_expiration");if(t){let r=Date.now(),i=new Date(t).getTime();Math.floor((i-r)/(1e3*60*60*24))<this.config.cookieRefreshThreshold&&(this.setCookie("grow_universal_id",e),this.setCookie("grow_universal_id_expiration",this.getFormattedDate()),this.setCookie("statsig_stable_id",e))}}},Et=class{constructor(){this.retryConfig={maxRetries:Ln,retryDelay:xn}}sendTrackingEvent(e,t){let r=0;return new Promise((i,o)=>{let a=()=>
5{if(window.analytics){let s=ie("_vwo_uuid_v2")??void 0,u=ie("grow_universal_id")??void 0,l={...t,growUniversalId:u,vwoUuid:s};window.analytics.track(e,l,{},()=>i("success"))}else r<this.retryConfig.maxRetries?(r+=1,setTimeout(a,this.retryConfig.retryDelay)):o("Analytics object not present on window.")};a()})}setupAnchorLinkClickTracking(e,t,r,i=!1){let o=window.location.pathname,a=i?new URL(window.location.href).hostname:null;Array.from(e).forEach(s=>{try{let u=r(s);if(!u)return;if(i){let v=a==="growtherapy.com"?s.href:s.href.replace("growtherapy.com","growtherapystaging.com");s.href=v}let c=new URL(s.href).pathname!==o?s.href:void 0,f={elementId:u,...c&&{destinationUrl:c},...Ye()};s.addEventListener("click",()=>{this.sendTrackingEvent(t,f).catch(v=>{console.error(`Failed to track anchor link click: ${v}`)})})}catch(u){u instanceof Error&&console.error(`Failed to setup tracking for element: ${u.message}`)}})}trackButtonClick(e,t=void 0){try{let r={type:e,...t,...Ye()};this.sendTrackingEvent(Ct.USER_CLICKED,r).catch(i=>{console.error(`Failed to track button click: ${i}`)})}catch(r){r instanceof Error&&console.error(`Failed to setup tracking for element: ${r.message}`)}}trackFormSubmit(e,t=void 0){try{let r={type:e,...t,...Ye()};this.sendTrackingEvent(Ct.FORM_SUBMITTED,r).catch(i=>{console.error(`Failed to track form submit: ${i}`)})}catch(r){console.debug(r),r instanceof Error&&console.error(`Failed to setup tracking for element: ${r.message}`)}}trackUserInput(e,t){try{let r={type:e,...t,...Ye()};this.sendTrackingEvent(Ct.USER_INPUTTED,r).catch(i=>{console.error(`Failed to track input: ${i}`)})}catch(r){r instanceof Error&&console.error(`Failed to setup tracking for element: ${r.message}`)}}},H=new Et;window.SegmentTracking={setupAnchorLinkClickTracking:H.setupAnchorLinkClickTracking.bind(H),sendTrackingEvent:H.sendTrackingEvent.bind(H),trackButtonClick:H.trackButtonClick.bind(H),trackFormSubmit:H.trackFormSubmit.bind(H),trackUserInput:H.trackUserInput.bind(H)};var Ee=class{constructor(){this.isAmazonLP=window.location.href.includes("/benefits/amazon"),this.EVENTS={BENEFIT_CARD_CLICK:"Benefit Card Click",BENEFIT_CARD_CTA_CLICK:"Benefit Card CTA Click",FAQ_CLICK:"FAQ Click",FIND_THERAPIST_CTA_CLICK:"Find a Therapist CTA Click",FIND_THERAPIST_CTA_NAV_CLICK:"Find a Therapist CTA Nav Click",HOW_IT_WORKS_LINK_CLICK:"How it works Link Click",INSURANCE_LOGO_CLICK:"Insurance Logo Click",INTERCOM_CLICK:"Get in Touch",REVIEWS_CAROUSEL:"Reviews Carousel",SCREENER_CARDS_CLICK:"Screener Cards",WPML_LANGUAGE_OPTION_CLICK:"Language Switcher Modal Choice"},this.FIND_THERAPIST_TEXT="find a therapist",this.EVENT_PATTERNS={MOBILE:"Mobile",TOGGLE_TYPES:["By City","By State","Provider Resources","Therapy Resources"]},this.MADLIBS_FILTERS_URL="/start/filters/",this.SELECTORS={CTA_SELECTORS:"[data-header-interstitial-trigger], [data-sticky-mobile-cta-trigger]",INTERCOM_TRIGGER:"[data-intercom-trigger]",MOBILE_NAV:".header__nav--mobile [data-segment-click-mobile-only]",HEADER_DROPDOWN_SUBMENU:".header__dropdown--sub-menu",HEADER_INTERSTITIAL_TRIGGER:"[data-header-interstitial-trigger]",HEADER_SEGMENT_CLICK:"header li[data-segment-click]",STICKY_MOBILE_CTA_TRIGGER:"[data-sticky-mobile-cta-trigger]",SUBMENU_TOGGLE:".brx-submenu-toggle span"},this.TRACKED_ATTR="data-tracked",this.cache=new Map,this.configs=[...this.createAccordionConfigs(),...this.createBasicConfigs(),...this.createHeaderNavConfigs(),...this.createMobileNavToggleConfigs(),...this.createScreenerConfigs(),...this.createStatesListConfigs(),...this.createToggleConfigs(),...this.createWpmlModalConfigs()],this.initialized=!1,this.init()}init(){this.initialized||(this.setupTracking(),this.initialized=!0)}attachTracking(e,t){if(e.hasAttribute(this.TRACKED_ATTR))return;e.setAttribute(this.TRACKED_ATTR,"true");let r=Array.isArray(t)?t:[t];e.addEventListener("click",i=>{r.forEach(o=>{this.shouldSkipTracking(i,o)||this.trackEvent(o,e)})},{passive:!0})}cacheGet(e,t){return this.cache.has(e)||this.cache.set(e,t()),this.cache.get(e)}createAccordionConfigs(){return[this.createPositionConfig(".accordion-wrapper__accordion-nested .accordion-wrapper__item",this.EVENTS.FAQ_CLICK,"faq_number",".accordion-wrapper__accordion-nested",".accordion-wrapper__item")]}createBasicConfigs(){return[this.createComponentConfig('a[href*="/cost-estimate"]',"Cost Estimate Link Click",e=>({link_text:e.textContent?.trim()||""})),{selector:'a[href^="/client-login"]',eventType:"Client Login"},{selector:'a[href="https://provider.growtherapy.com/login"]',eventType:"Provider Login"},this.createComponentConfig("[data-specialty]","Specialty Name Click",e=>({specialty_name:e.getAttribute("data-specialty")||""})),this.createComponentConfig("[data-insurance]",this.EVENTS.INSURANCE_LOGO_CLICK,e=>({insurance_name:e.getAttribute("data-insurance")||""})),{selector:".dark-content-image-layout .dark-content-card a",eventType:this.EVENTS.HOW_IT_WORKS_LINK_CLICK,getProperties:e=>({step_number:this.getHowItWorksStepNumber(e)})},{selector:'[data-segment-component-name="Testimonial Carousel"] .splide__arrow',eventType:this.EVENTS.REVIEWS_CAROUSEL},{selector:this.SELECTORS.INTERCOM_TRIGGER,eventType:this.EVENTS.INTERCOM_CLICK}]}createComponentConfig(e,t,r=null){let i=this.isAmazonLP&&t===this.EVENTS.FIND_THERAPIST_CTA_CLICK?"Find a Therapist Clicked":t;return{selector:e,eventType:i,getProperties:o=>({component_name:this.getComponentNameFromElement(o),...r?r(o):{}})}}createHeaderNavConfigs(){let e=[{path:"/how-it-works/",eventType:"Nav - How It Works Click"},{path:"/providers-medication-management/",eventType:"Nav - Prescribers Click"},{path:"/providers/",eventType:"Nav - Therapists/Counselors Click"},{path:"/employers/",eventType:"Nav - Employers Click"},{path:"/pcp-physicians/",eventType:"Nav - Physicians Click"},{path:"/payors/",eventType:"Nav - Payors Click"},{path:"/about-us/",eventType:"Nav - About Us Click"}],t=this.createTextFilter(this.FIND_THERAPIST_TEXT);return[...e.map(r=>({selector:`header a[href*="${r.path}"]`,eventType:r.eventType})),{selector:`.header__nav--mobile ${this.SELECTORS.STICKY_MOBILE_CTA_TRIGGER}`,eventType:this.EVENTS.FIND_THERAPIST_CTA_NAV_CLICK,filter:t},{selector:`header a[href*="${this.MADLIBS_FILTERS_URL}"]`,eventType:this.EVENTS.FIND_THERAPIST_CTA_NAV_CLICK,filter:t},this.createComponentConfig(`main ${this.SELECTORS.HEADER_INTERSTITIAL_TRIGGER}`,this.EVENTS.FIND_THERAPIST_CTA_CLICK,null),this.createComponentConfig(`main ${this.SELECTORS.STICKY_MOBILE_CTA_TRIGGER}`,this.EVENTS.FIND_THERAPIST_CTA_CLICK,null)].map(r=>(r.eventType===this.EVENTS.FIND_THERAPIST_CTA_CLICK&&(r.filter=t),r))}createMobileNavToggleConfigs(){return[{text:"get care",eventType:"Nav - Get Care Click - Mobile"},{text:"become a grow provider",eventType:"Nav - Become Provider Click - Mobile"},{text:"partner with grow",eventType:"Nav - Partner with Grow Click - Mobile"}].map(t=>({selector:this.SELECTORS.MOBILE_NAV,eventType:t.eventType,filter:this.createTextFilter(t.text,this.SELECTORS.SUBMENU_TOGGLE,"exact")}))}createPositionConfig(e,t,r,i,o){return{selector:e,eventType:t,getProperties:a=>({[r]:this.getElementPosition(a,i,o)})}}createScreenerConfigs(){return[this.createPositionConfig(".screeners-grid__posts-wrapper .related-content",this.EVENTS.SCREENER_CARDS_CLICK,"card_number",".screeners-grid__posts-wrapper",".related-content")]}createStatesListConfigs(){return[this.createTextConfig("header [data-states-list-link]","Nav - State Click"),this.createTextConfig("header [data-states-by-city-link]","Nav - City Click")]}createTextConfig(e,t,r="value"){return{selector:e,eventType:t,getProperties:i=>({[r]:i.textContent?.trim()||""})}}createTextFilter(e,t=null,r="includes"){let i=e.toLowerCase();return o=>{let s=(t?o.querySelector(t):o)?.textContent?.trim().toLowerCase();return s?r==="exact"?s===i:s.includes(i):!1}}createToggleConfigs(){return[{text:"by state",eventType:"Nav - By State Click"},{text:"by city",eventType:"Nav - By City Click"},{text:"therapy resources",eventType:"Nav - Therapy Resources Click"},{text:"provider resources",eventType:"Nav - Provider Resources Click"}].map(t=>({selector:this.SELECTORS.HEADER_SEGMENT_CLICK,eventType:t.eventType,filter:this.createTextFilter(t.text,this.SELECTORS.SUBMENU_TOGGLE,"exact")}))}createWpmlModalConfigs(){return[{selector:"[data-responsive-modal-trigger]",getEventType:e=>this.getResponsiveModalTriggerEventType(e),getProperties:e=>({component_name:this.getComponentNameFromElement(e),modal_id:e.getAttribute("data-responsive-modal-trigger")||"",trigger_location:this.getResponsiveModalTriggerLocation(e)})},{selector:'.wpml-language-switcher-form input[type="radio"]',getEventType:e=>this.getWpmlLanguageOptionEventType(e),getProperties:e=>({component_name:this.getComponentNameFromElement(e),selected_language:e.value||""})},{selector:"[data-responsive-modal-close]",getEventType:e=>this.getResponsiveModalCloseEventType(e),getProperties:e=>({component_name:this.getComponentNameFromElement(e),modal_id:this.getResponsiveModalIdFromElement(e)})}]}getCardNumberFromCTA(e){let t=e.closest(".keen-slider__slide");
5return t?this.getElementPosition(t,".care-support-section-slider",".keen-slider__slide"):1}getComponentNameFromElement(e){return e.closest("[data-segment-component-name]")?.getAttribute("data-segment-component-name")||""}getResponsiveModalTriggerLocation(e){return e.closest("header")?"header":e.closest("footer")?"footer":"other"}getResponsiveModalIdFromElement(e){return e.closest("[data-responsive-modal-id]")?.getAttribute("data-responsive-modal-id")||""}getResponsiveModalCloseEventType(e){return`Responsive Modal Close [${this.getResponsiveModalIdFromElement(e)||"unknown"}] - Click`}getResponsiveModalTriggerEventType(e){let t=this.getComponentNameFromElement(e),r=this.getResponsiveModalTriggerLocation(e),o={header:"Header",footer:"Footer",other:"Other"}[r]||"Other";return t?`${t} [${o}] - Click`:`Responsive Modal Open [${e.getAttribute("data-responsive-modal-trigger")||"unknown"}] - Click`}getWpmlLanguageOptionEventType(e){let t=(e.value||"").trim()||"unknown";return`${this.EVENTS.WPML_LANGUAGE_OPTION_CLICK} [${t}] - Click`}getElementPosition(e,t,r){let i=e.closest(t);if(!i)return 1;let o=i.querySelectorAll(r),a=Array.from(o).indexOf(e);return Math.max(1,a+1)}getHowItWorksStepNumber(e){let t=e.closest(".dark-content-card");if(!t)return 1;let r=t.closest(".dark-content-image-layout");if(!r)return 1;let i=r.querySelectorAll(".dark-content-card"),o=Array.from(i).indexOf(t);return Math.max(1,o+1)}groupConfigsBySelector(){let e={};for(let t of this.configs)e[t.selector]||(e[t.selector]=[]),e[t.selector].push(t);return e}hasAttributeOrInParent(e,t){return e.hasAttribute(t)||e.closest(`[${t}]`)!==null}hasMobileSubMenuAttribute(e){return this.hasAttributeOrInParent(e,"data-mobile-sub-menu")}isBenefitCardEvent(e){return e.eventType===this.EVENTS.BENEFIT_CARD_CLICK}isClickOnBenefitCardCTA(e){return this.isClickOnCTA(e)?!0:this.matchesOrInParent(e,`a[href*="${this.MADLIBS_FILTERS_URL}"]`)}isClickOnCTA(e){return e.closest(this.SELECTORS.CTA_SELECTORS)!==null}isInHeaderSubmenu(e){return e.closest(this.SELECTORS.HEADER_DROPDOWN_SUBMENU)!==null}isMobileNavEvent(e){return e.eventType?.includes(this.EVENT_PATTERNS.MOBILE)}isToggleEvent(e){return this.EVENT_PATTERNS.TOGGLE_TYPES.some(t=>e.eventType?.includes(t))}isSegmentTrackingAvailable(){return window.SegmentTracking&&typeof window.SegmentTracking.trackButtonClick=="function"}matchesOrInParent(e,t){return e.matches(t)||e.closest(t)!==null}setupTracking(){let e=this.groupConfigsBySelector(),t=new Map;for(let[r,i]of Object.entries(e)){let o=this.cacheGet(`elements_${r}`,()=>Array.from(document.querySelectorAll(r)));for(let a of o){let s=i.filter(u=>!u.filter||u.filter(a));s.length>0&&(t.has(a)||t.set(a,[]),t.get(a).push(...s))}}for(let[r,i]of t)this.attachTracking(r,i)}shouldSkipTracking(e,t){let r=e.target;return t.eventType===this.EVENTS.BENEFIT_CARD_CLICK?this.isClickOnBenefitCardCTA(r):t.eventType===this.EVENTS.BENEFIT_CARD_CTA_CLICK?!this.isClickOnBenefitCardCTA(r):this.isMobileNavEvent(t)?this.hasMobileSubMenuAttribute(r):this.isToggleEvent(t)?this.isInHeaderSubmenu(r):!1}trackEvent(e,t){if(!this.isSegmentTrackingAvailable())return;let r;try{if(r=e.getEventType?e.getEventType(t):e.eventType,!r)return;let i=e.getProperties?.(t)||{};window.SegmentTracking.trackButtonClick(r,i)}catch(i){console.error(`Tracking error for ${r??"unknown"}:`,i)}}};var Se=class{constructor(){this.initialize()}initialize(){try{this.loadTrustpilotScript()}catch(e){console.error("Failed to initialize Trustpilot:",e)}}loadTrustpilotScript(){if(document.querySelector('script[src*="trustpilot.com"]'))return;let e=document.createElement("script");e.type="text/javascript",e.src="https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js",e.defer=!0,document.head.appendChild(e)}};var Mn=()=>{let n="statsig_stable_id",e="STATSIG_LOCAL_STORAGE_STABLE_ID",t=new Date;t.setFullYear(t.getFullYear()+1);let r=`expires=${t.toUTCString()}`,i=ie(n),o=localStorage?.getItem(e);if(i)localStorage.setItem(e,i);else if(o)document.cookie=`${n}=${o}; ${r}; path=/; domain=${X()}`;else{let a=Te();localStorage?.setItem(e,a),document.cookie=`${n}=${a}; ${r}; path=/; domain=${X()}`}},be=class{constructor(){this.ANALYTICS_PARAMS=["utm_campaign","utm_source","utm_medium","utm_content","utm_term","utm_device","network","placement","geoid","matchtype","gclid","fbclid","ndclid","msclkid"],this.FIRST_TOUCH_ANALYTICS_PARAMS=["utm_campaign","utm_source","utm_medium","utm_content","utm_term","utm_device"],this.init()}init(){let e=new URLSearchParams(window.location.search),t=Array.from(e.entries()).filter(([o])=>o.startsWith("utm_")||o.startsWith("cc_opt")).map(([o,a])=>`${o}=${a}`).join("&"),r=new Date;r.setFullYear(r.getFullYear()+1);let i=`expires=${r.toUTCString()}`;this.ANALYTICS_PARAMS.forEach(o=>{let a=e.get(o);a&&(document.cookie=`grow_${o}=${a}; ${i}; domain=${X()}; path=/`)}),this.FIRST_TOUCH_ANALYTICS_PARAMS.forEach(o=>{let a=e.get(o);if(a){let s=`grow_first_${o}`;document.cookie.split("; ").find(u=>u.startsWith(s))||(document.cookie=`${s}=${a}; ${i}; domain=${X()}; path=/`)}}),this.setupLinkHandling(t),Mn()}setupLinkHandling(e){document.querySelectorAll("a").forEach(r=>{r.addEventListener("click",()=>{this.handleUtmParams(r,e),this.handleParamsOnNavigation(r)})})}handleUtmParams(e,t){if(e.href&&!e.href.includes(t)&&!e.href.includes("#")){let r=new URL(e.href,window.location.href);r.search+=(r.search?"&":"?")+t,e.href=r.toString()}}handleParamsOnNavigation(e){let{search:t}=window.location;if(!t)return;let r=e.getAttribute("href");if(!r||!r.startsWith(`${window.location.origin}/filters`)&&!r.startsWith(`${window.location.origin}/therapists`)&&!r.startsWith(`${window.location.origin}/categories`))return;let i=new URL(r,window.location.origin),o=new URLSearchParams(i.search);new URLSearchParams(t).forEach((s,u)=>{o.has(u)||o.append(u,s)}),i.search=o.toString(),e.setAttribute("href",i.toString())}};function Nn(){new Ce}function Rr(){new pe,new ve,new me,new ge,new Se,new be;let n=new Ee;window.GenericTracking=n}Nn();document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Rr()):Rr();
6/*! Bundled license information:
7
8js-cookie/dist/js.cookie.mjs:
9  (*! js-cookie v3.0.8 | MIT *)
10*/
11//# sourceMappingURL=growtherapy-analytics-js-77TXBUXZ.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.