BEFORE Google Tag Manager. */ (function () { 'use strict'; // ─── Configuration ─────────────────────────────────────────────────── var CONFIG = { cookieName: 'tms_cookie_consent', cookieExpiry: 365, consentVersion: 1, privacyPolicyUrl: '/privacy-policy/', cookiePolicyUrl: '/cookie-policy/', categories: { necessary: { name: 'Strictly Necessary', icon: '', description: 'Essential cookies required for the website to function properly. These cannot be disabled.', alwaysOn: true, cookies: [ { name: 'wordpress_*', provider: 'WordPress', purpose: 'Session management and authentication', expiry: 'Session' }, { name: 'wp-settings-*', provider: 'WordPress', purpose: 'User interface customization', expiry: '1 year' }, { name: 'tms_cookie_consent', provider: 'TM Services', purpose: 'Stores your cookie preferences', expiry: '1 year' } ] }, analytics: { name: 'Analytics', icon: '', description: 'Help us understand how visitors interact with our website by collecting and reporting information anonymously.', alwaysOn: false, cookies: [ { name: '_ga', provider: 'Google Analytics', purpose: 'Distinguishes unique users', expiry: '2 years' }, { name: '_ga_9XENJ4JP0D', provider: 'Google Analytics 4', purpose: 'Stores session state', expiry: '2 years' }, { name: '_gid', provider: 'Google Analytics', purpose: 'Distinguishes users (short-term)', expiry: '24 hours' }, { name: '_gat_UA-*', provider: 'Google Analytics', purpose: 'Throttles request rate', expiry: '1 minute' }, { name: '_clck', provider: 'Microsoft Clarity', purpose: 'Persists user ID for analytics', expiry: '1 year' }, { name: '_clsk', provider: 'Microsoft Clarity', purpose: 'Connects page views into a session', expiry: '1 day' } ] }, marketing: { name: 'Marketing', icon: '', description: 'Used to track visitors across websites to display relevant advertisements and measure campaign effectiveness.', alwaysOn: false, cookies: [ { name: '_gcl_au', provider: 'Google Ads', purpose: 'Conversion linker for ad clicks', expiry: '90 days' }, { name: '_uetsid', provider: 'Bing Ads', purpose: 'Tracks session for conversions', expiry: '1 day' }, { name: '_uetvid', provider: 'Bing Ads', purpose: 'Tracks user across sessions', expiry: '13 months' }, { name: '_fuid', provider: 'Factors.ai', purpose: 'Marketing user identification', expiry: '1 year' } ] }, functional: { name: 'Functional', icon: '', description: 'Enable enhanced functionality and personalization such as live chat, videos, and social media integration.', alwaysOn: false, cookies: [] } } }; // ─── Geo Detection (Timezone-based, no API calls) ──────────────────── var GEO = (function () { var gdprTimezones = [ 'Europe/', 'Atlantic/Azores', 'Atlantic/Canary', 'Atlantic/Faroe', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Arctic/Longyearbyen' ]; var ccpaTimezones = ['America/Los_Angeles', 'America/Anchorage', 'Pacific/Honolulu']; var lgpdTimezones = ['America/Sao_Paulo', 'America/Fortaleza', 'America/Recife', 'America/Bahia', 'America/Belem', 'America/Manaus', 'America/Cuiaba', 'America/Porto_Velho', 'America/Boa_Vista', 'America/Campo_Grande', 'America/Eirunepe', 'America/Rio_Branco', 'America/Noronha', 'America/Araguaina', 'America/Maceio', 'America/Santarem']; function detect() { try { var tz = Intl.DateTimeFormat().resolvedOptions().timeZone || ''; for (var i = 0; i < gdprTimezones.length; i++) { if (tz.indexOf(gdprTimezones[i]) === 0 || tz === gdprTimezones[i]) return 'gdpr'; } if (tz === 'Asia/Kolkata' || tz === 'Asia/Calcutta' || tz === 'Asia/Colombo') return 'india'; for (var j = 0; j < lgpdTimezones.length; j++) { if (tz === lgpdTimezones[j]) return 'lgpd'; } for (var k = 0; k < ccpaTimezones.length; k++) { if (tz === ccpaTimezones[k]) return 'ccpa'; } return 'default'; } catch (e) { return 'gdpr'; // strictest mode as fallback } } return { detect: detect }; })(); // ─── Cookie Utilities ──────────────────────────────────────────────── var CookieUtil = { set: function (name, value, days) { var d = new Date(); d.setTime(d.getTime() + (days * 86400000)); document.cookie = name + '=' + encodeURIComponent(value) + ';expires=' + d.toUTCString() + ';path=/;SameSite=Lax;Secure'; }, get: function (name) { var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); return match ? decodeURIComponent(match[2]) : null; }, remove: function (name) { document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;SameSite=Lax'; }, removeTracking: function (categories) { var allCookies = document.cookie.split(';'); for (var cat in CONFIG.categories) { if (cat === 'necessary' || categories[cat]) continue; var cookies = CONFIG.categories[cat].cookies; for (var i = 0; i < cookies.length; i++) { var pattern = cookies[i].name.replace(/\*/g, ''); for (var j = 0; j < allCookies.length; j++) { var cName = allCookies[j].split('=')[0].trim(); if (cName.indexOf(pattern) === 0) { CookieUtil.remove(cName); } } } } } }; // ─── Google Consent Mode v2 ────────────────────────────────────────── var ConsentMode = { init: function (region) { window.dataLayer = window.dataLayer || []; function gtag() { window.dataLayer.push(arguments); } window.gtag = gtag; var denied = 'denied'; var granted = 'granted'; var isOptIn = (region === 'gdpr' || region === 'lgpd' || region === 'india'); gtag('consent', 'default', { 'analytics_storage': isOptIn ? denied : granted, 'ad_storage': isOptIn ? denied : granted, 'ad_user_data': isOptIn ? denied : granted, 'ad_personalization': isOptIn ? denied : granted, 'functionality_storage': isOptIn ? denied : granted, 'security_storage': granted, 'wait_for_update': 500 }); }, update: function (categories) { if (!window.gtag) return; window.gtag('consent', 'update', { 'analytics_storage': categories.analytics ? 'granted' : 'denied', 'ad_storage': categories.marketing ? 'granted' : 'denied', 'ad_user_data': categories.marketing ? 'granted' : 'denied', 'ad_personalization': categories.marketing ? 'granted' : 'denied', 'functionality_storage': categories.functional ? 'granted' : 'denied' }); } }; // ─── Consent State Manager ─────────────────────────────────────────── var Consent = { _state: null, load: function () { var raw = CookieUtil.get(CONFIG.cookieName); if (!raw) return null; try { var parsed = JSON.parse(raw); if (parsed.version !== CONFIG.consentVersion) return null; this._state = parsed; return parsed; } catch (e) { return null; } }, save: function (categories) { var state = { necessary: true, analytics: !!categories.analytics, marketing: !!categories.marketing, functional: !!categories.functional, version: CONFIG.consentVersion, timestamp: Math.floor(Date.now() / 1000), region: GEO.detect() }; this._state = state; CookieUtil.set(CONFIG.cookieName, JSON.stringify(state), CONFIG.cookieExpiry); ConsentMode.update(state); CookieUtil.removeTracking(state); return state; }, get: function () { return this._state; } }; // ─── CSS Injection ─────────────────────────────────────────────────── function injectStyles() { var css = '' + /* Reset & Base */ '#tms-cb *, #tms-cb *::before, #tms-cb *::after { box-sizing: border-box; margin: 0; }' + '#tms-cb { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.5; color: #4D4D4D; -webkit-font-smoothing: antialiased; }' + /* Banner */ '.tms-cb-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 999999; background: #ffffff; box-shadow: 0 -4px 24px rgba(0,0,0,0.12); border-top: 3px solid #1F4F7A; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); padding: 0; }' + '.tms-cb-banner.tms-cb-visible { transform: translateY(0); }' + '.tms-cb-banner-inner { max-width: 1200px; margin: 0 auto; padding: 24px 42px; display: flex; align-items: center; gap: 32px; }' + '.tms-cb-banner-text { flex: 1; }' + '.tms-cb-banner-title { font-family: "Montserrat", "Open Sans", sans-serif; font-size: 16px; font-weight: 700; color: #1F4F7A; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }' + '.tms-cb-banner-desc { font-size: 13px; color: #4D4D4D; line-height: 1.6; }' + '.tms-cb-banner-desc a { color: #1F4F7A; text-decoration: underline; }' + '.tms-cb-banner-desc a:hover { color: #2A3951; }' + '.tms-cb-banner-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }' + /* Buttons */ '.tms-cb-btn { font-family: "Open Sans", sans-serif; font-size: 13px; font-weight: 600; padding: 10px 22px; border-radius: 4px; border: none; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; letter-spacing: 0.3px; outline: none; }' + '.tms-cb-btn:focus-visible { outline: 2px solid #1F4F7A; outline-offset: 2px; }' + '.tms-cb-btn-primary { background: #1F4F7A; color: #ffffff; }' + '.tms-cb-btn-primary:hover { background: #163d5f; }' + '.tms-cb-btn-secondary { background: transparent; color: #1F4F7A; border: 1.5px solid #1F4F7A; }' + '.tms-cb-btn-secondary:hover { background: #f0f4f8; }' + '.tms-cb-btn-ghost { background: transparent; color: #455075; border: 1.5px solid #d0d5dd; }' + '.tms-cb-btn-ghost:hover { background: #f5f5f5; border-color: #aab0be; }' + /* Overlay */ '.tms-cb-overlay { position: fixed; inset: 0; z-index: 1000000; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; padding: 16px; backdrop-filter: blur(2px); }' + '.tms-cb-overlay.tms-cb-visible { opacity: 1; visibility: visible; }' + /* Modal */ '.tms-cb-modal { background: #ffffff; border-radius: 8px; max-width: 680px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.2); transform: scale(0.95) translateY(10px); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); overflow: hidden; border-top: 3px solid #1F4F7A; }' + '.tms-cb-overlay.tms-cb-visible .tms-cb-modal { transform: scale(1) translateY(0); }' + /* Modal Header */ '.tms-cb-modal-header { padding: 28px 44px 20px; border-bottom: 1px solid #e8eaed; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }' + '.tms-cb-modal-title { font-family: "Montserrat", "Open Sans", sans-serif; font-size: 18px; font-weight: 700; color: #1F4F7A; }' + '.tms-cb-modal-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: #f0f2f5; color: #455075; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.2s; }' + '.tms-cb-modal-close:hover { background: #e0e3e8; color: #1F4F7A; }' + '.tms-cb-modal-close:focus-visible { outline: 2px solid #1F4F7A; outline-offset: 2px; }' + /* Modal Body */ '.tms-cb-modal-body { padding: 12px 44px 16px; overflow-y: auto; flex: 1; }' + '.tms-cb-modal-intro { font-size: 13px; color: #4D4D4D; line-height: 1.6; padding: 12px 0 8px; }' + '.tms-cb-modal-intro a { color: #1F4F7A; text-decoration: underline; }' + /* Category */ '.tms-cb-cat { border-bottom: 1px solid #eef0f3; padding: 18px 0; }' + '.tms-cb-cat:last-child { border-bottom: none; }' + '.tms-cb-cat-header { display: flex; align-items: flex-start; gap: 14px; }' + '.tms-cb-cat-info { flex: 1; min-width: 0; }' + '.tms-cb-cat-name { font-family: "Montserrat", "Open Sans", sans-serif; font-size: 14px; font-weight: 700; color: #1F4F7A; display: flex; align-items: center; }' + '.tms-cb-cat-count { font-size: 11px; color: #8891a5; margin-left: 8px; font-weight: 400; font-family: "Open Sans", sans-serif; }' + '.tms-cb-cat-desc { font-size: 12.5px; color: #6b7280; line-height: 1.55; margin-top: 3px; }' + '.tms-cb-cat-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 2px 8px; border-radius: 3px; margin-left: 8px; }' + '.tms-cb-cat-badge-on { background: #e8f0f7; color: #1F4F7A; }' + /* Toggle */ '.tms-cb-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }' + '.tms-cb-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }' + '.tms-cb-toggle-slider { position: absolute; inset: 0; background: #d0d5dd; border-radius: 12px; cursor: pointer; transition: background 0.25s ease; }' + '.tms-cb-toggle-slider::after { content: ""; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.25s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }' + '.tms-cb-toggle input:checked + .tms-cb-toggle-slider { background: #1F4F7A; }' + '.tms-cb-toggle input:checked + .tms-cb-toggle-slider::after { transform: translateX(20px); }' + '.tms-cb-toggle input:disabled + .tms-cb-toggle-slider { background: #1F4F7A; opacity: 0.6; cursor: default; }' + '.tms-cb-toggle input:focus-visible + .tms-cb-toggle-slider { outline: 2px solid #1F4F7A; outline-offset: 2px; }' + /* Cookie Detail Table */ '.tms-cb-details-btn { background: none; border: none; color: #1F4F7A; font-size: 12px; cursor: pointer; padding: 4px 0; margin-top: 4px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }' + '.tms-cb-details-btn:hover { text-decoration: underline; }' + '.tms-cb-details-btn:focus-visible { outline: 2px solid #1F4F7A; outline-offset: 2px; }' + '.tms-cb-details-arrow { display: inline-block; transition: transform 0.2s; font-size: 10px; }' + '.tms-cb-details-arrow.tms-cb-expanded { transform: rotate(90deg); }' + '.tms-cb-cookie-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; display: none; }' + '.tms-cb-cookie-table.tms-cb-visible { display: table; }' + '.tms-cb-cookie-table th { text-align: left; padding: 8px 14px; background: #f5f7fa; color: #455075; font-weight: 600; border-bottom: 1px solid #e0e3e8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }' + '.tms-cb-cookie-table td { padding: 8px 14px; border-bottom: 1px solid #f0f2f5; color: #4D4D4D; vertical-align: top; }' + '.tms-cb-cookie-table tr:last-child td { border-bottom: none; }' + /* Modal Footer */ '.tms-cb-modal-footer { padding: 22px 44px; border-top: 1px solid #e8eaed; display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; background: #fafbfc; }' + /* Floating Button */ '.tms-cb-float { position: fixed; bottom: 20px; left: 20px; z-index: 999998; width: 40px; height: 40px; border-radius: 6px; background: #1F4F7A; color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(31,79,122,0.3); transition: all 0.3s ease; opacity: 0; visibility: hidden; transform: scale(0.8); }' + '.tms-cb-float.tms-cb-visible { opacity: 1; visibility: visible; transform: scale(1); }' + '.tms-cb-float:hover { background: #163d5f; transform: scale(1.04); box-shadow: 0 4px 14px rgba(31,79,122,0.4); }' + '.tms-cb-float:focus-visible { outline: 2px solid #1F4F7A; outline-offset: 3px; }' + '.tms-cb-float svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }' + /* CCPA-specific link */ '.tms-cb-ccpa-link { font-size: 12px; color: #1F4F7A; text-decoration: underline; cursor: pointer; background: none; border: none; padding: 0; }' + /* Mobile Responsive */ '@media (max-width: 768px) {' + '.tms-cb-banner-inner { flex-direction: column; padding: 20px 24px; gap: 14px; text-align: center; }' + '.tms-cb-banner-actions { width: 100%; justify-content: center; flex-wrap: wrap; }' + '.tms-cb-btn { padding: 10px 16px; flex: 1; min-width: 100px; font-size: 12.5px; }' + '.tms-cb-modal { max-height: 90vh; border-radius: 8px 8px 0 0; margin-top: auto; }' + '.tms-cb-overlay { align-items: flex-end; padding: 0; }' + '.tms-cb-modal-body { padding: 10px 28px 14px; }' + '.tms-cb-modal-header { padding: 22px 28px 16px; }' + '.tms-cb-modal-footer { padding: 18px 28px; flex-wrap: wrap; }' + '.tms-cb-modal-footer .tms-cb-btn { flex: 1; }' + '.tms-cb-cat-header { gap: 10px; }' + '}' + '@media (max-width: 400px) {' + '.tms-cb-banner-actions { flex-direction: column; }' + '.tms-cb-btn { width: 100%; }' + '}' + /* Animations */ '@keyframes tms-cb-fadeIn { from { opacity: 0; } to { opacity: 1; } }' + /* Print: hide everything */ '@media print { #tms-cb { display: none !important; } }'; var style = document.createElement('style'); style.id = 'tms-cb-styles'; style.textContent = css; document.head.appendChild(style); } // ─── UI Builder ────────────────────────────────────────────────────── var UI = { container: null, banner: null, overlay: null, floatBtn: null, region: 'gdpr', build: function (region) { this.region = region; this.container = document.createElement('div'); this.container.id = 'tms-cb'; this.container.setAttribute('role', 'region'); this.container.setAttribute('aria-label', 'Cookie consent'); this._buildBanner(); this._buildModal(); this._buildFloat(); document.body.appendChild(this.container); }, _buildBanner: function () { var isCCPA = this.region === 'ccpa'; var b = document.createElement('div'); b.className = 'tms-cb-banner'; b.setAttribute('role', 'dialog'); b.setAttribute('aria-label', 'Cookie consent banner'); b.setAttribute('aria-describedby', 'tms-cb-banner-desc'); var html = '
' + '
' + '
Cookie Preferences
' + '
' + (isCCPA ? 'We use cookies and similar technologies to enhance your experience, analyze site traffic, and for advertising. You have the right to opt out of the sale or sharing of your personal information. ' : 'We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. You can choose which cookies you allow. ') + 'Cookie Policy' + '
' + '
' + '
' + '' + '' + '' + '
' + '
'; b.innerHTML = html; this.banner = b; this.container.appendChild(b); // Bind actions var buttons = b.querySelectorAll('[data-action]'); for (var i = 0; i < buttons.length; i++) { buttons[i].addEventListener('click', this._handleBannerAction.bind(this)); } }, _buildModal: function () { var ov = document.createElement('div'); ov.className = 'tms-cb-overlay'; ov.setAttribute('role', 'dialog'); ov.setAttribute('aria-modal', 'true'); ov.setAttribute('aria-label', 'Cookie preference settings'); var modal = document.createElement('div'); modal.className = 'tms-cb-modal'; // Header var header = '
' + '
Cookie Preferences
' + '' + '
'; // Body var body = '
' + '
' + 'We use cookies and similar tracking technologies to improve your experience on our website. ' + 'Some cookies are essential for the site to function, while others help us improve performance and provide personalized content. ' + 'You can manage your preferences below. For more details, see our ' + 'Cookie Policy and ' + 'Privacy Policy.' + '
'; var cats = CONFIG.categories; for (var key in cats) { if (!cats.hasOwnProperty(key)) continue; var cat = cats[key]; var cookieCount = cat.cookies.length; body += '
' + '
' + '
' + '
' + cat.name + '' + cookieCount + ' cookie' + (cookieCount !== 1 ? 's' : '') + '' + (cat.alwaysOn ? 'Always Active' : '') + '
' + '
' + cat.description + '
' + (cookieCount > 0 ? '' : '') + '
' + '' + '
'; // Cookie detail table if (cookieCount > 0) { body += '' + ''; for (var c = 0; c < cat.cookies.length; c++) { var ck = cat.cookies[c]; body += ''; } body += ''; } body += '
'; } body += '
'; // Footer var footer = ''; modal.innerHTML = header + body + footer; ov.appendChild(modal); this.overlay = ov; this.container.appendChild(ov); // Bind events ov.querySelector('[data-action="close-modal"]').addEventListener('click', this.closeModal.bind(this)); var footerBtns = ov.querySelectorAll('.tms-cb-modal-footer [data-action]'); for (var f = 0; f < footerBtns.length; f++) { footerBtns[f].addEventListener('click', this._handleModalAction.bind(this)); } // Cookie detail toggles var detailBtns = ov.querySelectorAll('.tms-cb-details-btn'); for (var d = 0; d < detailBtns.length; d++) { detailBtns[d].addEventListener('click', this._toggleDetails.bind(this)); } // Click outside modal to close ov.addEventListener('click', function (e) { if (e.target === ov) UI.closeModal(); }); // Escape key document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && ov.classList.contains('tms-cb-visible')) { UI.closeModal(); } }); }, _buildFloat: function () { var btn = document.createElement('button'); btn.className = 'tms-cb-float'; btn.innerHTML = ''; btn.setAttribute('aria-label', 'Open cookie preferences'); btn.setAttribute('title', 'Privacy Preferences'); btn.addEventListener('click', function () { UI.openModal(); }); this.floatBtn = btn; this.container.appendChild(btn); }, // ── Actions ── _handleBannerAction: function (e) { var action = e.currentTarget.getAttribute('data-action'); if (action === 'accept') this.acceptAll(); else if (action === 'reject') this.rejectAll(); else if (action === 'customize') this.openModal(); }, _handleModalAction: function (e) { var action = e.currentTarget.getAttribute('data-action'); if (action === 'accept') this.acceptAll(); else if (action === 'save') this.savePreferences(); }, _toggleDetails: function (e) { var btn = e.currentTarget; var key = btn.getAttribute('data-details'); var table = this.overlay.querySelector('[data-table="' + key + '"]'); var arrow = btn.querySelector('.tms-cb-details-arrow'); var isExpanded = table.classList.contains('tms-cb-visible'); table.classList.toggle('tms-cb-visible'); arrow.classList.toggle('tms-cb-expanded'); btn.setAttribute('aria-expanded', !isExpanded); }, acceptAll: function () { Consent.save({ necessary: true, analytics: true, marketing: true, functional: true }); this.hideBanner(); this.closeModal(); this.showFloat(); }, rejectAll: function () { Consent.save({ necessary: true, analytics: false, marketing: false, functional: false }); this.hideBanner(); this.closeModal(); this.showFloat(); }, savePreferences: function () { var toggles = this.overlay.querySelectorAll('[data-toggle]'); var prefs = { necessary: true }; for (var i = 0; i < toggles.length; i++) { var cat = toggles[i].getAttribute('data-toggle'); prefs[cat] = toggles[i].checked; } Consent.save(prefs); this.hideBanner(); this.closeModal(); this.showFloat(); }, // ── Visibility Controls ── showBanner: function () { requestAnimationFrame(function () { UI.banner.classList.add('tms-cb-visible'); }); }, hideBanner: function () { this.banner.classList.remove('tms-cb-visible'); }, openModal: function () { // Restore saved preferences to toggles var saved = Consent.get(); if (saved) { var toggles = this.overlay.querySelectorAll('[data-toggle]'); for (var i = 0; i < toggles.length; i++) { var cat = toggles[i].getAttribute('data-toggle'); if (!CONFIG.categories[cat].alwaysOn) { toggles[i].checked = !!saved[cat]; } } } this.overlay.classList.add('tms-cb-visible'); this.hideFloat(); // Focus trap var closeBtn = this.overlay.querySelector('.tms-cb-modal-close'); if (closeBtn) closeBtn.focus(); }, closeModal: function () { this.overlay.classList.remove('tms-cb-visible'); // If no consent yet, show banner again if (!Consent.get()) { this.showBanner(); } else { this.showFloat(); } }, showFloat: function () { this.floatBtn.classList.add('tms-cb-visible'); }, hideFloat: function () { this.floatBtn.classList.remove('tms-cb-visible'); } }; // ─── Initialization ────────────────────────────────────────────────── function init() { var region = GEO.detect(); // Set consent defaults for Google Consent Mode BEFORE anything else ConsentMode.init(region); // Check for existing consent var existing = Consent.load(); if (existing) { // User has already consented — apply stored preferences ConsentMode.update(existing); } // Build UI once DOM is ready function buildUI() { injectStyles(); UI.build(region); if (existing) { // Consent exists — just show the floating button UI.showFloat(); } else { // No consent — show banner // Small delay for smooth animation setTimeout(function () { UI.showBanner(); }, 300); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', buildUI); } else { buildUI(); } } // Start immediately — consent mode defaults must be set before GTM init(); })();
years Experience

What Smart Employers Do When Work Authorization Ends

employee work authorization expired

Introduction:

Work authorization issues rarely come with advance notice. One day, teams are running smoothly. The next, an employer is informed that an employee can no longer legally continue working due to visa or authorization expiry.

When an employee work authorization expired, the impact goes far beyond compliance. Projects stall, costs rise, and difficult decisions must be made quickly.

 

Smart employers understand that this moment is not just a legal issue—it is a leadership test.

Why This Situation Is Becoming More Common

Global hiring has increased significantly over the last decade. At the same time, visa processing timelines have become less predictable.

As a result, more companies are facing situations where:

  • Employees must stop work immediately
  • Travel restrictions force sudden relocations
  • Approvals remain uncertain for extended periods

When an employee visa expired, employers are often left navigating unclear options under pressure.

The Immediate Risks Employers Face

Once work authorization ends, employers must act fast. Continuing work without authorization exposes the company to serious legal and financial risks.

However, stopping work entirely creates another set of challenges:

  • Missed deadlines
  • Client dissatisfaction
  • Internal disruption
  • Rising bench costs

A work authorization expired employee situation forces leadership to balance compliance with business continuity.

Why Waiting or Replacing Talent Is No Longer a Practical Solution

Earlier, companies often placed employees on temporary leave while waiting for approvals. Today, that approach is costly and unsustainable. Paid leave without productivity strains budgets, while prolonged uncertainty damages morale and increases attrition risk. For employers, waiting without a structured plan frequently leads to rushed decisions later—usually at a much higher cost.

 

When authorization ends, replacing the employee may appear to be the safest route, but this option carries significant hidden expenses. Recruitment costs, onboarding time, and the loss of institutional knowledge can easily outweigh short-term compliance relief. In highly skilled roles, replacements may take months to reach full productivity, which is why many employers now explore alternatives before letting go of trained talent.

How Smart Employers Reframe the Problem

Instead of viewing authorization expiry as an endpoint, experienced employers see it as a transition point.

They separate:

  • Employment structure from
  • Work contribution

This mindset allows companies to retain talent while staying compliant—even when physical presence or visa status changes.

Employer of Record: A Practical Compliance Solution

One increasingly adopted solution is transitioning affected employees to an Employer of Record (EOR) model in India.

Under this structure:

  • The EOR becomes the legal employer in India
  • Payroll, taxes, and labor compliance are managed locally
  • The employee continues working operationally for the U.S. company

This approach allows employers to retain output without violating local or international regulations.

Managing Costs When Authorization Ends

Cost control becomes critical the moment authorization expires.

Keeping employees on U.S. payroll without work authorization is not viable. At the same time, terminating skilled employees can increase long-term costs.

India payroll under an EOR model often provides:

  • Predictable employment costs
  • Continued productivity
  • Reduced bench expenses

When an H1B work authorization expired, this balance between compliance and cost becomes especially important.

Protecting Client Commitments and Delivery Timelines

Client expectations do not pause for immigration issues. Sudden employee exits can put contracts, timelines, and service quality at risk.

By planning structured employment transitions, employers can:

  • Maintain delivery continuity
  • Avoid reassigning projects midstream
  • Preserve client trust

This continuity is often the key driver behind employer decisions.

Why Employee-Centric, Flexible Workforce Models Are Becoming the Standard

From the employee’s perspective, authorization expiry often feels like career instability. Employers who communicate clearly and offer structured alternatives reduce anxiety, strengthen loyalty, and demonstrate long-term commitment—not just short-term compliance. Providing legal, compliant employment options, such as the TMS Employer of Record (EOR) solution, reinforces this trust and highlights the importance of the human element, which many companies initially underestimate.

 

At the same time, global workforce planning has evolved. Employers no longer rely on a single country or visa category to build resilient teams  Authorization uncertainty has accelerated the shift toward flexible, compliant employment models that adapt to changing conditions. Rather than reacting case by case, forward-thinking employers now design policies in advance—often leveraging solutions like TMS EOR—to stay prepared, compliant, and competitive.

When Should Employers Act?

Employers typically explore structured alternatives when:

  • Authorization expiry is confirmed or imminent
  • Approvals lack clear timelines
  • Projects cannot afford disruption
  • No local entity exists in the employee’s country

Acting early reduces risk and avoids last-minute decisions.

A Smarter Way Forward

Visa and authorization systems may remain unpredictable, but workforce continuity does not have to suffer because of it. When an employee’s work authorization expires, employers who act decisively—while remaining fully compliant—can protect productivity, control costs, and retain valuable institutional knowledge. Clear planning and timely action prevent disruption, reduce uncertainty for employees, and avoid the expensive consequences of rushed decisions.

 

Ultimately, the choices made at this stage often shape long-term workforce resilience. Organizations that plan ahead, adopt flexible employment models, and prioritize both compliance and people are far better positioned to navigate ongoing regulatory uncertainty with confidence.

FAQs

Yes. Employers can reassess payroll and location once authorization is restored, depending on business needs.

No. EOR can support both short-term transitions and long-term workforce strategies.

Immediate action is recommended to avoid compliance risks and operational disruption.

No. It also applies when approvals are delayed or when authorization validity is uncertain.

K. Das

Senior content writer at Team Management Services and the most prolific contributor to the TMS blog. K. Das covers HR topics including payroll management, statutory compliance, employee benefits, and workforce regulations across India.

HEAD OFFICE

 

1003-04, 10th floor G-Square Business Park, Jawahar Road, Opposite Railway Station, above Kalyan Jewellers, Ghatkopar East, Mumbai – 400077

BRANCH OFFICE

601 to 603 Aries Galleria, Vasana Road, Vadodara – 390015 Gujarat, India

Team Management Services. All Rights Reserved | Privacy Policy | Terms & Conditions