1(()=>{"use strict";const e={n:t=>{const i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.element;function i(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=i(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}const s=function(){for(var e,t,s=0,n="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n},n=(0,t.createContext)(null);class r{static instance=null;constructor(){if(r.instance)return r.instance;r.instance=this}static getInstance(){return r.instance||(r.instance=new r),r.instance}apply(e,t){t&&"big-cursor"!==t.value&&("mask"===t.value&&this.applyCursorMask(),"guideline"===t.value&&this.applyCursorGuideline())}remove(){const e=document.getElementById("wap-cursor-mask"),t=document.getElementById("wap-cursor-outline");e&&e.remove(),t&&t.remove();const i=document.getElementById("wap-cursor-guideline");i&&i.remove(),document.removeEventListener("mousemove",this.updateMaskCursor),document.removeEventListener("mousemove",this.updateGuidelineCursor),this.maskOutlineElement=null,this.maskHalfHeight=null}applyCursorMask(){if(document.getElementById("wap-cursor-mask"))return;const e=document.createElement("div");e.id="wap-cursor-mask",e.style.setProperty("--mask-height","300px"),e.style.setProperty("--half-mask-height","150px"),Object.assign(e.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",pointerEvents:"none",backgroundColor:"rgba(0, 0, 0, 0.7)",maskImage:"linear-gradient(to bottom,\n black 0,\n black calc(var(--y, 50%) - var(--half-mask-height)),\n transparent calc(var(--y, 50%) - var(--half-mask-height)),\n transparent calc(var(--y, 50%) + var(--half-mask-height)),\n black calc(var(--y, 50%) + var(--half-mask-height)),\n black 100%)",WebkitMaskImage:"linear-gradient(to bottom,\n black 0,\n black calc(var(--y, 50%) - var(--half-mask-height)),\n transparent calc(var(--y, 50%) - var(--half-mask-height)),\n transparent calc(var(--y, 50%) + var(--half-mask-height)),\n black calc(var(--y, 50%) + var(--half-mask-height)),\n black 100%)",zIndex:"999999"});const t=document.createElement("div");t.id="wap-cursor-outline",Object.assign(t.style,{position:"fixed",left:"0",width:"100vw",height:"300px",pointerEvents:"none",borderTop:"3px solid yellow",borderBottom:"3px solid yellow",boxSizing:"border-box",zIndex:"999999"}),document.body.appendChild(e),document.body.appendChild(t),this.maskOutlineElement=t,this.maskHalfHeight=150,document.addEventListener("mousemove",this.updateMaskCursor)}updateMaskCursor=e=>{const t=document.getElementById("wap-cursor-mask"),i=this.maskOutlineElement,s=this.maskHalfHeight;if(t&&t.style.setProperty("--y",`${e.clientY}px`),i){const t=Math.max(0,Math.min(window.innerHeight-2*s,e.clientY-s));i.style.top=`${t}px`}};applyCursorGuideline(){if(document.getElementById("wap-cursor-guideline"))return;const e=document.createElement("div");e.id="wap-cursor-guideline",Object.assign(e.style,{position:"fixed",left:"0",top:"0",width:"45vw",height:"10px",backgroundColor:"#000",outline:"2px solid yellow",borderRadius:"2px",pointerEvents:"none",zIndex:"999999",transition:"top 0.02s linear, left 0.02s linear"}),document.body.appendChild(e),document.addEventListener("mousemove",this.updateGuidelineCursor)}updateGuidelineCursor=e=>{const t=document.getElementById("wap-cursor-guideline");if(!t)return;const i=t.offsetWidth,s=window.innerWidth;let n=e.clientX-i/2;n<0&&(n=0),n+i>s&&(n=s-i);const r=e.clientY-15;t.style.left=`${n}px`,t.style.top=`${r}px`}}const o=()=>r.getInstance(),a=/^[A-Za-z][A-Za-z'â-]{0,63}$/,c="Looking upâ¦";class l{constructor(){this.popup=null,this.popupAnchor=null,this.currentWord="",this.entries=[],this.entryIndex=0,this.pendingSpeakTimer=null,this.keepAliveTimer=null,this.isReading=!1,this.isActive=!1,this.clickHandler=this.handleOutsideClick.bind(this),this.dblClickHandler=this.handleDoubleClick.bind(this)}handleDoubleClick(e){if(e.target instanceof Node&&this.popup?.contains(e.target))return;const t=document.querySelector(".wap-preset__preview-drawer-root");
1if(t?.contains(e.target))return;this.removePopup(),document.querySelectorAll(".wap-dictionary-popup").forEach(e=>e.remove());const i=window.getSelection(),s=i.toString().trim();if(s&&a.test(s)){this.currentWord=s;const e=i.getRangeAt(0).getBoundingClientRect();this.showPopup(e.left+window.scrollX,e.top+window.scrollY-25)}}apply(){this.isActive||(this.isActive=!0,document.addEventListener("dblclick",this.dblClickHandler))}remove(){this.isActive=!1,this.removePopup(),document.removeEventListener("dblclick",this.dblClickHandler)}showPopup(e,t){this.removePopup();const i=this.currentWord;this.popupAnchor={x:e,y:t},this.entries=[],this.entryIndex=0,this.popup=document.createElement("div"),this.popup.className="wap-dictionary-popup";const s=document.createElement("div");s.className="wap-dictionary-card";const n=document.createElement("button");n.className="wap-dictionary-close",n.type="button",n.setAttribute("aria-label","Close"),n.appendChild(this.icon("close"));const r=document.createElement("form");r.className="wap-dictionary-search";const o=document.createElement("input");o.className="wap-dictionary-input",o.type="text",o.value=i,o.setAttribute("aria-label","Look up a word");const a=document.createElement("button");a.className="wap-dictionary-search-btn",a.type="submit",a.setAttribute("aria-label","Search"),a.appendChild(this.icon("search")),r.appendChild(o),r.appendChild(a);const l=document.createElement("p");l.className="wap-dictionary-body";const u=document.createElement("strong");u.className="wap-dictionary-term";const d=document.createElement("span");d.className="wap-dictionary-text",d.textContent=c,l.appendChild(u),l.appendChild(d);const h=document.createElement("div");h.className="wap-dictionary-actions";const p=this.actionButton("read","Read"),m=this.actionButton("spell","Spell"),y=document.createElement("div");y.className="wap-dictionary-pager";const b=document.createElement("button");b.className="wap-dictionary-prev",b.type="button",b.setAttribute("aria-label","Previous definition"),b.appendChild(this.icon("prev"));const _=document.createElement("span");_.className="wap-dictionary-count";const w=document.createElement("button");w.className="wap-dictionary-next",w.type="button",w.setAttribute("aria-label","Next definition"),w.appendChild(this.icon("next")),y.appendChild(b),y.appendChild(_),y.appendChild(w),h.appendChild(p),h.appendChild(m),h.appendChild(y),s.appendChild(r),s.appendChild(l),s.appendChild(h),this.popup.appendChild(n),this.popup.appendChild(s),document.body.appendChild(this.popup),n.addEventListener("click",()=>this.removePopup()),p.addEventListener("click",()=>this.toggleRead()),m.addEventListener("click",()=>this.spellWord(this.currentWord)),b.addEventListener("click",()=>this.showEntry(this.entryIndex-1)),w.addEventListener("click",()=>this.showEntry(this.entryIndex+1)),r.addEventListener("submit",e=>{e.preventDefault();const t=o.value.trim();t&&this.loadDefinition(t)}),this.renderPager(),this.positionPopup(),document.addEventListener("click",this.clickHandler),this.loadDefinition(i)}icon(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");const s={close:["M6 6l12 12M18 6L6 18"],search:["M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14z","M20 20l-4.2-4.2"],prev:["M15 5l-7 7 7 7"],next:["M9 5l7 7-7 7"],wave:["M4 11v2","M8 8v8","M12 5v14","M16 8v8","M20 11v2"]};for(const n of s[e]||[]){const e=document.createElementNS(t,"path");e.setAttribute("d",n),i.appendChild(e)}return i}actionButton(e,t){const i=document.createElement("button");i.className=`wap-dictionary-action wap-dictionary-${e}`,i.type="button";const s=document.createElement("span");s.className="wap-dictionary-action-icon",s.appendChild(this.icon("wave"));const n=document.createElement("span");return n.className="wap-dictionary-action-label",n.textContent=t,i.appendChild(s),i.appendChild(n),i}async loadDefinition(e){if(!this.popup)return;this.currentWord=e,this.entries=[],this.entryIndex=0;const t=this.popup.querySelector(".wap-dictionary-input"),i=this.popup.querySelector(".wap-dictionary-term"),s=this.popup.querySelector(".wap-dictionary-text");t&&t.value.trim()!==e&&(t.value=e),i&&(i.textContent=""),s&&(s.textContent=c),this.renderPager();const n=await this.getMeaning(e);this.popup&&this.currentWord===e&&(this.entries=n,this.showEntry(0),this.positionPopup())}showEntry(e){if(!this.popup)return;const t=this.popup.querySelector(".wap-dictionary-term"),i=this.popup.querySelector(".wap-dictionary-text");if(!this.entries.length)return t&&(t.textContent=""),i&&(i.textContent="Definition not available."),void this.renderPager();this.isReading&&this.stopReading(),this.entryIndex=Math.min(Math.max(e,0),this.entries.length-1);const s=this.entries[this.entryIndex];t&&(t.textContent=s.partOfSpeech?`${this.currentWord} (${s.partOfSpeech})`:this.currentWord),i&&(i.textContent=`: ${s.definition}`),this.renderPager()}renderPager(){if(!this.popup)return;const e=this.popup.querySelector(".wap-dictionary-pager"),t=this.popup.querySelector(".wap-dictionary-count"),i=this.popup.querySelector(".wap-dictionary-prev"),s=this.popup.querySelector(".wap-dictionary-next"),n=this.entries.length;e&&(e.hidden=n<2),t&&(t.textContent=n?`${this.entryIndex+1} of ${n}`:""),i&&(i.disabled=this.entryIndex<=0),s&&(s.disabled=this.entryIndex>=n-1)}positionPopup(){if(!this.popup||!this.popupAnchor)return;const{x:e,y:t}=this.popupAnchor,i=this.popup.getBoundingClientRect(),s=t-i.height-12,n=s>window.scrollY?s:t+24,r=window.scrollX+document.documentElement.clientWidth-i.width-12,o=Math.min(Math.max(e-i.width/2,window.scrollX+12),Math.max(r,window.scrollX+12));Object.assign(this.popup.style,{top:`${n}px`,left:`${o}px`})}removePopup(){this.popup&&(this.popup.remove(),this.popup=null),document.removeEventListener("click",this.clickHandler),window.clearTimeout(this.pendingSpeakTimer),this.pendingSpeakTimer=null,this.stopKeepAlive(),this.isReading=!1,"speechSynthesis"in window&&window.speechSynthesis.cancel()}handleOutsideClick(e){this.popup&&!this.popup.contains(e.target)&&this.removePopup()}async getMeaning(e){if(!a.test(e))return[];const t=await this.fetchFromDictionaryApi(e);return t.length?this.trimEntries(t):this.trimEntries(await this.fetchFromWiktionary(e))}trimEntries(e){const t=new Set,i=[];for(const s of e){const e=s.definition.trim().toLowerCase();if(e&&!t.has(e)&&(t.add(e),i.push(s),10===i.length))break}return i}async requestJson(e){const t="undefined"!=typeof AbortController?new AbortController:null,i=t?setTimeout(()=>t.abort(),3500):null;try{const i=await fetch(e,t?{signal:t.signal}:void 0);return i.ok?await i.json():null}catch(e){return null}finally{i&&clearTimeout(i)}}async fetchFromDictionaryApi(e){const t=await this.requestJson("https://api.dictionaryapi.dev/api/v2/entries/en/"+encodeURIComponent(e));if(!Array.isArray(t))return[];const i=[];for(const e of t)for(const t of e.meanings||[])for(const e of t.definitions||[]){const s=(e.definition||"").trim();s&&i.push({partOfSpeech:t.partOfSpeech||"",definition:s})}return i}async fetchFromWiktionary(e){const t=e.toLowerCase(),i=t===e?[e]:[e,t];for(const e of i){const i=await this.wiktionaryEntries(e),s=i.length&&i.every(e=>"proper noun"===e.partOfSpeech);if(i.length&&(e===t||!s))return i}return[]}async wiktionaryEntries(e){const t=await this.requestJson("https://en.wiktionary.org/api/rest_v1/page/def
1inition/"+encodeURIComponent(e)),i=t&&Array.isArray(t.en)?t.en:null;if(!i)return[];const s=[];for(const e of i)for(const t of e.definitions||[]){const i=this.toPlainText(t.definition);i&&s.push({partOfSpeech:(e.partOfSpeech||"").toLowerCase(),definition:i})}return s}toPlainText(e){if("string"!=typeof e||""===e)return"";let t=e;t="undefined"!=typeof DOMParser?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<[^>]*>/g,"");const i=t.indexOf(".mw-parser-output");return-1!==i&&(t=t.slice(0,i)),t.replace(/\s+/g," ").trim()}speechLang(){return"en-US"}englishVoice(){const e=window.speechSynthesis.getVoices()||[];if(!e.length)return null;const t=e.filter(e=>/^en(-|$)/i.test(e.lang||""));if(!t.length)return null;const i=["Google US English","Samantha","Microsoft","Google"];for(const e of i){const i=t.find(t=>(t.name||"").startsWith(e));if(i)return i}return t.find(e=>e.default)||t[0]}dispatch(e){const t=window.speechSynthesis,i=Array.isArray(e)?e:[e];if(!i.length)return;const s=()=>{i.forEach(e=>t.speak(e)),t.resume(),this.keepAlive()},n=i[i.length-1];if(n.addEventListener("end",()=>this.stopKeepAlive()),n.addEventListener("error",()=>this.stopKeepAlive()),t.speaking||t.pending)return t.cancel(),window.clearTimeout(this.pendingSpeakTimer),void(this.pendingSpeakTimer=window.setTimeout(()=>{this.pendingSpeakTimer=null,s()},60));s()}keepAlive(){this.stopKeepAlive(),this.keepAliveTimer=window.setInterval(()=>{const e=window.speechSynthesis;e.speaking?(e.pause(),e.resume()):this.stopKeepAlive()},1e4)}stopKeepAlive(){this.keepAliveTimer&&(window.clearInterval(this.keepAliveTimer),this.keepAliveTimer=null)}buildUtterance(e,t){const i=new SpeechSynthesisUtterance(e),s=this.englishVoice();return s&&(i.voice=s),i.lang=s?.lang||this.speechLang(),i.rate=t,i.pitch=1,i}spokenText(){const e=this.entries[this.entryIndex];return e?`${e.partOfSpeech?`${this.currentWord}, ${e.partOfSpeech}`:this.currentWord}. ${e.definition}`:this.currentWord}toggleRead(){if(!("speechSynthesis"in window))return;if(this.isReading)return void this.stopReading();const e=this.spokenText();if(!e)return;const t=this.buildUtterance(e,1);t.addEventListener("end",()=>this.setReadingState(!1)),t.addEventListener("error",()=>this.setReadingState(!1)),this.setReadingState(!0),this.dispatch(t)}stopReading(){window.clearTimeout(this.pendingSpeakTimer),this.pendingSpeakTimer=null,this.stopKeepAlive(),"speechSynthesis"in window&&window.speechSynthesis.cancel(),this.setReadingState(!1)}setReadingState(e){this.isReading=e;const t=this.popup?.querySelector(".wap-dictionary-read .wap-dictionary-action-label");t&&(t.textContent=e?"Pause":"Read")}pronounceWord(e){"speechSynthesis"in window&&e&&this.dispatch(this.buildUtterance(e,1))}spellWord(e){if(!("speechSynthesis"in window)||!e)return;this.setReadingState(!1);const t=e.split("").filter(e=>/[A-Za-z]/.test(e));t.length&&this.dispatch(t.map(e=>this.buildUtterance(e,.6)))}}let u=null;const d=()=>(u||(u=new l),u);class h{static instance=null;constructor(e={}){if(h.instance)return h.instance;this.dataAttribute="data-font-manipulator",this.validProperties=["font-size","line-height","letter-spacing","word-spacing"],this.originals=new WeakMap,this.userPercent=e.percent||20,this.userProperties=e.properties||["font-size"],h.instance=this}static getInstance(e){return h.instance||(h.instance=new h(e)),h.instance}apply(e=document.body,t=this.userPercent,i=this.userProperties){const s=this.collectTextElements(e),n=i.filter(e=>this.validProperties.includes(e));for(let e of s){const i=this.originals.get(e)||{},s=window.getComputedStyle(e),r={...i};n.forEach(n=>{const o=i[n],a=o?o.originalValue:(s.getPropertyValue(n)||"").trim();if(!a)return;const c=a.match(/^(-?\d*\.?\d+)([a-z%]*)$/i);if(!c)return;const l=parseFloat(c[1]);if(!Number.isFinite(l))return;const u=c[2]||"",d=o?o.inlineValue:e.style.getPropertyValue(n),h=o?o.inlinePriority:e.style.getPropertyPriority(n);r[n]={originalValue:a,inlineValue:d,inlinePriority:h,hasInline:o?o.hasInline:""!==d},e.style.setProperty(n,`${l*(1+t/100)}${u}`,"important")}),Object.keys(r).length>0&&(this.originals.set(e,r),e.setAttribute(this.dataAttribute,JSON.stringify(r)))}}remove(e=document.body){const t=Array.from(e.querySelectorAll(`[${this.dataAttribute}]`));for(let e of t){const t=this.originals.get(e)||this.parseMarker(e);Object.entries(t).forEach(([t,i])=>{i.hasInline?e.style.setProperty(t,i.inlineValue||"",i.inlinePriority||""):e.style.removeProperty(t)}),e.removeAttribute(this.dataAttribute)}}parseMarker(e){const t=e.getAttribute(this.dataAttribute);if(!t)return{};let i;try{i=JSON.parse(t)}catch(e){return{}}if(!i||"object"!=typeof i)return{};const s={};
1return Object.entries(i).forEach(([e,t])=>{"string"!=typeof t?t&&"object"==typeof t&&(s[e]={originalValue:t.originalValue||t.inlineValue||"",inlineValue:t.inlineValue||"",inlinePriority:t.inlinePriority||"",hasInline:!!t.hasInline}):s[e]={originalValue:t,inlineValue:t,inlinePriority:"",hasInline:""!==t}}),s}collectTextElements(e=document.body){const t=Array.from(e.querySelectorAll("*")),i=[],s=["#wpadminbar",".ant-drawer-content-wrapper","link","script","style"].map(e=>Array.from(document.querySelectorAll(e))).flat();for(let e of t){if(e===document.body)continue;if(s.some(t=>t.contains(e)))continue;if(!Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim().length>0))continue;const t=window.getComputedStyle(e);if("none"===t.display||"hidden"===t.visibility||0===parseFloat(t.opacity))continue;const n=e.getBoundingClientRect();0!==n.width&&0!==n.height&&"rgba(0, 0, 0, 0)"!==t.color&&i.push(e)}return i}}const p=e=>h.getInstance(e),m="wap-animations-paused",y="data-websac-fixed-bg",b="data-websac-hold",_="img, video, iframe, svg, marquee, lottie-player, dotlottie-player, dotlottie-wc",w=["pointerdown","pointerup","pointercancel","keydown","touchstart"],g=["transform","translate","rotate","scale","opacity","filter","background-position"],f=e=>"function"==typeof e?.closest&&!!e.closest(".wap-accessibility-view, .wap-preset__preview-drawer-root, .wap-preview-button, [class*='oachecker']"),v=e=>{try{e()}catch(e){}},S=e=>{const t=[];for(let i=0;i<e.length;i+=1)e[i].startsWith("--")&&t.push(e[i]);return t},E=(e,t,i)=>{null===i?e.removeAttribute(t):e.setAttribute(t,i)},k=e=>{try{const t=document.createElement("canvas");return t.width=e.naturalWidth,t.height=e.naturalHeight,t.getContext("2d").drawImage(e,0,0),t.toDataURL("image/png")}catch(e){return null}},A=e=>"function"==typeof e.getChildren?e.getChildren(!0,!0,!1):[e],C=e=>!!e&&e.totalDuration()>=1e9,T=e=>{const t=new Set;return A(e).forEach(e=>(e.targets?.()||[]).forEach(e=>t.add(e))),[...t]},x=e=>{const t=e.filter(e=>e&&"object"==typeof e);return t.length?t:[document]},P=e=>e.reduce((e,t)=>{const i=window.getComputedStyle(t),s="hidden"===i.visibility?0:parseFloat(i.opacity)||0,n=new window.DOMMatrixReadOnly("none"===i.transform?void 0:i.transform);return e+1e3*s-Math.hypot(n.m41,n.m42,n.m43)-200*(Math.abs(Math.hypot(n.a,n.b)-1)+Math.abs(Math.hypot(n.c,n.d)-1))-2*Math.abs(180*Math.atan2(n.b,n.a)/Math.PI)-20*(parseFloat((/blur\(([\d.]+)px\)/.exec(i.filter)||[])[1])||0)},0),L=(e,t,i="totalProgress")=>{e[i](.5,!0),e[i](t,!0)},M=e=>{const t=A(e).filter(C);(t.length?t:[e]).forEach(e=>{const t=e.vars?.startAt||{},i=!!e.vars?.runBackwards||0===t.opacity||0===t.autoAlpha;L(e,i?1:0,"progress")})};class I{static instance=null;constructor(){if(I.instance)return I.instance;this._active=!1,this._wanted=!1,this._teardownQueued=!1,this._bootHold=document.documentElement.classList.contains(m),this._lastGesture=0,this._gestureScroll=0,this._pointerDown=!1,this._sweep=this._sweep.bind(this),this._gsapTick=this._gsapTick.bind(this),this._onMutations=this._onMutations.bind(this),this._onStyleMutations=this._onStyleMutations.bind(this),this._flushQueue=this._flushQueue.bind(this),this._onPlay=this._onPlay.bind(this),this._onGesture=this._onGesture.bind(this),this._resetState(),I.instance=this}static getInstance(){return I.instance||(I.instance=new I),I.instance}apply(){this._wanted=!0,this._teardownQueued=!1,this._activate()}startFromBoot(){this._bootHold&&this._activate()}_activate(){this._active||(this._active=!0,document.documentElement.classList.add(m),v(()=>this._patchScrolling()),v(()=>this._patchWebAnimations()),v(()=>this._markFixedBackgrounds(document.documentElement)),this._sweep(),this._watchLoad(),this._observer=new window.MutationObserver(this._onMutations),this._observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["src","srcset"]}),this._styleObserver=new window.MutationObserver(this._onStyleMutations),this._styleObserver.observe(document.documentElement,{subtree:!0,attributes:!0,attributeFilter:["style"]}),this._interval=window.setInterval(this._sweep,1e3),document.addEventListener("DOMContentLoaded",this._sweep),window.addEventListener("load",this._sweep),document.addEventListener("play",this._onPlay,!0),w.forEac
1h(e=>document.addEventListener(e,this._onGesture,!0)),this._announce(!0))}remove(){this._wanted=!1,this._bootHold||this._teardownQueued||(this._active||document.documentElement.classList.contains(m))&&(this._teardownQueued=!0,queueMicrotask(()=>{this._teardownQueued&&this._teardown()}))}releaseBoot(){this._bootHold&&(this._bootHold=!1,this._wanted||this._teardown())}_resetState(){this._resumers=[],this._handled=new WeakSet,this._stills=new WeakMap,this._waitingImages=new WeakSet,this._corsTried=new WeakSet,this._pausedVideos=new Set,this._animePaused=new Set,this._watchFrame=null,this._finishes=new WeakMap,this._queue=new Set,this._queueTimer=null,this._observer=null,this._styleObserver=null,this._motion=new WeakMap,this._motionIgnored=new WeakSet,this._held=new Map,this._holdSheet=null,this._holdCount=0,this._interval=null,this._gsap=null,this._webAnimations={paused:new Set,timelines:new Map},this._scrollPatches=[],this._animatePatch=null,this._jqueryPatches=[],this._inJqueryCompletion=!1}_teardown(){this._teardownQueued=!1;const e=this._active;this._active=!1,this._observer?.disconnect(),this._styleObserver?.disconnect(),this._releaseHolds(),window.clearInterval(this._interval),window.clearTimeout(this._queueTimer),window.cancelAnimationFrame(this._watchFrame),document.removeEventListener("DOMContentLoaded",this._sweep),window.removeEventListener("load",this._sweep),window.removeEventListener("scroll",this._gsapTick),document.removeEventListener("play",this._onPlay,!0),w.forEach(e=>document.removeEventListener(e,this._onGesture,!0)),this._restoreScrolling(),this._restoreWebAnimations(),this._resumeGsap(),this._jqueryPatches.forEach(({fn:e,original:t,patched:i})=>{e.animate===i&&(e.animate=t)}),this._pausedVideos.forEach(e=>{e.paused&&e.play()?.catch?.(()=>{})}),this._animePaused.forEach(e=>v(()=>e.play())),this._resumers.forEach(e=>{try{e()}catch(e){}}),document.documentElement.classList.remove(m),document.querySelectorAll(`[${y}]`).forEach(e=>e.removeAttribute(y)),this._resetState(),e&&this._announce(!1)}_announce(e){document.dispatchEvent(new CustomEvent("websac-pause-animations",{detail:{paused:e}}))}_onGesture(e){this._lastGesture=performance.now(),this._gestureScroll=window.scrollY,"pointerdown"===e?.type?this._pointerDown=!0:"pointerup"!==e?.type&&"pointercancel"!==e?.type||(this._pointerDown=!1)}_sweep(){this._active&&(v(()=>this._settleGsap()),v(()=>this._settleWebAnimations()),v(()=>this._patchJquery()),this._stopScriptedEffects(),v(()=>this._stopCanvasAnimations()),document.querySelectorAll(_).forEach(e=>this._stopMedia(e)))}_stopScriptedEffects(){v(()=>this._settleAnime()),v(()=>this._stopUikit()),v(()=>this._stopSliders()),v(()=>this._settleOtherLibraries()),this._styleObserver?.takeRecords()}_settleOtherLibraries(){[window.Velocity,window.jQuery?.Velocity].forEach(e=>{!e||e.mock||this._handled.has(e)||(this._handled.add(e),e.mock=!0,this._resumers.push(()=>{e.mock=!1}))}),"function"==typeof window.jarallax&&document.querySelectorAll("[data-jarallax-original-styles]").forEach(e=>{const t=e.jarallax;if(!t||this._handled.has(e))return;this._handled.add(e);const i={...t.options};window.jarallax(e,"destroy"),this._resumers.push(()=>window.jarallax(e,i))});const e=window.lenis;if(e?.options&&!this._handled.has(e)){this._handled.add(e);const{smoothWheel:t,syncTouch:i}=e.options;e.options.smoothWheel=!1,e.options.syncTouch=!1,this._resumers.push(()=>{e.options.smoothWheel=t,e.options.syncTouch=i})}}_watchLoad(){const e=performance.now()+3e3,t=()=>{this._watchFrame=null,this._active&&(this._stopScriptedEffects(),performance.now()<e&&(this._watchFrame=window.requestAnimationFrame(t)))};this._watchFrame=window.requestAnimationFrame(t)}_onMutations(e){this._active&&(e.forEach(e=>{"attributes"!==e.type?e.addedNodes.forEach(e=>1===e.nodeType&&this._queue.add(e)):this._queue.add(e.target)}),this._queue.size&&!this._queueTimer&&(this._queueTimer=window.setTimeout(this._flushQueue,50)))}_flushQueue(){this._queueTimer=null;const e=[...this._queue];this._queue.clear(),this._active&&e.forEach(e=>{e.isConnected&&(this._stopMedia(e),e.querySelectorAll(_).forEach(e
1=>this._stopMedia(e)),this._markFixedBackgrounds(e))})}_onStyleMutations(e){if(!this._active)return;const t=performance.now(),i=(this._pointerDown||t-this._lastGesture<800)&&Math.abs(window.scrollY-this._gestureScroll)<20;e.forEach(e=>{const s=e.target;this._held.has(s)||this._motionIgnored.has(s)||v(()=>this._noteRewrite(s,t,i))})}_noteRewrite(e,t,i){const s=(e=>{const t={};return g.forEach(i=>{t[i]=e.getPropertyValue(i)}),t.custom=S(e).map(t=>`${t}:${e.getPropertyValue(t)}`).join(";"),t})(e.style),n=this._motion.get(e);if(!n)return void this._motion.set(e,{look:s,changed:new Set,times:[]});const r=Object.keys(s).filter(e=>s[e]!==n.look[e]);n.look=s,r.length&&(i?n.times=[]:(r.forEach(e=>n.changed.add(e)),n.times=n.times.filter(e=>t-e<1e3),n.times.push(t),n.times.length>=4&&this._hold(e,n)))}_canHold(e){if(e===document.documentElement||e===document.body)return!1;if(f(e)||e.closest("[role='tooltip'], [role='dialog'], [role='menu'], [role='listbox'], [data-popper-placement], [data-tippy-root], .tippy-box, .tooltip, .popover, .dropdown-menu"))return!1;if("fixed"===window.getComputedStyle(e).position)return!1;const t=e.offsetWidth||0;if((e.offsetHeight||0)>3*window.innerHeight||t>1.5*window.innerWidth)return!1;const i=e.parentElement?.clientWidth||0;return!(i>0&&t>1.4*i)}_hold(e,t){if(this._motion.delete(e),!this._canHold(e))return void this._motionIgnored.add(e);const i=t.changed.has("custom")?g:g.filter(e=>t.changed.has(e)),s=window.getComputedStyle(e),n=parseFloat(s.opacity)||0,r=e.getAttribute("style");e.style.setProperty("transition","none","important"),i.forEach(t=>e.style.removeProperty(t)),t.changed.has("custom")&&S(e.style).forEach(t=>e.style.removeProperty(t));const o={};if(i.forEach(e=>{o[e]=s.getPropertyValue(e)}),null===r?e.removeAttribute("style"):e.setAttribute("style",r),this._styleObserver?.takeRecords(),"opacity"in o){const e=parseFloat(o.opacity)||0;o.opacity=String(n>e?1:e)}const a=Object.entries(o).filter(([,e])=>""!==e).map(([e,t])=>`${e}: ${t} !important;`).join(" ");if(!a)return;this._holdCount+=1;const c=String(this._holdCount);e.setAttribute(b,c),this._held.set(e,c);const l=this._holdStylesheet();l.insertRule(`html.${m} [${b}="${c}"] { ${a} }`,l.cssRules.length)}_holdStylesheet(){return this._holdSheet?.isConnected||(this._holdSheet=document.createElement("style"),this._holdSheet.id="websac-pause-animations-holds",document.head.appendChild(this._holdSheet)),this._holdSheet.sheet}_releaseHolds(){this._held.forEach((e,t)=>{t.getAttribute(b)===e&&t.removeAttribute(b)}),this._held.clear(),this._holdSheet?.remove(),this._holdSheet=null}_frameTime(){return document.timeline?.currentTime??Math.floor(performance.now()/16)}_noteFinished(e){const t=performance.now(),i=this._frameTime();e.forEach(e=>{const s=this._finishes.get(e);!s||t-s.at>100?this._finishes.set(e,{at:t,frame:i,frames:1,burst:1}):(s.frame===i?s.burst+=1:(s.frame=i,s.frames+=1,s.burst=1),s.at=t)})}_isChained(e){const t=performance.now();return e.some(e=>{const i=this._finishes.get(e);return!!i&&t-i.at<=100&&(i.frames>=2||i.burst>=20)})}_settleGsap(){const e=window.gsap;if(!e?.globalTimeline||!e.ticker)return;this._gsap||(this._gsap={gsap:e,triggers:new Set,animations:new Set,seen:new WeakSet},e.ticker.add(this._gsapTick),window.addEventListener("scroll",this._gsapTick,{passive:!0}));const t=window.ScrollSmoother?.get?.();if(t&&"function"==typeof t.smooth&&!this._handled.has(t)){this._handled.add(t);const e=t.smooth();t.smooth(0),this._resumers.push(()=>t.smooth(e))}this._gsapTick()}_gsapTick(){const e=this._gsap;if(!this._active||!e)return;const t=window.ScrollTrigger;if("function"==typeof t?.getAll){const i=t.getAll().filter(t=>t.enabled&&!e.seen.has(t));i.sort((e,t)=>
1C(t.animation)-C(e.animation)),i.forEach(e=>v(()=>this._settleTrigger(e)))}e.gsap.globalTimeline.getChildren(!1,!0,!0).forEach(e=>v(()=>this._settleTimed(e))),this._styleObserver?.takeRecords()}_settleTrigger(e){const t=this._gsap;t.seen.add(e);const i=e.animation;if(!i)return;const s=!i.paused();if(e.disable(!!e.pin),t.triggers.add(e),C(i))M(i);else if((e=>{const t=A(e);return t.length>0&&t.every(e=>!!e.vars?.runBackwards)})(i))i.totalProgress(1);else{const e=(e=>T(e).filter(e=>e instanceof window.Element))(i),t=(e=>{const t=e.map(e=>[e,e.style.getPropertyValue("transition"),e.style.getPropertyPriority("transition")]);return e.forEach(e=>e.style.setProperty("transition","none","important")),()=>t.forEach(([e,t,i])=>{window.getComputedStyle(e).transform,t?e.style.setProperty("transition",t,i):e.style.removeProperty("transition")})})(e);try{const t=i.totalProgress(),s=((e,t)=>{if(!t.length)return 1;L(e,1);const i=P(t);return L(e,0),P(t)>i+1?0:1})(i,e);i.totalProgress(t,!0),1===s?i.totalProgress(1):i.totalProgress(0,!0)}finally{t()}}i.pause(),s&&t.animations.add(i)}_settleTimed(e){const t=this._gsap;if(!e.isActive()||(e=>!!e.scrollTrigger||"function"==typeof e.getChildren&&e.getChildren(!0,!0,!0).some(e=>e.scrollTrigger))(e))return;if(C(e))return M(e),e.pause(),void t.animations.add(e);const i=x(T(e));if(this._isChained(i))return e.pause(),void t.animations.add(e);e.totalProgress(e.reversed()?0:1),this._noteFinished(i)}_resumeGsap(){const e=this._gsap;if(e&&(e.gsap.ticker.remove(this._gsapTick),e.triggers.forEach(e=>{try{e.enable()}catch(e){}}),e.animations.forEach(e=>{try{e.resume()}catch(e){}}),e.triggers.size))try{window.ScrollTrigger?.refresh?.()}catch(e){}}_patchWebAnimations(){const e=window.Element?.prototype;if("function"!=typeof e?.animate)return;const t=this,i=e.animate,s=function(...e){const s=i.apply(this,e);return t._active&&s&&queueMicrotask(()=>t._settleWebAnimation(s)),s};e.animate=s,this._animatePatch={proto:e,original:i,patched:s}}_restoreWebAnimations(){const e=this._animatePatch;e&&e.proto.animate===e.patched&&(e.proto.animate=e.original);const{paused:t,timelines:i}=this._webAnimations;i.forEach((e,t)=>{try{t.timeline=e}catch(e){}}),t.forEach(e=>{try{e.play()}catch(e){}})}_settleWebAnimations(){"function"==typeof document.getAnimations&&document.getAnimations().forEach(e=>this._settleWebAnimation(e))}_settleWebAnimation(e){const t=this._webAnimations;if(!this._active||"running"!==e.playState||(e=>"function"==typeof window.CSSAnimation&&e instanceof window.CSSAnimation||"function"==typeof window.CSSTransition&&e instanceof window.CSSTransition)(e))return;const i=e.effect?.target;if(i&&f(i))return;const s=x([i]);try{!e.timeline||"function"!=typeof window.DocumentTimeline||e.timeline instanceof window.DocumentTimeline||(t.timelines.set(e,e.timeline),e.timeline=document.timeline);const i=e.effect?.getComputedTiming?.().endTime===1/0;i||this._isChained(s)?(e.pause(),i&&(e.currentTime=0),t.paused.add(e)):(e.finish(),this._noteFinished(s))}catch(e){}}_patchScrolling(){const e=this;[[window,["scroll","scrollTo","scrollBy"]],[window.Element?.prototype,["scroll","scrollTo","scrollBy","scrollIntoView"]]].forEach(([t,i])=>i.forEach(i=>{const s=t?.[i];if("function"!=typeof s)return;const n=function(...t){const[i]=t;return e._active&&i&&"object"==typeof i&&"smooth"===i.behavior&&(t[0]={...i,behavior:"auto"}),s.apply(this,t)},r=Object.prototype.hasOwnProperty.call(t,i);v(()=>{t[i]=n,this._scrollPatches.push({owner:t,name:i,original:s,patched:n,own:r})})}))}_restoreScrolling(){this._scrollPatches.forEach(({owner:e,name:t,original:i,patched:s,own:n})=>{e[t]===s&&(n?e[t]=i:delete e[t])})}_patchJquery(){[window.jQuery,window.$].forEach(e=>{const t=e?.fn;if("function"!=typeof t?.animate||!t.jquery||this._handled.has(t))return;this._handled.add(t);const i=this,s=t.animate,n=e=>function(...t){const s=i._inJqueryCompletion;i._inJqueryCompletion=!0;try{return e.apply(this,t)}finally{i._inJqueryCompletion=s}},r=function(e,t,r,o){if(!i._active||!e||"object"!=typeof e)return s.apply(this,arguments);if(i._inJqueryCompletion){const e=x(this.toArray());if(i._isChained(e))return this;i._noteFinished(e)}const a=t&&"object"==typeof t?{...t}:{complete:[o,r,t].find(e=>"function"==typeof e)};return a.duration=0,"function"==typeof a.complete&&(a.complete=n(a.c
1omplete)),s.call(this,e,a)};t.animate=r,this._jqueryPatches.push({fn:t,original:s,patched:r});try{e(":animated").finish()}catch(e){}})}_settleAnime(){const e=window.anime?.running;Array.isArray(e)&&[...e].forEach(e=>v(()=>this._settleAnimeInstance(e)))}_settleAnimeInstance(e){if(e.paused)return;const t=(e.animatables||[]).map(e=>e.target);if(t.some(e=>f(e)))return;const i=x(t),s=!0===e.loop||e.loop===1/0;if(s||this._isChained(i))return e.pause(),s&&e.seek(0),void this._animePaused.add(e);e.seek(e.duration),e.pause(),this._noteFinished(i)}_stopUikit(){[window.bdtUIkit,window.UIkit].filter((e,t,i)=>"function"==typeof e?.getComponent&&i.indexOf(e)===t).forEach(e=>{document.querySelectorAll("[class*='parallax'], [bdt-parallax], [data-bdt-parallax], [uk-parallax], [data-uk-parallax]").forEach(t=>{const i=e.getComponent(t,"parallax");i?.matchMedia&&(i.matchMedia=!1,i.$emit?.("resize"),this._resumeOnce(i,()=>{i.matchMedia=!i.mediaObj||i.mediaObj.matches,i.$emit?.("resize")}))}),document.querySelectorAll("[bdt-slideshow], [data-bdt-slideshow], [bdt-slider], [data-bdt-slider], [uk-slideshow], [data-uk-slideshow], [uk-slider], [data-uk-slider]").forEach(t=>{["slideshow","slider"].forEach(i=>{const s=e.getComponent(t,i);s?.autoplay&&"function"==typeof s.stopAutoplay&&(s.stopAutoplay(),this._resumeOnce(s,()=>s.startAutoplay?.()))})})})}_resumeOnce(e,t){this._handled.has(e)||(this._handled.add(e),this._resumers.push(t))}_stopSliders(){document.querySelectorAll(".swiper, .swiper-container, swiper-container").forEach(e=>{const t=e.swiper;if(t?.params&&!t.destroyed){if(!this._handled.has(t)){const e=t.params.speed;t.params.speed=0,t.animating&&"function"==typeof t.transitionEnd&&t.transitionEnd(),this._resumeOnce(t,()=>{t.destroyed||(t.params.speed=e)})}t.autoplay?.running&&(t.autoplay.stop(),this._resumeOnce(t.autoplay,()=>!t.destroyed&&t.autoplay.start()))}});const e=window.Flickity;"function"==typeof e?.data&&document.querySelectorAll(".flickity-enabled").forEach(t=>{const i=e.data(t);"playing"===i?.player?.state&&(i.stopPlayer(),this._resumeOnce(i,()=>i.playPlayer()))});const t=window.jQuery;"function"==typeof t&&(document.querySelectorAll(".slick-initialized").forEach(e=>{const i=e.slick;if(i?.options){if(!this._handled.has(i)){const e=i.options.speed;i.options.speed=0,this._resumeOnce(i,()=>{i.options.speed=e})}i.options.autoplay&&!i.paused&&(t(e).slick("slickPause"),this._resumeOnce(i.options,()=>!i.unslicked&&t(e).slick("slickPlay")))}}),document.querySelectorAll(".owl-carousel").forEach(e=>{const i=t(e).data("owl.carousel");i?.settings?.autoplay&&(t(e).trigger("stop.owl.autoplay"),this._resumeOnce(i,()=>t(e).trigger("play.owl.autoplay",[i.settings.autoplayTimeout])))}),document.querySelectorAll(".flexslider").forEach(e=>{const i=t(e).data("flexslider");i?.playing&&"function"==typeof i.pause&&(i.pause(),this._resumeOnce(i,()=>i.play()))}),document.querySelectorAll("rs-module, .rev_slider").forEach(e=>{const i=t(e);this._handled.has(e)||"function"!=typeof i.revpause||(i.revpause(),this._resumeOnce(e,()=>i.revresume()))}))}_stopCanvasAnimations(){const e=window.lottie||window.bodymovin;"function"!=typeof e?.freeze||this._handled.has(e)||(this._handled.add(e),e.freeze(),this._resumers.push(()=>e.unfreeze()));const t=window.tsParticles;(("function"==typeof t?.dom?t.dom():[])||[]).forEach(e=>{"function"==typeof e?.pause&&("function"!=typeof e.getAnimationStatus||e.getAnimationStatus())&&(e.pause(),this._resumeOnce(e,()=>e.play()))}),(window.pJSDom||[]).forEach(e=>{const t=e?.pJS?.particles?.move;t?.enable&&(t.enable=!1,this._resumeOnce(t,()=>{t.enable=!0}))})}_stopMedia(e){if(this._active&&!f(e))try{switch(e.localName){case"img":this._freezeImage(e);break;case"video":this._pauseVideo(e);break;case"iframe":this._pauseEmbed(e);break;case"svg":this._pauseSvg(e);break;case"marquee":this._stopMarquee(e);break;case"lottie-player":case"dotlottie-player":case"dotlottie-wc":this._pauseLottiePlayer(e)}}catch(e){}}_freezeImage(e){const t=this._stills.get(e);if(t&&e.getAttribute("src")===t)return;t&&this._stills.delete(e);const i=e.currentSrc||e.src||"";if(!(e=>/^data:image\/gif/i.test(e)||/\.gif(?:$|[?#])/i.test(e))(i)||this._waitingImages.has(e))return;
1if(!e.complete||!e.naturalWidth)return this._waitingImages.add(e),void e.addEventListener("load",()=>{this._waitingImages.delete(e),this._stopMedia(e)},{once:!0});if(e.naturalWidth<2&&e.naturalHeight<2)return;const s=k(e);if(s)return void this._showStill(e,s);if(this._corsTried.has(e))return;this._corsTried.add(e);const n=new window.Image;n.crossOrigin="anonymous",n.onload=()=>{const t=k(n);t&&this._active&&(e.currentSrc||e.src)===i&&this._showStill(e,t)},n.src=i}_showStill(e,t){const i="picture"===e.parentElement?.localName?e.parentElement:null,s=i?[...i.querySelectorAll("source[srcset]")]:[],n={src:e.getAttribute("src"),srcset:e.getAttribute("srcset"),sizes:e.getAttribute("sizes"),sources:s.map(e=>[e,e.getAttribute("srcset")])};s.forEach(e=>e.removeAttribute("srcset")),e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.setAttribute("src",t),this._stills.set(e,t),this._resumers.push(()=>{e.getAttribute("src")===t&&(n.sources.forEach(([e,t])=>E(e,"srcset",t)),E(e,"srcset",n.srcset),E(e,"sizes",n.sizes),E(e,"src",n.src))})}_pauseVideo(e){!e.paused&&(e=>e.autoplay||e.loop||e.muted&&!e.controls)(e)&&(e.pause(),this._pausedVideos.add(e))}_onPlay(e){const t=e.target;this._active&&"video"===t?.localName&&!f(t)&&(performance.now()-this._lastGesture<1e3?this._pausedVideos.delete(t):this._pauseVideo(t))}_pauseEmbed(e){if(this._handled.has(e))return;const t=(e=>{let t;try{t=new URL(e,window.location.href)}catch(e){return null}if(!["1","true"].includes(t.searchParams.get("autoplay"))&&"1"!==t.searchParams.get("background"))return null;if(/(^|\.)youtube(-nocookie)?\.com$/.test(t.hostname)&&t.pathname.startsWith("/embed/")){const e=e=>JSON.stringify({event:"command",func:e,args:[]});return{origin:t.origin,pause:e("pauseVideo"),play:e("playVideo")}}return"player.vimeo.com"===t.hostname?{origin:t.origin,pause:JSON.stringify({method:"pause"}),play:JSON.stringify({method:"play"})}:null})(e.getAttribute("src")||"");if(!t)return;this._handled.add(e);const i=i=>{try{e.contentWindow?.postMessage(i,t.origin)}catch(e){}},s=()=>this._active&&i(t.pause);s(),e.addEventListener("load",s,{once:!0}),[1e3,3e3].forEach(e=>window.setTimeout(s,e)),this._resumers.push(()=>i(t.play))}_pauseSvg(e){e.ownerSVGElement||"function"!=typeof e.pauseAnimations||e.animationsPaused()||e.querySelector("animate, animateMotion, animateTransform, set")&&(e.pauseAnimations(),this._resumers.push(()=>e.unpauseAnimations()))}_stopMarquee(e){this._handled.has(e)||"function"!=typeof e.stop||(this._handled.add(e),e.stop(),this._resumers.push(()=>e.start()))}_pauseLottiePlayer(e){const t=e.dotLottie||e;(e.dotLottie?e.dotLottie.isPlaying:"playing"===e.currentState)&&"function"==typeof t.pause&&(t.pause(),this._resumeOnce(e,()=>t.play()))}_markFixedBackgrounds(e){(e===document.documentElement?document.querySelectorAll("*"):[e,...e.querySelectorAll("*")]).forEach(e=>{window.getComputedStyle(e).backgroundAttachment.includes("fixed")&&e.setAttribute(y,"")})}}const O=()=>I.getInstance();class R{static instance=null;constructor(){if(R.instance)return R.instance;this._enabled=!1,this.skipSelectors=[".wap-preset__preview-drawer-root"],this._tooltip=null,this._arrow=null,this._currentLabel=null,this._boundMouseOver=this._handleMouseOver.bind(this),this._boundMouseOut=this._handleMouseOut.bind(this),this._boundMouseMove=this._handleMouseMove.bind(this),R.instance=this}static getInstance(){return R.instance||(R.instance=new R),R.instance}apply(){this._enabled||(this._enabled=!0,this._createTooltip(),document.addEventListener("mouseover",this._boundMouseOver,!0),document.addEventListener("mouseout",this._boundMouseOut,!0),document.addEventListener("mousemove",this._boundMouseMove,!0))}remove(){this._enabled&&(this._enabled=!1,document.removeEventListener("mouseover",this._boundMouseOver,!0),document.removeEventListener("mouseout",this._boundMouseOut,!0),document.removeEventListener("mousemove",this._boundMouseMove,!0),this._tooltip&&this._tooltip.remove(),this._tooltip=null,this._arrow=null)}_createTooltip(){this._tooltip=document.createElement("div"),this._tooltip.className="wap-accessibility-tooltip",this._arrow=document.createElement("span"),this._arrow.className="wap-accessibility-tooltip-arrow",this._tooltip.appendChild(this._arrow),document.body.appendChild(this._tooltip)}_shouldSkip(e){if(!e)return!1;const t=document.querySelectorAll(this.skipSelectors);for(let i=0;i<t.length;i++)if(t[i].contains(e))return!0;return!1}_getTooltipText(e){if(!e||this._shouldSkip(e))return this._handleMouseOut(),null;let t=e.getAttribute("aria-label")||("IMG"===e.tagName?e.alt:null),i=e;for(let e=0;e<2&&!t&&i?.parentElement;e++){if(i=i.parentElement,this._shouldSkip(i))return null;t=i.getAttribute("aria-label")||("IMG"===i.tagName?i.alt:null)}if(!t&&("BUTTON"===e.tagName||"A"===e.tagName)){const t=e.textContent?.trim();if(t)return t}return t||null}_handleMouseOver(e){if(!this._enabled)return;const t=this._getTooltipText(e.target);t&&(this._tooltip.textContent=t,this._tooltip.appendChild(this._arrow),this._tooltip.classList.add("visible"))}_handleMouseOut(){this._enabled&&this._tooltip.classList.remove("visible")}_handleMouseMove(e){if(!this._enabled||!this._tooltip.classList.contains("visible"))return;const t=this._tooltip;this._arrow,t.style.left="-9999px",t.style.top="-9999px";const i=t.getBoundingClientRect(),s=e.clientX,n=e.clientY,r=12,o=window.innerWidth,a=window.innerHeight;
1let c=n-i.height-r,l=s-i.width/2,u="top";c<0&&(c=n+r,u="bottom"),c+i.height>a&&(c=Math.max(r,n-i.height-r),u="top"),l<0&&(l=r),l+i.width>o&&(l=o-i.width-r),t.style.left=`${l}px`,t.style.top=`${c}px`,this._applyArrow(u)}_applyArrow(e){const t=this._arrow;t.classList.remove("top","bottom"),t.classList.add(e)}}const F=()=>R.getInstance(),N="websacFeatureHandlers",$=e=>("undefined"==typeof window?{}:(window[N]||(window[N]={}),window[N]))[e]||null;class q{static instance=null;constructor(){if(q.instance)return q.instance;this.props={},this.previousFeatureValues={},this.backgroundObservers={},q.instance=this}static getInstance(){return q.instance||(q.instance=new q),q.instance}init(e){if(e&&0!==Object.keys(e).length)for(const t in e){const i=e[t],s=i.currentAttribute||{};if(i.currentStep)switch(this.previousFeatureValues[t]&&this.removeFeature(t),this.previousFeatureValues[t]||(this.previousFeatureValues[t]=i.currentAttribute?.value||null),this.props[t]=[],t){case"contrast":this.applyContrast(t,s);break;case"cursor":this.applyCursor(t,s);break;case"tooltips":this.applyTooltip(t,s);break;case"dictionary":this.applyDictionary(t,s);break;case"biggerText":this.applyBiggerText(t,s);break;case"saturation":this.applySaturation(t,s);break;case"pauseAnimations":O().apply();break;default:this.applyExtensionFeature(t,s)}else this.removeFeature(t)}}settleSavedPreferences(){O().releaseBoot()}applyExtensionFeature(e,t){const i=$(e);i&&"function"==typeof i.apply?i.apply(t,e):this.applyCSSFeature(e,t)}removeExtensionFeature(e){const t=$(e);if(t&&"function"==typeof t.remove)return t.remove(e),void delete this.props[e];this.removeCSSFeature(e)}isInsidePreviewDrawer(e){const t=document.querySelector(".wap-preset__preview-drawer-root");return!!t&&t.contains(e)}applyContrast(e,t){if(t)switch(t.value){case"invert":document.documentElement.style.setProperty("--wap-invert","100%");break;case"dark":case"light":this.applyCSSFeature(e,t)}}removeContrast(){document.documentElement.style.removeProperty("--wap-invert"),this.removeCSSFeature("contrast"),delete this.props.contrast}applySaturation(e,t){if(t&&"saturation"===e)switch(t.value){case"low":document.documentElement.style.setProperty("--wap-saturation","0.5");break;case"high":document.documentElement.style.setProperty("--wap-saturation","3");break;case"desaturate":document.documentElement.style.setProperty("--wap-saturation","0")}}removeSaturation(){document.documentElement.style.removeProperty("--wap-saturation"),delete this.props.saturation}applyCursor(e,t){t&&o&&("big-cursor"===t.value?this.applyCSSFeature(e,t):o()?.apply(e,t))}removeCursor(){o()?.remove(),this.removeCSSFeature("cursor"),delete this.props.cursor}applyTooltip(){F()?.apply()}removeTooltip(){F()?.remove(),delete this.props.tooltips}applyDictionary(e,t){t&&d().apply()}removeDictionary(e){d().remove()}isActuallyVisible(e){let t=e;for(;t&&1===t.nodeType;){const e=window.getComputedStyle(t);if("none"===e.display||"hidden"===e.visibility||0===parseFloat(e.opacity))return!1;t=t.parentElement}return!0}applyCSSFeature(e,t){if(!t?.css||0===t.css.length)return;t.hideBackgroundImages&&this.applyBackgroundImageHiding(e);const i=document.querySelector(".wap-preset__preview-button");let s=!1;const n=t.css.filter(e=>this.shouldUseStyleRule(e));n.length>0&&this.applyStyleRules(e,n),t.css.forEach(t=>{this.shouldUseStyleRule(t)||document.querySelectorAll(t.selector).forEach(n=>{if(!this.isInsidePreviewDrawer(n)&&n!==i&&!i?.contains(n)&&this.isActuallyVisible(n)){"highlightLinks"===e&&this.props.contrast?.length>0&&(s=!0);for(const i in t.properties){let r=n.style.getPropertyValue(i);const o=n.style.getPropertyPriority(i);this.props[e].some(e=>e.element===n&&e.property===i)||this.props[e].push({element:n,property:i,originalPriority:s?"":o,originalValue:s?null:r||null}),n.style.setProperty(this.toCssProperty(i),t.properties[i],"important")}}})})}isUniversalSelector(e){return"*"===String(e).trim()}shouldUseStyleRule(e){return!0===e?.rule||this.isUniversalSelector(e?.selector)}styleRuleId(e){return`websac-feature-${e}`}static get RULE_SCOPE(){return[".wap-preset__preview-drawer-root",".wap-accessibility-view",".wap-preview-button"].map(e=>`:not(${e}):not(${e} *)`).join("")}
1applyStyleRule(e,t,i="*"){this.applyStyleRules(e,[{properties:t,selector:i}])}applyStyleRules(e,t){this.removeStyleRule(e);const i=q.RULE_SCOPE,s=[];if(t.forEach(({properties:e,selector:t="*"})=>{const n=Object.entries(e||{}).map(([e,t])=>`${this.toCssProperty(e)}: ${t} !important;`).join(" ");if(!n)return;const r=String(t).split(",").map(e=>e.trim()).filter(Boolean);if(0===r.length)return;const o=1===r.length&&this.isUniversalSelector(r[0]),a=r.flatMap(e=>o?[`${e}${i}`,`${e}${i}::before`,`${e}${i}::after`]:[`${e}${i}`]);s.push(`${a.join(", ")} { ${n} }`)}),0===s.length)return;const n=document.createElement("style");n.id=this.styleRuleId(e),n.textContent=s.join("\n"),document.head.appendChild(n)}removeStyleRule(e){document.getElementById(this.styleRuleId(e))?.remove()}static get HIDDEN_BG_ATTR(){return"data-websac-hidden-bg"}backgroundRuleId(e){return`websac-feature-${e}-backgrounds`}applyBackgroundImageHiding(e){this.removeBackgroundImageHiding(e);const t=document.createElement("style");t.id=this.backgroundRuleId(e),t.textContent=`[${q.HIDDEN_BG_ATTR}] { background-image: none !important; }`,document.head.appendChild(t),this.markBackgroundImages(document.body),this.backgroundObservers[e]?.disconnect();const i=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)1===e.nodeType&&this.markBackgroundImages(e)});i.observe(document.documentElement,{childList:!0,subtree:!0}),this.backgroundObservers[e]=i}markBackgroundImages(e){const t=e=>{if(this.isInsidePreviewDrawer(e))return;const t=window.getComputedStyle(e).backgroundImage;t&&t.includes("url(")&&e.setAttribute(q.HIDDEN_BG_ATTR,"")};1===e.nodeType&&e!==document.body&&t(e),e.querySelectorAll?.("*").forEach(t)}removeBackgroundImageHiding(e){this.backgroundObservers[e]?.disconnect(),delete this.backgroundObservers[e],document.getElementById(this.backgroundRuleId(e))?.remove(),document.querySelectorAll(`[${q.HIDDEN_BG_ATTR}]`).forEach(e=>e.removeAttribute(q.HIDDEN_BG_ATTR))}removeCSSFeature(e){this.removeStyleRule(e),this.removeBackgroundImageHiding(e);const t=this.props[e];t&&(t.forEach(e=>{const t=this.toCssProperty(e.property);e.originalValue?e.element.style.setProperty(t,e.originalValue,e.originalPriority||""):e.element.style.removeProperty(t)}),delete this.props[e])}toCssProperty(e){return String(e).replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}applyBiggerText(e,t){t&&p()?.apply(document.body,t.percent,t.properties)}removeBiggerText(e){p()?.remove(),delete this.props.biggerText}removeFeature(e){switch(e){case"contrast":this.removeContrast();break;case"cursor":this.removeCursor();break;case"tooltips":this.removeTooltip();break;case"dictionary":this.removeDictionary(e);break;case"biggerText":this.removeBiggerText(e);break;case"saturation":this.removeSaturation();break;case"pauseAnimations":O().remove(),delete this.props[e];break;default:this.removeExtensionFeature(e)}delete this.previousFeatureValues[e]}removeAllFeatures(){Object.keys(this.previousFeatureValues).forEach(e=>{this.removeFeature(e)}),this.props={},this.previousFeatureValues={}}getActiveFeatures(){return{...this.previousFeatureValues}}}const D=()=>q.getInstance(),B=window.wp.i18n,H=window.ReactJSXRuntime;(0,B.__)("Contrast +","website-accessibility"),(0,B.__)("The contrast setting has been disabled.","website-accessibility"),(0,B.__)("Improves visibility by changing the websiteâs contrast with invert, dark, and light modes.","website-accessibility"),(0,B.__)("Invert","website-accessibility"),(0,B.__)("Enable Contrast Mode, set to Invert.","website-accessibility"),(0,B.__)("Dark","website-accessibility"),(0,B.__)("Contrast Mode, set to Dark.","website-accessibility"),(0,B.__)("Light","website-accessibility"),(0,B.__)("Contrast Mode, set to Light.","website-accessibility"),(0,B.__)("Highlight Links","website-accessibility"),(0,B.__)("The highlight links setting has been disabled.","website-accessibility"),(0,B.__)("Helps users find clickable links by clearly highlighting them.","website-accessibility"),(0,B.__)("Enable","website-accessibility"),(0,B.__)("Highlight Links Enable.","website-accessibility"),(0,B.__)("Disable","website-accessibility"),(0,B.__)("Bigger Text","website-accessibility"),(0,B.__)("The bigger text setting has been disabled.","website-accessibility"),(0,B.__)("Increases text size to improve readability across the website.","website-accessibility"),(0,B.__)("Medium","website-accessibility"),(0,B.__)("Bigger Text, set to Medium.","website-accessibility"),(0,B.__)("Large","website-accessibility"),(0,B.__)("Bigger Text, set to Large.","website-accessibility"),(0,B.__)("Extra Large","website-accessibility"),(0,B.__)("Bigger Text, set to Extra Large.","website-accessibility"),(0,B.__)("Huge","website-accessibility"),(0,B.__)("Bigger Text, set to Huge.","website-accessibility"),(0,B.__)("Text Spacing","website-accessibility"),(0,B.__)("The text spacing setting has been disabled.","website-accessibility"),(0,B.__)("Improves readability by adding space between text elements.","
1website-accessibility"),(0,B.__)("Medium","website-accessibility"),(0,B.__)("Text Spacing, set to Medium.","website-accessibility"),(0,B.__)("Large","website-accessibility"),(0,B.__)("Text Spacing, set to Large.","website-accessibility"),(0,B.__)("Extra Large","website-accessibility"),(0,B.__)("Text Spacing, set to Extra Large.","website-accessibility"),(0,B.__)("Pause Animations","website-accessibility"),(0,B.__)("The pause animations setting has been disabled.","website-accessibility"),(0,B.__)("Pauses animations to reduce distractions and motion.","website-accessibility"),(0,B.__)("Play Animations","website-accessibility"),(0,B.__)("Animations are paused. Select to play them again.","website-accessibility"),(0,B.__)("Enable","website-accessibility"),(0,B.__)("Pause Animations Enable.","website-accessibility"),(0,B.__)("Disable","website-accessibility"),(0,B.__)("Hide Images","website-accessibility"),(0,B.__)("The hide images setting has been disabled.","website-accessibility"),(0,B.__)("Hides images to reduce distractions and improve focus on text content.","website-accessibility"),(0,B.__)("Enable","website-accessibility"),(0,B.__)("Hide Images Enable.","website-accessibility"),(0,B.__)("Disable","website-accessibility"),(0,B.__)("Cursor","website-accessibility"),(0,B.__)("The cursor setting has been disabled.","website-accessibility"),(0,B.__)("Changes the cursor to a big cursor, mask, or guideline.","website-accessibility"),(0,B.__)("Big Cursor","website-accessibility"),(0,B.__)("Big Cursor Enable.","website-accessibility"),(0,B.__)("Mask","website-accessibility"),(0,B.__)("Cursor Mask Enable.","website-accessibility"),(0,B.__)("Guideline","website-accessibility"),(0,B.__)("Cursor Guideline Enable.","website-accessibility"),(0,B.__)("Tooltips","website-accessibility"),(0,B.__)("The tooltips setting has been disabled.","website-accessibility"),(0,B.__)("Enables tooltips to provide additional context for elements on the page.","website-accessibility"),(0,B.__)("Enable","website-accessibility"),(0,B.__)("Tooltips Enable.","website-accessibility"),(0,B.__)("Disable","website-accessibility"),(0,B.__)("Line Height","website-accessibility"),(0,B.__)("The line height setting has been disabled.","website-accessibility"),(0,B.__)("Increases the space between lines of text for better readability.","website-accessibility"),(0,B.__)("Medium","website-accessibility"),(0,B.__)("Line Height, set to Medium.","website-accessibility"),(0,B.__)("Large","website-accessibility"),(0,B.__)("Line Height, set to Large.","website-accessibility"),(0,B.__)("Extra Large","website-accessibility"),(0,B.__)("Line Height, set to Extra Large.","website-accessibility"),(0,B.__)("Text Alignment","website-accessibility"),(0,B.__)("The text alignment setting has been disabled.","website-accessibility"),(0,B.__)("Aligns text to the left, center, or right.","website-accessibility"),(0,B.__)("Left","website-accessibility"),(0,B.__)("Text Alignment, set to Left.","website-accessibility"),(0,B.__)("Center","website-accessibility"),(0,B.__)("Text Alignment, set to Center.","website-accessibility"),(0,B.__)("Right","website-accessibility"),(0,B.__)("Text Alignment, set to Right.","website-accessibility"),(0,B.__)("Justify","website-accessibility"),(0,B.__)("Text Alignment, set to Justify.","website-accessibility"),(0,B.__)("Saturation","website-accessibility"),(0,B.__)("The saturation setting has been disabled.","website-accessibility"),(0,B.__)("Adjusts the saturation of colors to improve readability.","website-accessibility"),(0,B.__)("Low","website-accessibility"),(0,B.__)("Saturation, set to Low.","website-accessibility"),(0,B.__)("High","website-accessibility"),(0,B.__)("Saturation, set to High.","website-accessibility"),(0,B.__)("Desaturate","website-accessibility"),(0,B.__)("Saturation, set to Desaturate.","website-accessibility"),(0,B.__)("Dictionary","website-accessibility"),(0,B.__)("The dictionary setting has been disabled.","website-accessibility"),(0,B.__)("Enables a dictionary to provide additional context for words on the page.","website-accessibility"),(0,B.__)("Enable","website-accessibility"),(0,B.__)("Dictionary Enable.","website-accessibility"),(0,B.__)("Disable","website-accessibility"),(0,B.__)("Dictionary Disable.","website-accessibility");(0,B.__)("Motor Impaired","website-accessibility"),(0,B.__)("Motor Impaired","website-accessibility"),(0,B.__)("Color Blind","website-accessibility"),(0,B.__)("Color Blind","website-accessibility"),(0,B.__)("Low Vision","website-accessibility"),(0,B.__)("Low Vision","website-accessibility"),(0,B.__)("Cognitive & Learning","website-accessibility"),(0,B.__)("Cognitive & Learning","website-accessibility"),(0,B.__)("Seizure & Epileptic","website-accessibility"),(0,B.__)("Seizure & Epileptic","website-accessibility"),(0,B.__)("ADHD","website-accessibility"),(0,B.__)("ADHD","website-accessibility"),(0,B.__)("Text","website-accessibility"),(0,B.__)("Color & Contrast","website-accessibility"),(0,B.__)("Orientation","website-accessibility"),(0,B.__)("Behavior","website-accessibility");const j=e=>{if(null==e)return;const t=String(e).trim();return""!==t?/^-?\d*\.?\d+$/.test(t)?`${t}px`:t:void 0},W={currentProfile:null,currentSettings:{contrast:{currentStep:0,currentAttribute:null,isMultiStep:!0},highlightLinks:{currentStep:0,currentAttribute:null,isMultiStep:!1},tooltips:{currentStep:0,currentAttribute:null,isMultiStep:!1},textSpacing:{currentStep:0,currentAttribute:null,isMultiStep:!0},biggerText:{currentStep:0,currentAttribute:null,isMultiStep:!0},pauseAnimations:{currentStep:0,currentAttribute:null,isMultiStep:!1},hideImages:{currentStep:0,currentAttribute:null,isMultiStep:!1},cursor:{currentStep:0,currentAttribute:null,isMultiStep:!0},saturation:{currentStep:0,currentAttribute:null,isMultiStep:!0},textAlign:{currentStep:0,currentAttribute:null,isMultiStep:!0},lineHeight:{currentStep:0,currentAttribute:null,isMultiStep:!0}},isLoading:!1,isOverSized:!1,localStorageKeyPrefix:"websiteAccessibilityLocalPreferences",selectedLanguage:null,siteLanguage:(window?.websiteAccessibility?.siteLanguage||"en-US").split("-")[0]},V=(e,t)=>{switch(t.type){case"SET_CURRENT_PROFILE":return{...e,currentProfile:t.payload};case"SET_CURRENT_SETTINGS":return{...e,currentSettings:t.payload};case"SET_LOADING":return{...e,isLoading:t.payload};case"SET_OVERSIZED":return{...e,isOverSized:t.payload};case"RESET_ACCESSIBILITY":return D().removeAllFeatures(),{...W};case"RESET_PROFILE_SETTINGS":return D().removeAllFeatures(),{...e,currentProfile:null,currentSettings:W.currentSettings};case"SET_SELECTED_LANGUAGE":return{...e,selectedLanguage:t.payload};default:return e}},z=window.wp.apiFetch;var G=e.n(z);const U=()=>{const{defaultProfiles:e=[],useBrowserKey:i}=window.wapHelpers||{},{PreviewButton:r,PreviewContent:o,Icon:a,WapDrawer:c,FrontendExtensions:l
1=null}=window?.wapComponents,{profiles:u,currentPreset:d,currentPresetId:h,settings:p,nonce:m,restUrl:y,isUserLoggedIn:b}=window?.websiteAccessibility,{dispatch:_,...w}=(()=>{const e=(0,t.useContext)(n);if(!e)throw new Error("useFrontendAccessibility must be used within an AccessibilityProvider");return e})(),[g,f]=(0,t.useState)(!1),v=(0,t.useRef)(!1),S=(0,t.useRef)(null),E=i(!!p?.show_usage_statistics),k=(0,t.useRef)(!1),A=(0,t.useRef)(null),C=(0,t.useRef)(null),T=(0,t.useCallback)(()=>{v.current=!0,f(!1),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{v.current=!1,S.current=null},600)},[]),x=(0,t.useCallback)(()=>{v.current||f(!0)},[]);(0,t.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);const P=(0,t.useMemo)(()=>[...e,...u||[]],[u]),L=(0,t.useMemo)(()=>{const e=d?.panel?.wrapper?.maxHeight;if(null==e||""===e)return 80;const t=Number(e);return!Number.isFinite(t)||t<=0||t>100?80:t},[d?.panel?.wrapper?.maxHeight]),M=(0,t.useMemo)(()=>{const e=d?.panel?.items?.find(e=>"footer"===e.slug)?.attributes;return e?.activePreference||!1},[d]);function I(e){if(!e)return;const t=(i=e.profile,i?.id&&P.find(e=>e.id===i?.id||e.ID===i?.id)||null);var i;_(t?.id!==e?.profile?.id?{type:"SET_CURRENT_SETTINGS",payload:{}}:{type:"SET_CURRENT_SETTINGS",payload:e.settings||{}}),_({type:"SET_CURRENT_PROFILE",payload:t}),_({type:"SET_OVERSIZED",payload:e.oversized||!1});const s=e.selectedLanguage||null;_({type:"SET_SELECTED_LANGUAGE",payload:s})}const O=(0,t.useMemo)(()=>{if(!h)return null;const{currentProfile:e,currentSettings:t,isOverSized:i,selectedLanguage:s}=w,n={id:e?.id,name:e?.name};let r={};if(n?.id&&(r.profile=n),Object.keys(t).length>0){let e={};Object.keys(t).forEach(i=>{0!==t[i]?.currentStep&&(e[i]=t[i])}),Object.keys(e).length>0&&(r.settings=e)}return i&&(r.oversized=i),s&&(r.selectedLanguage=s),{post_id:h,data:r}},[w?.currentProfile,w?.currentSettings,w?.isOverSized,w?.selectedLanguage,w?.siteLanguage]);(0,t.useEffect)(()=>{if(!h)return;const e=`${w?.localStorageKeyPrefix}-${h}`,t=localStorage.getItem(e);M&&b?G()({path:`/websac/v1/preference?post_id=${h}`,method:"GET"}).then(i=>{i?.success&&i.data&&Object.keys(i.data).length>0?(I(i.data),localStorage.setItem(e,JSON.stringify(i.data))):t&&I(JSON.parse(t))}).catch(e=>{console.error("Error fetching preference:",e),t&&I(JSON.parse(t))}):t&&I(JSON.parse(t))},[h,M,b]),(0,t.useEffect)(()=>{h&&O?.data&&localStorage.setItem(`${w.localStorageKeyPrefix}-${h}`,JSON.stringify(O?.data))},[O?.data,h]);const R=(0,t.useRef)([]);(0,t.useEffect)(()=>{D().init(w?.currentSettings),w?.currentSettings!==W.currentSettings&&D().settleSavedPreferences(),((e=[])=>{e.forEach(e=>{document.body.classList.contains(e)&&document.body.classList.remove(e)})})(R.current);const e=[];for(const t in w?.currentSettings){const i=w?.currentSettings[t];if(!i?.currentStep||0===i?.currentStep)continue;const s=i?.currentAttribute;s?.value&&e.push(`one-accessibility-feature-${t}-${s?.value}`)}w?.currentProfile?.id&&e.push(`one-accessibility-feature-profile-${w?.currentProfile?.id}`),((e=[])=>{e.forEach(e=>{document.body.classList.contains(e)||document.body.classList.add(e)})})(e),R.current=e},[w?.currentSettings,h,w?.currentProfile,w?.isOverSized]),(0,t.useEffect)(()=>{const e=e=>{"Escape"===e.key&&g&&T(),!e.ctrlKey||"u"!==e.key&&"U"!==e.key||(e.preventDefault(),x())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,T,x]),(0,t.useEffect)(()=>{((e,t={})=>{const i="undefined"!=typeof window?window?.wapHelpers?.announce:null;if("function"!=typeof i)return!1;try{return!0===i(e,t)}catch(e){return!1}})(g?(0,B.__)("Accessibility Menu Open","website-accessibility"):(0,B.__)("Accessibility Menu Close","website-accessibility"),{event:g?"open":"close",settings:w?.currentSettings})},[g]);const F=async e=>{if(k.current)return;if(!E)return;if(!m)return void console.warn("Nonce missing. Statistics not sent.");if(!y)return;const t={};for(const i in e)0!=e?.[i]?.currentStep&&(t[i]=1);const i=`${y}websac/v1/usage-statistics`;try{k.current=!0;const s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":m},body:JSON.stringify({...t,browserKey:E})});(await s.json()).success||(C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{C.current=null,F(e)},5500))}catch(e){console.error("Error sending statistics",e)}finally{k.current=!1}};return(0,t.useEffect)(()=>()=>{A.current&&clearTimeout(A.current),C.current&&clearTimeout(C.current)},[]),(0,t.useEffect)(()=>(g?document.body.classList.add("wap-accessibility-sidebar-open"):document.body.classList.remove("wap-accessibility-sidebar-open"),()=>{document.body.classList.remove("wap-accessibility-sidebar-open")}),[g]),(0,t.useEffect)(()=>
1{if(!d)return;let e=0;try{const t=new URL(window.location.href),i=(t.searchParams.get("websac_open")||"").toLowerCase();if("1"!==i&&"true"!==i&&"yes"!==i)return;e=window.requestAnimationFrame(()=>{x()}),t.searchParams.delete("websac_open"),window.history.replaceState({},"",t.toString())}catch{}return()=>{e&&window.cancelAnimationFrame(e)}},[d,x]),d?(0,H.jsxs)("div",{className:"wap-accessibility-view notranslate",translate:"no",children:[(0,H.jsx)(r,{type:"default",text:"icon"!==d?.button?.buttonType?d?.button?.text:null,icon:"text"!==d?.button?.buttonType?(0,H.jsx)(a,{name:d?.button?.icon}):null,className:s("notranslate","wap-button-style-preset__preview-btn",d?.button?.position,d?.button?.buttonType&&`wap-button-style-preset__preview-btn--${d?.button?.buttonType}`,g&&"wap-accessibility-launcher--no-pointer"),style:{"--button-font-size":d?.button?.fontSize,"--button-icon-size":d?.button?.iconSize,"--button-color":d?.button?.color,"--button-bg":d?.button?.bgColor,"--button-padding":d?.button?.padding,"--button-radius":j(d?.button?.borderRadius),"--button-offset-x":d?.button?.offsetX?`${d?.button?.offsetX}px`:"","--button-offset-y":d?.button?.offsetY?`${d?.button?.offsetY}px`:""},onClick:()=>x(),onFocus:e=>e.preventDefault(),"aria-label":(0,B.__)("Accessibility Menu","website-accessibility")}),(0,H.jsx)(c,{open:g,onClose:T,placement:d?.panel?.wrapper?.position||"right",className:`wap-preset__preview-drawer notranslate wap-preset__preview-drawer--${d?.panel?.wrapper?.position||"right"}`,rootClassName:`wap-preset__preview-drawer-root notranslate wap-preset__preview-drawer-root--${d?.panel?.wrapper?.position||"right"}`,width:Number(d?.panel?.wrapper?.width)||400,styles:{wrapper:{maxHeight:`${L}vh`}},mask:!1,keyboard:!0,maskClosable:!1,autoFocus:!1,children:(0,H.jsx)(o,{panel:d?.panel,allProfiles:P,setIsOpen:T,isOpen:g,accessibilityContext:w,accessibilityDispatch:_,onFeatureInteraction:(e={})=>{p?.show_usage_statistics&&(A.current&&clearTimeout(A.current),C.current&&(clearTimeout(C.current),C.current=null),A.current=setTimeout(()=>{F(e||{})},1e3))}})}),l?(0,H.jsx)(l,{accessibilityContext:w,accessibilityDispatch:_,currentPreset:d,settings:p,isOpen:g}):null]}):null},J=({children:e})=>{const[i,s]=(0,t.useReducer)(V,W);return(0,H.jsx)(n.Provider,{value:{...i,dispatch:s},children:e})};O().startFromBoot(),window.addEventListener("load",()=>{const e=document.getElementById("website-accessibility-app");e&&(0,t.createRoot)(e).render((0,H.jsx)(J,{children:(0,H.jsx)(U,{})}))})})();
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.