1"use strict";(globalThis.webpackChunklightbox_block=globalThis.webpackChunklightbox_block||[]).push([[103],{945:(t,e,n)=>{n.r(e),n.d(e,{getPdfFetchUrl:()=>a,renderPdf:()=>i});var o=n(100);let r=!1;const a=t=>{if("string"!=typeof t||""===t)return"";const e=window.lbbPdfViewer?.proxyUrl;if(!e)return t;let n;try{n=new URL(t,window.location.href)}catch(e){return t}return"data:"===n.protocol||n.origin===window.location.origin?t:`${e}?url=${encodeURIComponent(n.href)}`},i=(t,e,n={})=>{if(!t||"string"!=typeof e||""===e)return()=>{};const i=!1!==n.popOut;t.classList.add("is-lbb-sized"),t.parentElement?.classList.add("has-lbb-pdf");const l=(t=>{if(!t)return null;const e="undefined"!=typeof window&&window.innerWidth<=640?t.mobile:"undefined"!=typeof window&&window.innerWidth<=1024?t.tablet:t.desktop,n=Number(e);return Number.isFinite(n)&&n>0?n:null})(n.size);l&&t.style.setProperty("width",`${l}%`,"important"),(()=>{if(r)return;const t=window.lbbPdfViewer?.workerUrl;t&&(o.EA.workerSrc=t),r=!0})();let s=!1,d=null,c=null;t.classList.add("lbbPdfViewer");const b=document.createElement("div");b.className="lbbPdfViewer__root",b.innerHTML=`\n\t\t<div class="lbbPdfViewer__status">${function(){const t=document.createElement("div");return t.textContent="Loadingâ¦",t.innerHTML}()}</div>\n\t\t<div class="lbbPdfViewer__bar">\n\t\t\t<a class="lbbPdfViewer__popout" data-role="popout" href="#" target="_blank" rel="noopener noreferrer" aria-label="Open in new tab" title="Open in new tab">\n\t\t\t\t<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">\n\t\t\t\t\t<path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M14 4h6v6M20 4l-8 8M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>\n\t\t\t\t</svg>\n\t\t\t</a>\n\t\t</div>\n\t\t<div class="lbbPdfViewer__pages"></div>\n\t\t<div class="lbbPdfViewer__toolbar" hidden>\n\t\t\t<button type="button" class="lbbPdfViewer__btn" data-action="prev" aria-label="Previous page">‹</button>\n\t\t\t<span class="lbbPdfViewer__count"><span data-role="current">1</span> / <span data-role="total">?</span></span>\n\t\t\t<button type="button" class="lbbPdfViewer__btn" data-action="next" aria-label="Next page">›</button>\n\t\t\t<span class="lbbPdfViewer__sep"></span>\n\t\t\t<button type="button" class="lbbPdfViewer__btn" data-action="zoomOut" aria-label="Zoom out">−</button>\n\t\t\t<span class="lbbPdfViewer__zoom" data-role="zoom">100%</span>\n\t\t\t<button type="button" class="lbbPdfViewer__btn" data-action="zoomIn" aria-label="Zoom in">+</button>\n\t\t</div>\n\t`;const u=t.querySelector(".lbbPdfViewer__root");u&&u.remove(),t.appendChild(b);const h=()=>{const e=t.closest(".fancybox__container"),n=e?.querySelector(".f-thumbs"),o=n?n.getBoundingClientRect().height:0;b.style.setProperty("--lbb-pdf-toolbar-offset",`${Math.round(o)+12}px`)};h(),requestAnimationFrame(h),setTimeout(h,300);const p=b.querySelector(".lbbPdfViewer__status"),w=b.querySelector(".lbbPdfViewer__pages"),f=b.querySelector(".lbbPdfViewer__toolbar"),m=b.querySelector('[data-role="current"]'),g=b.querySelector('[data-role="total"]'),_=b.querySelector('[data-role="zoom"]'),y=b.querySelector('[data-role="popout"]');y&&(i?y.href=e:(y.closest(".lbbPdfViewer__bar")||y).remove());let P=1;const v=e=>{const n=(w.clientWidth||b.clientWidth||t.clientWidth)-32,o=e.getViewport({scale:1});return n<=0?1:n/o.width},V=async(t,e)=>{if(s||!d)return;const n=await d.getPage(t);if(s)return;const o=window.devicePixelRatio||1,r=n.getViewport({scale:v(n)*P});e.width=Math.floor(r.width*o),e.height=Math.floor(r.height*o),e.style.width=`${Math.floor(r.width)}px`,e.style.height=`${Math.floor(r.height)}px`;const a=e.getContext("2d"),i=1!==o?[o,0,0,o,0,0]:null;c=n.render({canvasContext:a,viewport:r,transform:i});try{await c.promise}catch(t){if("RenderingCancelledException"!==t?.name)throw t}},x=async()=>{if(s||!d)return;w.innerHTML="";const t=[];for(let e=1;e<=d.numPages;e++){const n=document.createElement("div");n.className="lbbPdfViewer__page",n.dataset.page=String(e);const o=document.createElement("canvas");n.appendChild(o),w.appendChild(n),t.push(o)}for(let e=1;e<=d.numPages;e++){if(s)return;await V(e,t[e-1]),1===e&&await new Promise(t=>requestAnimationFrame(t))}},C=t=>
1{const e=w.querySelector(`[data-page="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})},k=async t=>{P=Math.min(3,Math.max(.5,t)),_.textContent=`${Math.round(100*P)}%`,await x()};f.addEventListener("click",t=>{const e=t.target.closest("[data-action]");if(!e)return;const n=parseInt(m.textContent,10)||1;switch(e.dataset.action){case"prev":C(Math.max(1,n-1));break;case"next":C(Math.min(d?.numPages||1,n+1));break;case"zoomIn":k(P+.25);break;case"zoomOut":k(P-.25)}});const L=()=>{if(!d)return;const t=w.querySelectorAll(".lbbPdfViewer__page"),e=w.scrollTop+w.clientHeight/2;for(const n of t)if(n.offsetTop<=e&&n.offsetTop+n.offsetHeight>e){m.textContent=n.dataset.page;break}};w.addEventListener("scroll",L);let M=null;const E=()=>{clearTimeout(M),M=setTimeout(()=>{s||(h(),d&&x())},200)};return window.addEventListener("resize",E),o.YE({url:a(e),withCredentials:!1}).promise.then(async t=>{s?t.destroy():(d=t,g.textContent=String(t.numPages),p.hidden=!0,f.hidden=!1,await x())}).catch(t=>{s||(p.hidden=!1,p.textContent=(t=>{const e=`${t?.name||""} ${t?.message||""}`.toLowerCase();return e.includes("worker")||e.includes("fetch")&&e.includes("dynamically imported")})(t)?"Could not load the PDF viewer. Check that cdnjs.cloudflare.com is reachable.":t?.message?`Could not display this PDF. ${t.message}`:"Could not display this PDF.")}),()=>{if(s=!0,w.removeEventListener("scroll",L),window.removeEventListener("resize",E),clearTimeout(M),b.remove(),t.classList.remove("lbbPdfViewer","is-lbb-sized"),t.style.removeProperty("width"),t.parentElement?.classList.remove("has-lbb-pdf"),c){try{c.cancel()}catch(t){}c=null}d&&(d.destroy(),d=null)}}}}]);
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.