PageSourceSearch

https://www.alphadi.org/bundles/hp-scripts.min.js?v=ZHApbpWBMcSvjokQcwPZYptpuVDzcPqCftH9nsYyTTE

js alphadi.org collected 2026-10-09 22:41:38 UTC 15,320 bytes, 1 lines download raw bytes

1function formatLanguageOption(opt){const option=$(opt.element);if(!option.val())return opt.text;const lang=option.val().split("-")[0];return $(`<span class="language-option"><i class="lang-icon ${lang}"></i> <span class="option-text">${opt.text}</span></span>`)}function floatingAlert(message,type="success",autoRemove=!0,autoRemoveAfterMs=3e3,removeAllPreviousAlerts=!1,animated=!0){if(removeAllPreviousAlerts&&$(".floating-alert-container").empty(),message&&0!=message.length){var element=$('<div style="display:none;" class="floating-alert mb-2 alert alert-'+type+(animated?"  animated":"")+' d-flex justify-content-between align-items-center column-gap-10">'+message+' <a onclick="$(this).parent().remove()">x</a></div>');$(".floating-alert-container").append(element),animated?element.show("fast"):element.show(),autoRemove&&setTimeout(function(){element.hide("fast",function(){element.remove()})},autoRemoveAfterMs)}}document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".nav__item").forEach(function(item){const btn=item.querySelector(".nav__dropdown-trigger");btn&&btn.addEventListener("click",function(e){e.stopPropagation();const isOpen=item.classList.contains("is-open");document.querySelectorAll(".nav__item.is-open").forEach(el=>el.classList.remove("is-open")),isOpen||item.classList.add("is-open")})}),document.addEventListener("click",()=>document.querySelectorAll(".nav__item.is-open").forEach(el=>el.classList.remove("is-open")));const navToggle=document.getElementById("sheetToggle"),navSheet=document.getElementById("navSheet"),sheetOverlay=document.getElementById("sheetOverlay"),sheetClose=document.getElementById("sheetClose"),closeSheet=()=>{navToggle?.classList.remove("is-open"),navSheet?.classList.remove("is-open"),sheetOverlay?.classList.remove("is-open"),document.body.style.overflow=""};navToggle?.addEventListener("click",()=>navSheet?.classList.contains("is-open")?closeSheet():(navToggle?.classList.add("is-open"),navSheet?.classList.add("is-open"),sheetOverlay?.classList.add("is-open"),void(document.body.style.overflow="hidden"))),sheetClose?.addEventListener("click",closeSheet),sheetOverlay?.addEventListener("click",closeSheet),navSheet?.querySelectorAll("a").forEach(a=>a.addEventListener("click",closeSheet)),document.querySelectorAll(".nav__sheet-group-trigger").forEach(btn=>{btn.addEventListener("click",function(){const sub=btn.nextElementSibling;if(!sub)return;const isOpen=sub.classList.contains("is-open");sub.classList.toggle("is-open",!isOpen),btn.classList.toggle("is-open",!isOpen)})});const animEls=document.querySelectorAll(".fade-up, .fade-in");if(animEls.length){const obs=new IntersectionObserver(entries=>entries.forEach(e=>{e.isIntersecting&&(e.target.classList.add("is-visible"),obs.unobserve(e.target))}),{threshold:.1,rootMargin:"0px 0px -40px 0px"});animEls.forEach(el=>obs.observe(el))}const mockupImages=document.querySelector(".mockup-images");if(mockupImages){const mObs=new IntersectionObserver(([entry])=>{entry.isIntersecting&&(mockupImages.classList.add("is-visible"),mObs.unobserve(mockupImages))},{threshold:.2});mObs.observe(mockupImages)}document.querySelectorAll("[data-count]").forEach(el=>{const cObs=new IntersectionObserver(entries=>{entries.forEach(e=>{if(!e.isIntersecting)return;const target=parseInt(el.dataset.count,10),suffix=el.dataset.suffix||"",start=performance.now(),tick=now=>{const p=Math.min((now-start)/1800,1);el.textContent=Math.round((1-Math.pow(1-p,3))*target)+suffix,p<1&&requestAnimationFrame(tick)};requestAnimationFrame(tick),cObs.unobserve(el)})},{threshold:.5});cObs.observe(el)}),document.querySelectorAll(".chart-fill[data-width]").forEach(el=>{const bObs=new IntersectionObserver(entries=>{entries.forEach(e=>{e.isIntersecting&&(el.style.width=el.dataset.width,bObs.unobserve(el))})},{threshold:.3});bObs.observe(el)}),document.querySelectorAll(".accordion__trigger").forEach(trigger=>{trigger.addEventListener("click",()=>{const item=trigger.closest(".accordion__item"),isOpen=item.classList.contains("is-open");document.querySelectorAll(".accordion__item.is-open").forEach(i=>
1i.classList.remove("is-open")),isOpen||item.classList.add("is-open")})}),document.querySelectorAll(".lang-switch").forEach(ls=>{const btn=ls.querySelector(".lang-switch__btn");btn?.addEventListener("click",e=>{e.stopPropagation(),ls.classList.toggle("is-open")})}),document.addEventListener("click",()=>document.querySelectorAll(".lang-switch").forEach(ls=>ls.classList.remove("is-open")));const currentPath=window.location.pathname.replace(/\/$/,"");document.querySelectorAll(".nav__link").forEach(link=>{const href=link.getAttribute("href")?.replace(/\/$/,"");href&&""!==href&&currentPath.endsWith(href)&&link.classList.add("is-active")}),document.querySelectorAll(".alphadi-alert .alert-close").forEach(btn=>{btn.addEventListener("click",()=>btn.closest(".alphadi-alert").remove())}),document.querySelectorAll(".alphadi-alert[data-auto-dismiss]").forEach(el=>{setTimeout(()=>{el.style.opacity="0",el.style.transform="translateY(-10px)",setTimeout(()=>el.remove(),400)},6e3)});let cartState={};try{cartState=JSON.parse(localStorage.getItem("alphadi-cart")||"{}")}catch(e){cartState={}}const saveCart=()=>localStorage.setItem("alphadi-cart",JSON.stringify(cartState)),updateBadges=()=>{const n=Object.values(cartState).reduce((s,v)=>s+v.qty,0);document.querySelectorAll(".cart-badge").forEach(b=>{b.textContent=n,b.classList.toggle("has-items",n>0)})},renderCartBody=()=>{const body=document.getElementById("cartBody"),foot=document.getElementById("cartFoot");if(!body)return;const entries=Object.entries(cartState).filter(([,v])=>v.qty>0);if(!entries.length)return body.innerHTML=`<div class="cart-empty">\n        <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z"/><line x1="3" y1="6" x2="21" y2="6"/><path d="M16 10a4 4 0 01-8 0"/></svg>\n        <p>${cartEmptyLabel}</p></div>`,void(foot&&(foot.style.display="none"));foot&&(foot.style.display=""),body.innerHTML=entries.map(([id,v])=>{const lineTotal=window.formatPrice(v.price*v.qty),unitDisplay=v.price<0?`<span style="color:#28a745;">${window.formatPrice(v.price)}</span>`:`${window.formatPrice(v.price)}`,coverHtml=v.image?`<img src="${v.image}" alt="${v.name}" style="width:100%;height:100%;object-fit:cover;display:block;">`:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,.4)" stroke-width="1.5"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>',isBooking="training"===v.type||"event"===v.type,qtyHtml=isBooking?`<span class="cart-item__qty-fixed" style="font-size:.8rem;color:var(--c-mid);">1 ${cartUnitLabel}</span>`:`<div class="cart-item__qty">\n              <button data-action="dec" data-id="${id}">&#8722;</button>\n              <span class="cart-item__qty-num">${v.qty}</span>\n              <button data-action="inc" data-id="${id}">+</button>\n            </div>`,participantName=v.participant?v.participant.name||`${v.participant.firstName||""} ${v.participant.lastName||""}`.trim():"",participantHtml=isBooking&&participantName?`<div class="cart-item__meta" style="font-size:.75rem;color:var(--c-subtle);margin-top:.15rem;">\n             ${participantName}${v.participant.company?" · "+v.participant.company:""}\n           </div>`:"";return`<div class="cart-item">\n        <div class="cart-item__cover" style="background:var(--c-dark);display:flex;align-items:center;justify-content:center;overflow:hidden;">\n          ${coverHtml}\n        </div>\n        <div class="cart-item__info">\n          <div class="cart-item__name">${v.name}</div>\n          ${v.format?`<div class="cart-item__meta">${v.format}</div>`:""}\n          ${participantHtml}\n          <div class="cart-item__unit-price">${unitDisplay} / ${cartUnitLabel}</div>\n          <div class="cart-item__actions">\n            ${qtyHtml}\n            <button class="cart-item__remove" data-action="remove" data-id="${id}">${cartRemoveLabel}</button>\n          </div>\n        </div>\n        <div class="cart-item__price">${lineTotal}</div>\n      </div>`}).join("");
1const tot=document.getElementById("cartTotal");tot&&(tot.textContent=window.formatPrice(Object.values(cartState).reduce((s,v)=>s+v.price*v.qty,0)))},cartEmptyLabel=document.getElementById("cartDrawer")?.dataset.labelEmpty||"Your cart is empty.",cartRemoveLabel=document.getElementById("cartDrawer")?.dataset.labelRemove||"Remove",cartUnitLabel=(document.getElementById("cartDrawer")?.dataset.labelOrder,document.getElementById("cartDrawer")?.dataset.labelContinue,document.getElementById("cartDrawer")?.dataset.labelUnit||"unit"),cartRequiredLabel=document.getElementById("cartDrawer")?.dataset.labelRequired||"This option is required.",openCart=()=>{document.getElementById("cartOverlay")?.classList.add("is-open"),document.getElementById("cartDrawer")?.classList.add("is-open"),document.body.style.overflow="hidden",renderCartBody()},closeCart=()=>{document.getElementById("cartOverlay")?.classList.remove("is-open"),document.getElementById("cartDrawer")?.classList.remove("is-open"),document.body.style.overflow=""},cartKey=(id,format)=>{const suffix=(format||"").trim();return suffix?`${id}__${suffix}`:id},addToCart=(id,name,price,format,image,type,isShippable)=>{const key=cartKey(id,format);cartState[key]?cartState[key].qty+=1:cartState[key]={name:name,price:parseFloat(price)||0,format:format||"",qty:1,image:image||"",type:type||"",isShippable:!!isShippable},saveCart(),updateBadges(),openCart()};window.alphadiAddProductToCart=function(data){addToCart(data.id,data.name,data.price,data.format||"",data.image||"","product",!!data.isShippable)},window.alphadiAddBookingToCart=function(data,participant){const key=`${cartKey(data.id,data.format)}__p${Date.now()}${Math.floor(1e3*Math.random())}`;cartState[key]={name:data.name,price:parseFloat(data.price)||0,format:data.format||"",qty:1,image:data.image||"",type:data.type||"",participant:{firstName:participant?.firstName||"",lastName:participant?.lastName||"",name:participant?.name||"",company:participant?.company||"",email:participant?.email||"",phone:participant?.phone||"",notes:participant?.notes||""}},saveCart(),updateBadges(),openCart()},document.getElementById("cartBody")?.addEventListener("click",e=>{const btn=e.target.closest("[data-action]");if(!btn)return;const{action:action,id:id}=btn.dataset;"inc"===action?cartState[id]&&(cartState[id].qty+=1):"dec"===action?cartState[id]&&(cartState[id].qty=Math.max(0,cartState[id].qty-1),0===cartState[id].qty&&delete cartState[id]):"remove"===action&&delete cartState[id],saveCart(),updateBadges(),renderCartBody()}),document.getElementById("cartClose")?.addEventListener("click",closeCart),document.getElementById("cartContinue")?.addEventListener("click",closeCart),document.getElementById("cartOverlay")?.addEventListener("click",closeCart),document.querySelectorAll(".cart-btn").forEach(b=>b.addEventListener("click",openCart)),document.querySelectorAll(".product-configurator").forEach(configurator=>{const basePrice=parseFloat(configurator.dataset.basePrice)||0,productId=configurator.dataset.productId,productName=configurator.dataset.productName,cartFormat=configurator.dataset.cartFormat||"",livePrice=configurator.querySelector(".product-live-price"),selected={};configurator.querySelectorAll(".product-option.is-selected").forEach(btn=>{const fi=btn.dataset.featureIndex;selected[fi]={name:btn.dataset.optionName,price:parseFloat(btn.dataset.optionPrice)||0}});const recalcPrice=()=>{const delta=Object.values(selected).reduce((s,v)=>s+v.price,0),total=Math.max(0,basePrice+delta);if(livePrice){livePrice.textContent=window.formatPrice(total);const origEl=livePrice.closest(".product-configurator")?.querySelector(".product-original-price");origEl&&(delta<0?(origEl.textContent=window.formatPrice(basePrice),origEl.style.display=""):origEl.style.display="none")}return total};configurator.addEventListener("click",e=>{const btn=e.target.closest(".product-option");if(!btn)return;const fi=btn.dataset.featureIndex,group=btn.closest(".product-feature-group");group?.querySelectorAll(".product-option").forEach(b=>b.classList.remove("is-selected","is-error")),btn.classList.add("is-selected"),selected[fi]={n
1ame:btn.dataset.optionName,price:parseFloat(btn.dataset.optionPrice)||0};const errEl=group?.querySelector(".product-feature-error");errEl&&(errEl.textContent=""),recalcPrice()});const atcBtn=configurator.querySelector(".product-atc-btn");atcBtn?.addEventListener("click",()=>{if(!(()=>{let valid=!0;return configurator.querySelectorAll('.product-feature-group[data-feature-required="true"]').forEach(group=>{const fi=group.dataset.featureIndex,errEl=group.querySelector(".product-feature-error");selected[fi]?(errEl&&(errEl.textContent=""),group.querySelectorAll(".product-option").forEach(b=>b.classList.remove("is-error"))):(errEl&&(errEl.textContent=cartRequiredLabel),group.querySelectorAll(".product-option").forEach(b=>b.classList.add("is-error")),valid=!1)}),valid})())return;const finalPrice=recalcPrice(),finalFormat=(()=>{const parts=Object.values(selected).map(v=>v.name).filter(Boolean);return parts.length>0?parts.join(", "):cartFormat})();addToCart(productId,productName,finalPrice,finalFormat,configurator.dataset.cartImage||"")}),recalcPrice()}),document.querySelectorAll("[data-add-to-cart]").forEach(btn=>{btn.addEventListener("click",e=>{e.preventDefault(),addToCart(btn.dataset.addToCart,btn.dataset.cartName||btn.dataset.addToCart,btn.dataset.cartPrice||"0",btn.dataset.cartFormat||"",btn.dataset.cartImage||"",btn.dataset.cartType||"")})}),updateBadges()}),function(){"use strict";var PHONE_STRIP=/[^0-9+\s()\-./]/g;function clean(el){var current=el.value,next=window.alphadiSanitizePhone(current,el.hasAttribute("data-phone-digits-only"));next!==current&&(el.value=next,el.dispatchEvent(new Event("change",{bubbles:!0})))}function cleanAll(){document.querySelectorAll('input[type="tel"]:not([data-phone-format="false"])').forEach(clean)}window.alphadiIsPhone=window.alphadiIsPhone||function(value){return/^\+?[0-9][0-9\s()\-./]{4,24}$/.test((value||"").trim())},window.alphadiSanitizePhone=window.alphadiSanitizePhone||function(value,digitsOnly){var v=null==value?"":String(value),digits=v.replace(/[^0-9]/g,"");if(digitsOnly)return digits;var hasPlus="+"===v.charAt(0);return v=v.replace(PHONE_STRIP,"").replace(/\s{2,}/g," ").trim(),hasPlus&&"+"!==v.charAt(0)&&(v="+"+v),v},document.addEventListener("input",function(e){var el=e.target;el&&"INPUT"===el.tagName&&"tel"===el.type&&"false"!==el.dataset.phoneFormat&&clean(el)}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",cleanAll):cleanAll()}(),$(document).ready(function(){$(".language-selector").select2({templateResult:formatLanguageOption,templateSelection:formatLanguageOption,minimumResultsForSearch:-1}),$("#LanguageSwitcher").change(function(e){$("form#selectLanguage").submit()})}),window.addEventListener("beforeunload",function(event){$("body").addClass("loading"),setTimeout(function(){$("body").removeClass("loading")},3e3)}),document.addEventListener("DOMContentLoaded",function(event){$("body").removeClass("loading")});

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