PageSourceSearch

https://app.avidai.com/build/assets/amplitude-DZJ2xCGq.js

js avidai.com collected 2026-10-03 20:19:38 UTC 8,492 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="843911d8-0e79-5813-936a-f0cfb83fd6cb")}catch(e){}}();
3import{a as e,c as t,i as n,l as r,o as i,r as a,s as o,t as s,u as c}from"./vendor-amplitude-CzOTLebq.js";var l=`avid-web`,u=`US`,d={attribution:!0,fileDownloads:!0,formInteractions:!0,pageViews:!0,sessions:!0,elementInteractions:!0,networkTracking:!0,webVitals:!0,frustrationInteractions:{thrashedCursor:!0,errorClicks:!0,deadClicks:!0,rageClicks:!0}},f=null,p=null,m=null,h=null,g=!1,_=!1,v={},y={},b={};function x(e,t={}){window.__amplitudeDebug={...window.__amplitudeDebug||{},stage:e,timestamp:new Date().toISOString(),...t}}function S(e,t,n){let r=null,i=new Promise((e,i)=>{r=window.setTimeout(()=>{i(Error(`${n} timed out after ${t}ms`))},t)});return Promise.race([e,i]).finally(()=>{r&&window.clearTimeout(r)})}function C(){let e=window?._avid_env||{};return{apiKey:e.AMPLITUDE_API_KEY||``,serverZone:w(e.AMPLITUDE_SERVER_ZONE)}}function w(e){return String(e||u).toUpperCase()===`EU`?`EU`:`US`}function T(e,t){if(typeof document>`u`)return Promise.resolve(null);if(t&&window?.[t])return Promise.resolve(window[t]);let n=document.querySelector(`script[src="${e}"]`);return n?new Promise((r,i)=>{n.addEventListener(`load`,()=>r(t?window?.[t]:!0),{once:!0}),n.addEventListener(`error`,()=>i(Error(`Failed to load script: ${e}`)),{once:!0})}):new Promise((n,r)=>{let i=document.createElement(`script`);i.async=!0,i.src=e,i.onload=()=>n(t?window?.[t]:!0),i.onerror=()=>r(Error(`Failed to load script: ${e}`)),document.head.appendChild(i)})}async function E(e){if(!e||g)return null;h||=S(T(`https://cdn.amplitude.com/script/${e}.engagement.js`,`engagement`),8e3,`Amplitude engagement plugin load`);let t=await h;if(!t?.plugin)throw Error(`Amplitude engagement plugin did not expose window.engagement.plugin`);return await S(a(t.plugin()).promise,5e3,`Amplitude engagement plugin init`),g=!0,t}function D(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null&&e!==``))}var O=`X-Amplitude-Session-Id`,k=`X-Amplitude-Device-Id`,A=!1,j=null;function M(){if(!f)return{sessionId:null,deviceId:null};let e=typeof f.getSessionId==`function`?f.getSessionId():null,t=typeof f.getDeviceId==`function`?f.getDeviceId():null;return{sessionId:typeof e==`number`&&Number.isFinite(e)?e:null,deviceId:typeof t==`string`&&t.length>=5?t:null}}function N(e){let{sessionId:t,deviceId:n}=M();return t!==null&&e.set(O,String(t)),n&&e.set(k,n),e}function P(e,t=window.location.origin){try{let n=typeof e==`string`?e:e?.url||``;return new URL(n,t||window.location.origin).origin===window.location.origin}catch{return!1}}function F(){A||typeof window>`u`||(A=!0,window.axios?.interceptors?.request&&window.axios.interceptors.request.use(e=>{if(!P(e.url||``,e.baseURL||window.location.origin))return e;let t=e.headers||{},{sessionId:n,deviceId:r}=M();return n!==null&&(t[O]=String(n)),r&&(t[k]=r),e.headers=t,e}),typeof window.fetch==`function`&&(j=window.fetch.bind(window),window.fetch=(e,t={})=>{if(!P(e))return j(e,t);let n=new Headers(t.headers||(typeof Request<`u`&&e instanceof Request?e.headers:void 0));return N(n),j(e,{...t,headers:n})}))}function I(){return{name:`avid-default-properties`,type:`enrichment`,setup:async()=>void 0,execute:async e=>(e.event_properties={...e.event_properties||{},app_env:window.app_env||`unknown`},e)}}function L(e={}){return e.url?String(e.url):void 0}function R(e={}){let t=L(e);return t?`user:${t}`:`anonymous`}function z(e={},t=null){let n=D({email:e.email||``,avid_email:e.email||``,avid_first_name:e.first_name||``,avid_last_name:e.last_name||``,avid_user_type:e.user_type||``,avid_agency_id:e.agency_id||e.agency?.id||null,avid_agency:K(e),avid_user_id:e.id||null});return t?.active&&(n.avid_is_impersonating=!0,n.avid_impersonated_user_id=t.impersonatedUser?.id??t.impersonatedUserId??null),n}function B(e=null){if(!e||typeof e!=`object`||!e.id)return{};let t=D({avid_client_plan_level:e.plan_level??null,avid_client_plan_level_effective:e.plan_level_effective??null,avid_client_is_onboarding:typeof e.is_onboarding==`boolean`?e.is_onboarding:null,avid_organization:e.name??null,avid_client_name:e.name??null,avid_client_id:e.id??null}),n=v[e.id];return n&&Object.assign(t,n),t}function V(e=window?.client||{}){let t=e?.id,n=e?.url;!t||!n||typeof window.axios?.get!=`function`||v[t]||b[t]||(b[t]=window.axios.get(`/api/clients/${encodeURIComponent(n)}/amplitude-usage`).then(({data:e})=>{v[t]={avid_pathways_configured_count:e?.avid_pathways_configured_count??0,avid_connected_integrations_count:e?.avid_connected_integrations_count??0,avid_connected_integrations:typeof e?.avid_connected_integrations==`string`?e.avid_connected_integrations:``},y[t]=e?.groupProperties&&typeof e.groupProperties==`object`?e.groupProperties:{},x(`usage:loaded`,{clientId:t,usageProperties:v[t],groupProperties:y[t]}),U(J(),H())}).catch(e=>{x(`usage:error`,{clientId:t,error:e?.message||`amplitude-usage request failed`,status:e?.response?.status??null})}).finally(()=>{delete b[t]}))}function H(){return typeof window<`u`&&window.impersonation?.active?window.impersonation:null}function U(n={},r=H()){let i=L(n),a=window?.client||{},s={...z(n,r),...B(a)};if(t(i),Object.keys(s).length>0){let t=new c;
3Object.entries(s).forEach(([e,n])=>{t.set(e,n)}),e(t)}let l=W(a);l&&o(`client`,l);let u=G(n);u&&o(`agency`,u)}function W(e={}){if(!e?.id)return null;let t=typeof e.name==`string`?e.name.trim():``;return t?`${e.id}-${t}`:String(e.id)}function G(e={}){let t=e.agency_id??e.agency?.id??null;if(t==null||t===``)return null;let n=K(e);return n?`${t}-${n}`:String(t)}function K(e={}){return typeof e.agency==`string`&&e.agency.trim()!==``?e.agency:e.agency&&typeof e.agency==`object`&&e.agency.name?e.agency.name:null}async function q(e={},t=null){let{apiKey:r,serverZone:o}=C();if(x(`analytics:init:start`,{hasApiKey:!!r,serverZone:o}),!r)return x(`analytics:init:skipped`,{reason:`missing_api_key`}),null;if(!f){await S(i(r,L(e),{instanceName:l,serverZone:o,fetchRemoteConfig:!0,autocapture:d}).promise,8e3,`Amplitude analytics init`);try{await a(I()).promise}catch(e){console.warn(`Amplitude enrichment plugin failed to initialize`,e)}if(!_&&!(window.app_env===`local`||window.location.hostname===`local.avidai.com`))try{await S(a(s({sampleRate:1})).promise,5e3,`Amplitude session replay init`),_=!0}catch(e){console.warn(`Amplitude session replay failed to initialize`,e),x(`analytics:session_replay:error`,{error:e.message})}f=n,window.amplitude=n,F();try{await E(r)}catch(e){console.warn(`Amplitude engagement plugin failed to initialize`,e),x(`analytics:engagement:error`,{error:e.message})}}return U(e,t),V(window?.client||{}),F(),x(`analytics:init:done`,{userId:L(e)||null,...M()}),f}function J(e=null){return e&&L(e)?e:typeof window<`u`&&window.analyticsUser?window.analyticsUser:e||{}}var Y={async initialize(e={},t={}){let n=J(t.analyticsUser??e),r=t.impersonation??H(),i=R(n);return x(`initialize:start`,{userKey:i}),p&&m===i?(x(`initialize:reuse`,{userKey:i}),f&&(U(n,r),V(window?.client||{})),p):(m=i,p=(async()=>{try{return await q(n,r),m=i,window.amplitudeClient=f,x(`initialize:done`,{userKey:i}),f}catch(e){throw p=null,m=null,x(`initialize:error`,{userKey:i,error:e.message}),e}})(),p)},async updateUser(e={}){return this.initialize(e)},logEvent(e,t=null,n={}){if(!f||!e)return null;let i={...n};return t!=null&&(i.value=t),r(e,i)},getClient(){return f},getSessionId(){return M().sessionId},getDeviceId(){return M().deviceId},installRequestHeaderInterceptors(){F()}};function X(e={}){let t=window?.client||{},{sessionId:n,deviceId:r}=M(),i={},a=G(e),o=W(t);return o&&(i.client=o),a&&(i.agency=a),{userId:L(e)||null,sessionId:n,deviceId:r,userProperties:{...z(e),...B(t)},groups:i,groupProperties:t.id&&y[t.id]||{}}}window.getAmplitudeAnalyticsIdentity=()=>{let e=X(window.user||{});if(typeof window.amplitude?.getIdentity==`function`){let t=window.amplitude.getIdentity()||{};return{...t,userProperties:{...t.userProperties||{},...e.userProperties},groups:{...t.groups||{},...e.groups},groupProperties:{...t.groupProperties||{},...e.groupProperties}}}return{...e,_preview:!0,_initSkippedReason:window.__amplitudeDebug?.reason??null}};export{Y as t};
4//# sourceMappingURL=amplitude-DZJ2xCGq.js.map
5//# debugId=843911d8-0e79-5813-936a-f0cfb83fd6cb

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.