1!function(window,document){"use strict";const CONFIG={COOKIE_NAME:"aid",DOMAIN:".cionic.com",MAX_AGE:31536e3,PATH:"/",SECURE:!0,SAME_SITE:"Lax",DEBUG:!1,API_DOMAINS:{production:"https://cionic.com",development:""}},ENVIRONMENT={isProduction:function(){const hostname=window.location.hostname.toLowerCase();return"cionic.com"===hostname||hostname.endsWith(".cionic.com")&&!hostname.includes("alpha")&&!hostname.includes("dev")&&!hostname.includes("beta")},isDevelopment:function(){const hostname=window.location.hostname.toLowerCase();return"localhost"===hostname||"127.0.0.1"===hostname||hostname.includes("alpha")||hostname.includes("beta")||hostname.includes("dev")},getEnvironmentName:function(){return this.isProduction()?"production":this.isDevelopment()?"development":"unknown"}};window.Cipi=new class{constructor(){this.initialized=!1,this.debugMode=CONFIG.DEBUG,this.cookieSupported=this.isCookieSupported(),this.environment=ENVIRONMENT.getEnvironmentName(),this.shouldTrack=ENVIRONMENT.isProduction()}init(){if(this.initialized)this.debug("Cipi already initialized");else{this.debug("Initializing Cipi (Cionic Pixel Manager) v1.0"),this.debug("Environment:",this.environment),this.debug("Should track:",this.shouldTrack),this.debug("Hostname:",window.location.hostname);try{if(!this.shouldTrack)return this.debug("Skipping cookie migration - not in production environment"),void(this.initialized=!0);if(!this.cookieSupported)return this.debug("Cookies not supported or blocked"),void(this.initialized=!0);this.handleCookieMigration(),this.initialized=!0,this.debug("Cipi initialized successfully")}catch(error){this.error("Failed to initialize Cipi",error)}}}handleCookieMigration(){const currentAid=this.getCookie(CONFIG.COOKIE_NAME);currentAid?(this.debug("Migrating existing cookie to cross-domain format"),this.setCrossDomainCookie(currentAid),this.logCookieTransfer(currentAid,"migration"),this.triggerAidGeneration()):(this.debug("No existing aid cookie found - triggering backend aid generation"),this.triggerAidGeneration())}triggerAidGeneration(){try{if(!this.shouldTrack)return void this.debug("Skipping aid generation trigger - not in production environment");const baseUrl=CONFIG.API_DOMAINS[this.environment]||"",img=new Image;img.onload=()=>{this.debug("Aid generation request completed successfully"),setTimeout(()=>{const newAid=this.getCookie(CONFIG.COOKIE_NAME);newAid&&(this.debug("Backend generated new aid:",newAid),this.setCrossDomainCookie(newAid),this.logCookieTransfer(newAid,"generation_migration"))},500)},img.onerror=()=>{this.debug("Aid generation request failed - this shouldn't happen")};const params=new URLSearchParams({t:Date.now(),url:window.location.href,ref:document.referrer||""}),urlParams=new URLSearchParams(window.location.search);urlParams.get("utm_source")&¶ms.set("utm_source",urlParams.get("utm_source")),urlParams.get("utm_medium")&¶ms.set("utm_medium",urlParams.get("utm_medium")),urlParams.get("utm_campaign")&¶ms.set("utm_campaign",urlParams.get("utm_campaign")),urlParams.get("utm_content")&¶ms.set("utm_content",urlParams.get("utm_content"));const pixelUrl=`${baseUrl}/pixel.gif?${params.toString()}`;this.debug("Requesting pixel from:",pixelUrl),img.src=pixelUrl}catch(error){this.debug("Error triggering aid generation:",error)}}setCrossDomainCookie(aid){try{const cookieValue=this.buildCookieString(aid);document.cookie=cookieValue,this.debug("Set cross-domain cookie:",cookieValue),setTimeout(()=>{this.getCookie(CONFIG.COOKIE_NAME)===aid?this.debug("Cookie verification successful"):this.error("Cookie verification failed")},100)}catch(error){this.error("Failed to set cross-domain cookie",error)}}buildCookieString(aid){const parts=[`${CONFIG.COOKIE_NAME}=${aid}`,`Domain=${CONFIG.DOMAIN}`,`Path=${CONFIG.PATH}`,`Max-Age=${CONFIG.MAX_AGE}`,`SameSite=${CONFIG.SAME_SITE}`];return CONFIG.SECURE&&"https:"===window.location.protocol&&parts.push("Secure"),parts.join("; ")}getCookie(name){try{const cookies=document.cookie.split(";");for(let cookie of cookies){const[cookieName,cookieValue]=cookie.trim().split("=");if(cookieName===name)return cookieValue}return null}catch(error){return this.debug("Error reading cookie:",error),null}}
1isCookieSupported(){try{const testCookie="__cipi_test__";document.cookie=`${testCookie}=test; Path=/; Max-Age=1`;const supported=-1!==document.cookie.indexOf(testCookie);return supported&&(document.cookie=`${testCookie}=; Path=/; Max-Age=0`),supported}catch(error){return!1}}debug(message,...args){this.debugMode&&"undefined"!=typeof console&&console.log(`[Cipi] ${message}`,...args)}error(message,error){"undefined"!=typeof console&&console.error(`[Cipi] ${message}`,error)}getAid(){return this.shouldTrack?this.getCookie(CONFIG.COOKIE_NAME):null}isInitialized(){return this.initialized}shouldTrackUser(){return this.shouldTrack}getEnvironment(){return this.environment}manualMigration(){this.shouldTrack?(this.debug("Manual migration triggered"),this.handleCookieMigration()):this.debug("Manual migration skipped - not in production environment")}enableDebug(){this.debugMode=!0,CONFIG.DEBUG=!0}disableDebug(){this.debugMode=!1,CONFIG.DEBUG=!1}logCookieTransfer(aid,type){this.debugMode&&console.log(`[Cipi] Cookie transfer: ${type} - Aid: ${aid}`)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){window.Cipi.init()}):window.Cipi.init(),window.Cipi.manualInit=function(){window.Cipi.init()},window.CionicCookieManager=window.Cipi}(window,document); 2//# sourceURL=https://242111136.fs1.hubspotusercontent-na2.net/hubfs/242111136/hub_generated/template_assets/1/231774082783/1783039928968/template_cionic-pixel.js
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.