1!function(){class e{constructor(e={}){this.options={progressSelector:".p-top-loading__progress",coverSelector:".p-top-loading",minLoadingDuration:500,debug:!1,waitForElementOnRevisit:null,waitForContentOnRevisit:!1,iframeTimeout:1e4,videoSelector:".p-top-loading video",topPagePaths:["/","/index.html"],expirationDays:7,cookieName:"visitData",...e},this.progress=document.querySelector(this.options.progressSelector),this.cover=document.querySelector(this.options.coverSelector),this.loadingTasks=[],this.loadingComplete=!1,this.startTime=null,this.finishTimeout=null,this.progressAnimationFrame=null,this.video=document.querySelector(this.options.videoSelector),this.currentProgress=0,this.targetProgress=0,this.videoStartTime=null,this.log("Loading class initialized"),this.logVideoState("constructor"),this.bindVideoDebugEvents(),this.observeLoadingCoverState(),document.body.classList.add("is-reveal-wait"),this.shouldSkipLoading()?this.handleExistingSession():this.handleNewSession()}shouldSkipLoading(){if(this.options.debug)return this.log("shouldSkipLoading: false because debug mode is enabled"),!1;const e=this.getVisitData(),t=e&&!this.isExpired(e.timestamp)||!this.isTopPage();return this.log(`shouldSkipLoading: ${t}, isTopPage: ${this.isTopPage()}, hasVisitData: ${!!e}`),t}isTopPage(){return this.options.topPagePaths.includes(location.pathname)}getVisitData(){const e=document.cookie.split("; ").find((e=>e.startsWith(`${this.options.cookieName}=`)));if(!e)return null;try{return JSON.parse(decodeURIComponent(e.split("=").slice(1).join("=")))}catch(e){return this.log(`Failed to parse visit cookie: ${e}`),null}}setVisitData(){const e={visited:!0,timestamp:Date.now()},t=24*this.options.expirationDays*60*60,i="https:"===location.protocol?"; Secure":"";document.cookie=`${this.options.cookieName}=${encodeURIComponent(JSON.stringify(e))}; Max-Age=${t}; Path=/; SameSite=Lax${i}`}isExpired(e){return Date.now()-e>24*this.options.expirationDays*60*60*1e3}queueAddLoadedClass(e,t){const i=this.getRevealWrapper();let o=!1;const s=()=>{o||(o=!0,i.removeEventListener("transitionend",a),this.resetWrapperReveal(i),e&&this.log(e),"function"==typeof t&&t())},a=e=>{e.target===i&&"opacity"===e.propertyName&&s()};setTimeout((()=>{requestAnimationFrame((()=>{this.prepareWrapperReveal(i),requestAnimationFrame((()=>{this.startWrapperReveal(i),i.addEventListener("transitionend",a),requestAnimationFrame((()=>{document.body.classList.add("is-loaded"),i.style.opacity="1",document.body.classList.remove("is-reveal-wait")})),setTimeout(s,950)}))}))}),0)}getRevealWrapper(){return document.getElementById("wrapper")||document.body}prepareWrapperReveal(e){document.body.classList.remove("is-loaded"),document.body.classList.add("is-reveal-preparing"),e.style.setProperty("transition","none","important"),e.style.setProperty("opacity","0.01","important"),e.offsetHeight}startWrapperReveal(e){e.style.setProperty("transition","opacity 0.7s cubic-bezier(0.43, 0.05, 0.17, 1)"),e.style.setProperty("opacity","0.01"),document.body.classList.remove("is-reveal-preparing"),e.offsetHeight}resetWrapperReveal(e){e.style.opacity="",e.style.transition="",document.body.classList.remove("is-reveal-preparing")}waitForRealTypeSettled(e=180){return this.waitForNextPaint().then((()=>this.waitForTimeout(e))).then((()=>this.waitForNextPaint()))}getRevealTasks(){return this.isTopPage()?[()=>this.waitForInitialViewReady(),()=>this.waitForAppReady()]:[()=>this.waitForRealTypeReady(),()=>this.waitForFontsReady(),()=>this.waitForAppReady(),()=>this.waitForMainThreadReady(),()=>this.waitForNextPaint()]}handleExistingSession(){this.log("Handling existing user or non-top page"),this.removeCoverElement();const e=[...this.loadingTasks,...this.getRevealTasks()];Promise.all(e.map((e=>e()))).then((()=>{this.queueAddLoadedClass('All tasks completed, body class "is-loaded" added')})).catch((e=>{this.log(`Error in loading tasks: ${e}`),this.queueAddLoadedClass()})),this.isTopPage()&&(this.setVisitData(),this.log("Visit data updated for existing session"))}removeCoverElement(){this.options.debug?this.log("Debug mode enabled, keeping loading cover element"):this.cover&&setTimeout((()=>{this.cover.remove()}),5e3)}finishCoverFadeOut(){setTimeout((()=>{requestAnimationFrame((()=>{const e=document.getElementById("wrapper")||document.body,t=this.cover;let i=!1;const o=()=>{i||(i=!0,t&&t.removeEventListener("transitionend",s),document.body.classList.remove("is-loading"),document.body.classList.remove("is-reveal-wait"),t&&!this.options.debug?t.remove():this.removeCoverElement(),this.log("Loading finished"))},s=e=>{e.target===t&&"opacity"===e.propertyName&&o()};if(e.offsetHeight,!t)return document.body.classList.add("is-loaded"),document.body.classList.remove("is-reveal-wait"),void o();t.style.visibility="visible",t.style.pointerEvents="none",t.style.transition="opacity 0.75s cubic-bezier(.39,.575,.565,1)",t.style.opacity="1",t.offsetHeight,t.addEventListener("transitionend",s),requestAnimationFrame((()=>{document.body.classList.add("is-loaded"),t.style.opacity="0",document.body.classList.remove("is-reveal-wait"),this.log('Body class changed from "is-loading" to "is-loaded"'),setTimeout(o,1e3)}))}
1))}),0)}waitForTimeout(e){return new Promise((t=>{setTimeout(t,e)}))}waitForNextPaint(){return new Promise((e=>{requestAnimationFrame((()=>{requestAnimationFrame(e)}))}))}waitForMainThreadReady(e=1500){return new Promise((t=>{"requestIdleCallback"in window?window.requestIdleCallback((()=>t()),{timeout:e}):setTimeout(t,120)}))}waitForVideoReady(e,t=3e3){return!e||e.readyState>=2?Promise.resolve():new Promise((i=>{let o=!1;const s=()=>{o||(o=!0,clearTimeout(r),a.forEach((t=>{e.removeEventListener(t,s)})),i())},a=["loadeddata","canplay","playing","error"],r=setTimeout(s,t);a.forEach((t=>{e.addEventListener(t,s,{once:!0})})),e.preload="auto",e.load()}))}waitForTopStylesReady(e=1500){const t=document.querySelector(".p-top-main"),i=document.querySelector(".p-top-fv");return t||i?new Promise((o=>{const s=Date.now(),a=e=>{if(!e)return!1;const t=getComputedStyle(e).backgroundColor;return t&&"rgba(0, 0, 0, 0)"!==t&&"transparent"!==t},r=()=>{a(t)||a(i)||Date.now()-s>=e?o():requestAnimationFrame(r)};r()})):Promise.resolve()}waitForFontsReady(e=1500){return document.fonts&&document.fonts.ready?Promise.race([document.fonts.ready.catch((()=>{})),this.waitForTimeout(e)]):Promise.resolve()}waitForRealTypeReady(e=5e3){return window.__quoitworksRealTypeReady||(window.__quoitworksRealTypeReady=new Promise((t=>{const i=Date.now(),o=()=>{this.waitForRealTypeSettled().then(t)},s=()=>{if(window.RT&&"function"==typeof window.RT.start){let t=!1;const i=()=>{t||(t=!0,o())};try{window.RT.start((e=>{this.log(`RealType error: ${e}`)}),i),setTimeout(i,e)}catch(e){this.log(`RealType start failed: ${e}`),i()}}else{if(Date.now()-i>=e)return this.log("RealType wait timed out"),void o();setTimeout(s,50)}};s()}))),window.__quoitworksRealTypeReady}waitForAppReady(e=5e3){return window.__quoitworksAppReady?Promise.resolve():new Promise((t=>{let i=!1;const o=()=>{i||(i=!0,clearTimeout(s),window.removeEventListener("quoitworks:app-ready",o),t())},s=setTimeout(o,e);window.addEventListener("quoitworks:app-ready",o,{once:!0})}))}waitForInitialViewReady(){if(!this.isTopPage())return Promise.resolve();const e=document.querySelector(".js-fvVideo");return Promise.all([this.waitForTopStylesReady(),this.waitForVideoReady(e),this.waitForRealTypeReady(),this.waitForFontsReady(),this.waitForMainThreadReady()]).then((()=>this.waitForNextPaint()))}checkElementAndFinish(e){const t=document.querySelectorAll(e);this.log(`Checking for elements: ${e}, found: ${t.length}`),t.length>0&&this.options.waitForContentOnRevisit?Promise.all(Array.from(t).map((e=>this.waitForElement(e)))).then((()=>this.finishLoading())):this.finishLoading()}handleNewSession(){if(!this.isTopPage())return this.log("Not top page, skipping loading animation"),this.removeCoverElement(),void this.queueAddLoadedClass();this.log("Handling new or expired session on top page"),this.loadingTasks.push((()=>this.waitForInitialViewReady())),document.body.classList.add("is-loading"),this.log('Body class "is-loading" added'),this.logVideoState("after body.is-loading added"),this.video?this.waitForVideoStart():this.startTimer()}waitForVideoStart(){this.log("Waiting for video to start"),this.logVideoState("waitForVideoStart entry"),this.video.muted=!0,this.video.playsInline=!0,this.video.preload="auto";let e=!1;const t=()=>{this.startTime||(this.videoStartTime=Date.now(),this.startTimer())},i=()=>!this.video.paused&&this.video.readyState>=2?Promise.resolve():new Promise((e=>{this.video.addEventListener("playing",e,{once:!0})})),o=()=>{this.startTime||e||setTimeout(a,250)},s=setTimeout((()=>{this.startTime||(e=!0,this.log("Video start timed out - Starting timer without video"),t())}),1e4),a=()=>{e||this.startTime||(this.logVideoState("before play"),this.video.play().then((()=>{i().then((()=>{e||this.startTime||(clearTimeout(s),this.log("Video started playing - Timer start"),this.logVideoState("play promise resolved"),t())}))})).catch((e=>
1{this.log(`Video autoplay failed: ${e} - Retrying video playback`),o()})))};this.video.addEventListener("error",(()=>{e||this.startTime||(this.log("Video load error - Retrying video load"),this.video.load(),o())})),this.video.readyState>=2?(this.log("Video readyState >= 2, starting after current data is available"),a()):(this.log("Video readyState < 2, waiting for loadeddata"),this.video.addEventListener("loadeddata",a,{once:!0}),this.video.load())}startTimer(){this.startTime=Date.now(),this.log(`Timer started at ${this.startTime}`),this.updateProgress(),this.executeLoadingTasks()}updateProgress(){const e=()=>{if(!this.startTime)return void(this.progressAnimationFrame=requestAnimationFrame(e));const t=Date.now()-this.startTime;Math.floor(t/1e3)>Math.floor((t-16)/1e3)&&this.log(`Timer: ${(t/1e3).toFixed(1)}s`);const i=this.video?Math.max(this.options.minLoadingDuration,t):this.options.minLoadingDuration,o=Math.min(t/i,1);this.targetProgress=this.loadingComplete?1:.98*o;const s=this.loadingComplete?.1:.05;if(this.currentProgress+=(this.targetProgress-this.currentProgress)*s,this.progress){const e=Math.min(Math.round(100*this.currentProgress),100);this.progress.style.scale=`${e}% 100%`}const a=this.videoStartTime?Date.now()-this.videoStartTime:0,r=!this.video||a>=this.options.minLoadingDuration;if(this.loadingComplete&&this.currentProgress>=.995&&r){this.progress&&(this.progress.style.scale="100% 100%"),cancelAnimationFrame(this.progressAnimationFrame);const e=Date.now()-this.startTime;this.log(`Final loading time: ${(e/1e3).toFixed(1)}s`),this.completeLoading()}else this.progressAnimationFrame=requestAnimationFrame(e)};this.progressAnimationFrame=requestAnimationFrame(e)}addLoadingTask(e){this.shouldSkipLoading()?e():("function"==typeof e?this.loadingTasks.push(e):e instanceof Promise?this.loadingTasks.push((()=>e)):console.warn("Invalid loading task. Must be a function or a Promise."),this.log(`Loading task added. Total tasks: ${this.loadingTasks.length}`))}executeLoadingTasks(){Promise.all(this.loadingTasks.map((e=>e()))).then((()=>{this.loadingComplete=!0,this.log("All loading tasks completed"),this.checkAndFinishLoading()})).catch((e=>{this.log(`Error in loading tasks: ${e}`),this.loadingComplete=!0,this.checkAndFinishLoading()}))}checkAndFinishLoading(){if(!this.startTime)return void this.log("Start time not set yet, cannot finish loading");if(this.video&&this.videoStartTime){const e=Date.now()-this.videoStartTime,t=(e/1e3).toFixed(1);if(this.log(`Current video playing time: ${t}s / ${this.options.minLoadingDuration/1e3}s`),e<this.options.minLoadingDuration){const t=this.options.minLoadingDuration-e,i=(t/1e3).toFixed(1);return this.log(`Waiting additional ${i}s for video minimum duration`),this.finishTimeout&&clearTimeout(this.finishTimeout),void(this.finishTimeout=setTimeout((()=>{this.checkAndFinishLoading()}),t))}}if(this.log(`Loading tasks completed: ${this.loadingComplete}`),!this.loadingComplete)return;const e=Date.now()-(this.videoStartTime||this.startTime);this.log(`Total loading time: ${(e/1e3).toFixed(1)}s`),this.finishLoading()}completeLoading(){this.finishCoverFadeOut()}finishLoading(){this.log("Finishing loading"),this.finishTimeout&&clearTimeout(this.finishTimeout),this.loadingComplete=!0,this.isTopPage()&&(this.setVisitData(),this.log("Visit cookie updated with visit data and timestamp"))}waitForElement(e){return e instanceof HTMLIFrameElement?this.waitForIframe(e):this.waitForImagesAndVideos(e)}waitForImagesAndVideos(e){return new Promise((t=>{const i=Array.from(e.getElementsByTagName("img")),o=Array.from(e.getElementsByTagName("video")),s=i.length+o.length;let a=0;const r=()=>{a++,a===s&&t()};i.forEach((e=>{e.complete?r():(e.onload=r,e.onerror=r)})),o.forEach((e=>{e.readyState>=4?r():(e.oncanplaythrough=r,e.onerror=r)})),0===s&&t()}))}waitForIframe(e){return new Promise((t=>{const i=setTimeout((()=>{this.log(`Iframe load timed out: ${e.src}`),t()}),this.options.iframeTimeout);e.contentDocument&&"complete"===e.contentDocument.readyState?(clearTimeout(i),this.log(`Iframe already loaded: ${e.src}`),t()):(e.onload=()=>{clearTimeout(i),this.log(`Iframe loaded: ${e.src}`),t()},e.onerror=()=>{clearTimeout(i),this.log(`Iframe load error: ${e.src}`),t()})}))}
1log(e){this.options.debug&&console.log(`[Loading] ${e}`)}bindVideoDebugEvents(){if(!this.options.debug||!this.video)return;let e=this.video.currentTime;["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","ended","seeking","seeked","waiting","stalled","suspend","error"].forEach((t=>{this.video.addEventListener(t,(()=>{this.logVideoState(`video event: ${t}`),this.video.currentTime<e-.05&&this.log(`currentTime moved backward: ${e.toFixed(3)} -> ${this.video.currentTime.toFixed(3)}`),e=this.video.currentTime}))})),this.video.addEventListener("timeupdate",(()=>{this.video.currentTime<e-.05&&this.log(`currentTime moved backward on timeupdate: ${e.toFixed(3)} -> ${this.video.currentTime.toFixed(3)}`),e=this.video.currentTime}))}logVideoState(e){if(!this.options.debug||!this.video)return;const t=Number.isFinite(this.video.duration)?this.video.duration.toFixed(3):String(this.video.duration),i=this.video.error?`code=${this.video.error.code}, message=${this.video.error.message||""}`:"none";this.log(`${e}: currentTime=${this.video.currentTime.toFixed(3)}, duration=${t}, readyState=${this.video.readyState}, networkState=${this.video.networkState}, paused=${this.video.paused}, ended=${this.video.ended}, src=${this.video.getAttribute("src")||""}, currentSrc=${this.video.currentSrc||""}, error=${i}`)}observeLoadingCoverState(){if(!this.options.debug||!this.cover)return;const e=new MutationObserver((()=>{this.logCoverState("cover mutation")}));e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),e.observe(this.cover,{attributes:!0,attributeFilter:["class","style"]})}logCoverState(e){if(!this.options.debug||!this.cover)return;const t=getComputedStyle(this.cover);this.log(`${e}: bodyClass="${document.body.className}", cover opacity=${t.opacity}, visibility=${t.visibility}, display=${t.display}`)}}window.addEventListener("DOMContentLoaded",(()=>{new e({minLoadingDuration:1500,debug:!1,waitForElementOnRevisit:".c-service-fv,.c-image-fv-img",waitForContentOnRevisit:!0})}))}();
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.