(()=>{function f(n){var r,i,e=Array.prototype.slice.call(document.querySelectorAll(".progress-circle path"));function t(){i=0,e=document.documentElement,t=window.pageYOffset||e.scrollTop||0;var e,t,o=1-((e=(e.scrollHeight||0)-window.innerHeight)<=0||(t=t/e)<0?0:1 .wp-block-columns"),t=document.querySelector(".sidebar-col .is-sticky");e&&t&&s.create({trigger:e,pin:t,start:"top 10px",end:function(){return"+="+(e.offsetHeight-t.offsetHeight)},pinSpacing:!1,invalidateOnRefresh:!0})}})})})();; (function () { "use strict"; if (typeof window === "undefined") return; if (!window.LNS_DATA || !LNS_DATA.endpoint) return; function debounce(fn, wait) { var t; return function () { var ctx = this, args = arguments; clearTimeout(t); t = setTimeout(function () { fn.apply(ctx, args); }, wait); }; } function escapeHtml(str) { return String(str).replace(/[&<>"']/g, function (m) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[m]; }); } function buildAdvancedSearchUrl(q) { var base = window.location.origin + '/'; return base + '?s=' + encodeURIComponent(String(q || '').trim()); } function renderAdvancedButton(q) { var query = String(q || '').trim(); if (!query) return ''; var url = buildAdvancedSearchUrl(query); return ( '
' + '' + 'Advanced search' + '' + '
' ); } function renderItems(items, showExcerpt) { var html = ''; return html; } function renderGrouped(container, groups, query, showExcerpt) { if (!groups || !groups.length) { container.innerHTML = '
No results' + (query ? ' for “' + escapeHtml(query) + '”' : '') + '.
' + renderAdvancedButton(query); return; } var html = ''; for (var g = 0; g < groups.length; g++) { var group = groups[g] || {}; var label = group.label ? String(group.label) : ''; var items = group.items || []; if (!items.length) continue; html += '
'; html += '
' + escapeHtml(label) + '
'; html += renderItems(items, showExcerpt); html += '
'; } if (!html) { container.innerHTML = '
No results' + (query ? ' for “' + escapeHtml(query) + '”' : '') + '.
' + renderAdvancedButton(query); return; } container.innerHTML = html + renderAdvancedButton(query); } /* --------------------------------------------------------------------- */ /* Toggle UI: .show-search opens/closes .search-in */ /* Adds/removes .lns-open when open/closed */ /* --------------------------------------------------------------------- */ function setupToggle(root) { // root = .search-in var btn = root.querySelector('.show-search'); var wrap = root.querySelector('.lns-wrap'); if (!btn || !wrap) return; var input = wrap.querySelector('.lns-input'); var results = wrap.querySelector('.lns-results'); function isOpen() { return !root.classList.contains('lns-collapsed'); } function open() { root.classList.remove('lns-collapsed'); root.classList.add('lns-open'); // ✅ requested btn.setAttribute('aria-expanded', 'true'); if (input && input.focus) input.focus(); if (results && !results.innerHTML) { results.innerHTML = '
Start typing to search…
'; } } function close() { root.classList.add('lns-collapsed'); root.classList.remove('lns-open'); // ✅ requested btn.setAttribute('aria-expanded', 'false'); } btn.addEventListener('click', function (e) { e.preventDefault(); if (isOpen()) close(); else open(); }); // ESC closes when open root.addEventListener('keydown', function (e) { var key = e.key || e.keyCode; if ((key === 'Escape' || key === 'Esc' || key === 27) && isOpen()) { close(); if (btn && btn.focus) btn.focus(); } }); // Click outside closes (only when open) document.addEventListener('mousedown', function (e) { if (!isOpen()) return; if (!root.contains(e.target)) close(); }); // Optional: open when input receives focus (keyboard users) if (input) { input.addEventListener('focus', function () { if (!isOpen()) open(); }); } } /* --------------------------------------------------------------------- */ /* Search attach */ /* --------------------------------------------------------------------- */ function attachSearch(el) { // el = .lns-wrap var input = el.querySelector('.lns-input'); var results = el.querySelector('.lns-results'); if (!input || !results) return; var min = parseInt(el.getAttribute('data-min') || '2', 10); var perPage = parseInt(el.getAttribute('data-per-page') || '12', 10); var types = (el.getAttribute('data-types') || 'post,page'); var showExcerpt = el.getAttribute('data-show-excerpt') === '1'; if (!results.innerHTML) { results.innerHTML = '
Start typing to search…
'; } var doSearch = debounce(function () { var q = (input.value || '').trim(); if (q.length < min) { results.innerHTML = '
Keep typing…
'; return; } try { var url = new URL(LNS_DATA.endpoint, window.location.origin); url.searchParams.set('q', q); url.searchParams.set('types', types); url.searchParams.set('per_page', String(perPage)); var headers = {}; if (LNS_DATA.nonce) headers['X-WP-Nonce'] = LNS_DATA.nonce; fetch(url.toString(), { headers: headers, credentials: 'same-origin' }) .then(function (res) { if (!res.ok) throw new Error('HTTP ' + res.status); return res.json(); }) .then(function (data) { var groups = (data && data.groups) ? data.groups : null; if (groups && groups.length) { renderGrouped(results, groups, q, showExcerpt); return; } // Fallback if API returns only items (older PHP). var items = (data && data.items) || []; if (!items.length) { results.innerHTML = '
No results' + (q ? ' for “' + escapeHtml(q) + '”' : '') + '.
' + renderAdvancedButton(q); return; } results.innerHTML = renderItems(items, showExcerpt) + renderAdvancedButton(q); }) .catch(function () { results.innerHTML = '
Error loading results.
'; }); } catch (e) { results.innerHTML = '
Error loading results.
'; } }, 250); input.addEventListener('input', doSearch); } document.addEventListener('DOMContentLoaded', function () { // Toggle behavior (adds .lns-open when open) var roots = document.querySelectorAll('.search-in'); for (var r = 0; r < roots.length; r++) { setupToggle(roots[r]); } // Live search var nodes = document.querySelectorAll('.lns-wrap'); for (var i = 0; i < nodes.length; i++) attachSearch(nodes[i]); }); })(); // ======================== // Header, scroll helpers, menus, masonry // ======================== (function () { 'use strict'; // --- Helpers (scoped to this IIFE) --- const throttle = (fn, wait = 100) => { let last = 0; let pending = null; return function (...args) { const now = Date.now(); const remaining = wait - (now - last); if (!last || remaining <= 0) { last = now; fn.apply(this, args); } else if (!pending) { pending = setTimeout(() => { last = Date.now(); pending = null; fn.apply(this, args); }, remaining); } }; }; const smoothScrollToY = (y) => { try { window.scrollTo({ top: y, behavior: 'smooth' }); } catch (e) { // Older browsers window.scrollTo(0, y); } }; const onElementReady = (selector, cb) => { const el = document.querySelector(selector); if (el) { cb(el); return; } const mo = new MutationObserver(() => { const found = document.querySelector(selector); if (found) { mo.disconnect(); cb(found); } }); mo.observe(document.documentElement, { childList: true, subtree: true }); }; document.addEventListener('DOMContentLoaded', () => { // ------------------------------ // 1) .nolink/.no-link menu items & .load-more-btn as inert anchors // ------------------------------ const initNoLink = () => { const noLinkAnchors = document.querySelectorAll( '.nolink > a, .no-link > a' ); noLinkAnchors.forEach((a) => { a.setAttribute('aria-disabled', 'true'); if (!a.hasAttribute('tabindex')) { a.setAttribute('tabindex', '0'); } }); // Delegated click: prevent navigation but keep semantics document.addEventListener('click', (e) => { const inertLink = e.target.closest( '.nolink > a, .no-link > a, .load-more-btn a' ); if (!inertLink) return; e.preventDefault(); }); }; initNoLink(); // ------------------------------ // 2) Header scroll state & Back-to-top visibility // ------------------------------ const header = document.querySelector('header.wp-block-template-part'); const backToTop = document.querySelector('.back-to-top'); const updateOnScroll = throttle(() => { const y = window.scrollY || document.documentElement.scrollTop || 0; if (header) { header.classList.toggle('scroll-header', y > 120); } if (backToTop) { backToTop.classList.toggle('show', y > 600); } }, 100); updateOnScroll(); window.addEventListener('scroll', updateOnScroll, { passive: true }); // ------------------------------ // 3) Back button (delegated) // ------------------------------ document.addEventListener('click', (e) => { const a = e.target.closest('.back-btn a'); if (!a) return; e.preventDefault(); window.history.back(); }); // ------------------------------ // 4) Back-to-top click // ------------------------------ if (backToTop) { backToTop.addEventListener('click', (e) => { e.preventDefault(); smoothScrollToY(0); }); } // ------------------------------ // 5) Section scroll links with offset (.scroll-to a[href*="#"]) // ------------------------------ document.addEventListener('click', (e) => { const link = e.target.closest('.scroll-to a[href*="#"]'); if (!link) return; const href = link.getAttribute('href') || ''; const id = href.split('#')[1]; if (!id) return; const target = document.getElementById(id) || document.querySelector(`[name="${CSS.escape(id)}"]`); if (!target) return; e.preventDefault(); const rect = target.getBoundingClientRect(); const absoluteTop = rect.top + window.pageYOffset; const y = absoluteTop - 120; // offset for fixed header smoothScrollToY(y); }); // ------------------------------ // 6) Mobile menu toggle (.av-nav-toggle) // ------------------------------ (function initMobileMenu() { onElementReady('.av-nav-toggle', (toggleBtn) => { const SHOW_SEARCH_SEL = '.show-search'; const WRAP_CLASS = 'search-in'; const DISABLED_CLASS = 'is-disabled'; const setButtonDisabled = (el, disabled) => { const isButton = el.tagName === 'BUTTON' || el.getAttribute('role') === 'button'; if (isButton && 'disabled' in el) { el.disabled = disabled; } else { el.setAttribute('aria-disabled', String(disabled)); el.classList.toggle(DISABLED_CLASS, disabled); el.style.pointerEvents = disabled ? 'none' : ''; if (disabled) { if (!el.hasAttribute('data-prev-tabindex')) { el.setAttribute( 'data-prev-tabindex', el.getAttribute('tabindex') ?? '' ); } el.setAttribute('tabindex', '-1'); } else if (el.hasAttribute('data-prev-tabindex')) { const prev = el.getAttribute('data-prev-tabindex'); if (prev === '') { el.removeAttribute('tabindex'); } else { el.setAttribute('tabindex', prev); } el.removeAttribute('data-prev-tabindex'); } } }; const setWrapperDisabled = (wrap, disabled) => { if (!wrap) return; wrap.setAttribute('aria-disabled', String(disabled)); wrap.classList.toggle(DISABLED_CLASS, disabled); wrap.style.pointerEvents = disabled ? 'none' : ''; }; const applyDisabledFromBody = () => { const active = document.body.classList.contains('side-menu-opened'); const buttons = document.querySelectorAll(SHOW_SEARCH_SEL); buttons.forEach((btn) => { setButtonDisabled(btn, active); const wrap = btn.closest(`.${WRAP_CLASS}`); setWrapperDisabled(wrap, active); }); }; const isOpen = () => document.body.classList.contains('side-menu-opened'); const openMenu = () => { document.body.classList.add('side-menu-opened'); toggleBtn.classList.add('activated'); applyDisabledFromBody(); }; const closeMenu = () => { if (!isOpen()) return; document.body.classList.remove('side-menu-opened'); toggleBtn.classList.remove('activated'); applyDisabledFromBody(); }; applyDisabledFromBody(); toggleBtn.addEventListener('click', () => { if (isOpen()) { closeMenu(); } else { openMenu(); } // Original hidden-menu-item toggler requestAnimationFrame(() => { requestAnimationFrame(() => { document .querySelectorAll('.av-dropdown-toggle--mobile') .forEach((btn) => { if (btn.dataset._bound === '1') return; btn.dataset._bound = '1'; btn.addEventListener('click', () => { const hiddenItems = document.querySelectorAll( '.hidden-menu-item' ); if (hiddenItems.length) { hiddenItems.forEach((li) => li.classList.remove( 'hidden-menu-item' ) ); } else { document .querySelectorAll( '#av-mobile-wrap > ul > .menu-item' ) .forEach((li) => { const itsButton = li.querySelector( 'button' ) === btn; if (!itsButton) { li.classList.add( 'hidden-menu-item' ); } }); } }); }); }); }); }); // ESC closes document.addEventListener('keydown', (e) => { if (e.key === 'Escape') { closeMenu(); } }); // Stay in sync if some other script toggles body class const bodyClassObserver = new MutationObserver( (mutations) => { for (const m of mutations) { if (m.attributeName === 'class') { applyDisabledFromBody(); break; } } } ); bodyClassObserver.observe(document.body, { attributes: true, attributeFilter: ['class'], }); }); })(); // ------------------------------ // 7) Mobile submenu accordion (.av-mobile) // ------------------------------ (function () { const findSubmenuForButton = (btn) => { const li = btn.closest('li'); if (!li) return null; const submenu = li.querySelector(':scope > ul.sub-menu'); if (submenu) return submenu; let n = btn.nextElementSibling; while (n) { if (n.matches && n.matches('ul.sub-menu')) return n; if (n.tagName === 'LI') break; n = n.nextElementSibling; } return null; }; const setClosed = (li) => { if (!li) return; li.classList.remove('is-open'); const btn = li.querySelector( ':scope > .av-dropdown-toggle--mobile[data-av-sub-toggle="true"]' ); const submenu = li.querySelector(':scope > ul.sub-menu'); if (btn) btn.setAttribute('aria-expanded', 'false'); if (submenu && !submenu.hasAttribute('hidden')) { submenu.setAttribute('hidden', ''); } }; const setOpen = (li) => { if (!li) return; li.classList.add('is-open'); const btn = li.querySelector( ':scope > .av-dropdown-toggle--mobile[data-av-sub-toggle="true"]' ); const submenu = li.querySelector(':scope > ul.sub-menu'); if (btn) btn.setAttribute('aria-expanded', 'true'); if (submenu && submenu.hasAttribute('hidden')) { submenu.removeAttribute('hidden'); } }; const onToggleClick = (e) => { const btn = e.currentTarget; const li = btn.closest('li'); if (!li) return; const submenu = findSubmenuForButton(btn); if (!submenu) return; const isOpen = btn.getAttribute('aria-expanded') === 'true'; if (isOpen) { setClosed(li); return; } const parentUL = li.parentElement; if (parentUL) { const openSiblings = parentUL.querySelectorAll(':scope > li.is-open'); openSiblings.forEach((sib) => { if (sib !== li) setClosed(sib); }); } setOpen(li); }; const bindMobileToggles = (root) => { const container = root || document; const buttons = container.querySelectorAll( '.av-mobile .av-dropdown-toggle--mobile[data-av-sub-toggle="true"]' ); buttons.forEach((btn) => { btn.removeEventListener('click', onToggleClick); btn.addEventListener('click', onToggleClick); }); }; if (document.readyState === 'loading') { document.addEventListener( 'DOMContentLoaded', () => bindMobileToggles(), { once: true } ); } else { bindMobileToggles(); } document.addEventListener('click', (e) => { const t = e.target.closest('[data-av-toggle]'); if (t) { setTimeout(() => bindMobileToggles(), 0); } }); })(); // ------------------------------ // 8) WP navigation submenu toggles (.wp-block-navigation-submenu__toggle) // One handler: toggles submenu + hides other items. // ------------------------------ document.addEventListener('click', (e) => { const toggle = e.target.closest('.wp-block-navigation-submenu__toggle'); if (!toggle) return; e.preventDefault(); const menuItem = toggle.closest('.wp-block-navigation-item'); const submenu = toggle.nextElementSibling || menuItem?.querySelector(':scope > .wp-block-navigation__submenu'); const isExpanded = toggle.getAttribute('aria-expanded') === 'true'; const nextExpanded = !isExpanded; toggle.setAttribute('aria-expanded', String(nextExpanded)); if (submenu) submenu.classList.toggle('active', nextExpanded); const allMenuItems = document.querySelectorAll( '.wp-block-navigation__responsive-container-content > ul > .wp-block-navigation-item' ); allMenuItems.forEach((item) => { if (!item.contains(toggle)) { item.classList.toggle('hidden-menu-item', nextExpanded); } }); }); // ------------------------------ // 9) .scroll-to-next links // ------------------------------ const nextLinks = document.querySelectorAll('.scroll-to-next a'); if (nextLinks.length) { nextLinks.forEach((link) => { link.addEventListener('click', (e) => { e.preventDefault(); const href = link.getAttribute('href') || ''; const id = href.startsWith('#') ? href.slice(1) : href; if (!id) return; const targetSection = document.getElementById(id); if (!targetSection) return; targetSection.scrollIntoView({ behavior: 'smooth' }); // Remove hash without reload history.pushState(null, '', ' '); }); }); } // ------------------------------ // 10) Masonry-style columns on blog/archive pages // ------------------------------ const body = document.body; if (body.classList.contains('archive') && body.classList.contains('post-type-archive-alumni-spotlights')) { return; } if ( body.classList.contains('page-template-blog-page') || body.classList.contains('archive') || body.classList.contains('term-papers') ) { let originalPosts = null; const getColumnsCount = () => { const width = window.innerWidth; if (width < 599) return 1; if (width < 1024) return 2; return 3; }; const createMasonryGrid = () => { const container = document.querySelector( 'ul.wp-block-post-template' ); if (!container) return; const columnsCount = getColumnsCount(); if (!originalPosts) { originalPosts = Array.from( container.querySelectorAll('li.wp-block-post') ); } if (!originalPosts.length) return; container.innerHTML = ''; const columns = []; for (let i = 0; i < columnsCount; i++) { const col = document.createElement('div'); col.classList.add('masonry-column'); const inner = document.createElement('div'); inner.classList.add('masonry-inner'); col.appendChild(inner); container.appendChild(col); columns.push(inner); } originalPosts.forEach((post, index) => { const colIndex = index % columnsCount; columns[colIndex].appendChild(post); }); }; const debounce = (fn, wait) => { let timeout; return function (...args) { clearTimeout(timeout); timeout = setTimeout(() => fn.apply(this, args), wait); }; }; createMasonryGrid(); window.addEventListener( 'resize', debounce(createMasonryGrid, 150), { passive: true } ); } }); })(); // ======================== // Responsive menu behavior (desktop vs mobile regions) // ======================== (function () { 'use strict'; function initDinsmoreMenus(rootSelector) { const root = document.querySelector(rootSelector || '.av-responsive-menu'); if (!root) return; const cssBp = getComputedStyle(document.documentElement) .getPropertyValue('--av-bp') .trim(); const bp = cssBp && cssBp.endsWith('px') ? parseInt(cssBp, 10) : parseInt(root.getAttribute('data-breakpoint') || '992', 10); document.documentElement.style.setProperty('--av-bp', `${bp}px`); document.documentElement.classList.add('js-av-dropdowns'); const desktopRegion = root.querySelector('.av-desktop'); const mobileRegion = root.querySelector('.av-mobile'); const toggles = Array.prototype.slice.call( root.querySelectorAll('[data-av-toggle], .av-nav-toggle') ); const drawers = toggles.map((btn) => { const resolveTargetId = (b) => { return ( b.getAttribute('data-av-toggle') || b.getAttribute('aria-controls') || ((h) => (h && h.startsWith('#') ? h.slice(1) : null))( b.getAttribute('href') ) ); }; const id = resolveTargetId(btn); const list = id ? document.getElementById(id) : null; const wrap = id ? document.getElementById(`${id}-wrap`) || (list ? list.closest('.av-mobile-wrap') : null) : null; if (btn && !btn.hasAttribute('aria-expanded')) { btn.setAttribute('aria-expanded', 'false'); } if (wrap) wrap.hidden = true; if (list) list.hidden = true; return { btn, id, wrap, list }; }); const mq = window.matchMedia(`(min-width:${bp}px)`); const isDesktop = () => mq.matches; const setRegionState = (el, hidden) => { if (!el) return; el.setAttribute('aria-hidden', hidden ? 'true' : 'false'); if (hidden) { el.setAttribute('inert', ''); } else { el.removeAttribute('inert'); } }; const applyViewportState = () => { const desktop = isDesktop(); setRegionState(desktopRegion, !desktop); setRegionState(mobileRegion, desktop); drawers.forEach((d) => { if (!d.btn) return; d.btn.setAttribute('aria-expanded', 'false'); if (d.wrap) d.wrap.hidden = true; if (d.list) d.list.hidden = true; }); }; if (document.readyState === 'loading') { document.addEventListener( 'DOMContentLoaded', applyViewportState, { once: true } ); } else { applyViewportState(); } if (mq.addEventListener) { mq.addEventListener('change', applyViewportState); } else if (mq.addListener) { mq.addListener(applyViewportState); } // Mobile drawer drawers.forEach((d) => { const { btn, wrap, list } = d; if (!btn || !wrap || !list) return; btn.addEventListener('click', (e) => { if (btn.tagName === 'A') e.preventDefault(); e.stopPropagation(); const open = btn.getAttribute('aria-expanded') === 'true'; btn.setAttribute('aria-expanded', String(!open)); wrap.hidden = open; list.hidden = open; }); document.addEventListener('keydown', (e) => { if (e.key !== 'Escape') return; if (btn.getAttribute('aria-expanded') !== 'true') return; btn.setAttribute('aria-expanded', 'false'); wrap.hidden = true; list.hidden = true; btn.focus({ preventScroll: true }); }); document.addEventListener('click', (e) => { if (btn.getAttribute('aria-expanded') !== 'true') return; if (wrap.contains(e.target) || btn.contains(e.target)) return; btn.setAttribute('aria-expanded', 'false'); wrap.hidden = true; list.hidden = true; }); }); // Desktop dropdowns const roots = [ root.querySelector('.av-nav--top .menu--top'), root.querySelector('.av-nav--primary .menu--primary'), ].filter(Boolean); if (!roots.length) return; const OPEN = 'is-open'; const timers = new WeakMap(); const openDelay = 60; const closeDelay = 180; const hasSub = (li) => !!li && !!li.querySelector(':scope > .sub-menu'); const clearT = (node) => { const t = timers.get(node); if (t) { clearTimeout(t); timers.delete(node); } }; // ARIA prep roots.forEach((r) => { r.querySelectorAll('li.menu-item-has-children').forEach((li) => { li.dataset.dropdownParent = 'true'; li.dataset.state = 'closed'; const trigger = li.querySelector(':scope > a'); const panel = li.querySelector(':scope > .sub-menu'); const btn = li.querySelector(':scope > .av-dropdown-toggle'); if (trigger) { trigger.dataset.dropdownTrigger = 'true'; trigger.setAttribute('aria-haspopup', 'menu'); trigger.setAttribute('aria-expanded', 'false'); } if (panel) { panel.dataset.dropdownPanel = 'true'; if (!panel.id) { const base = li.id || `menu-item-${Math.random().toString(36).slice(2)}`; panel.id = `submenu-${base}`; } } if (btn) { btn.setAttribute('aria-expanded', 'false'); btn.dataset.dropdownToggle = 'true'; if (panel) btn.setAttribute('aria-controls', panel.id); } }); }); const setOpen = (li, on) => { if (!li) return; li.classList.toggle(OPEN, !!on); li.dataset.state = on ? 'open' : 'closed'; const a = li.querySelector(':scope > a[data-dropdown-trigger]'); if (a) a.setAttribute('aria-expanded', on ? 'true' : 'false'); const b = li.querySelector(':scope > .av-dropdown-toggle'); if (b) b.setAttribute('aria-expanded', on ? 'true' : 'false'); if (on) { const p = li.parentElement; if (p) { p.querySelectorAll(`:scope > li.${OPEN}`).forEach((s) => { if (s !== li) setOpen(s, false); }); } } else { li.querySelectorAll(`li.${OPEN}`).forEach((n) => { setOpen(n, false); }); } }; roots.forEach((rootMenu) => { rootMenu.addEventListener( 'pointerenter', (e) => { if (!isDesktop()) return; const submenu = e.target.closest('.sub-menu'); const li = submenu ? submenu.parentElement : e.target.closest('li.menu-item-has-children'); if (!li || !rootMenu.contains(li) || !hasSub(li)) return; clearT(li); timers.set( li, setTimeout(() => setOpen(li, true), openDelay) ); }, true ); rootMenu.addEventListener( 'pointerleave', (e) => { if (!isDesktop()) return; const submenu = e.target.closest('.sub-menu'); const li = submenu ? submenu.parentElement : e.target.closest('li.menu-item-has-children'); if (!li || !rootMenu.contains(li) || !hasSub(li)) return; const to = e.relatedTarget; if (to && li.contains(to)) return; clearT(li); timers.set( li, setTimeout(() => setOpen(li, false), closeDelay) ); }, true ); rootMenu.addEventListener('click', (e) => { if (!isDesktop()) return; const btn = e.target.closest('button.av-dropdown-toggle'); if (btn) { e.preventDefault(); e.stopPropagation(); const li = btn.parentElement; setOpen(li, !li.classList.contains(OPEN)); return; } const a = e.target.closest('a[data-dropdown-trigger]'); if (!a) return; const li2 = a.parentElement; if ( !li2 || !li2.classList.contains('menu-item-has-children') ) { return; } if (!li2.classList.contains(OPEN)) { e.preventDefault(); setOpen(li2, true); } }); rootMenu.addEventListener('focusin', (e) => { if (!isDesktop()) return; const li = e.target.closest('li.menu-item-has-children'); if (li && rootMenu.contains(li)) setOpen(li, true); }); rootMenu.addEventListener('focusout', () => { if (!isDesktop()) return; setTimeout(() => { const active = document.activeElement; rootMenu.querySelectorAll(`li.${OPEN}`).forEach((openLi) => { if (!openLi.contains(active)) setOpen(openLi, false); }); }, 0); }); }); const closeAll = () => { roots.forEach((r) => { r.querySelectorAll(`li.${OPEN}`).forEach((li) => setOpen(li, false) ); }); drawers.forEach((d) => { if (!d.wrap || !d.list) return; d.wrap.hidden = true; d.list.hidden = true; if (d.btn) d.btn.setAttribute('aria-expanded', 'false'); }); }; if (mq.addEventListener) mq.addEventListener('change', closeAll); else if (mq.addListener) mq.addListener(closeAll); } if (document.readyState === 'loading') { document.addEventListener( 'DOMContentLoaded', () => initDinsmoreMenus('.av-responsive-menu'), { once: true } ); } else { initDinsmoreMenus('.av-responsive-menu'); } // ======================== // Tablet touch “no-hover” patch // - Blocks hover events on touch devices in desktop breakpoint // - Keeps your current click behavior: 1st tap opens, 2nd tap navigates // - closes open dropdowns when tapping outside // ======================== //start function getBp(root) { const cssBp = getComputedStyle(document.documentElement) .getPropertyValue('--av-bp') .trim(); if (cssBp && cssBp.endsWith('px')) { const n = parseInt(cssBp, 10); if (!Number.isNaN(n)) return n; } const attr = root && root.getAttribute('data-breakpoint'); const n2 = parseInt(attr || '992', 10); return Number.isNaN(n2) ? 992 : n2; } function isTouchDesktop(root) { const bp = getBp(root); const desktopMq = window.matchMedia(`(min-width:${bp}px)`); if (!desktopMq.matches) return false; const noHover = window.matchMedia('(hover: none)').matches; const coarse = window.matchMedia('(pointer: coarse)').matches; return noHover || coarse; } function closeAllDropdowns(root) { if (!root) return; const openLis = root.querySelectorAll( '.av-nav--top li.is-open, .av-nav--primary li.is-open' ); openLis.forEach((li) => { li.classList.remove('is-open'); li.dataset.state = 'closed'; const a = li.querySelector(':scope > a[data-dropdown-trigger]'); if (a) a.setAttribute('aria-expanded', 'false'); const b = li.querySelector(':scope > .av-dropdown-toggle'); if (b) b.setAttribute('aria-expanded', 'false'); }); } function init() { const root = document.querySelector('.av-responsive-menu'); if (!root) return; const blockHoverIfTouchDesktop = (e) => { if (!isTouchDesktop(root)) return; const inDesktopNav = e.target && e.target.closest ? e.target.closest('.av-nav--top, .av-nav--primary') : null; if (!inDesktopNav) return; e.stopPropagation(); }; document.addEventListener('pointerenter', blockHoverIfTouchDesktop, true); document.addEventListener('pointerleave', blockHoverIfTouchDesktop, true); const onOutsideTap = (e) => { if (!isTouchDesktop(root)) return; if (root.contains(e.target)) return; closeAllDropdowns(root); }; if (window.PointerEvent) { document.addEventListener('pointerdown', onOutsideTap, { passive: true }); } else { document.addEventListener('touchstart', onOutsideTap, { passive: true }); } const bp = getBp(root); const desktopMq = window.matchMedia(`(min-width:${bp}px)`); const onBpChange = () => closeAllDropdowns(root); if (desktopMq.addEventListener) desktopMq.addEventListener('change', onBpChange); else if (desktopMq.addListener) desktopMq.addListener(onBpChange); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init, { once: true }); } else { init(); } //end })(); /** * Windows Touch Desktop dropdown patch (strong override) * - Desktop breakpoint only * - Windows + touch only * - Uses pointerdown (capture) + suppresses ensuing click to prevent "open then close" * - Parent link: 1st tap opens, 2nd tap navigates * - Arrow button: opens/closes on 1st tap */ (function () { 'use strict'; function getBp(root) { var cssBp = getComputedStyle(document.documentElement) .getPropertyValue('--av-bp') .trim(); if (cssBp && cssBp.endsWith('px')) { var n = parseInt(cssBp, 10); if (!Number.isNaN(n)) return n; } var attr = root && root.getAttribute('data-breakpoint'); var n2 = parseInt(attr || '992', 10); return Number.isNaN(n2) ? 992 : n2; } function isWindowsPlatform() { if (navigator.userAgentData && typeof navigator.userAgentData.platform === 'string') { return navigator.userAgentData.platform.toLowerCase().indexOf('windows') !== -1; } var p = (navigator.platform || '').toLowerCase(); if (p.indexOf('win') !== -1) return true; var ua = (navigator.userAgent || '').toLowerCase(); return ua.indexOf('windows') !== -1; } function isWindowsTouchDesktop(root) { if (!isWindowsPlatform()) return false; var bp = getBp(root); var desktopMq = window.matchMedia('(min-width:' + bp + 'px)'); if (!desktopMq.matches) return false; var noHover = window.matchMedia('(hover: none)').matches; var coarse = window.matchMedia('(pointer: coarse)').matches; var touchPoints = typeof navigator.maxTouchPoints === 'number' ? navigator.maxTouchPoints : 0; return noHover || coarse || touchPoints > 0; } function findNavContainer(target) { return target && target.closest ? target.closest('.av-nav--top, .av-nav--primary') : null; } function findParentLi(target) { return target && target.closest ? target.closest( '.av-nav--top li[data-dropdown-parent="true"], .av-nav--primary li[data-dropdown-parent="true"], ' + '.av-nav--top li.menu-item-has-children, .av-nav--primary li.menu-item-has-children' ) : null; } function setLiState(li, isOpen) { if (!li) return; if (isOpen) { li.classList.add('is-open'); li.dataset.state = 'open'; } else { li.classList.remove('is-open'); li.dataset.state = 'closed'; delete li.dataset.dsArmed; } var a = li.querySelector(':scope > a[data-dropdown-trigger]'); if (a) a.setAttribute('aria-expanded', isOpen ? 'true' : 'false'); var b = li.querySelector(':scope > .av-dropdown-toggle, :scope > button[data-dropdown-toggle]'); if (b) b.setAttribute('aria-expanded', isOpen ? 'true' : 'false'); } function closeSiblings(li) { if (!li || !li.parentElement) return; var siblings = li.parentElement.querySelectorAll(':scope > li.is-open'); siblings.forEach(function (sib) { if (sib !== li) setLiState(sib, false); }); } function initWindowsTouchPatch() { var root = document.querySelector('.av-responsive-menu'); if (!root) return; if (!isWindowsTouchDesktop(root)) return; // Block synthetic mouse events right after touch var ignoreMouseUntil = 0; function shouldIgnorePointer(e) { if (!e) return false; if (e.pointerType === 'touch') { ignoreMouseUntil = Date.now() + 650; return false; } if (e.pointerType === 'mouse' && Date.now() < ignoreMouseUntil) return true; return false; } // Click suppression token (per tap) var suppressNextClickUntil = 0; function suppressThisTap() { suppressNextClickUntil = Date.now() + 800; } // 1) pointerdown capture: handle toggles BEFORE existing code root.addEventListener( 'pointerdown', function (e) { if (!isWindowsTouchDesktop(root)) return; if (shouldIgnorePointer(e)) return; var nav = findNavContainer(e.target); if (!nav) return; var btn = e.target && e.target.closest ? e.target.closest('.av-dropdown-toggle, button[data-dropdown-toggle]') : null; var link = e.target && e.target.closest ? e.target.closest('a[data-dropdown-trigger]') : null; // Arrow button: always toggle on first tap if (btn) { var liBtn = findParentLi(btn); if (!liBtn) return; e.preventDefault(); e.stopPropagation(); if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation(); var isOpenBtn = liBtn.classList.contains('is-open') || liBtn.dataset.state === 'open'; if (!isOpenBtn) closeSiblings(liBtn); setLiState(liBtn, !isOpenBtn); // Prevent "open then close" from other click handlers suppressThisTap(); return; } // Parent link: 1st tap opens, 2nd tap navigates if (link) { var liLink = findParentLi(link); if (!liLink) return; var isOpenLink = liLink.classList.contains('is-open') || liLink.dataset.state === 'open'; var armed = liLink.dataset.dsArmed === '1'; // Closed => open only if (!isOpenLink) { e.preventDefault(); e.stopPropagation(); if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation(); closeSiblings(liLink); setLiState(liLink, true); liLink.dataset.dsArmed = '1'; suppressThisTap(); return; } // Open: // If armed => allow navigation on second tap, but keep other handlers from toggling it. if (armed) { // Do NOT preventDefault here (we want to navigate). // But we *do* stop propagation to avoid other handlers closing before nav. e.stopPropagation(); if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation(); return; } // Open but not armed (opened by something else): arm it, and suppress click once. e.preventDefault(); e.stopPropagation(); if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation(); liLink.dataset.dsArmed = '1'; suppressThisTap(); } }, true ); // 2) click capture: suppress the click that follows our pointerdown handling root.addEventListener( 'click', function (e) { if (!isWindowsTouchDesktop(root)) return; // If we just handled the tap on pointerdown, swallow click so other menu JS can't "undo" it. if (Date.now() < suppressNextClickUntil) { e.preventDefault(); e.stopPropagation(); if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation(); } }, true ); // 3) Outside tap closes document.addEventListener( 'pointerdown', function (e) { if (!isWindowsTouchDesktop(root)) return; if (!e || root.contains(e.target)) return; var openLis = root.querySelectorAll('.av-nav--top li.is-open, .av-nav--primary li.is-open'); openLis.forEach(function (li) { setLiState(li, false); }); }, { passive: true } ); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initWindowsTouchPatch, { once: true }); } else { initWindowsTouchPatch(); } })(); // ======================== // Safari detection + "latest" sliders + chips slider // ======================== (function () { 'use strict'; function isSafariDesktop() { const ua = navigator.userAgent; return /Safari/.test(ua) && !/(Chrome|Chromium|Edg|OPR|Brave|Vivaldi)/.test(ua); } function isSafariIOS() { const ua = navigator.userAgent; const isiOS = /iP(hone|ad|od)/.test(ua); return isiOS && /Safari/.test(ua) && !/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(ua); } function isSafari() { return isSafariDesktop() || isSafariIOS(); } if (isSafari()) { document.documentElement.classList.add('is-safari'); if (isSafariIOS()) document.documentElement.classList.add('is-safari-ios'); if (isSafariDesktop()) document.documentElement.classList.add('is-safari-macos'); } document.addEventListener('DOMContentLoaded', () => { if (isSafari()) { document.body.classList.add('is-safari'); if (isSafariIOS()) document.body.classList.add('is-safari-ios'); if (isSafariDesktop()) document.body.classList.add('is-safari-macos'); } const aVselector = '.featured-office-block .wp-block-post-featured-image > p'; const firstMatch = document.querySelector(aVselector); if (!firstMatch) return; document.querySelectorAll(aVselector).forEach((p) => p.remove()); }); // ---------- IIFE #1: .latest-sections slider ---------- (function () { const BP_ON = 1024; const GAP_TAB = 30; const GAP_MOB = 20; const PEEK_TAB = 60; const PEEK_MOB = 40; const EASE_MS = 400; const THRESH_FR = 0.12; const REDUCED = matchMedia('(prefers-reduced-motion: reduce)').matches; const clamp = (n, a, b) => Math.min(Math.max(n, a), b); const blocks = document.querySelectorAll('.latest-sections'); if (!blocks.length) return; blocks.forEach(bootstrapCards); let rTO1; addEventListener( 'resize', () => { clearTimeout(rTO1); rTO1 = setTimeout(() => blocks.forEach(bootstrapCards), 120); }, { passive: true } ); function bootstrapCards(root) { const cols = root.querySelector('.wp-block-columns'); if (!cols) return; const active = innerWidth <= BP_ON; const inited = root.dataset.cardsInit === '1'; if (active && !inited) initCards(root, cols); else if (!active && inited) destroyCards(root); else if (active && inited) { const idx = root._cards && typeof root._cards.uiIndex === 'number' ? root._cards.uiIndex : 0; layoutCards(root); goToCard(root, idx, true); } } function initCards(root, cols) { root.dataset.cardsInit = '1'; const slides = Array.from(cols.querySelectorAll('.latest-unit')); if (!slides.length) { root.dataset.cardsInit = '0'; return; } const viewport = document.createElement('div'); viewport.className = 'ls-viewport'; viewport.style.overflow = 'hidden'; viewport.style.position = 'relative'; viewport.style.touchAction = 'pan-y'; const track = document.createElement('div'); track.className = 'ls-track'; track.style.display = 'flex'; track.style.willChange = 'transform'; track.style.transition = REDUCED ? 'none' : `transform ${EASE_MS}ms ease`; viewport.appendChild(track); cols.parentNode.insertBefore(viewport, cols); slides.forEach((s) => { s.classList.add('ls-slide'); s.style.flex = '0 0 auto'; s.style.maxWidth = 'none'; track.appendChild(s); }); cols.style.display = 'none'; const dots = document.createElement('div'); dots.className = 'ls-dots'; dots.setAttribute('role', 'tablist'); slides.forEach((_, i) => { const b = document.createElement('button'); b.className = 'ls-dot'; b.type = 'button'; b.setAttribute('role', 'tab'); b.setAttribute('aria-label', `Go to slide ${i + 1}`); dots.appendChild(b); }); root.appendChild(dots); viewport.setAttribute('aria-roledescription', 'carousel'); viewport.setAttribute('aria-label', 'Latest items'); slides.forEach((s, i) => { s.setAttribute('role', 'group'); s.setAttribute('aria-roledescription', 'slide'); s.setAttribute('aria-label', `Slide ${i + 1} of ${slides.length}`); }); const st = { uiIndex: 0, count: slides.length, els: { root, cols, viewport, track, slides, dots }, moved: false, dragging: false, justDragged: false, gap: 0, peek: 0, slideW: 0, step: 0, maxTranslate: 0, }; root._cards = st; const dotBtns = Array.from(dots.children); st.els.dotHandlers = dotBtns.map((_, i) => () => goToCard(root, i)); dotBtns.forEach((btn, i) => btn.addEventListener('click', st.els.dotHandlers[i]) ); st.onKey = (e) => { if (e.key === 'ArrowLeft') { e.preventDefault(); goToCard(root, st.uiIndex - 1); } if (e.key === 'ArrowRight') { e.preventDefault(); goToCard(root, st.uiIndex + 1); } }; viewport.tabIndex = 0; viewport.addEventListener('keydown', st.onKey); const onDown = (x) => { st.dragging = true; st.moved = false; st.justDragged = false; st.startX = x; st.curX = x; track.style.transition = 'none'; }; const onMove = (x) => { if (!st.dragging) return; st.curX = x; const dx = x - st.startX; if (Math.abs(dx) > 3) st.moved = true; const baseX = clamp(st.uiIndex * st.step, 0, st.maxTranslate); const raw = baseX - dx; const clampX = clamp(raw, 0, st.maxTranslate); track.style.transform = `translateX(${-clampX}px)`; }; const onUp = () => { if (!st.dragging) return; const dx = st.curX - st.startX; st.dragging = false; track.style.transition = REDUCED ? 'none' : `transform ${EASE_MS}ms ease`; const threshold = Math.max(40, st.step * THRESH_FR); if (dx > threshold) goToCard(root, st.uiIndex - 1); else if (dx < -threshold) goToCard(root, st.uiIndex + 1); else goToCard(root, st.uiIndex); if (st.moved) st.justDragged = true; }; st.pointerHandlers = { down: (e) => { viewport.setPointerCapture(e.pointerId); onDown(e.clientX); }, move: (e) => { if (st.dragging) onMove(e.clientX); }, up: () => onUp(), cancel: () => onUp(), }; viewport.addEventListener('pointerdown', st.pointerHandlers.down); viewport.addEventListener('pointermove', st.pointerHandlers.move, { passive: true, }); viewport.addEventListener('pointerup', st.pointerHandlers.up); viewport.addEventListener( 'pointercancel', st.pointerHandlers.cancel ); st.onClickCapture = (e) => { if (st.justDragged) { e.preventDefault(); e.stopPropagation(); st.justDragged = false; } }; viewport.addEventListener('click', st.onClickCapture, true); layoutCards(root); goToCard(root, 0, true); st.ro = new ResizeObserver(() => { layoutCards(root); goToCard(root, st.uiIndex, true); }); st.ro.observe(viewport); } function layoutCards(root) { const st = root._cards; if (!st) return; const { viewport, track, slides } = st.els; const isMobile = innerWidth <= 767; st.gap = isMobile ? GAP_MOB : GAP_TAB; st.peek = isMobile ? PEEK_MOB : PEEK_TAB; if (st.count <= 1) st.peek = 0; const vw = viewport.clientWidth; st.slideW = Math.max(0, vw - st.peek); const w = Math.floor(st.slideW); track.style.gap = `${st.gap}px`; slides.forEach((s) => { s.style.width = `${w}px`; }); st.step = Math.floor(st.slideW + st.gap); const contentW = st.count * st.slideW + (st.count - 1) * st.gap; const viewportW = st.slideW + st.peek; st.maxTranslate = Math.max(0, Math.ceil(contentW - viewportW)); } function goToCard(root, uiIndex, immediate) { const st = root._cards; if (!st) return; const { track, dots } = st.els; st.uiIndex = Math.min(Math.max(uiIndex, 0), st.count - 1); const rawX = st.uiIndex * st.step; const x = Math.min(rawX, st.maxTranslate); if (immediate || REDUCED) track.style.transition = 'none'; track.style.transform = `translateX(${-x}px)`; if (immediate || REDUCED) { track.getBoundingClientRect(); if (!REDUCED) { track.style.transition = `transform ${EASE_MS}ms ease`; } } Array.from(dots.children).forEach((b, i) => { if (i === st.uiIndex) { b.setAttribute('aria-selected', 'true'); b.tabIndex = 0; } else { b.removeAttribute('aria-selected'); b.tabIndex = -1; } }); } function destroyCards(root) { const st = root._cards; if (!st) return; const { viewport, track, cols, slides, dots } = st.els; if (st.ro) st.ro.disconnect(); if (st.onKey) viewport.removeEventListener('keydown', st.onKey); if (st.pointerHandlers) { viewport.removeEventListener( 'pointerdown', st.pointerHandlers.down ); viewport.removeEventListener( 'pointermove', st.pointerHandlers.move ); viewport.removeEventListener( 'pointerup', st.pointerHandlers.up ); viewport.removeEventListener( 'pointercancel', st.pointerHandlers.cancel ); } if (st.onClickCapture) { viewport.removeEventListener('click', st.onClickCapture, true); } const btns = Array.from(dots.children); if (st.els.dotHandlers) { btns.forEach((btn, i) => btn.removeEventListener('click', st.els.dotHandlers[i]) ); } slides.forEach((s) => { s.classList.remove('ls-slide'); s.style.width = ''; s.style.flex = ''; s.style.maxWidth = ''; cols.appendChild(s); }); if (viewport && viewport.parentNode) { viewport.parentNode.removeChild(viewport); } if (dots && dots.parentNode) { dots.parentNode.removeChild(dots); } cols.style.display = ''; delete root._cards; root.dataset.cardsInit = '0'; } })(); // ---------- IIFE #2: .turns-into-slider-xs chips slider ---------- (function () { const BP_ON = 992; // match your SCSS breakpoint (< 992px) const EASE_MS = 300; const REDUCED = matchMedia('(prefers-reduced-motion: reduce)').matches; const getTranslateX = (el) => { const t = getComputedStyle(el).transform; if (!t || t === 'none') return 0; if (typeof DOMMatrix !== 'undefined') { const m = new DOMMatrix(t); return m.m41 || 0; } if (typeof WebKitCSSMatrix !== 'undefined') { const m = new WebKitCSSMatrix(t); return m.m41 || 0; } const m2d = t.match(/matrix\([^,]+,[^,]+,[^,]+,[^,]+,(-?\d+\.?\d*),/); if (m2d && m2d[1]) return parseFloat(m2d[1]) || 0; const m3d = t.match(/matrix3d\((?:[^,]+,){12}(-?\d+\.?\d*)/); if (m3d && m3d[1]) return parseFloat(m3d[1]) || 0; return 0; }; const shells = document.querySelectorAll('.turns-into-slider-xs'); if (!shells.length) return; shells.forEach(bootstrap); let rTO; addEventListener('resize', () => { clearTimeout(rTO); rTO = setTimeout(() => { document.querySelectorAll('.turns-into-slider-xs').forEach(bootstrap); }, 120); }, { passive: true }); function bootstrap(shell) { const active = innerWidth <= BP_ON; const inited = shell.dataset.chipsInit === '1'; if (inited) destroy(shell); if (active) init(shell); } function init(shell) { shell.dataset.chipsInit = '1'; const viewport = document.createElement('div'); viewport.className = 'chips-viewport'; viewport.style.overflow = 'hidden'; viewport.style.position = 'relative'; viewport.style.touchAction = 'pan-y'; const track = document.createElement('div'); track.className = 'chips-track'; track.style.display = 'flex'; track.style.alignItems = 'stretch'; track.style.willChange = 'transform'; track.style.transform = 'translateX(0px)'; track.style.transition = REDUCED ? 'none' : `transform ${EASE_MS}ms ease`; const items = Array.from(shell.children); shell.parentNode.insertBefore(viewport, shell); viewport.appendChild(track); items.forEach((el) => { el.style.flex = '0 0 auto'; track.appendChild(el); }); shell.style.display = 'none'; const st = { shell, viewport, track, items, dragging: false, moved: false, justDragged: false, startX: 0, curX: 0, baseX: 0, maxTranslate: 0, ro: null, }; shell._chips = st; const onPointerDown = (e) => { st.dragging = true; st.moved = false; st.justDragged = false; st.startX = e.clientX; st.curX = e.clientX; st.baseX = getTranslateX(track); track.style.transition = 'none'; viewport.setPointerCapture(e.pointerId); }; const onPointerMove = (e) => { if (!st.dragging) return; st.curX = e.clientX; const dx = st.curX - st.startX; if (Math.abs(dx) > 3) st.moved = true; let next = st.baseX + dx; // Clamp between 0 and -maxTranslate next = Math.min(0, Math.max(next, -st.maxTranslate)); track.style.transform = `translateX(${next}px)`; }; const onPointerUp = () => { if (!st.dragging) return; st.dragging = false; snapToNearest(st); if (st.moved) st.justDragged = true; }; viewport.addEventListener('pointerdown', onPointerDown); viewport.addEventListener('pointermove', onPointerMove, { passive: true }); viewport.addEventListener('pointerup', onPointerUp); viewport.addEventListener('pointercancel', onPointerUp); st.pointerHandlers = { onPointerDown, onPointerMove, onPointerUp }; const onClickCap = (e) => { if (st.justDragged) { e.preventDefault(); e.stopPropagation(); st.justDragged = false; } }; viewport.addEventListener('click', onClickCap, true); st.onClickCap = onClickCap; layout(shell); const ro = new ResizeObserver(() => layout(shell)); ro.observe(viewport); st.ro = ro; } function layout(shell) { const st = shell._chips; if (!st) return; const { viewport, track } = st; // Includes item widths, flex gaps, padding, borders — everything. const total = track.scrollWidth; const vw = viewport.clientWidth; st.maxTranslate = Math.max(0, Math.ceil(total - vw)); const cur = getTranslateX(track); const clamped = Math.min(0, Math.max(cur, -st.maxTranslate)); track.style.transition = REDUCED ? 'none' : `transform ${EASE_MS}ms ease`; track.style.transform = `translateX(${clamped}px)`; } function snapToNearest(st) { const { track, items, maxTranslate } = st; if (!items.length) return; const curX = getTranslateX(track); const targets = [0, -maxTranslate]; items.forEach((el) => targets.push(-el.offsetLeft)); let target = targets[0]; let bestDist = Math.abs(curX - target); for (let i = 1; i < targets.length; i++) { const d = Math.abs(curX - targets[i]); if (d < bestDist) { bestDist = d; target = targets[i]; } } target = Math.min(0, Math.max(target, -maxTranslate)); track.style.transition = REDUCED ? 'none' : `transform ${EASE_MS}ms ease`; track.style.transform = `translateX(${target}px)`; } function destroy(shell) { const st = shell._chips; if (!st) return; const { viewport, track, items } = st; if (st.ro) st.ro.disconnect(); if (st.pointerHandlers) { viewport.removeEventListener('pointerdown', st.pointerHandlers.onPointerDown); viewport.removeEventListener('pointermove', st.pointerHandlers.onPointerMove); viewport.removeEventListener('pointerup', st.pointerHandlers.onPointerUp); viewport.removeEventListener('pointercancel', st.pointerHandlers.onPointerUp); } if (st.onClickCap) viewport.removeEventListener('click', st.onClickCap, true); items.forEach((el) => { el.style.flex = ''; shell.appendChild(el); }); if (viewport && viewport.parentNode) { viewport.parentNode.removeChild(viewport); } shell.style.display = ''; delete shell._chips; shell.dataset.chipsInit = '0'; } })(); })(); // ======================== // Viewport debugger (DEV only): enable via // ======================== (function () { 'use strict'; function showViewPortSize(display) { if (!display) return; const box = document.createElement('div'); box.id = 'viewportsize'; box.style.zIndex = '9999'; box.style.position = 'fixed'; box.style.bottom = '30px'; box.style.left = '0'; box.style.color = '#fff'; box.style.background = '#000'; box.style.padding = '10px'; box.style.fontFamily = 'monospace'; box.style.fontSize = '12px'; box.style.pointerEvents = 'none'; const updateSize = () => { const height = window.innerHeight; const width = window.innerWidth; box.innerHTML = `Height: ${height}
Width: ${width}`; }; updateSize(); document.body.appendChild(box); window.addEventListener('resize', updateSize); } document.addEventListener('DOMContentLoaded', () => { const debugFlag = document.documentElement.dataset.debugViewport === '1'; showViewPortSize(debugFlag); }); })(); // ======================== // Person tabs, LinkedIn, vCard width sync, tile cleanup // ======================== (function () { 'use strict'; const artInitPersonTabs = (root = document) => { const wrap = root.querySelector('.js-person-tabs'); if (!wrap || wrap.__artTabsBound) return; wrap.__artTabsBound = true; const onToggle = (e) => { const details = e.target; if ( !(details instanceof HTMLDetailsElement) || !details.classList.contains('person-section-details') ) return; if (details.open) { details.classList.add('tab-open'); details.classList.remove('tab-close'); } else { details.classList.remove('tab-open'); details.classList.add('tab-close'); } }; wrap.addEventListener('toggle', onToggle, true); }; if (document.readyState === 'loading') { document.addEventListener( 'DOMContentLoaded', () => artInitPersonTabs(), { once: true } ); } else { artInitPersonTabs(); } const artInit = () => { const linkedIns = document.querySelectorAll('.ds-linkedin'); if (linkedIns.length) { linkedIns.forEach((el) => el.classList.add('ln-loaded')); } const email = document.querySelector('.person-email'); const vcard = document.querySelector('.download-vcard'); if (!email || !vcard) return; const syncWidth = () => { const w = email.getBoundingClientRect().width - 26; vcard.style.width = `${Math.max(0, Math.floor(w))}px`; }; syncWidth(); if ('ResizeObserver' in window) { const ro = new ResizeObserver(() => { requestAnimationFrame(syncWidth); }); ro.observe(email); } window.addEventListener('resize', syncWidth, { passive: true }); }; if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', artInit, { once: true }); } else { artInit(); } function art_init() { const hasPerson = document.querySelector('.person-tile'); const hasPl = document.querySelector('.pl-item'); if (!hasPerson && !hasPl) return; const nodes = document.querySelectorAll( '.person-tile > p, .pl-item > p' ); if (!nodes.length) return; nodes.forEach((p) => { if (p && p.parentNode) p.parentNode.removeChild(p); }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', art_init, { once: true }); } else { art_init(); } })(); // ======================== // External links + Swiper industry slider // ======================== (function () { 'use strict'; function markExternalLinks() { const links = document.querySelectorAll('a[href]'); const currentHost = window.location.hostname.replace(/^www\./, ''); const currentOrigin = window.location.origin; links.forEach((link) => { const href = link.getAttribute('href'); if ( !href || href.charAt(0) === '#' || href.indexOf('mailto:') === 0 || href.indexOf('tel:') === 0 || href.indexOf('javascript:') === 0 ) { return; } let url; try { url = new URL(href, currentOrigin); } catch (e) { return; } const linkHost = url.hostname.replace(/^www\./, ''); if (!['http:', 'https:'].includes(url.protocol)) return; if (linkHost && linkHost !== currentHost) { link.setAttribute('target', '_blank'); const rel = (link.getAttribute('rel') || '') .split(/\s+/) .filter(Boolean); if (!rel.includes('noopener')) rel.push('noopener'); if (!rel.includes('noreferrer')) rel.push('noreferrer'); link.setAttribute('rel', rel.join(' ')); } }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', markExternalLinks, { once: true, }); } else { markExternalLinks(); } // Swiper: industry featured slider function dsInitIndustryFeaturedSlider() { if (typeof window.Swiper === 'undefined') { return; } const sliders = document.querySelectorAll( '.ifs-slider.swiper[data-ifs-slider="1"]' ); if (!sliders.length) return; sliders.forEach((sliderEl) => { if (sliderEl.dataset.swiperInitialized === '1') return; sliderEl.dataset.swiperInitialized = '1'; const paginationEl = sliderEl.querySelector('.swiper-pagination'); const outer = sliderEl.closest('.industry-related-wrap'); let desktopSlides = 4; if ( outer && outer.classList.contains( 'industry-related-wrap--no-resources' ) && outer.classList.contains('industry-related-wrap--no-faqs') ) { desktopSlides = 2; } /* eslint-disable no-new */ new window.Swiper(sliderEl, { loop: true, speed: 700, spaceBetween: 50, autoplay: { delay: 8000, disableOnInteraction: false, }, slidesPerView: 1, slidesPerGroup: 1, centeredSlides: false, pagination: { el: paginationEl || null, clickable: true, }, breakpoints: { 0: { slidesPerView: 1, }, 768: { slidesPerView: 2, }, 1024: { slidesPerView: desktopSlides, }, }, a11y: { enabled: true, }, }); /* eslint-enable no-new */ }); } if (document.readyState === 'loading') { document.addEventListener( 'DOMContentLoaded', dsInitIndustryFeaturedSlider, { once: true } ); } else { dsInitIndustryFeaturedSlider(); } document.addEventListener('facetwp-loaded', dsInitIndustryFeaturedSlider); })(); /* one-word-paras.js */ /* few-words-paras.js */ (function () { 'use strict'; function countWords(text) { if (window.Intl && Intl.Segmenter) { const seg = new Intl.Segmenter(undefined, { granularity: 'word' }); let n = 0; for (const s of seg.segment(text)) if (s.isWordLike) n++; return n; } const m = text.replace(/\u00A0/g, ' ').match(/\b[\p{L}\p{N}’'-]+\b/gu); return m ? m.length : 0; } function tagShortParagraphs(root) { const scope = root || document; const paras = scope.querySelectorAll('.office-leadership .wp-block-heading, .pattern-linked-box p, .office-team-cta .wp-block-heading'); for (let i = 0; i < paras.length; i++) { const p = paras[i]; const text = (p.textContent || '').trim(); if (!text) continue; const wc = countWords(text); // shared class for 1–2 words if (wc <= 2) { p.classList.add('is-few-words'); if (wc === 1) p.classList.add('is-one-word'); if (wc === 2) p.classList.add('is-two-words'); } } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { tagShortParagraphs(); }, { once: true }); } else { tagShortParagraphs(); } const STORAGE_KEY = "ds_last_service_parent"; const qs = (sel, root = document) => root.querySelector(sel); // --- 1) Remember the last parent service the user clicked from --- document.addEventListener("click", (event) => { const link = event.target.closest("a.js-service-child-link"); if (!link) return; const parentId = link.getAttribute("data-parent-service-id"); if (!parentId) return; try { window.sessionStorage.setItem(STORAGE_KEY, String(parentId)); // console.log("[ds] stored parent", parentId); } catch (err) { // ignore storage errors } }); // --- 2) On service single, override the parent crumb if we have context --- document.addEventListener("DOMContentLoaded", () => { const nav = qs(".ds-breadcrumbs.ds-breadcrumbs--services"); if (!nav) return; const parentsJson = nav.getAttribute("data-service-parents"); if (!parentsJson) { // console.log("[ds] no data-service-parents on nav"); return; } let parents; try { parents = JSON.parse(parentsJson); } catch (err) { // console.warn("[ds] failed to parse parents JSON", err); return; } if (!parents || typeof parents !== "object") { return; } let storedParentId = null; try { storedParentId = window.sessionStorage.getItem(STORAGE_KEY); } catch (err) { storedParentId = null; } if (!storedParentId) { // console.log("[ds] no stored parent id"); return; } // Keys from PHP JSON will be strings const keyStr = String(storedParentId); const keyInt = parseInt(storedParentId, 10); let parentInfo = parents[keyStr]; if (!parentInfo && Number.isFinite(keyInt)) { parentInfo = parents[String(keyInt)]; } if (!parentInfo) { // console.log("[ds] stored parent not found in map", storedParentId, parents); return; } const parentLink = nav.querySelector(".ds-breadcrumbs-parent--services"); // If there is no parent link at all, we could insert one, but for now just bail. if (!parentLink) { // console.log("[ds] no .ds-breadcrumbs-parent--services link to override"); return; } if (parentInfo.url) { parentLink.setAttribute("href", parentInfo.url); } if (parentInfo.title) { parentLink.textContent = parentInfo.title; } }); if (!document.querySelector(".ds-search-reveal-btn")) return; document.addEventListener("click", (e) => { const btn = e.target.closest(".ds-search-reveal-btn"); if (!btn) return; e.preventDefault(); const section = btn.closest(".search-section"); if (!section) return; // First click: reveal hidden items if (!btn.dataset.revealed) { section.querySelectorAll(".ds-search-hidden-item").forEach((el) => { el.classList.remove("ds-search-hidden-item"); }); btn.dataset.revealed = "1"; const needsViewAll = btn.dataset.needsViewAll === "1"; if (needsViewAll) { btn.textContent = btn.getAttribute("data-view-all-label") || "View all results"; } else { // remove entire button area const buttonWrap = btn.closest(".wp-block-buttons") || btn.closest(".wp-block-button"); if (buttonWrap) { buttonWrap.remove(); } else { btn.remove(); } } return; } // Second click: go to view-all page (only if needed) if (btn.dataset.needsViewAll !== "1") return; const url = btn.getAttribute("data-view-all-url"); if (url) window.location.assign(url); }); })(); // ---------- IIFE #3: .lfs-serv-ind-slider — INFINITE LOOP + DOTS + VIP-ROBUST DRAG ---------- (function () { 'use strict'; const LFS_SELECTOR = '.lfs-serv-ind-slider'; const LFS_MIN_COUNT_TO_SLIDE = 4; // Breakpoints: desktop=3, <=1023=2, <=767=1 const LFS_BP_TAB = 1080; const LFS_BP_MOB = 599; const LFS_GAP_DESK = 40; const LFS_GAP_TAB = 30; const LFS_GAP_MOB = 20; const LFS_EASE_MS = 400; const LFS_THRESH_FR = 0.12; const LFS_REDUCED = matchMedia('(prefers-reduced-motion: reduce)').matches; // Autoplay const LFS_AUTOPLAY_MS = 4500; const LFS_AUTOPLAY_RESUME_DELAY = 1200; const clamp = (n, a, b) => Math.min(Math.max(n, a), b); const getPerView = () => { if (innerWidth <= LFS_BP_MOB) return 2; if (innerWidth <= LFS_BP_TAB) return 2; return 3; }; const getGap = () => { if (innerWidth <= LFS_BP_MOB) return LFS_GAP_MOB; if (innerWidth <= LFS_BP_TAB) return LFS_GAP_TAB; return LFS_GAP_DESK; }; function scanAndInit(rootNode) { const scope = rootNode && rootNode.nodeType === 1 ? rootNode : document; const roots = scope.querySelectorAll ? scope.querySelectorAll(LFS_SELECTOR) : document.querySelectorAll(LFS_SELECTOR); if (!roots.length) return; roots.forEach((root) => { if (root.dataset.lfsInit === '1' && root._lfs) { rebuildForBreakpoint(root); return; } const items = Array.from(root.children).filter((n) => n && n.nodeType === 1); if (items.length < LFS_MIN_COUNT_TO_SLIDE) return; init(root, items); }); } function init(root, originalItems) { root.dataset.lfsInit = '1'; const viewport = document.createElement('div'); viewport.className = 'lfs-viewport'; viewport.style.overflow = 'hidden'; viewport.style.position = 'relative'; viewport.style.width = '100%'; viewport.style.touchAction = 'pan-y'; viewport.style.setProperty('user-select', 'none', 'important'); viewport.style.setProperty('-webkit-user-select', 'none', 'important'); const track = document.createElement('div'); track.className = 'lfs-track'; track.style.setProperty('display', 'flex', 'important'); track.style.setProperty('flex-wrap', 'nowrap', 'important'); track.style.setProperty('flex-direction', 'row', 'important'); track.style.setProperty('align-items', 'center', 'important'); track.style.setProperty('user-select', 'none', 'important'); track.style.setProperty('-webkit-user-select', 'none', 'important'); track.style.willChange = 'transform'; track.style.transform = 'translateX(0px)'; track.style.transition = LFS_REDUCED ? 'none' : `transform ${LFS_EASE_MS}ms ease`; viewport.appendChild(track); root.parentNode.insertBefore(viewport, root); // Hide original wrapper root.style.display = 'none'; // Dots const dots = document.createElement('div'); dots.className = 'lfs-dots'; dots.setAttribute('role', 'tablist'); viewport.parentNode.insertBefore(dots, viewport.nextSibling); const st = { uiIndex: 0, // real slide index loopIndex: 0, // index in track (includes clones) realCount: originalItems.length, perView: getPerView(), gap: 0, slideW: 0, step: 0, dragging: false, moved: false, justDragged: false, startX: 0, startY: 0, curX: 0, curY: 0, lockAxis: null, // null | 'x' | 'y' baseLoopIndex: 0, activePointerId: null, _autoTimer: null, _autoResumeTimer: null, els: { root, viewport, track, dots }, realItems: originalItems, allItems: [], dotBtns: [], dotHandlers: [], }; root._lfs = st; viewport.setAttribute('aria-roledescription', 'carousel'); viewport.setAttribute('aria-label', 'Slider'); viewport.tabIndex = 0; buildTrackAndDots(st); // Pause autoplay on hover/focus viewport.addEventListener('mouseenter', () => stopAutoplay(st)); viewport.addEventListener('mouseleave', () => scheduleAutoplayResume(st)); viewport.addEventListener('focusin', () => stopAutoplay(st)); viewport.addEventListener('focusout', () => scheduleAutoplayResume(st)); // Keyboard st.onKey = (e) => { if (e.key === 'ArrowLeft') { e.preventDefault(); stopAutoplay(st); moveBy(st, -1); scheduleAutoplayResume(st); } if (e.key === 'ArrowRight') { e.preventDefault(); stopAutoplay(st); moveBy(st, 1); scheduleAutoplayResume(st); } }; viewport.addEventListener('keydown', st.onKey); // Robust drag (window capture) bindDrag(st); // Prevent clicks after drag st.onClickCapture = (e) => { if (st.justDragged) { e.preventDefault(); e.stopPropagation(); st.justDragged = false; } }; viewport.addEventListener('click', st.onClickCapture, true); // Resize observer st.ro = new ResizeObserver(() => rebuildForBreakpoint(root)); st.ro.observe(viewport); ensureAutoplay(st); } function rebuildForBreakpoint(root) { const st = root._lfs; if (!st) return; const nextPerView = getPerView(); if (nextPerView === st.perView) { layout(st); snapToLoopIndex(st, st.loopIndex, true); updateDots(st); ensureAutoplay(st); return; } const keepRealIndex = st.uiIndex; stopAutoplay(st); st.perView = nextPerView; buildTrackAndDots(st); st.uiIndex = clamp(keepRealIndex, 0, st.realCount - 1); st.loopIndex = st.uiIndex + st.perView; layout(st); snapToLoopIndex(st, st.loopIndex, true); updateDots(st); ensureAutoplay(st); } function buildTrackAndDots(st) { const { track, dots } = st.els; // Clear track while (track.firstChild) track.removeChild(track.firstChild); // Clear dots and handlers if (st.dotBtns.length && st.dotHandlers.length) { st.dotBtns.forEach((btn, i) => btn.removeEventListener('click', st.dotHandlers[i])); } while (dots.firstChild) dots.removeChild(dots.firstChild); st.dotBtns = []; st.dotHandlers = []; const real = st.realItems; const cloneN = Math.min(st.perView, st.realCount); const leftClones = []; const rightClones = []; for (let i = st.realCount - cloneN; i < st.realCount; i++) { const c = real[i].cloneNode(true); c.classList.add('lfs-clone'); leftClones.push(c); } real.forEach((el) => { el.classList.add('lfs-slide'); el.style.setProperty('flex', '0 0 auto', 'important'); el.style.setProperty('max-width', 'none', 'important'); // Disable native dragging/selecting inside slides (VIP prod often differs here) el.style.setProperty('user-select', 'none', 'important'); el.style.setProperty('-webkit-user-select', 'none', 'important'); el.querySelectorAll('img').forEach((img) => { img.setAttribute('draggable', 'false'); img.style.setProperty('-webkit-user-drag', 'none', 'important'); img.style.setProperty('user-drag', 'none', 'important'); img.style.setProperty('pointer-events', 'none', 'important'); // drag handled by viewport/window }); }); for (let i = 0; i < cloneN; i++) { const c = real[i].cloneNode(true); c.classList.add('lfs-clone'); // Ensure clones also disable native drag c.querySelectorAll('img').forEach((img) => { img.setAttribute('draggable', 'false'); img.style.setProperty('-webkit-user-drag', 'none', 'important'); img.style.setProperty('user-drag', 'none', 'important'); img.style.setProperty('pointer-events', 'none', 'important'); }); rightClones.push(c); } st.allItems = [...leftClones, ...real, ...rightClones]; st.allItems.forEach((el) => { el.style.setProperty('flex', '0 0 auto', 'important'); el.style.setProperty('max-width', 'none', 'important'); track.appendChild(el); }); // Dots for (let i = 0; i < st.realCount; i++) { const b = document.createElement('button'); b.className = 'lfs-dot'; b.type = 'button'; b.setAttribute('role', 'tab'); b.setAttribute('aria-label', `Go to slide ${i + 1}`); b.tabIndex = i === 0 ? 0 : -1; dots.appendChild(b); const handler = () => { stopAutoplay(st); goToRealIndex(st, i); scheduleAutoplayResume(st); }; b.addEventListener('click', handler); st.dotBtns.push(b); st.dotHandlers.push(handler); } st.uiIndex = clamp(st.uiIndex, 0, st.realCount - 1); st.loopIndex = st.uiIndex + st.perView; layout(st); snapToLoopIndex(st, st.loopIndex, true); updateDots(st); dots.style.display = st.realCount > st.perView ? '' : 'none'; } function layout(st) { const { viewport, track } = st.els; st.gap = getGap(); const vw = viewport.clientWidth; const per = Math.max(1, st.perView); const slideW = (vw - st.gap * (per - 1)) / per; st.slideW = Math.max(0, slideW); const w = Math.floor(st.slideW); track.style.gap = `${st.gap}px`; st.allItems.forEach((el) => { el.style.width = `${w}px`; }); st.step = Math.floor(st.slideW + st.gap); } function snapToLoopIndex(st, loopIndex, immediate) { st.loopIndex = loopIndex; const x = st.loopIndex * st.step; if (immediate || LFS_REDUCED) st.els.track.style.transition = 'none'; st.els.track.style.transform = `translateX(${-x}px)`; if (immediate || LFS_REDUCED) { st.els.track.getBoundingClientRect(); if (!LFS_REDUCED) st.els.track.style.transition = `transform ${LFS_EASE_MS}ms ease`; } } function moveBy(st, delta) { st.uiIndex = (st.uiIndex + delta + st.realCount) % st.realCount; updateDots(st); const targetLoop = st.loopIndex + delta; snapToLoopIndex(st, targetLoop, false); if (LFS_REDUCED) normalizeIfNeeded(st); else { const onEnd = () => { st.els.track.removeEventListener('transitionend', onEnd); normalizeIfNeeded(st); }; st.els.track.addEventListener('transitionend', onEnd); } } function normalizeIfNeeded(st) { const minRealLoop = st.perView; const maxRealLoop = st.perView + st.realCount - 1; if (st.loopIndex < minRealLoop) { st.loopIndex = st.loopIndex + st.realCount; snapToLoopIndex(st, st.loopIndex, true); } else if (st.loopIndex > maxRealLoop) { st.loopIndex = st.loopIndex - st.realCount; snapToLoopIndex(st, st.loopIndex, true); } } function goToRealIndex(st, targetRealIndex) { targetRealIndex = clamp(targetRealIndex, 0, st.realCount - 1); const cur = st.uiIndex; let delta = targetRealIndex - cur; const half = st.realCount / 2; if (delta > half) delta -= st.realCount; else if (delta < -half) delta += st.realCount; st.uiIndex = targetRealIndex; updateDots(st); const targetLoop = st.loopIndex + delta; snapToLoopIndex(st, targetLoop, false); if (LFS_REDUCED) normalizeIfNeeded(st); else { const onEnd = () => { st.els.track.removeEventListener('transitionend', onEnd); normalizeIfNeeded(st); }; st.els.track.addEventListener('transitionend', onEnd); } } function updateDots(st) { const dots = st.dotBtns; if (!dots || !dots.length) return; dots.forEach((b, i) => { if (i === st.uiIndex) { b.classList.add('is-active'); b.setAttribute('aria-selected', 'true'); b.tabIndex = 0; } else { b.classList.remove('is-active'); b.removeAttribute('aria-selected'); b.tabIndex = -1; } }); } // ------------------------------------------------------------ // VIP-ROBUST DRAG: start on viewport, move/up on WINDOW (capture) // ------------------------------------------------------------ function bindDrag(st) { const { viewport, track } = st.els; const endDrag = () => { if (!st.dragging) return; st.dragging = false; st.activePointerId = null; track.style.transition = LFS_REDUCED ? 'none' : `transform ${LFS_EASE_MS}ms ease`; const dx = st.curX - st.startX; const threshold = Math.max(40, st.step * LFS_THRESH_FR); if (st.lockAxis === 'x') { if (dx > threshold) moveBy(st, -1); else if (dx < -threshold) moveBy(st, 1); else snapToLoopIndex(st, st.loopIndex, false); if (st.moved) st.justDragged = true; } else { // User was scrolling vertically -> snap back snapToLoopIndex(st, st.loopIndex, false); } st.lockAxis = null; window.removeEventListener('pointermove', onWinMove, true); window.removeEventListener('pointerup', onWinUp, true); window.removeEventListener('pointercancel', onWinUp, true); scheduleAutoplayResume(st); }; const onWinMove = (e) => { // ignore other pointers if we captured one if (st.activePointerId !== null && e.pointerId !== st.activePointerId) return; // stop “hover drag” if mouse is no longer pressed if (e.pointerType === 'mouse' && st.dragging && e.buttons === 0) { endDrag(); return; } st.curX = e.clientX; st.curY = e.clientY; const dx = st.curX - st.startX; const dy = st.curY - st.startY; // Decide axis lock if (!st.lockAxis) { if (Math.abs(dx) > 6 || Math.abs(dy) > 6) { st.lockAxis = Math.abs(dx) > Math.abs(dy) ? 'x' : 'y'; } } if (st.lockAxis === 'x') { // critical on VIP: stop native drag/selection/scroll while horizontal e.preventDefault(); if (Math.abs(dx) > 3) st.moved = true; const baseX = st.baseLoopIndex * st.step; const raw = baseX - dx; track.style.transform = `translateX(${-raw}px)`; } }; const onWinUp = () => endDrag(); const onDown = (e) => { // primary mouse only if (e.pointerType === 'mouse' && e.button !== 0) return; stopAutoplay(st); st.dragging = true; st.moved = false; st.justDragged = false; st.lockAxis = null; st.activePointerId = typeof e.pointerId === 'number' ? e.pointerId : null; st.startX = e.clientX; st.startY = e.clientY; st.curX = e.clientX; st.curY = e.clientY; st.baseLoopIndex = st.loopIndex; // stop native image dragging on VIP prod e.preventDefault(); track.style.transition = 'none'; // Listen on WINDOW capture so nothing can block our drag window.addEventListener('pointermove', onWinMove, { capture: true, passive: false }); window.addEventListener('pointerup', onWinUp, true); window.addEventListener('pointercancel', onWinUp, true); }; // bind on viewport capture to beat overlays viewport.addEventListener('pointerdown', onDown, true); // extra safety: if pointer leaves / capture lost, end viewport.addEventListener('lostpointercapture', endDrag); viewport.addEventListener('pointerleave', endDrag); // store for reference st._dragHandlers = { onDown, onWinMove, onWinUp, endDrag }; } // ------------------------------------------------------------ // Autoplay // ------------------------------------------------------------ function stopAutoplay(st) { if (st._autoTimer) { clearInterval(st._autoTimer); st._autoTimer = null; } if (st._autoResumeTimer) { clearTimeout(st._autoResumeTimer); st._autoResumeTimer = null; } } function startAutoplay(st) { stopAutoplay(st); if (LFS_REDUCED) return; if (st.realCount <= st.perView) return; st._autoTimer = setInterval(() => moveBy(st, 1), LFS_AUTOPLAY_MS); } function scheduleAutoplayResume(st) { stopAutoplay(st); if (LFS_REDUCED) return; st._autoResumeTimer = setTimeout(() => startAutoplay(st), LFS_AUTOPLAY_RESUME_DELAY); } function ensureAutoplay(st) { if (st.realCount <= st.perView) { stopAutoplay(st); return; } if (!st._autoTimer && !st.dragging) startAutoplay(st); } // ------------------------------------------------------------ // Run // ------------------------------------------------------------ const run = () => scanAndInit(document); if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', run); } else { run(); } addEventListener('load', run, { once: true, passive: true }); document.addEventListener('facetwp-loaded', run); let resizeTO; addEventListener( 'resize', () => { clearTimeout(resizeTO); resizeTO = setTimeout(run, 120); }, { passive: true } ); const mo = new MutationObserver((mutations) => { for (const m of mutations) { for (const node of m.addedNodes) { if (!node || node.nodeType !== 1) continue; if (node.matches && node.matches(LFS_SELECTOR)) { scanAndInit(node.parentNode || document); return; } if (node.querySelector && node.querySelector(LFS_SELECTOR)) { scanAndInit(node); return; } } } }); mo.observe(document.documentElement, { childList: true, subtree: true }); //dsd advisors check const TARGET_PATH = '/services/dsd-advisors/'; const normalizePath = (path) => { if (!path) return '/'; let p = path; // Ensure leading slash if (!p.startsWith('/')) p = `/${p}`; // Ensure exactly one trailing slash p = p.replace(/\/+$/, ''); return `${p}/`; }; document.addEventListener('DOMContentLoaded', () => { const target = normalizePath(TARGET_PATH); // Scope it if you want, e.g. '.entry-content a[href]' const links = document.querySelectorAll('a[href]'); for (const a of links) { const href = a.getAttribute('href'); if (!href) continue; // Skip non-nav types if (href.startsWith('#') || href.startsWith('mailto:') || href.startsWith('tel:')) continue; let url; try { url = new URL(href, window.location.origin); } catch { continue; } if (normalizePath(url.pathname) === target) { a.target = '_blank'; // Security best practice for new tab a.rel = 'noopener noreferrer'; } } }); })(); document.addEventListener('DOMContentLoaded', () => { const selector = '.single-offices figure.wp-block-post-featured-image > p'; const nodes = document.querySelectorAll(selector); if (!nodes.length) return; nodes.forEach((node) => node.remove()); }); ; (()=>{let s=new Set(["pager","sort","per_page","reset"]),n={lastAction:null,lastFacetName:null,lastFocused:null},a=(e,t)=>(t||document).querySelector(e),r=(e,t)=>Array.prototype.slice.call((t||document).querySelectorAll(e)),t=e=>{let t=a("#facetwp-announcer");t&&(t.textContent="",setTimeout(()=>{t.textContent=e},10))},o=t=>{var e=a("#results");e&&e.setAttribute("aria-busy",t?"true":"false"),r(".fwp-reset-all-fields, .facetwp-reset, .fwp-clear-facet").forEach(e=>{e.disabled=!!t,e.setAttribute("aria-disabled",t?"true":"false")})},l=()=>{r(".facetwp-facet").forEach(t=>{if(!t.querySelector(".fwp-clear-facet")){var a,r=t.getAttribute("data-type")||"";if(!s.has(r)){let e=t.getAttribute("data-name")||"";e&&((r=document.createElement("button")).type="button",r.className="fwp-clear-facet",r.setAttribute("data-facet",e),r.setAttribute("aria-label",`Clear ${e} filter`),r.setAttribute("aria-controls","results"),(a=document.createElement("span")).className="btn-label",a.textContent="Clear",r.appendChild(a),r.addEventListener("click",()=>{n.lastAction="reset-facet",n.lastFacetName=e,n.lastFocused=document.activeElement,window.FWP&&"function"==typeof window.FWP.reset&&window.FWP.reset(e)}),t.appendChild(r))}}})},c=e=>!(!window.FWP||!window.FWP.facets)&&(e=window.FWP.facets[e],Array.isArray(e)||"string"==typeof e?0{if(window.FWP&&window.FWP.facets){var e,t=window.FWP.facets;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var a=t[e];if(Array.isArray(a)&&a.length)return!0;if("string"==typeof a&&a.length)return!0;if(a&&"object"==typeof a&&Object.keys(a).length)return!0}}return!1},d=()=>{if(e())return!0;var t=r('.facetwp-facet[data-type="search"] .facetwp-search');for(let e=0;e{r(".facetwp-facet").forEach(e=>{var t,a=e.querySelector(".fwp-clear-facet");a&&(t=e.getAttribute("data-name")||"",e=e.getAttribute("data-type")||"",e=!s.has(e)&&t&&c(t),a.style.display=e?"":"none",a.classList.toggle("has-value",!!e),e?a.removeAttribute("tabindex"):a.setAttribute("tabindex","-1"))});var e,t=a(".fwp-reset-all-fields");t&&(e=d(),t.style.display=e?"":"none",t.classList.toggle("has-active-facets",!!e),!e)&&document.activeElement===t&&(e=t.getAttribute("data-focus-target")||"#results-top",t=a(e))&&t.focus()},u=()=>{r('.facetwp-facet[data-type="search"] .facetwp-search').forEach(e=>{"1"!==e.dataset.clearBound&&(e.dataset.clearBound="1",e.addEventListener("input",()=>{i()}))})},f=()=>{r(".fwp-reset-all-fields").forEach(e=>{var t,a;e.hasAttribute("aria-controls")||e.setAttribute("aria-controls","results"),e.querySelector(".btn-label")||(t=(e.textContent||"").trim()||"Clear all filters",e.textContent="",(a=document.createElement("span")).className="btn-label",a.textContent=t,e.appendChild(a))})},p=()=>{r(".fwp-reset-all-fields").forEach(e=>{"1"!==e.dataset.bound&&(e.dataset.bound="1",e.addEventListener("click",()=>{n.lastAction="reset-all",n.lastFocused=document.activeElement,window.FWP&&"function"==typeof window.FWP.reset&&window.FWP.reset()}))}),r(".facetwp-reset").forEach(e=>{"1"!==e.dataset.bound&&(e.dataset.bound="1",e.addEventListener("click",()=>{n.lastAction="reset-all",n.lastFocused=document.activeElement}))})};document.addEventListener("DOMContentLoaded",()=>{l(),f(),p(),u(),i()}),document.addEventListener("facetwp-refresh",()=>{o(!0)}),document.addEventListener("facetwp-loaded",()=>{var e;o(!1),l(),f(),p(),u(),i(),"reset-all"===n.lastAction?(t("All filters cleared. Showing updated results."),e=(e=a(".fwp-reset-all-fields"))&&e.getAttribute("data-focus-target")||"#results-top",(e=a(e)||a("#results"))&&e.focus()):"reset-facet"===n.lastAction&&(t(`${n.lastFacetName||"Filter"} cleared. Showing updated results.`),(e=a(`.facetwp-facet[data-name="${n.lastFacetName||""}"]`))?(a('select, input, button, a, [tabindex="0"]',e)||e).focus():n.lastFocused&&n.lastFocused.focus()),n.lastAction=null,n.lastFacetName=null,n.lastFocused=null})})(),(()=>{let a=e=>!(!window.FWP||!window.FWP.facets||!(e=e.getAttribute("data-name")||""))&&(e=window.FWP.facets[e],Array.isArray(e)||"string"==typeof e?0{var t=e.querySelector("select, .facetwp-dropdown");if(!t)return!1;if(t.multiple){for(let e=0;e{var t=a(e)||r(e);e.classList.toggle("has-value",!!t)},e=()=>{var t=document.querySelectorAll('.facetwp-facet[data-type="dropdown"], .facetwp-facet[data-type="fselect"]');for(let e=0;e{if("1"!==r.dataset.pmBound){r.dataset.pmBound="1";var e=r.querySelector("select, .facetwp-dropdown");e&&(e.addEventListener("focus",()=>{r.classList.add("is-open")}),e.addEventListener("blur",()=>{r.classList.remove("is-open")}),e.addEventListener("change",()=>{s(r)}));let a=r.querySelector(".fs-wrap");a&&(r.classList.toggle("is-open",a.classList.contains("fs-open")),new MutationObserver(t=>{for(let e=0;e{s(r)})),s(r)}})(t[e])};document.addEventListener("DOMContentLoaded",e),document.addEventListener("facetwp-loaded",()=>{e();var t=document.querySelectorAll('.facetwp-facet[data-type="dropdown"], .facetwp-facet[data-type="fselect"]');for(let e=0;e{let r=(e,t,a)=>{e&&e.addEventListener(t,a)},s=(e,t)=>{if(e&&"function"==typeof e.closest)return e.closest(t);let a=e;for(;a&&1===a.nodeType;){if(a.matches(t))return a;a=a.parentElement}return null},n=(e,t,a)=>{if(e.setAttribute("aria-expanded",String(a)),a)t.hidden=!1,t.classList.add("is-open");else{t.classList.remove("is-open");let e=()=>{t.hidden=!0,t.removeEventListener("transitionend",e)};t.addEventListener("transitionend",e),setTimeout(()=>{t.hidden=!0},320)}e=s(t,".people-search-wrap");e&&e.classList.toggle("adv-search-open",!!a)},o=e=>{var t=e.getAttribute("aria-controls");let a=t&&document.getElementById(t);a&&(t=!("true"===e.getAttribute("aria-expanded")),n(e,a,t),t?setTimeout(()=>{var e=a.querySelector('input,select,textarea,button,[tabindex="0"],[contenteditable="true"]');e?e.focus():0<=a.tabIndex&&a.focus()},20):e.focus())},e=t=>{var e,a;t&&"1"!==t.dataset.advBound&&(t.dataset.advBound="1",a=(a=t.getAttribute("aria-controls"))&&document.getElementById(a))&&(e="true"===t.getAttribute("aria-expanded"),a.hidden=!e,a.classList.toggle("is-open",e),(a=s(a,".people-search-wrap"))&&a.classList.toggle("adv-search-open",e),"a"===t.tagName.toLowerCase()&&t.setAttribute("role","button"),r(t,"click",e=>{"a"===t.tagName.toLowerCase()&&e.preventDefault(),o(t)}),r(t,"keydown",e=>{"a"!==t.tagName.toLowerCase()||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),o(t))}))},t=(document.addEventListener("DOMContentLoaded",()=>{Array.prototype.slice.call(document.querySelectorAll(".adv-search, #adv-search")).forEach(e)}),!1);document.addEventListener("click",function(e){e.target.closest(".facetwp-pager")&&(e.target.closest("a")||e.target.closest("button")||e.target.closest("[data-page]")||e.target.closest(".facetwp-page"))&&(t=!0)},!0),document.addEventListener("facetwp-loaded",function(){var e;window.FWP&&window.FWP.loaded&&t&&(t=!1,document.querySelector(".facetwp-pager"))&&((e=document.querySelector(".careers-filter"))?(e=e.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||0)-200,window.scrollTo({top:Math.max(0,e),behavior:"smooth"})):window.scrollTo({top:0,behavior:"smooth"}))})})();; /* html2canvas 0.5.0-beta4 Copyright (c) 2017 Niklas von Hertzen 2017-06-14 Custom build by Erik Koopmans, featuring latest bugfixes and features Released under MIT License */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.html2canvas=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g1&&(d=c[0]+"@",a=c[1]),a=a.replace(H,".");var e=a.split("."),f=g(e,b).join(".");return d+f}function i(a){for(var b,c,d=[],e=0,f=a.length;e=55296&&b<=56319&&e65535&&(a-=65536,b+=L(a>>>10&1023|55296),a=56320|1023&a),b+=L(a)}).join("")}function k(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:x}function l(a,b){return a+22+75*(a<26)-((0!=b)<<5)}function m(a,b,c){var d=0;for(a=c?K(a/B):a>>1,a+=K(a/b);a>J*z>>1;d+=x)a=K(a/J);return K(d+(J+1)*a/(a+A))}function n(a){var b,c,d,e,g,h,i,l,n,o,p=[],q=a.length,r=0,s=D,t=C;for(c=a.lastIndexOf(E),c<0&&(c=0),d=0;d=128&&f("not-basic"),p.push(a.charCodeAt(d));for(e=c>0?c+1:0;e=q&&f("invalid-input"),l=k(a.charCodeAt(e++)),(l>=x||l>K((w-r)/h))&&f("overflow"),r+=l*h,n=i<=t?y:i>=t+z?z:i-t,!(lK(w/o)&&f("overflow"),h*=o;b=p.length+1,t=m(r-g,b,0==g),K(r/b)>w-s&&f("overflow"),s+=K(r/b),r%=b,p.splice(r++,0,s)}return j(p)}function o(a){var b,c,d,e,g,h,j,k,n,o,p,q,r,s,t,u=[];for(a=i(a),q=a.length,b=D,c=0,g=C,h=0;h=b&&pK((w-c)/r)&&f("overflow"),c+=(j-b)*r,b=j,h=0;hw&&f("overflow"),p==b){for(k=c,n=x;o=n<=g?y:n>=g+z?z:n-g,!(k= 0x80 (not a basic code point)","invalid-input":"Invalid input"},J=x-y,K=Math.floor,L=String.fromCharCode;if(u={version:"1.4.1",ucs2:{decode:i,encode:j},decode:n,encode:o,toASCII:q,toUnicode:p},"function"==typeof a&&"object"==typeof a.amd&&a.amd)a("punycode",function(){return u});else if(r&&s)if(c.exports==r)s.exports=u;else for(v in u)u.hasOwnProperty(v)&&(r[v]=u[v]);else e.punycode=u}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(a,b,c){function d(a,b,c){!a.defaultView||b===a.defaultView.pageXOffset&&c===a.defaultView.pageYOffset||a.defaultView.scrollTo(b,c)}function e(a,b){try{b&&(b.width=a.width,b.height=a.height,b.getContext("2d").putImageData(a.getContext("2d").getImageData(0,0,a.width,a.height),0,0))}catch(c){h("Unable to copy canvas content from",a,c)}}function f(a,b){for(var c=3===a.nodeType?document.createTextNode(a.nodeValue):a.cloneNode(!1),d=a.firstChild;d;)b!==!0&&1===d.nodeType&&"SCRIPT"===d.nodeName||c.appendChild(f(d,b)),d=d.nextSibling;return 1===a.nodeType&&(c._scrollTop=a.scrollTop,c._scrollLeft=a.scrollLeft,"CANVAS"===a.nodeName?e(a,c):"TEXTAREA"!==a.nodeName&&"SELECT"!==a.nodeName||(c.value=a.value)),c}function g(a){if(1===a.nodeType){a.scrollTop=a._scrollTop,a.scrollLeft=a._scrollLeft;for(var b=a.firstChild;b;)g(b),b=b.nextSibling}}var h=a("./log");b.exports=function(a,b,c,e,h,i,j){var k=f(a.documentElement,h.javascriptEnabled),l=b.createElement("iframe");return l.className="html2canvas-container",l.style.visibility="hidden",l.style.position="fixed",l.style.left="-10000px",l.style.top="0px",l.style.border="0",l.width=c,l.height=e,l.scrolling="no",b.body.appendChild(l),new Promise(function(b){var c=l.contentWindow.document;l.contentWindow.onload=l.onload=function(){var a=setInterval(function(){c.body.childNodes.length>0&&(g(c.documentElement),clearInterval(a),"view"===h.type&&(l.contentWindow.scrollTo(i,j),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||l.contentWindow.scrollY===j&&l.contentWindow.scrollX===i||(c.documentElement.style.top=-j+"px",c.documentElement.style.left=-i+"px",c.documentElement.style.position="absolute")),b(l))},50)},c.open(),c.write(""),d(a,i,j),c.replaceChild(c.adoptNode(k),c.documentElement),c.close()})}},{"./log":13}],3:[function(a,b,c){function d(a){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(a)||this.namedColor(a)||this.rgb(a)||this.rgba(a)||this.hex6(a)||this.hex3(a)}d.prototype.darken=function(a){var b=1-a;return new d([Math.round(this.r*b),Math.round(this.g*b),Math.round(this.b*b),this.a])},d.prototype.isTransparent=function(){return 0===this.a},d.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},d.prototype.fromArray=function(a){return Array.isArray(a)&&(this.r=Math.min(a[0],255),this.g=Math.min(a[1],255),this.b=Math.min(a[2],255),a.length>3&&(this.a=a[3])),Array.isArray(a)};var e=/^#([a-f0-9]{3})$/i;d.prototype.hex3=function(a){var b=null;return null!==(b=a.match(e))&&(this.r=parseInt(b[1][0]+b[1][0],16),this.g=parseInt(b[1][1]+b[1][1],16),this.b=parseInt(b[1][2]+b[1][2],16)),null!==b};var f=/^#([a-f0-9]{6})$/i;d.prototype.hex6=function(a){var b=null;return null!==(b=a.match(f))&&(this.r=parseInt(b[1].substring(0,2),16),this.g=parseInt(b[1].substring(2,4),16),this.b=parseInt(b[1].substring(4,6),16)),null!==b};var g=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;d.prototype.rgb=function(a){var b=null;return null!==(b=a.match(g))&&(this.r=Number(b[1]),this.g=Number(b[2]),this.b=Number(b[3])),null!==b};var h=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;d.prototype.rgba=function(a){var b=null;return null!==(b=a.match(h))&&(this.r=Number(b[1]),this.g=Number(b[2]),this.b=Number(b[3]),this.a=Number(b[4])),null!==b},d.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},d.prototype.namedColor=function(a){a=a.toLowerCase();var b=i[a];if(b)this.r=b[0],this.g=b[1],this.b=b[2];else if("transparent"===a)return this.r=this.g=this.b=this.a=0,!0;return!!b},d.prototype.isColor=!0;var i={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};b.exports=d},{}],4:[function(b,c,d){function e(a,b){var c=v++;if(b=b||{},b.logging&&(p.options.logging=!0,p.options.start=Date.now()),b.async="undefined"==typeof b.async||b.async,b.allowTaint="undefined"!=typeof b.allowTaint&&b.allowTaint,b.removeContainer="undefined"==typeof b.removeContainer||b.removeContainer,b.javascriptEnabled="undefined"!=typeof b.javascriptEnabled&&b.javascriptEnabled,b.imageTimeout="undefined"==typeof b.imageTimeout?1e4:b.imageTimeout,b.renderer="function"==typeof b.renderer?b.renderer:l,b.strict=!!b.strict,"string"==typeof a){if("string"!=typeof b.proxy)return Promise.reject("Proxy must be used when rendering url");var d=null!=b.width?b.width:window.innerWidth,e=null!=b.height?b.height:window.innerHeight;return s(j(a),b.proxy,document,d,e,b).then(function(a){return g(a.contentWindow.document.documentElement,a,b,d,e)})}var h=(void 0===a?[document.documentElement]:a.length?a:[a])[0];return h.setAttribute(u+c,c),f(h.ownerDocument,b,h.ownerDocument.defaultView.innerWidth,h.ownerDocument.defaultView.innerHeight,c).then(function(a){return"function"==typeof b.onrendered&&(p("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),b.onrendered(a)),a})}function f(a,b,c,d,e){return r(a,a,c,d,b,a.defaultView.pageXOffset,a.defaultView.pageYOffset).then(function(f){p("Document cloned");var h=u+e,i="["+h+"='"+e+"']";a.querySelector(i).removeAttribute(h);var j=f.contentWindow,k=j.document.querySelector(i),l="function"==typeof b.onclone?Promise.resolve(b.onclone(j.document)):Promise.resolve(!0);return l.then(function(){return g(k,f,b,c,d)})})}function g(a,b,c,d,e){var f=b.contentWindow,g=new k(f.document),j=new m(c,g),l=t(a),o="view"===c.type?d:l.right+1,q="view"===c.type?e:l.bottom+1,r=new c.renderer(o,q,j,c,document),s=new n(a,r,g,j,c);return s.ready.then(function(){p("Finished rendering");var d;if("view"===c.type)d=i(r.canvas,{width:r.canvas.width,height:r.canvas.height,top:0,left:0,x:0,y:0});else if(a===f.document.body||a===f.document.documentElement||null!=c.canvas)d=r.canvas;else if(c.scale){var e={width:null!=c.width?c.width:l.width,height:null!=c.height?c.height:l.height,top:l.top,left:l.left,x:0,y:0},g={};for(var j in e)e.hasOwnProperty(j)&&(g[j]=e[j]*c.scale);d=i(r.canvas,g),d.style.width=e.width+"px",d.style.height=e.height+"px"}else d=i(r.canvas,{width:null!=c.width?c.width:l.width,height:null!=c.height?c.height:l.height,top:l.top,left:l.left,x:0,y:0});return h(b,c),d})}function h(a,b){b.removeContainer&&(a.parentNode.removeChild(a),p("Cleaned up container"))}function i(a,b){var c=document.createElement("canvas"),d=Math.min(a.width-1,Math.max(0,b.left)),e=Math.min(a.width,Math.max(1,b.left+b.width)),f=Math.min(a.height-1,Math.max(0,b.top)),g=Math.min(a.height,Math.max(1,b.top+b.height));c.width=b.width,c.height=b.height;var h=e-d,i=g-f;return p("Cropping canvas at:","left:",b.left,"top:",b.top,"width:",h,"height:",i),p("Resulting crop with width",b.width,"and height",b.height,"with x",d,"and y",f),c.getContext("2d").drawImage(a,d,f,h,i,b.x,b.y,h,i),c}function j(a){var b=document.createElement("a");return b.href=a,b.href=b.href,b}var k=b("./support"),l=b("./renderers/canvas"),m=b("./imageloader"),n=b("./nodeparser"),o=b("./nodecontainer"),p=b("./log"),q=b("./utils"),r=b("./clone"),s=b("./proxy").loadUrlDocument,t=q.getBounds,u="data-html2canvas-node",v=0;e.CanvasRenderer=l,e.NodeContainer=o,e.log=p,e.utils=q;var w="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return Promise.reject("No canvas support")}:e;c.exports=w,"function"==typeof a&&a.amd&&a("html2canvas",[],function(){return w})},{"./clone":2,"./imageloader":11,"./log":13,"./nodecontainer":14,"./nodeparser":15,"./proxy":16,"./renderers/canvas":20,"./support":22,"./utils":26}],5:[function(a,b,c){function d(a){if(this.src=a,e("DummyImageContainer for",a),!this.promise||!this.image){e("Initiating DummyImageContainer"),d.prototype.image=new Image;var b=this.image;d.prototype.promise=new Promise(function(a,c){b.onload=a,b.onerror=c,b.src=f(),b.complete===!0&&a(b)})}}var e=a("./log"),f=a("./utils").smallImage;b.exports=d},{"./log":13,"./utils":26}],6:[function(a,b,c){function d(a,b){var c,d,f=document.createElement("div"),g=document.createElement("img"),h=document.createElement("span"),i="Hidden Text";f.style.visibility="hidden",f.style.fontFamily=a,f.style.fontSize=b,f.style.margin=0,f.style.padding=0,document.body.appendChild(f),g.src=e(),g.width=1,g.height=1,g.style.margin=0,g.style.padding=0,g.style.verticalAlign="baseline",h.style.fontFamily=a,h.style.fontSize=b,h.style.margin=0,h.style.padding=0,h.appendChild(document.createTextNode(i)),f.appendChild(h),f.appendChild(g),c=g.offsetTop-h.offsetTop+1,f.removeChild(h),f.appendChild(document.createTextNode(i)),f.style.lineHeight="normal",g.style.verticalAlign="super",d=g.offsetTop-f.offsetTop+1,document.body.removeChild(f),this.baseline=c,this.lineWidth=1,this.middle=d}var e=a("./utils").smallImage;b.exports=d},{"./utils":26}],7:[function(a,b,c){function d(){this.data={}}var e=a("./font");d.prototype.getMetrics=function(a,b){return void 0===this.data[a+"-"+b]&&(this.data[a+"-"+b]=new e(a,b)),this.data[a+"-"+b]},b.exports=d},{"./font":6}],8:[function(a,b,c){function d(b,c,d){this.image=null,this.src=b;var e=this,g=f(b);this.promise=(c?new Promise(function(a){"about:blank"===b.contentWindow.document.URL||null==b.contentWindow.document.documentElement?b.contentWindow.onload=b.onload=function(){a(b)}:a(b)}):this.proxyLoad(d.proxy,g,d)).then(function(b){var c=a("./core");return c(b.contentWindow.document.documentElement,{type:"view",width:b.width,height:b.height,proxy:d.proxy,javascriptEnabled:d.javascriptEnabled,removeContainer:d.removeContainer,allowTaint:d.allowTaint,imageTimeout:d.imageTimeout/2})}).then(function(a){return e.image=a})}var e=a("./utils"),f=e.getBounds,g=a("./proxy").loadUrlDocument;d.prototype.proxyLoad=function(a,b,c){var d=this.src;return g(d.src,a,d.ownerDocument,b.width,b.height,c)},b.exports=d},{"./core":4,"./proxy":16,"./utils":26}],9:[function(a,b,c){function d(a){this.src=a.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=Promise.resolve(!0)}d.TYPES={LINEAR:1,RADIAL:2},d.REGEXP_COLORSTOP=/^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i,b.exports=d},{}],10:[function(a,b,c){function d(a,b){this.src=a,this.image=new Image;var c=this;this.tainted=null,this.promise=new Promise(function(d,e){c.image.onload=d,c.image.onerror=e,b&&(c.image.crossOrigin="anonymous"),c.image.src=a,c.image.complete===!0&&d(c.image)})}b.exports=d},{}],11:[function(a,b,c){function d(a,b){this.link=null,this.options=a,this.support=b,this.origin=this.getOrigin(window.location.href)}var e=a("./log"),f=a("./imagecontainer"),g=a("./dummyimagecontainer"),h=a("./proxyimagecontainer"),i=a("./framecontainer"),j=a("./svgcontainer"),k=a("./svgnodecontainer"),l=a("./lineargradientcontainer"),m=a("./webkitgradientcontainer"),n=a("./utils").bind;d.prototype.findImages=function(a){var b=[];return a.reduce(function(a,b){switch(b.node.nodeName){case"IMG":return a.concat([{args:[b.node.src],method:"url"}]);case"svg":case"IFRAME":return a.concat([{args:[b.node],method:b.node.nodeName}])}return a},[]).forEach(this.addImage(b,this.loadImage),this),b},d.prototype.findBackgroundImage=function(a,b){return b.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(a,this.loadImage),this),a},d.prototype.addImage=function(a,b){return function(c){c.args.forEach(function(d){this.imageExists(a,d)||(a.splice(0,0,b.call(this,c)),e("Added image #"+a.length,"string"==typeof d?d.substring(0,100):d))},this)}},d.prototype.hasImageBackground=function(a){return"none"!==a.method},d.prototype.loadImage=function(a){if("url"===a.method){var b=a.args[0];return!this.isSVG(b)||this.support.svg||this.options.allowTaint?b.match(/data:image\/.*;base64,/i)?new f(b.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),(!1)):this.isSameOrigin(b)||this.options.allowTaint===!0||this.isSVG(b)?new f(b,(!1)):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new f(b,(!0)):this.options.proxy?new h(b,this.options.proxy):new g(b):new j(b)}return"linear-gradient"===a.method?new l(a):"gradient"===a.method?new m(a):"svg"===a.method?new k(a.args[0],this.support.svg):"IFRAME"===a.method?new i(a.args[0],this.isSameOrigin(a.args[0].src),this.options):new g(a)},d.prototype.isSVG=function(a){return"svg"===a.substring(a.length-3).toLowerCase()||j.prototype.isInline(a)},d.prototype.imageExists=function(a,b){return a.some(function(a){return a.src===b})},d.prototype.isSameOrigin=function(a){return this.getOrigin(a)===this.origin},d.prototype.getOrigin=function(a){var b=this.link||(this.link=document.createElement("a"));return b.href=a,b.href=b.href,b.protocol+b.hostname+b.port},d.prototype.getPromise=function(a){return this.timeout(a,this.options.imageTimeout)["catch"](function(){var b=new g(a.src);return b.promise.then(function(b){a.image=b})})},d.prototype.get=function(a){var b=null;return this.images.some(function(c){return(b=c).src===a})?b:null},d.prototype.fetch=function(a){return this.images=a.reduce(n(this.findBackgroundImage,this),this.findImages(a)),this.images.forEach(function(a,b){a.promise.then(function(){e("Succesfully loaded image #"+(b+1),a)},function(c){e("Failed loading image #"+(b+1),a,c)})}),this.ready=Promise.all(this.images.map(this.getPromise,this)),e("Finished searching images"),this},d.prototype.timeout=function(a,b){var c,d=Promise.race([a.promise,new Promise(function(d,f){c=setTimeout(function(){e("Timed out loading image",a),f(a)},b)})]).then(function(a){return clearTimeout(c),a});return d["catch"](function(){clearTimeout(c)}),d},b.exports=d},{"./dummyimagecontainer":5,"./framecontainer":8,"./imagecontainer":10,"./lineargradientcontainer":12,"./log":13,"./proxyimagecontainer":17,"./svgcontainer":23,"./svgnodecontainer":24,"./utils":26,"./webkitgradientcontainer":27}],12:[function(a,b,c){function d(a){e.apply(this,arguments),this.type=e.TYPES.LINEAR;var b=d.REGEXP_DIRECTION.test(a.args[0])||!e.REGEXP_COLORSTOP.test(a.args[0]);b?a.args[0].split(/\s+/).reverse().forEach(function(a,b){switch(a){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var c=this.y0,d=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=d,this.y1=c;break;case"center":break;default:var e=.01*parseFloat(a,10);if(isNaN(e))break;0===b?(this.y0=e,this.y1=1-this.y0):(this.x0=e,this.x1=1-this.x0)}},this):(this.y0=0,this.y1=1),this.colorStops=a.args.slice(b?1:0).map(function(a){var b=a.match(e.REGEXP_COLORSTOP),c=+b[2],d=0===c?"%":b[3];return{color:new f(b[1]),stop:"%"===d?c/100:null}}),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(a,b){null===a.stop&&this.colorStops.slice(b).some(function(c,d){return null!==c.stop&&(a.stop=(c.stop-this.colorStops[b-1].stop)/(d+1)+this.colorStops[b-1].stop,!0)},this)},this)}var e=a("./gradientcontainer"),f=a("./color");d.prototype=Object.create(e.prototype),d.REGEXP_DIRECTION=/^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i,b.exports=d},{"./color":3,"./gradientcontainer":9}],13:[function(a,b,c){var d=function(){d.options.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-d.options.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))};d.options={logging:!1},b.exports=d},{}],14:[function(a,b,c){function d(a,b){this.node=a,this.parent=b,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function e(a){var b=a.options[a.selectedIndex||0];return b?b.text||"":""}function f(a){if(a&&"matrix"===a[1])return a[2].split(",").map(function(a){return parseFloat(a.trim())});if(a&&"matrix3d"===a[1]){var b=a[2].split(",").map(function(a){return parseFloat(a.trim())});return[b[0],b[1],b[4],b[5],b[12],b[13]]}}function g(a){var b=a[0],c=a[2],d=a[4],e=a[1],f=a[3],g=a[5],h=b*f-c*e,i=[f,-e,-c,b,c*g-d*f,d*e-b*g].map(function(a){return a/h});return i}function h(a){return a.toString().indexOf("%")!==-1}function i(a){return a.replace("px","")}function j(a){return parseFloat(a)}var k=a("./color"),l=a("./utils"),m=l.getBounds,n=l.parseBackgrounds,o=l.offsetBounds;d.prototype.cloneTo=function(a){a.visible=this.visible,a.borders=this.borders,a.bounds=this.bounds,a.clip=this.clip,a.backgroundClip=this.backgroundClip,a.computedStyles=this.computedStyles,a.styles=this.styles,a.backgroundImages=this.backgroundImages,a.opacity=this.opacity},d.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},d.prototype.assignStack=function(a){this.stack=a,a.children.push(this)},d.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},d.prototype.css=function(a){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[a]||(this.styles[a]=this.computedStyles[a])},d.prototype.prefixedCss=function(a){var b=["webkit","moz","ms","o"],c=this.css(a);return void 0===c&&b.some(function(b){return c=this.css(b+a.substr(0,1).toUpperCase()+a.substr(1)),void 0!==c},this),void 0===c?null:c},d.prototype.computedStyle=function(a){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,a)},d.prototype.cssInt=function(a){var b=parseInt(this.css(a),10);return isNaN(b)?0:b},d.prototype.color=function(a){return this.colors[a]||(this.colors[a]=new k(this.css(a)))},d.prototype.cssFloat=function(a){var b=parseFloat(this.css(a));return isNaN(b)?0:b},d.prototype.fontWeight=function(){var a=this.css("fontWeight");switch(parseInt(a,10)){case 401:a="bold";break;case 400:a="normal"}return a},d.prototype.parseClip=function(){var a=this.css("clip").match(this.CLIP);return a?{top:parseInt(a[1],10),right:parseInt(a[2],10),bottom:parseInt(a[3],10),left:parseInt(a[4],10)}:null},d.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=n(this.css("backgroundImage")))},d.prototype.cssList=function(a,b){var c=(this.css(a)||"").split(",");return c=c[b||0]||c[0]||"auto",c=c.trim().split(" "),1===c.length&&(c=[c[0],h(c[0])?"auto":c[0]]),c},d.prototype.parseBackgroundSize=function(a,b,c){var d,e,f=this.cssList("backgroundSize",c);if(h(f[0]))d=a.width*parseFloat(f[0])/100;else{if(/contain|cover/.test(f[0])){var g=a.width/a.height,i=b.width/b.height;return g0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,a)):a():(this.renderQueue.forEach(this.paint,this),a())},this))},this))}function e(a){return a.parent&&a.parent.clip.length}function f(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function g(){}function h(a,b,c,d){var e={top:b.top+a[0].width/2,right:b.right-a[1].width/2,bottom:b.bottom-a[2].width/2,left:b.left+a[3].width/2};return a.map(function(f,g){if(f.width>0){var h=b.left,i=b.top,j=b.width,k=b.height-a[2].width;switch(g){case 0:k=a[0].width,f.args=l({c1:[h,i],c2:[h+j,i],c3:[h+j-a[1].width,i+k],c4:[h+a[3].width,i+k]},d[0],d[1],c.topLeftOuter,c.topLeftInner,c.topRightOuter,c.topRightInner),f.pathArgs=m({c1:[e.left,e.top],c2:[e.right,e.top]},d[0],d[1],c.topLeft,c.topRight);break;case 1:h=b.left+b.width-a[1].width,j=a[1].width,f.args=l({c1:[h+j,i],c2:[h+j,i+k+a[2].width],c3:[h,i+k],c4:[h,i+a[0].width]},d[1],d[2],c.topRightOuter,c.topRightInner,c.bottomRightOuter,c.bottomRightInner),f.pathArgs=m({c1:[e.right,e.top],c2:[e.right,e.bottom]},d[1],d[2],c.topRight,c.bottomRight);break;case 2:i=i+b.height-a[2].width,k=a[2].width,f.args=l({c1:[h+j,i+k],c2:[h,i+k],c3:[h+a[3].width,i],c4:[h+j-a[3].width,i]},d[2],d[3],c.bottomRightOuter,c.bottomRightInner,c.bottomLeftOuter,c.bottomLeftInner),f.pathArgs=m({c1:[e.right,e.bottom],c2:[e.left,e.bottom]},d[2],d[3],c.bottomRight,c.bottomLeft);break;case 3:j=a[3].width,f.args=l({c1:[h,i+k+a[2].width],c2:[h,i],c3:[h+j,i+a[0].width],c4:[h+j,i+k]},d[3],d[0],c.bottomLeftOuter,c.bottomLeftInner,c.topLeftOuter,c.topLeftInner),f.pathArgs=m({c1:[e.left,e.bottom],c2:[e.left,e.top]},d[3],d[0],c.bottomLeft,c.topLeft)}}return f})}function i(a,b,c,d){var e=4*((Math.sqrt(2)-1)/3),f=c*e,g=d*e,h=a+c,i=b+d;return{topLeft:k({x:a,y:i},{x:a,y:i-g},{x:h-f,y:b},{x:h,y:b}),topRight:k({x:a,y:b},{x:a+f,y:b},{x:h,y:i-g},{x:h,y:i}),bottomRight:k({x:h,y:b},{x:h,y:b+g},{x:a+f,y:i},{x:a,y:i}),bottomLeft:k({x:h,y:i},{x:h-f,y:i},{x:a,y:b+g},{x:a,y:b})}}function j(a,b,c){var d=a.left,e=a.top,f=a.width,g=a.height,h=b[0][0]f+c[3].width/2?0:k-c[3].width/2,l-c[0].width/2).topRight.subdivide(.5),bottomRight:i(d+Math.min(s,f-c[3].width/2),e+Math.min(r,g+c[0].width/2),Math.max(0,m-c[1].width/2),n-c[2].width/2).bottomRight.subdivide(.5),bottomLeft:i(d+c[3].width/2,e+t,Math.max(0,o-c[3].width/2),p-c[2].width/2).bottomLeft.subdivide(.5),topLeftOuter:i(d,e,h,j).topLeft.subdivide(.5),topLeftInner:i(d+c[3].width,e+c[0].width,Math.max(0,h-c[3].width),Math.max(0,j-c[0].width)).topLeft.subdivide(.5),topRightOuter:i(d+q,e,k,l).topRight.subdivide(.5),topRightInner:i(d+Math.min(q,f+c[3].width),e+c[0].width,q>f+c[3].width?0:k-c[3].width,l-c[0].width).topRight.subdivide(.5),bottomRightOuter:i(d+s,e+r,m,n).bottomRight.subdivide(.5),bottomRightInner:i(d+Math.min(s,f-c[3].width),e+Math.min(r,g+c[0].width),Math.max(0,m-c[1].width),n-c[2].width).bottomRight.subdivide(.5),bottomLeftOuter:i(d,e+t,o,p).bottomLeft.subdivide(.5),bottomLeftInner:i(d+c[3].width,e+t,Math.max(0,o-c[3].width),p-c[2].width).bottomLeft.subdivide(.5)}}function k(a,b,c,d){var e=function(a,b,c){return{x:a.x+(b.x-a.x)*c,y:a.y+(b.y-a.y)*c}};return{start:a,startControl:b,endControl:c,end:d,subdivide:function(f){var g=e(a,b,f),h=e(b,c,f),i=e(c,d,f),j=e(g,h,f),l=e(h,i,f),m=e(j,l,f);return[k(a,g,j,m),k(m,l,i,d)]},curveTo:function(a){a.push(["bezierCurve",b.x,b.y,c.x,c.y,d.x,d.y])},curveToReversed:function(d){d.push(["bezierCurve",c.x,c.y,b.x,b.y,a.x,a.y])}}}function l(a,b,c,d,e,f,g){var h=[];return b[0]>0||b[1]>0?(h.push(["line",d[1].start.x,d[1].start.y]),d[1].curveTo(h)):h.push(["line",a.c1[0],a.c1[1]]),c[0]>0||c[1]>0?(h.push(["line",f[0].start.x,f[0].start.y]),f[0].curveTo(h),h.push(["line",g[0].end.x,g[0].end.y]),g[0].curveToReversed(h)):(h.push(["line",a.c2[0],a.c2[1]]),h.push(["line",a.c3[0],a.c3[1]])),b[0]>0||b[1]>0?(h.push(["line",e[1].end.x,e[1].end.y]),e[1].curveToReversed(h)):h.push(["line",a.c4[0],a.c4[1]]),h}function m(a,b,c,d,e){var f=[];return b[0]>0||b[1]>0?(f.push(["line",d[1].start.x,d[1].start.y]),d[1].curveTo(f)):f.push(["line",a.c1[0],a.c1[1]]),c[0]>0||c[1]>0?(f.push(["line",e[0].start.x,e[0].start.y]),e[0].curveTo(f)):f.push(["line",a.c2[0],a.c2[1]]),f}function n(a,b,c,d,e,f,g){b[0]>0||b[1]>0?(a.push(["line",d[0].start.x,d[0].start.y]),d[0].curveTo(a),d[1].curveTo(a)):a.push(["line",f,g]),(c[0]>0||c[1]>0)&&a.push(["line",e[0].start.x,e[0].start.y])}function o(a){return a.cssInt("zIndex")<0}function p(a){return a.cssInt("zIndex")>0}function q(a){return 0===a.cssInt("zIndex")}function r(a){return["inline","inline-block","inline-table"].indexOf(a.css("display"))!==-1}function s(a){return a instanceof W}function t(a){return a.node.data.trim().length>0}function u(a){return/^(normal|none|0px)$/.test(a.parent.css("letterSpacing"))}function v(a){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(b){var c=a.css("border"+b+"Radius"),d=c.split(" ");return d.length<=1&&(d[1]=d[0]),d.map(H)})}function w(a){return a.nodeType===Node.TEXT_NODE||a.nodeType===Node.ELEMENT_NODE}function x(a){var b=a.css("position"),c=["absolute","relative","fixed"].indexOf(b)!==-1?a.css("zIndex"):"auto";return"auto"!==c}function y(a){return"static"!==a.css("position")}function z(a){return"none"!==a.css("float")}function A(a){return["inline-block","inline-table"].indexOf(a.css("display"))!==-1}function B(a){var b=this;return function(){return!a.apply(b,arguments)}}function C(a){return a.node.nodeType===Node.ELEMENT_NODE}function D(a){return a.isPseudoElement===!0}function E(a){return a.node.nodeType===Node.TEXT_NODE}function F(a){return function(b,c){return b.cssInt("zIndex")+a.indexOf(b)/a.length-(c.cssInt("zIndex")+a.indexOf(c)/a.length)}}function G(a){return a.getOpacity()<1}function H(a){return parseInt(a,10)}function I(a){return a.width}function J(a){return a.node.nodeType!==Node.ELEMENT_NODE||["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(a.node.nodeName)===-1}function K(a){return[].concat.apply([],a)}function L(a){var b=a.substr(0,1);return b===a.substr(a.length-1)&&b.match(/'|"/)?a.substr(1,a.length-2):a}function M(a){for(var b,c=[],d=0,e=!1;a.length;)N(a[d])===e?(b=a.splice(0,d),b.length&&c.push(Q.ucs2.encode(b)),e=!e,d=0):d++,d>=a.length&&(b=a.splice(0,d),b.length&&c.push(Q.ucs2.encode(b)));return c}function N(a){return[32,13,10,9,45].indexOf(a)!==-1}function O(a){return/[^\u0000-\u00ff]/.test(a)}var P=a("./log"),Q=a("punycode"),R=a("./nodecontainer"),S=a("./textcontainer"),T=a("./pseudoelementcontainer"),U=a("./fontmetrics"),V=a("./color"),W=a("./stackingcontext"),X=a("./utils"),Y=X.bind,Z=X.getBounds,$=X.parseBackgrounds,_=X.offsetBounds;d.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(a){if(C(a)){D(a)&&a.appendToDOM(),a.borders=this.parseBorders(a);var b="hidden"===a.css("overflow")?[a.borders.clip]:[],c=a.parseClip();c&&["absolute","fixed"].indexOf(a.css("position"))!==-1&&b.push([["rect",a.bounds.left+c.left,a.bounds.top+c.top,c.right-c.left,c.bottom-c.top]]),a.clip=e(a)?a.parent.clip.concat(b):b,a.backgroundClip="hidden"!==a.css("overflow")?a.clip.concat([a.borders.clip]):a.clip,D(a)&&a.cleanDOM()}else E(a)&&(a.clip=e(a)?a.parent.clip:[]);D(a)||(a.bounds=null)},this)},d.prototype.asyncRenderer=function(a,b,c){c=c||Date.now(),this.paint(a[this.renderIndex++]),a.length===this.renderIndex?b():c+20>Date.now()?this.asyncRenderer(a,b,c):setTimeout(Y(function(){this.asyncRenderer(a,b)},this),0)},d.prototype.createPseudoHideStyles=function(a){this.createStyles(a,"."+T.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+T.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},d.prototype.disableAnimations=function(a){this.createStyles(a,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},d.prototype.createStyles=function(a,b){var c=a.createElement("style");c.innerHTML=b,a.body.appendChild(c)},d.prototype.getPseudoElements=function(a){var b=[[a]];if(a.node.nodeType===Node.ELEMENT_NODE){var c=this.getPseudoElement(a,":before"),d=this.getPseudoElement(a,":after");c&&b.push(c),d&&b.push(d)}return K(b)},d.prototype.getPseudoElement=function(a,b){var c=a.computedStyle(b);if(!c||!c.content||"none"===c.content||"-moz-alt-content"===c.content||"none"===c.display)return null;for(var d=L(c.content),e="url"===d.substr(0,3),g=document.createElement(e?"img":"html2canvaspseudoelement"),h=new T(g,a,b),i=c.length-1;i>=0;i--){var j=f(c.item(i));g.style[j]=c[j]}if(g.className=T.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+T.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,e)return g.src=$(d)[0].args[0],[h];var k=document.createTextNode(d);return g.appendChild(k),[h,new S(k,h)]},d.prototype.getChildren=function(a){return K([].filter.call(a.node.childNodes,w).map(function(b){var c=[b.nodeType===Node.TEXT_NODE?new S(b,a):new R(b,a)].filter(J);return b.nodeType===Node.ELEMENT_NODE&&c.length&&"TEXTAREA"!==b.tagName?c[0].isElementVisible()?c.concat(this.getChildren(c[0])):[]:c},this))},d.prototype.newStackingContext=function(a,b){var c=new W(b,a.getOpacity(),a.node,a.parent);a.cloneTo(c);var d=b?c.getParentStack(this):c.parent.stack;d.contexts.push(c),a.stack=c},d.prototype.createStackingContexts=function(){this.nodes.forEach(function(a){C(a)&&(this.isRootElement(a)||G(a)||x(a)||this.isBodyWithTransparentRoot(a)||a.hasTransform())?this.newStackingContext(a,!0):C(a)&&(y(a)&&q(a)||A(a)||z(a))?this.newStackingContext(a,!1):a.assignStack(a.parent.stack)},this)},d.prototype.isBodyWithTransparentRoot=function(a){return"BODY"===a.node.nodeName&&a.parent.color("backgroundColor").isTransparent()},d.prototype.isRootElement=function(a){return null===a.parent},d.prototype.sortStackingContexts=function(a){a.contexts.sort(F(a.contexts.slice(0))),a.contexts.forEach(this.sortStackingContexts,this)},d.prototype.parseTextBounds=function(a){return function(b,c,d){if("none"!==a.parent.css("textDecoration").substr(0,4)||0!==b.trim().length){if(this.support.rangeBounds&&!a.parent.hasTransform()){var e=d.slice(0,c).join("").length;return this.getRangeBounds(a.node,e,b.length)}if(a.node&&"string"==typeof a.node.data){var f=a.node.splitText(b.length),g=this.getWrapperBounds(a.node,a.parent.hasTransform());return a.node=f,g}}else this.support.rangeBounds&&!a.parent.hasTransform()||(a.node=a.node.splitText(b.length));return{}}},d.prototype.getWrapperBounds=function(a,b){var c=a.ownerDocument.createElement("html2canvaswrapper"),d=a.parentNode,e=a.cloneNode(!0);c.appendChild(a.cloneNode(!0)),d.replaceChild(c,a);var f=b?_(c):Z(c);return d.replaceChild(e,c),f},d.prototype.getRangeBounds=function(a,b,c){var d=this.range||(this.range=a.ownerDocument.createRange());return d.setStart(a,b),d.setEnd(a,b+c),d.getBoundingClientRect()},d.prototype.parse=function(a){var b=a.contexts.filter(o),c=a.children.filter(C),d=c.filter(B(z)),e=d.filter(B(y)).filter(B(r)),f=c.filter(B(y)).filter(z),h=d.filter(B(y)).filter(r),i=a.contexts.concat(d.filter(y)).filter(q),j=a.children.filter(E).filter(t),k=a.contexts.filter(p);b.concat(e).concat(f).concat(h).concat(i).concat(j).concat(k).forEach(function(a){this.renderQueue.push(a),s(a)&&(this.parse(a),this.renderQueue.push(new g))},this)},d.prototype.paint=function(a){try{a instanceof g?this.renderer.ctx.restore():E(a)?(D(a.parent)&&a.parent.appendToDOM(),this.paintText(a),D(a.parent)&&a.parent.cleanDOM()):this.paintNode(a)}catch(b){if(P(b),this.options.strict)throw b}},d.prototype.paintNode=function(a){s(a)&&(this.renderer.setOpacity(a.opacity),this.renderer.ctx.save(),a.hasTransform()&&this.renderer.setTransform(a.parseTransform())),"INPUT"===a.node.nodeName&&"checkbox"===a.node.type?this.paintCheckbox(a):"INPUT"===a.node.nodeName&&"radio"===a.node.type?this.paintRadio(a):this.paintElement(a)},d.prototype.paintElement=function(a){var b=a.parseBounds();this.renderer.clip(a.backgroundClip,function(){this.renderer.renderBackground(a,b,a.borders.borders.map(I))},this,a),this.renderer.mask(a.backgroundClip,function(){this.renderer.renderShadows(a,a.borders.clip)},this,a),this.renderer.clip(a.clip,function(){this.renderer.renderBorders(a.borders.borders)},this,a),this.renderer.clip(a.backgroundClip,function(){switch(a.node.nodeName){case"svg":case"IFRAME":var c=this.images.get(a.node);c?this.renderer.renderImage(a,b,a.borders,c):P("Error loading <"+a.node.nodeName+">",a.node);break;case"IMG":var d=this.images.get(a.node.src);d?this.renderer.renderImage(a,b,a.borders,d):P("Error loading ",a.node.src);break;case"CANVAS":this.renderer.renderImage(a,b,a.borders,{image:a.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(a)}},this,a)},d.prototype.paintCheckbox=function(a){var b=a.parseBounds(),c=Math.min(b.width,b.height),d={width:c-1,height:c-1,top:b.top,left:b.left},e=[3,3],f=[e,e,e,e],g=[1,1,1,1].map(function(a){return{color:new V("#A5A5A5"),width:a}}),i=j(d,f,g);this.renderer.clip(a.backgroundClip,function(){this.renderer.rectangle(d.left+1,d.top+1,d.width-2,d.height-2,new V("#DEDEDE")),this.renderer.renderBorders(h(g,d,i,f)),a.node.checked&&(this.renderer.font(new V("#424242"),"normal","normal","bold",c-3+"px","arial"),this.renderer.text("✔",d.left+c/6,d.top+c-1))},this,a)},d.prototype.paintRadio=function(a){var b=a.parseBounds(),c=Math.min(b.width,b.height)-2;this.renderer.clip(a.backgroundClip,function(){this.renderer.circleStroke(b.left+1,b.top+1,c,new V("#DEDEDE"),1,new V("#A5A5A5")),a.node.checked&&this.renderer.circle(Math.ceil(b.left+c/4)+1,Math.ceil(b.top+c/4)+1,Math.floor(c/2),new V("#424242"))},this,a)},d.prototype.paintFormValue=function(a){var b=a.getValue();if(b.length>0){var c=a.node.ownerDocument,d=c.createElement("html2canvaswrapper"),e=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];e.forEach(function(b){try{d.style[b]=a.css(b)}catch(c){P("html2canvas: Parse: Exception caught in renderFormValue: "+c.message)}});var f=a.parseBounds();d.style.position="fixed",d.style.left=f.left+"px",d.style.top=f.top+"px",d.textContent=b,c.body.appendChild(d),this.paintText(new S(d.firstChild,a)),c.body.removeChild(d)}},d.prototype.paintText=function(a){a.applyTextTransform();var b=Q.ucs2.decode(a.node.data),c=(!this.options.letterRendering||u(a))&&!O(a.node.data),d=c?M(b):b.map(function(a){return Q.ucs2.encode([a])});c||(a.parent.node.style.fontVariantLigatures="none");var e=a.parent.fontWeight(),f=a.parent.css("fontSize"),g=a.parent.css("fontFamily"),h=a.parent.parseTextShadows();this.renderer.font(a.parent.color("color"),a.parent.css("fontStyle"),a.parent.css("fontVariant"),e,f,g),h.length?this.renderer.fontShadow(h[0].color,h[0].offsetX,h[0].offsetY,h[0].blur):this.renderer.clearShadow(),this.renderer.clip(a.parent.clip,function(){d.map(this.parseTextBounds(a),this).forEach(function(b,c){b&&(this.renderer.text(d[c],b.left,b.bottom),this.renderTextDecoration(a.parent,b,this.fontMetrics.getMetrics(g,f)))},this)},this,a.parent)},d.prototype.renderTextDecoration=function(a,b,c){switch(a.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(b.left,Math.round(b.top+c.baseline+c.lineWidth),b.width,1,a.color("color"));break;case"overline":this.renderer.rectangle(b.left,Math.round(b.top),b.width,1,a.color("color"));break;case"line-through":this.renderer.rectangle(b.left,Math.ceil(b.top+c.middle+c.lineWidth),b.width,1,a.color("color"))}};var aa={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};d.prototype.parseBorders=function(a){var b=a.parseBounds(),c=v(a),d=["Top","Right","Bottom","Left"].map(function(b,c){var d=a.css("border"+b+"Style"),e=a.color("border"+b+"Color");"inset"===d&&e.isBlack()&&(e=new V([255,255,255,e.a]));var f=aa[d]?aa[d][c]:null;return{width:a.cssInt("border"+b+"Width"),color:f?e[f[0]](f[1]):e,style:d,pathArgs:null,args:null}}),e=j(b,c,d);return{clip:this.parseBackgroundClip(a,e,d,c,b),borders:h(d,b,e,c)}},d.prototype.parseBackgroundClip=function(a,b,c,d,e){var f=a.css("backgroundClip"),g=[];switch(f){case"content-box":case"padding-box":n(g,d[0],d[1],b.topLeftInner,b.topRightInner,e.left+c[3].width,e.top+c[0].width),n(g,d[1],d[2],b.topRightInner,b.bottomRightInner,e.left+e.width-c[1].width,e.top+c[0].width),n(g,d[2],d[3],b.bottomRightInner,b.bottomLeftInner,e.left+e.width-c[1].width,e.top+e.height-c[2].width),n(g,d[3],d[0],b.bottomLeftInner,b.topLeftInner,e.left+c[3].width,e.top+e.height-c[2].width);break;default:n(g,d[0],d[1],b.topLeftOuter,b.topRightOuter,e.left,e.top),n(g,d[1],d[2],b.topRightOuter,b.bottomRightOuter,e.left+e.width,e.top),n(g,d[2],d[3],b.bottomRightOuter,b.bottomLeftOuter,e.left+e.width,e.top+e.height),n(g,d[3],d[0],b.bottomLeftOuter,b.topLeftOuter,e.left,e.top+e.height)}return g},b.exports=d},{"./color":3,"./fontmetrics":7,"./log":13,"./nodecontainer":14,"./pseudoelementcontainer":18,"./stackingcontext":21,"./textcontainer":25,"./utils":26,punycode:1}],16:[function(a,b,c){function d(a,b,c){var d="withCredentials"in new XMLHttpRequest;if(!b)return Promise.reject("No proxy configured");var e=g(d),i=h(b,a,e);return d?k(i):f(c,i,e).then(function(a){return o(a.content)})}function e(a,b,c){var d="crossOrigin"in new Image,e=g(d),i=h(b,a,e);return d?Promise.resolve(i):f(c,i,e).then(function(a){return"data:"+a.type+";base64,"+a.content})}function f(a,b,c){return new Promise(function(d,e){var f=a.createElement("script"),g=function(){delete window.html2canvas.proxy[c],a.body.removeChild(f)};window.html2canvas.proxy[c]=function(a){g(),d(a)},f.src=b,f.onerror=function(a){g(),e(a)},a.body.appendChild(f)})}function g(a){return a?"":"html2canvas_"+Date.now()+"_"+ ++p+"_"+Math.round(1e5*Math.random())}function h(a,b,c){return a+"?url="+encodeURIComponent(b)+(c.length?"&callback=html2canvas.proxy."+c:"")}function i(a){return function(b){var c,d=new DOMParser;try{c=d.parseFromString(b,"text/html")}catch(e){m("DOMParser not supported, falling back to createHTMLDocument"),c=document.implementation.createHTMLDocument("");try{c.open(),c.write(b),c.close()}catch(f){m("createHTMLDocument write not supported, falling back to document.body.innerHTML"),c.body.innerHTML=b}}var g=c.querySelector("base");if(!g||!g.href.host){var h=c.createElement("base");h.href=a,c.head.insertBefore(h,c.head.firstChild)}return c}}function j(a,b,c,e,f,g){return new d(a,b,window.document).then(i(a)).then(function(a){return n(a,c,e,f,g,0,0)})}var k=a("./xhr"),l=a("./utils"),m=a("./log"),n=a("./clone"),o=l.decode64,p=0;c.Proxy=d,c.ProxyURL=e,c.loadUrlDocument=j},{"./clone":2,"./log":13,"./utils":26,"./xhr":28}],17:[function(a,b,c){function d(a,b){var c=document.createElement("a");c.href=a,a=c.href,this.src=a,this.image=new Image;var d=this;this.promise=new Promise(function(c,f){d.image.crossOrigin="Anonymous",d.image.onload=c,d.image.onerror=f,new e(a,b,document).then(function(a){d.image.src=a})["catch"](f)})}var e=a("./proxy").ProxyURL;b.exports=d},{"./proxy":16}],18:[function(a,b,c){function d(a,b,c){e.call(this,a,b),this.isPseudoElement=!0,this.before=":before"===c}var e=a("./nodecontainer");d.prototype.cloneTo=function(a){d.prototype.cloneTo.call(this,a),a.isPseudoElement=!0,a.before=this.before},d.prototype=Object.create(e.prototype),d.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},d.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},d.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",d.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",b.exports=d},{"./nodecontainer":14}],19:[function(a,b,c){function d(a,b,c,d,e){this.width=a,this.height=b,this.images=c,this.options=d,this.document=e}var e=a("./log");d.prototype.renderImage=function(a,b,c,d){var e=a.cssInt("paddingLeft"),f=a.cssInt("paddingTop"),g=a.cssInt("paddingRight"),h=a.cssInt("paddingBottom"),i=c.borders,j=b.width-(i[1].width+i[3].width+e+g),k=b.height-(i[0].width+i[2].width+f+h);this.drawImage(d,0,0,d.image.width||j,d.image.height||k,b.left+e+i[3].width,b.top+f+i[0].width,j,k)},d.prototype.renderBackground=function(a,b,c){b.height>0&&b.width>0&&(this.renderBackgroundColor(a,b),this.renderBackgroundImage(a,b,c))},d.prototype.renderBackgroundColor=function(a,b){var c=a.color("backgroundColor");c.isTransparent()||this.rectangle(b.left,b.top,b.width,b.height,c)},d.prototype.renderShadows=function(a,b){var c=a.css("boxShadow");if("none"!==c){var d=c.split(/,(?![^(]*\))/);this.shadow(b,d)}},d.prototype.renderBorders=function(a){a.forEach(this.renderBorder,this)},d.prototype.renderBorder=function(a){if(!a.color.isTransparent()&&null!==a.args)if("dashed"===a.style||"dotted"===a.style){var b="dashed"===a.style?3:a.width;this.ctx.setLineDash([b]),this.path(a.pathArgs),this.ctx.strokeStyle=a.color,this.ctx.lineWidth=a.width,this.ctx.stroke()}else this.drawShape(a.args,a.color)},d.prototype.renderBackgroundImage=function(a,b,c){var d=a.parseBackgroundImages();d.reverse().forEach(function(d,f,g){switch(d.method){case"url":var h=this.images.get(d.args[0]);h?this.renderBackgroundRepeating(a,b,h,g.length-(f+1),c):e("Error loading background-image",d.args[0]);break;case"linear-gradient":case"gradient":var i=this.images.get(d.value);i?this.renderBackgroundGradient(i,b,c):e("Error loading background-image",d.args[0]);break;case"none":break;default:e("Unknown background-image type",d.args[0])}},this)},d.prototype.renderBackgroundRepeating=function(a,b,c,d,e){var f=a.parseBackgroundSize(b,c.image,d),g=a.parseBackgroundPosition(b,c.image,d,f),h=a.parseBackgroundRepeat(d);switch(h){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(c,g,f,b,b.left+e[3],b.top+g.top+e[0],99999,f.height,e);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(c,g,f,b,b.left+g.left+e[3],b.top+e[0],f.width,99999,e);break;case"no-repeat":this.backgroundRepeatShape(c,g,f,b,b.left+g.left+e[3],b.top+g.top+e[0],f.width,f.height,e);break;default:this.renderBackgroundRepeat(c,g,f,{top:b.top,left:b.left},e[3],e[0])}},b.exports=d},{"./log":13}],20:[function(a,b,c){function d(a,b){f.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options.canvas||(this.options.dpi&&(this.options.scale=this.options.dpi/96),this.options.scale?(this.canvas.style.width=a+"px",this.canvas.style.height=b+"px",this.canvas.width=Math.floor(a*this.options.scale),this.canvas.height=Math.floor(b*this.options.scale),this.ctx.scale(this.options.scale,this.options.scale)):(this.canvas.width=a,this.canvas.height=b)),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},h("Initialized CanvasRenderer with size",a,"x",b)}function e(a){return a.length>0}var f=a("../renderer"),g=a("../lineargradientcontainer"),h=a("../log");d.prototype=Object.create(f.prototype),d.prototype.setFillStyle=function(a){return this.ctx.fillStyle="object"==typeof a&&a.isColor?a.toString():a,this.ctx},d.prototype.rectangle=function(a,b,c,d,e){this.setFillStyle(e).fillRect(a,b,c,d)},d.prototype.circle=function(a,b,c,d){this.setFillStyle(d),this.ctx.beginPath(),this.ctx.arc(a+c/2,b+c/2,c/2,0,2*Math.PI,!0),this.ctx.closePath(),this.ctx.fill()},d.prototype.circleStroke=function(a,b,c,d,e,f){this.circle(a,b,c,d),this.ctx.strokeStyle=f.toString(),this.ctx.stroke()},d.prototype.shadow=function(a,b){var c=function(a){var b={color:/^(#|rgb|hsl|(?!(inset|initial|inherit))\D+)/i,inset:/^inset/i,px:/px$/i},c=["x","y","blur","spread"],d=a.split(/ (?![^(]*\))/),e={};for(var f in b)e[f]=d.filter(b[f].test.bind(b[f])),e[f]=0===e[f].length?null:1===e[f].length?e[f][0]:e[f];for(var g=0;g";try{c.drawImage(a,0,0),b.toDataURL()}catch(d){return!1}return!0},b.exports=d},{}],23:[function(a,b,c){function d(a){this.src=a,this.image=null;var b=this;this.promise=this.hasFabric().then(function(){return b.isInline(a)?Promise.resolve(b.inlineFormatting(a)):e(a)}).then(function(a){return new Promise(function(c){window.html2canvas.svg.fabric.loadSVGFromString(a,b.createCanvas.call(b,c))})})}var e=a("./xhr"),f=a("./utils").decode64;d.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?Promise.resolve():Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},d.prototype.inlineFormatting=function(a){return/^data:image\/svg\+xml;base64,/.test(a)?this.decode64(this.removeContentType(a)):this.removeContentType(a)},d.prototype.removeContentType=function(a){return a.replace(/^data:image\/svg\+xml(;base64)?,/,"")},d.prototype.isInline=function(a){return/^data:image\/svg\+xml/i.test(a)},d.prototype.createCanvas=function(a){var b=this;return function(c,d){var e=new window.html2canvas.svg.fabric.StaticCanvas("c");b.image=e.lowerCanvasEl,e.setWidth(d.width).setHeight(d.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(c,d)).renderAll(),a(e.lowerCanvasEl)}},d.prototype.decode64=function(a){return"function"==typeof window.atob?window.atob(a):f(a)},b.exports=d},{"./utils":26,"./xhr":28}],24:[function(a,b,c){function d(a,b){this.src=a,this.image=null;var c=this;this.promise=b?new Promise(function(b,d){c.image=new Image,c.image.onload=b,c.image.onerror=d,c.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(a),c.image.complete===!0&&b(c.image)}):this.hasFabric().then(function(){return new Promise(function(b){window.html2canvas.svg.fabric.parseSVGDocument(a,c.createCanvas.call(c,b))})})}var e=a("./svgcontainer");d.prototype=Object.create(e.prototype),b.exports=d},{"./svgcontainer":23}],25:[function(a,b,c){function d(a,b){f.call(this,a,b)}function e(a,b,c){if(a.length>0)return b+c.toUpperCase()}var f=a("./nodecontainer");d.prototype=Object.create(f.prototype),d.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},d.prototype.transform=function(a){var b=this.node.data;switch(a){case"lowercase":return b.toLowerCase();case"capitalize":return b.replace(/(^|\s|:|-|\(|\))([a-z])/g,e);case"uppercase":return b.toUpperCase();default:return b}},b.exports=d},{"./nodecontainer":14}],26:[function(a,b,c){c.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},c.bind=function(a,b){return function(){return a.apply(b,arguments)}},c.decode64=function(a){var b,c,d,e,f,g,h,i,j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=a.length,l="";for(b=0;b>4,h=(15&d)<<4|e>>2,i=(3&e)<<6|f,l+=64===e?String.fromCharCode(g):64===f||f===-1?String.fromCharCode(g,h):String.fromCharCode(g,h,i);return l},c.getBounds=function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=null==a.offsetWidth?b.width:a.offsetWidth;return{top:b.top,bottom:b.bottom||b.top+b.height,right:b.left+c,left:b.left,width:c,height:null==a.offsetHeight?b.height:a.offsetHeight}}return{}},c.offsetBounds=function(a){var b=a.offsetParent?c.offsetBounds(a.offsetParent):{top:0,left:0};return{top:a.offsetTop+b.top,bottom:a.offsetTop+a.offsetHeight+b.top,right:a.offsetLeft+b.left+a.offsetWidth,left:a.offsetLeft+b.left,width:a.offsetWidth,height:a.offsetHeight}},c.parseBackgrounds=function(a){var b,c,d,e,f,g,h,i=" \r\n\t",j=[],k=0,l=0,m=function(){b&&('"'===c.substr(0,1)&&(c=c.substr(1,c.length-2)),c&&h.push(c),"-"===b.substr(0,1)&&(e=b.indexOf("-",1)+1)>0&&(d=b.substr(0,e),b=b.substr(e)),j.push({prefix:d,method:b.toLowerCase(),value:f,args:h,image:null})),h=[],b=d=c=f=""};return h=[],b=d=c=f="",a.split("").forEach(function(a){if(!(0===k&&i.indexOf(a)>-1)){switch(a){case'"':g?g===a&&(g=null):g=a;break;case"(":if(g)break;if(0===k)return k=1,void(f+=a);l++;break;case")":if(g)break;if(1===k){if(0===l)return k=0,f+=a,void m();l--}break;case",":if(g)break;if(0===k)return void m();if(1===k&&0===l&&!b.match(/^url$/i))return h.push(c),c="",void(f+=a)}f+=a,0===k?b+=a:c+=a}}),m(),j}},{}],27:[function(a,b,c){function d(a){e.apply(this,arguments),this.type="linear"===a.args[0]?e.TYPES.LINEAR:e.TYPES.RADIAL}var e=a("./gradientcontainer");d.prototype=Object.create(e.prototype),b.exports=d},{"./gradientcontainer":9}],28:[function(a,b,c){function d(a){return new Promise(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.onload=function(){200===d.status?b(d.responseText):c(new Error(d.statusText))},d.onerror=function(){ c(new Error("Network Error"))},d.send()})}b.exports=d},{}]},{},[4])(4)}); ; /** @license * * jsPDF - PDF Document creation from JavaScript * Version 3.0.4 Built on 2025-11-19T12:48:37.231Z * CommitID 00000000 * * Copyright (c) 2010-2025 James Hall , https://github.com/MrRio/jsPDF * 2015-2025 yWorks GmbH, http://www.yworks.com * 2015-2025 Lukas Holländer , https://github.com/HackbrettXXX * 2016-2018 Aras Abbasi * 2010 Aaron Spike, https://github.com/acspike * 2012 Willow Systems Corporation, https://github.com/willowsystems * 2012 Pablo Hess, https://github.com/pablohess * 2012 Florian Jenett, https://github.com/fjenett * 2013 Warren Weckesser, https://github.com/warrenweckesser * 2013 Youssef Beddad, https://github.com/lifof * 2013 Lee Driscoll, https://github.com/lsdriscoll * 2013 Stefan Slonevskiy, https://github.com/stefslon * 2013 Jeremy Morel, https://github.com/jmorel * 2013 Christoph Hartmann, https://github.com/chris-rock * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria * 2014 James Makes, https://github.com/dollaruw * 2014 Diego Casorran, https://github.com/diegocr * 2014 Steven Spungin, https://github.com/Flamenco * 2014 Kenneth Glassey, https://github.com/Gavvers * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Contributor(s): * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, * kim3er, mfo, alnorth, Flamenco */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jspdf={})}(this,function(t){function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=200&&e.status<=299}function l(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var c=i.saveAs||("object"!==("undefined"==typeof window?"undefined":r(window))||window!==i?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=i.URL||i.webkitURL,a=document.createElement("a");e=e||t.name||"download",a.download=e,a.rel="noopener","string"==typeof t?(a.href=t,a.origin!==location.origin?h(a.href)?o(t,e,n):l(a,a.target="_blank"):l(a)):(a.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){l(a)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(h(t))o(t,e,n);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){l(i)})}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!==r(e)&&(s.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,e,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof t)return o(t,e,n);var s="application/octet-stream"===t.type,h=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&h)&&"object"===("undefined"==typeof FileReader?"undefined":r(FileReader))){var c=new FileReader;c.onloadend=function(){var t=c.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=t:location=t,a=null},c.readAsDataURL(t)}else{var u=i.URL||i.webkitURL,f=u.createObjectURL(t);a?a.location=f:location.href=f,a=null,setTimeout(function(){u.revokeObjectURL(f)},4e4)}}); /** * A class to parse color values * @author Stoyan Stefanov * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} * @license Use it if you like it */function u(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}}var f=i.atob.bind(i),d=i.btoa.bind(i); /** * @license * Joseph Myers does not specify a particular license for his work. * * Author: Joseph Myers * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js * * Modified by: Owen Leong */ function p(t,e){var n=t[0],r=t[1],i=t[2],a=t[3];n=m(n,r,i,a,e[0],7,-680876936),a=m(a,n,r,i,e[1],12,-389564586),i=m(i,a,n,r,e[2],17,606105819),r=m(r,i,a,n,e[3],22,-1044525330),n=m(n,r,i,a,e[4],7,-176418897),a=m(a,n,r,i,e[5],12,1200080426),i=m(i,a,n,r,e[6],17,-1473231341),r=m(r,i,a,n,e[7],22,-45705983),n=m(n,r,i,a,e[8],7,1770035416),a=m(a,n,r,i,e[9],12,-1958414417),i=m(i,a,n,r,e[10],17,-42063),r=m(r,i,a,n,e[11],22,-1990404162),n=m(n,r,i,a,e[12],7,1804603682),a=m(a,n,r,i,e[13],12,-40341101),i=m(i,a,n,r,e[14],17,-1502002290),n=b(n,r=m(r,i,a,n,e[15],22,1236535329),i,a,e[1],5,-165796510),a=b(a,n,r,i,e[6],9,-1069501632),i=b(i,a,n,r,e[11],14,643717713),r=b(r,i,a,n,e[0],20,-373897302),n=b(n,r,i,a,e[5],5,-701558691),a=b(a,n,r,i,e[10],9,38016083),i=b(i,a,n,r,e[15],14,-660478335),r=b(r,i,a,n,e[4],20,-405537848),n=b(n,r,i,a,e[9],5,568446438),a=b(a,n,r,i,e[14],9,-1019803690),i=b(i,a,n,r,e[3],14,-187363961),r=b(r,i,a,n,e[8],20,1163531501),n=b(n,r,i,a,e[13],5,-1444681467),a=b(a,n,r,i,e[2],9,-51403784),i=b(i,a,n,r,e[7],14,1735328473),n=v(n,r=b(r,i,a,n,e[12],20,-1926607734),i,a,e[5],4,-378558),a=v(a,n,r,i,e[8],11,-2022574463),i=v(i,a,n,r,e[11],16,1839030562),r=v(r,i,a,n,e[14],23,-35309556),n=v(n,r,i,a,e[1],4,-1530992060),a=v(a,n,r,i,e[4],11,1272893353),i=v(i,a,n,r,e[7],16,-155497632),r=v(r,i,a,n,e[10],23,-1094730640),n=v(n,r,i,a,e[13],4,681279174),a=v(a,n,r,i,e[0],11,-358537222),i=v(i,a,n,r,e[3],16,-722521979),r=v(r,i,a,n,e[6],23,76029189),n=v(n,r,i,a,e[9],4,-640364487),a=v(a,n,r,i,e[12],11,-421815835),i=v(i,a,n,r,e[15],16,530742520),n=w(n,r=v(r,i,a,n,e[2],23,-995338651),i,a,e[0],6,-198630844),a=w(a,n,r,i,e[7],10,1126891415),i=w(i,a,n,r,e[14],15,-1416354905),r=w(r,i,a,n,e[5],21,-57434055),n=w(n,r,i,a,e[12],6,1700485571),a=w(a,n,r,i,e[3],10,-1894986606),i=w(i,a,n,r,e[10],15,-1051523),r=w(r,i,a,n,e[1],21,-2054922799),n=w(n,r,i,a,e[8],6,1873313359),a=w(a,n,r,i,e[15],10,-30611744),i=w(i,a,n,r,e[6],15,-1560198380),r=w(r,i,a,n,e[13],21,1309151649),n=w(n,r,i,a,e[4],6,-145523070),a=w(a,n,r,i,e[11],10,-1120210379),i=w(i,a,n,r,e[2],15,718787259),r=w(r,i,a,n,e[9],21,-343485551),t[0]=k(n,t[0]),t[1]=k(r,t[1]),t[2]=k(i,t[2]),t[3]=k(a,t[3])}function g(t,e,n,r,i,a){return e=k(k(e,t),k(r,a)),k(e<>>32-i,n)}function m(t,e,n,r,i,a,s){return g(e&n|~e&r,t,e,i,a,s)}function b(t,e,n,r,i,a,s){return g(e&r|n&~r,t,e,i,a,s)}function v(t,e,n,r,i,a,s){return g(e^n^r,t,e,i,a,s)}function w(t,e,n,r,i,a,s){return g(n^(e|~r),t,e,i,a,s)}function y(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)p(r,_(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(p(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,p(r,i),r}function _(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}var x="0123456789abcdef".split("");function A(t){for(var e="",n=0;n<4;n++)e+=x[t>>8*n+4&15]+x[t>>8*n&15];return e}function L(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function N(t){return function(t){return t.map(L).join("")}(y(t))}var S="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var e=0;e>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295} /** * @license * FPDF is released under a permissive license: there is no usage restriction. * You may embed it freely in your application (commercial or not), with or * without modifications. * * Reference: http://www.fpdf.org/en/script/script37.php */function P(t,e){var n,r,i,a;if(t!==n){for(var s=(i=t,a=1+(256/t.length|0),new Array(a+1).join(i)),o=[],h=0;h<256;h++)o[h]=h;var l=0;for(h=0;h<256;h++){var c=o[h];l=(l+c+s.charCodeAt(h))%256,o[h]=o[l],o[l]=c}n=t,r=o}else o=r;var u=e.length,f=0,d=0,p="";for(h=0;h€/\f©þdSiz";var a=(e+this.padding).substr(0,32),s=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,s),this.P=-(1+(255^i)),this.encryptionKey=N(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=P(this.encryptionKey,this.padding)}function C(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r126?"#"+("0"+i.toString(16)).slice(-2):t[r]}return e}function j(t){if("object"!==r(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,n,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof n||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[n,!!r],i},this.unsubscribe=function(t){for(var n in e)if(e[n][t])return delete e[n][t],0===Object.keys(e[n]).length&&delete e[n],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var o in e[n]){var h=e[n][o];try{h[0].apply(t,r)}catch(l){i.console&&s.error("jsPDF PubSub Error",l.message,l)}h[1]&&a.push(o)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function E(t){if(!(this instanceof E))return new E(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function O(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function B(t,e,n,r,i){if(!(this instanceof B))return new B(t,e,n,r,i);this.type="axial"===t?2:3,this.coords=e,this.colors=n,O.call(this,r,i)}function M(t,e,n,r,i){if(!(this instanceof M))return new M(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,O.call(this,r,i)}function R(t){var e,n="string"==typeof arguments[0]?arguments[0]:"p",a=arguments[1],o=arguments[2],h=arguments[3],l=[],f=1,p=16,g="S",m=null;"object"===r(t=t||{})&&(n=t.orientation,a=t.unit||a,o=t.format||o,h=t.compress||t.compressPdf||h,null!==(m=t.encryption||null)&&(m.userPassword=m.userPassword||"",m.ownerPassword=m.ownerPassword||"",m.userPermissions=m.userPermissions||[]),f="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(e=t.precision),void 0!==t.floatPrecision&&(p=t.floatPrecision),g=t.defaultPathOperation||"S"),l=t.filters||(!0===h?["FlateEncode"]:l),a=a||"mm",n=(""+(n||"P")).toLowerCase();var b=t.putOnlyUsedFonts||!1,v={},w={internal:{},__private__:{}};w.__private__.PubSub=j;var y="1.3",_=w.__private__.getPdfVersion=function(){return y};w.__private__.setPdfVersion=function(t){y=t};var x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};w.__private__.getPageFormats=function(){return x};var A=w.__private__.getPageFormat=function(t){return x[t]};o=o||"a4";var L="compat",N="advanced",S=L;function k(){this.saveGraphicsState(),ct(new Wt(Nt,0,0,-Nt,0,Sn()*Nt).toString()+" cm"),this.setFontSize(this.getFontSize()/Nt),g="n",S=N}function P(){this.restoreGraphicsState(),g="S",S=L}var F=w.__private__.combineFontStyleAndFontWeight=function(t,e){if("bold"==t&&"normal"==e||"bold"==t&&400==e||"normal"==t&&"italic"==e||"bold"==t&&"italic"==e)throw new Error("Invalid Combination of fontweight and fontstyle");return e&&(t=400==e||"normal"===e?"italic"===t?"italic":"normal":700!=e&&"bold"!==e||"normal"!==t?(700==e?"bold":e)+""+t:"bold"),t};w.advancedAPI=function(t){var e=S===L;return e&&k.call(this),"function"!=typeof t||(t(this),e&&P.call(this)),this},w.compatAPI=function(t){var e=S===N;return e&&P.call(this),"function"!=typeof t||(t(this),e&&k.call(this)),this},w.isAdvancedAPI=function(){return S===N};var O,T=function(t){if(S!==N)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},q=w.roundToPrecision=w.__private__.roundToPrecision=function(t,n){var r=e||n;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};O=w.hpf=w.__private__.hpf="number"==typeof p?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,p)}:"smart"===p?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,16)};var D=w.f2=w.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return q(t,2)},z=w.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return q(t,3)},U=w.scale=w.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return S===L?t*Nt:S===N?t:void 0},H=function(t){return U(function(t){return S===L?Sn()-t:S===N?t:void 0}(t))};w.__private__.setPrecision=w.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(e=parseInt(t,10))};var W,V="00000000000000000000000000000000",G=w.__private__.getFileId=function(){return V},Y=w.__private__.setFileId=function(t){return V=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():V.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==m&&(Ce=new I(m.userPermissions,m.userPassword,m.ownerPassword,V)),V};w.setFileId=function(t){return Y(t),this},w.getFileId=function(){return G()};var Z=w.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=e<0?"+":"-",r=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[n,Q(r),"'",Q(i),"'"].join("");return["D:",t.getFullYear(),Q(t.getMonth()+1),Q(t.getDate()),Q(t.getHours()),Q(t.getMinutes()),Q(t.getSeconds()),a].join("")},J=w.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),s=parseInt(t.substr(14,2),10);return new Date(e,n,r,i,a,s,0)},X=w.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=Z(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return W=e},K=w.__private__.getCreationDate=function(t){var e=W;return"jsDate"===t&&(e=J(W)),e};w.setCreationDate=function(t){return X(t),this},w.getCreationDate=function(t){return K(t)};var $,Q=w.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},tt=w.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},et=0,nt=[],rt=[],it=0,at=[],st=[],ot=!1,ht=rt;w.__private__.setCustomOutputDestination=function(t){ot=!0,ht=t};var lt=function(t){ot||(ht=t)};w.__private__.resetCustomOutputDestination=function(){ot=!1,ht=rt};var ct=w.__private__.out=function(t){return t=t.toString(),it+=t.length+1,ht.push(t),ht},ut=w.__private__.write=function(t){return ct(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},ft=w.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},dt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];w.__private__.getStandardFonts=function(){return dt};var pt=t.fontSize||16;w.__private__.setFontSize=w.setFontSize=function(t){return pt=S===N?t/Nt:t,this};var gt,mt=w.__private__.getFontSize=w.getFontSize=function(){return S===L?pt:pt*Nt},bt=t.R2L||!1;w.__private__.setR2L=w.setR2L=function(t){return bt=t,this},w.__private__.getR2L=w.getR2L=function(){return bt};var vt,wt=w.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))gt=t;else if(isNaN(t)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');gt=t}else gt=parseInt(t,10)};w.__private__.getZoomMode=function(){return gt};var yt,_t=w.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');vt=t};w.__private__.getPageMode=function(){return vt};var xt=w.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');yt=t};w.__private__.getLayoutMode=function(){return yt},w.__private__.setDisplayMode=w.setDisplayMode=function(t,e,n){return wt(t),xt(e),_t(n),this};var At={title:"",subject:"",author:"",keywords:"",creator:""};w.__private__.getDocumentProperty=function(t){if(-1===Object.keys(At).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return At[t]},w.__private__.getDocumentProperties=function(){return At},w.__private__.setDocumentProperties=w.setProperties=w.setDocumentProperties=function(t){for(var e in At)At.hasOwnProperty(e)&&t[e]&&(At[e]=t[e]);return this},w.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(At).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return At[t]=e};var Lt,Nt,St,kt,Pt,Ft={},It={},Ct=[],jt={},Et={},Ot={},Bt={},Mt=null,Rt=0,Tt=[],qt=new j(w),Dt=t.hotfixes||[],zt={},Ut={},Ht=[],Wt=function t(e,n,r,i,a,s){if(!(this instanceof t))return new t(e,n,r,i,a,s);isNaN(e)&&(e=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(a)&&(a=0),isNaN(s)&&(s=0),this._matrix=[e,n,r,i,a,s]};Object.defineProperty(Wt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Wt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Wt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Wt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Wt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Wt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Wt.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Wt.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Wt.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Wt.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Wt.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Wt.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Wt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Wt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Wt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Wt.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Wt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(O).join(t)},Wt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,r=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,a=t.tx*this.sx+t.ty*this.shx+this.tx,s=t.tx*this.shy+t.ty*this.sy+this.ty;return new Wt(e,n,r,i,a,s)},Wt.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,s=Math.sqrt(t*t+e*e),o=(t/=s)*n+(e/=s)*r;n-=t*o,r-=e*o;var h=Math.sqrt(n*n+r*r);return o/=h,t*(r/=h)>16&255,i=l>>8&255,a=255&l}if(void 0===i||void 0===s&&n===i&&i===a)e="string"==typeof n?n+" "+o[0]:2===t.precision?D(n/255)+" "+o[0]:z(n/255)+" "+o[0];else if(void 0===s||"object"===r(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.","1.","1.",o[1]].join(" ");e="string"==typeof n?[n,i,a,o[1]].join(" "):2===t.precision?[D(n/255),D(i/255),D(a/255),o[1]].join(" "):[z(n/255),z(i/255),z(a/255),o[1]].join(" ")}else e="string"==typeof n?[n,i,a,s,o[2]].join(" "):2===t.precision?[D(n),D(i),D(a),D(s),o[2]].join(" "):[z(n),z(i),z(a),z(s),o[2]].join(" ");return e},re=w.__private__.getFilters=function(){return l},ie=w.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||re(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,s=t.objectId,o=function(t){return t};if(null!==m&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==m&&(o=Ce.encryptor(s,0));var h={};!0===n&&(n=["FlateEncode"]);var l=t.additionalKeyValues||[],c=(h=void 0!==R.API.processDataByFilters?R.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==h.data.length&&(l.push({key:"Length",value:h.data.length}),!0===i&&l.push({key:"Length1",value:a})),0!=c.length)if(c.split("/").length-1==1)l.push({key:"Filter",value:c});else{l.push({key:"Filter",value:"["+c+"]"});for(var u=0;u>"),0!==h.data.length&&(ct("stream"),ct(o(h.data)),ct("endstream"))},ae=w.__private__.putPage=function(t){var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;Kt(r,!0),ct("<>"),ct("endobj");var a=n.join("\n");return S===N&&(a+="\nQ"),Kt(i,!0),ie({data:a,filters:re(),objectId:i}),ct("endobj"),r},se=w.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=Rt;t++)Tt[t].objId=Xt(),Tt[t].contentsObjId=Xt();for(t=1;t<=Rt;t++)n.push(ae({number:t,data:st[t],objId:Tt[t].objId,contentsObjId:Tt[t].contentsObjId,mediaBox:Tt[t].mediaBox,cropBox:Tt[t].cropBox,bleedBox:Tt[t].bleedBox,trimBox:Tt[t].trimBox,artBox:Tt[t].artBox,userUnit:Tt[t].userUnit,rootDictionaryObjId:Qt,resourceDictionaryObjId:te}));Kt(Qt,!0),ct("<>"),ct("endobj"),qt.publish("postPutPages")},oe=function(t){qt.publish("putFont",{font:t,out:ct,newObject:Jt,putStream:ie}),!0!==t.isAlreadyPutted&&(t.objectNumber=Jt(),ct("<<"),ct("/Type /Font"),ct("/BaseFont /"+C(t.postScriptName)),ct("/Subtype /Type1"),"string"==typeof t.encoding&&ct("/Encoding /"+t.encoding),ct("/FirstChar 32"),ct("/LastChar 255"),ct(">>"),ct("endobj"))},he=function(t){t.objectNumber=Jt();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[O(t.x),O(t.y),O(t.x+t.width),O(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");ie({data:n,additionalKeyValues:e,objectId:t.objectNumber}),ct("endobj")},le=function(t,e){e||(e=21);var n=Jt(),r=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var a={offset:0,color:t[0].color};t.unshift(a)}if(1!=t[t.length-1].offset){var s={offset:1,color:t[t.length-1].color};t.push(s)}for(var o="",h=0,l=0;lt[h+1].offset;)h++;var c=t[h].offset,u=(n-c)/(t[h+1].offset-c),f=t[h].color,d=t[h+1].color;o+=tt(Math.round((1-u)*f[0]+u*d[0]).toString(16))+tt(Math.round((1-u)*f[1]+u*d[1]).toString(16))+tt(Math.round((1-u)*f[2]+u*d[2]).toString(16))}return o.trim()}(t.colors,e),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+e+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ie({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),ct("endobj"),t.objectNumber=Jt(),ct("<< /ShadingType "+t.type),ct("/ColorSpace /DeviceRGB");var a="/Coords ["+O(parseFloat(t.coords[0]))+" "+O(parseFloat(t.coords[1]))+" ";2===t.type?a+=O(parseFloat(t.coords[2]))+" "+O(parseFloat(t.coords[3])):a+=O(parseFloat(t.coords[2]))+" "+O(parseFloat(t.coords[3]))+" "+O(parseFloat(t.coords[4]))+" "+O(parseFloat(t.coords[5])),ct(a+="]"),t.matrix&&ct("/Matrix ["+t.matrix.toString()+"]"),ct("/Function "+n+" 0 R"),ct("/Extend [true true]"),ct(">>"),ct("endobj")},ce=function(t,e){var n=Xt(),r=Jt();e.push({resourcesOid:n,objectOid:r}),t.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+t.boundingBox.map(O).join(" ")+"]"}),i.push({key:"XStep",value:O(t.xStep)}),i.push({key:"YStep",value:O(t.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),ie({data:t.stream,additionalKeyValues:i,objectId:t.objectNumber}),ct("endobj")},ue=function(t){for(var e in t.objectNumber=Jt(),ct("<<"),t)switch(e){case"opacity":ct("/ca "+D(t[e]));break;case"stroke-opacity":ct("/CA "+D(t[e]))}ct(">>"),ct("endobj")},fe=function(t){Kt(t.resourcesOid,!0),ct("<<"),ct("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in ct("/Font <<"),Ft)Ft.hasOwnProperty(t)&&(!1===b||!0===b&&v.hasOwnProperty(t))&&ct("/"+t+" "+Ft[t].objectNumber+" 0 R");ct(">>")}(),function(){if(Object.keys(jt).length>0){for(var t in ct("/Shading <<"),jt)jt.hasOwnProperty(t)&&jt[t]instanceof B&&jt[t].objectNumber>=0&&ct("/"+t+" "+jt[t].objectNumber+" 0 R");qt.publish("putShadingPatternDict"),ct(">>")}}(),function(t){if(Object.keys(jt).length>0){for(var e in ct("/Pattern <<"),jt)jt.hasOwnProperty(e)&&jt[e]instanceof w.TilingPattern&&jt[e].objectNumber>=0&&jt[e].objectNumber>")}}(t.objectOid),function(){if(Object.keys(Ot).length>0){var t;for(t in ct("/ExtGState <<"),Ot)Ot.hasOwnProperty(t)&&Ot[t].objectNumber>=0&&ct("/"+t+" "+Ot[t].objectNumber+" 0 R");qt.publish("putGStateDict"),ct(">>")}}(),function(){for(var t in ct("/XObject <<"),zt)zt.hasOwnProperty(t)&&zt[t].objectNumber>=0&&ct("/"+t+" "+zt[t].objectNumber+" 0 R");qt.publish("putXobjectDict"),ct(">>")}(),ct(">>"),ct("endobj")},de=function(t){It[t.fontName]=It[t.fontName]||{},It[t.fontName][t.fontStyle]=t.id},pe=function(t,e,n,r,i){var a={id:"F"+(Object.keys(Ft).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return qt.publish("addFont",{font:a,instance:this}),Ft[a.id]=a,de(a),a.id},ge=w.__private__.pdfEscape=w.pdfEscape=function(t,e){return function(t,e){var n,r,i,a,s,o,h,l,c;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&Ft[Lt].metadata&&Ft[Lt].metadata[i]&&Ft[Lt].metadata[i].encoding&&(a=Ft[Lt].metadata[i].encoding,!s&&Ft[Lt].encoding&&(s=Ft[Lt].encoding),!s&&a.codePages&&(s=a.codePages[0]),"string"==typeof s&&(s=a[s]),s)){for(h=!1,o=[],n=0,r=t.length;n>8&&(h=!0);t=o.join("")}for(n=t.length;void 0===h&&0!==n;)t.charCodeAt(n-1)>>8&&(h=!0),n--;if(!h)return t;for(o=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");o.push(c),o.push(l-(c<<8))}return String.fromCharCode.apply(void 0,o)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},me=w.__private__.beginPage=function(t){st[++Rt]=[],Tt[Rt]={objId:0,contentsObjId:0,userUnit:Number(f),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},we(Rt),lt(st[$])},be=function(t,e){var r,i,a;switch(n=e||n,"string"==typeof t&&(r=A(t.toLowerCase()),Array.isArray(r)&&(i=r[0],a=r[1])),Array.isArray(t)&&(i=t[0]*Nt,a=t[1]*Nt),isNaN(i)&&(i=o[0],a=o[1]),(i>14400||a>14400)&&(s.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),i=Math.min(14400,i),a=Math.min(14400,a)),o=[i,a],n.substr(0,1)){case"l":a>i&&(o=[a,i]);break;case"p":i>a&&(o=[a,i])}me(o),Ke(Je),ct(sn),0!==fn&&ct(fn+" J"),0!==dn&&ct(dn+" j"),qt.publish("addPage",{pageNumber:Rt})},ve=function(t){t>0&&t<=Rt&&(st.splice(t,1),Tt.splice(t,1),Rt--,$>Rt&&($=Rt),this.setPage($))},we=function(t){t>0&&t<=Rt&&($=t)},ye=w.__private__.getNumberOfPages=w.getNumberOfPages=function(){return st.length-1},_e=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:Ft[Lt].fontName,e=void 0!==e?e:Ft[Lt].fontStyle,r=t.toLowerCase(),void 0!==It[r]&&void 0!==It[r][e]?i=It[r][e]:void 0!==It[t]&&void 0!==It[t][e]?i=It[t][e]:!1===n.disableWarning&&s.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=It.times[e])&&(i=It.times.normal),i},xe=w.__private__.putInfo=function(){var t=Jt(),e=function(t){return t};for(var n in null!==m&&(e=Ce.encryptor(t,0)),ct("<<"),ct("/Producer ("+ge(e("jsPDF "+R.version))+")"),At)At.hasOwnProperty(n)&&At[n]&&ct("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+ge(e(At[n]))+")");ct("/CreationDate ("+ge(e(W))+")"),ct(">>"),ct("endobj")},Ae=w.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Qt;switch(Jt(),ct("<<"),ct("/Type /Catalog"),ct("/Pages "+e+" 0 R"),gt||(gt="fullwidth"),gt){case"fullwidth":ct("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ct("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ct("/OpenAction [3 0 R /Fit]");break;case"original":ct("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+gt;"%"===n.substr(n.length-1)&&(gt=parseInt(gt)/100),"number"==typeof gt&&ct("/OpenAction [3 0 R /XYZ null null "+D(gt)+"]")}switch(yt||(yt="continuous"),yt){case"continuous":ct("/PageLayout /OneColumn");break;case"single":ct("/PageLayout /SinglePage");break;case"two":case"twoleft":ct("/PageLayout /TwoColumnLeft");break;case"tworight":ct("/PageLayout /TwoColumnRight")}vt&&ct("/PageMode /"+vt),qt.publish("putCatalog"),ct(">>"),ct("endobj")},Le=w.__private__.putTrailer=function(){ct("trailer"),ct("<<"),ct("/Size "+(et+1)),ct("/Root "+et+" 0 R"),ct("/Info "+(et-1)+" 0 R"),null!==m&&ct("/Encrypt "+Ce.oid+" 0 R"),ct("/ID [ <"+V+"> <"+V+"> ]"),ct(">>")},Ne=w.__private__.putHeader=function(){ct("%PDF-"+y),ct("%ºß¬à")},Se=w.__private__.putXRef=function(){var t="0000000000";ct("xref"),ct("0 "+(et+1)),ct("0000000000 65535 f ");for(var e=1;e<=et;e++)"function"==typeof nt[e]?ct((t+nt[e]()).slice(-10)+" 00000 n "):void 0!==nt[e]?ct((t+nt[e]).slice(-10)+" 00000 n "):ct("0000000000 00000 n ")},ke=w.__private__.buildDocument=function(){var t;et=0,it=0,rt=[],nt=[],at=[],Qt=Xt(),te=Xt(),lt(rt),qt.publish("buildDocument"),Ne(),se(),function(){qt.publish("putAdditionalObjects");for(var t=0;t"),ct("/O <"+Ce.toHexString(Ce.O)+">"),ct("/P "+Ce.P),ct(">>"),ct("endobj")),xe(),Ae();var e=it;return Se(),Le(),ct("startxref"),ct(""+e),ct("%%EOF"),lt(st[$]),rt.join("\n")},Pe=w.__private__.getBlob=function(t){return new Blob([ft(t)],{type:"application/pdf"})},Fe=w.output=w.__private__.output=(Zt=function(t,e){switch("string"==typeof(e=e||{})?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return ke();case"save":w.save(e.filename);break;case"arraybuffer":return ft(ke());case"blob":return Pe(ke());case"bloburi":case"bloburl":if(void 0!==i.URL&&"function"==typeof i.URL.createObjectURL)return i.URL&&i.URL.createObjectURL(Pe(ke()))||void 0;s.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",r=ke();try{n=d(r)}catch(m){n=d(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+e.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(i)){var a="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",o=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';e.pdfObjectUrl&&(a=e.pdfObjectUrl,o="");var h='