1(()=>{var __defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res},__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},isPwa,getContrastTextColor,isReturningVisitor,urlBase64ToUint8Array,hasUrlParam,addParamToUrl,removeParamFromUrl,setCookie,getCookie,init_utils=__esm({"frontend/assets/js/dev/components/utils.js"(){isPwa=()=>{const isPwaDisplayMode=window.matchMedia("(display-mode: standalone)").matches||window.matchMedia("(display-mode: fullscreen)").matches||window.matchMedia("(display-mode: minimal-ui)").matches||window.navigator.standalone,isTwa=document.referrer.startsWith("android-app://"),isPwaParam=hasUrlParam("isPwa","true"),pwaSession=sessionStorage.getItem("isPwa");return isPwaDisplayMode||isTwa||isPwaParam||pwaSession},getContrastTextColor=backgroundColor=>{const temp=document.createElement("div");temp.style.backgroundColor=backgroundColor,temp.style.display="none",document.body.appendChild(temp);const computedColor=window.getComputedStyle(temp).backgroundColor;document.body.removeChild(temp);const[r,g,b]=computedColor.match(/\d+/g).map(Number);return(.299*r+.587*g+.114*b)/255>.5?"#000000":"#ffffff"},isReturningVisitor=()=>localStorage.getItem("pwa_has_visited")?!sessionStorage.getItem("pwa_first_session"):(localStorage.setItem("pwa_has_visited","true"),sessionStorage.setItem("pwa_first_session","true"),!1),urlBase64ToUint8Array=base64String=>{const padding="=".repeat((4-base64String.length%4)%4),base64=(base64String+padding).replace(/\-/g,"+").replace(/_/g,"/"),rawData=window.atob(base64),outputArray=new Uint8Array(rawData.length);for(let i=0;i<rawData.length;++i)outputArray[i]=rawData.charCodeAt(i);return outputArray},hasUrlParam=(paramName,paramValue="",url=window.location.href)=>
1{const urlObject=new URL(url);return paramValue?urlObject.searchParams.get(paramName)===paramValue:urlObject.searchParams.has(paramName)},addParamToUrl=(paramName,paramValue="",url=window.location.href)=>{const urlObject=new URL(url);return paramValue===""?(urlObject.searchParams.append(paramName,""),urlObject.href.replace(`${paramName}=`,paramName)):(urlObject.searchParams.set(paramName,paramValue),urlObject.href)},removeParamFromUrl=(paramName,url=window.location.href)=>{const urlObject=new URL(url);return urlObject.searchParams.delete(paramName),urlObject.href},setCookie=(name,value,days)=>{var expires="";if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/"},getCookie=name=>{for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)==" ";)c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}}}),PushNotificationsSubscriptionManager,pushNotificationsSubscription,pushNotificationsSubscription_default,init_pushNotificationsSubscription=__esm({"frontend/assets/js/dev/components/pushNotificationsSubscription.js"(){init_frontend(),init_utils(),PushNotificationsSubscriptionManager=class{constructor(){this.subscribers=new Set,this.currentState=this.determineInitialState(),this.initialize()}determineInitialState(){return!("serviceWorker"in navigator)||!("PushManager"in window)?"blocked":"unsubscribed"}async initialize(){try{if(Notification.permission==="denied"){this.updateState("blocked");return}
1const state=await this.getSubscriptionState();this.updateState(state)}catch(error){console.error("Error initializing push notifications:",error),this.updateState("blocked")}}subscribe(callback){return this.subscribers.add(callback),callback(this.currentState),()=>this.subscribers.delete(callback)}updateState(newState){if(!["loading","subscribed","unsubscribed","blocked"].includes(newState)){console.error("Invalid state:",newState);return}this.currentState!==newState&&(this.currentState=newState,this.notifySubscribers())}notifySubscribers(){this.subscribers.forEach(callback=>callback(this.currentState))}async getSubscriptionState(){if(Notification.permission==="denied")return"blocked";try{return await(await navigator.serviceWorker.ready).pushManager.getSubscription()?"subscribed":"unsubscribed"}catch(error){return console.error("Error getting subscription state:",error),"blocked"}}async addSubscription(){if(this.currentState!=="loading"){this.updateState("loading");try{if(Notification.permission==="default"){const permission=await Notification.requestPermission();if(permission==="denied"){this.updateState("blocked");return}if(permission!=="granted"){this.updateState("unsubscribed");return}}const subscription=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:urlBase64ToUint8Array(config.jsVars.vapidPublicKey)}),response=await fetch(`${config.jsVars.restUrl}${config.jsVars.slug}/addSubscription`,{method:"POST",credentials:"include",headers:{"X-WP-Nonce":config.jsVars.restNonce,"Content-Type":"application/json"},body:JSON.stringify({endpoint:subscription.endpoint,authKey:subscription.getKey("auth")?btoa(String.fromCharCode.apply(null,new Uint8Array(subscription.getKey("auth")))):null,p256dhKey:subscription.getKey("p256dh")?btoa(String.fromCharCode.apply(null,new Uint8Array(subscription.getKey("p256dh")))):null,contentEncoding:(PushManager.supportedContentEncodings||["aesgcm"])[0]})});if(!response.ok)throw new Error(await response.text()||"Subscription failed");return this.updateState("subscribed"),subscription}catch(error){throw console.error("Subscription error:",error),this.updateState(Notification.permission==="denied"?"blocked":"unsubscribed"),error}}}async removeSubscription(){if(this.currentState!=="loading"){this.updateState("loading");try{const subscription=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(!subscription){this.updateState("unsubscribed");return}const response=await fetch(`${config.jsVars.restUrl}${config.jsVars.slug}/removeSubscription`,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:subscription.endpoint})}),responseData=await response.json();if(!response.ok||responseData.status!=="success")throw new Error(responseData.message||"Failed to remove subscription");await subscription.unsubscribe(),this.updateState("unsubscribed")}catch(error){throw console.error("Unsubscribe error:",error),this.updateState("subscribed"),error}}}},pushNotificationsSubscription=new PushNotificationsSubscriptionManager,pushNotificationsSubscription_default=pushNotificationsSubscription}});async function gatherClientData(){const parts=[];return parts.push(navigator.userAgent||""),parts.push(navigator.language||""),parts.push(navigator.languages?navigator.languages.join(","):""),parts.push(screen.width||""),parts.push(screen.height||""),parts.push(screen.colorDepth||""),parts.push(new Date().getTimezoneOffset()),parts.push(navigator.hardwareConcurrency||""),parts.push(navigator.maxTouchPoints||""),parts.push(navigator.platform||""),parts.push(navigator.doNotTrack||""),parts.push(navigator.deviceMemory||""),parts.push(getWebGLInfo()),parts.push(getCanvasFingerprint()),parts.join("###")}function stringToUint8Array(str){return new TextEncoder().encode(str)}async function computeHash(data){if(window.crypto&&window.crypto.subtle)try{const encoded=stringToUint8Array(data),hashBuffer=await window.crypto.subtle.digest("SHA-256",encoded);return Array.from(new Uint8Array(hashBuffer)).map(b=>b.toString(16).padStart(2,"0")).join("")}catch{return fallbackHash(data)}else return fallbackHash(data)}function fallbackHash(str){let hash=0;for(let i=0;i<str.length;i++)hash=Math.imul(31,hash)+str.charCodeAt(i)|0;return"fallback_"+Math.abs(hash)}function getWebGLInfo(){try{const canvas=document.createElement("canvas"),gl=canvas.getContext("webgl")||canvas.getContext("experimental-webgl");
1if(!gl)return"";const debugInfo=gl.getExtension("WEBGL_debug_renderer_info");if(debugInfo){const vendor=gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL),renderer=gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);return`${vendor}###${renderer}`}}catch{}return""}function getCanvasFingerprint(){try{const canvas=document.createElement("canvas"),ctx=canvas.getContext("2d");return ctx.textBaseline="top",ctx.font="14px 'Arial'",ctx.fillStyle="#f60",ctx.fillRect(100,1,80,20),ctx.fillStyle="#069",ctx.fillText("Hello!",2,15),canvas.toDataURL()}catch{return""}}async function getOrCreatePwaUserId(){const STORAGE_KEY="pwaUserId";let existing=localStorage.getItem(STORAGE_KEY);if(existing)return existing;const data=await gatherClientData(),hash=await computeHash(data);return localStorage.setItem(STORAGE_KEY,hash),hash}var init_pwaUserId=__esm({"frontend/assets/js/dev/components/pwaUserId.js"(){}}),pwaTracker_exports={};__export(pwaTracker_exports,{initPwaTracker:()=>initPwaTracker});function setPwaSession(){sessionStorage.setItem("isPwa","true"),document.body.classList.add("isPwa")}async function sendPwaUsageEventToServer(retries=3){for(let i=0;i<retries;i++)try{const pwaUserId=await getOrCreatePwaUserId(),response=await fetch(`${config.jsVars.restUrl}${config.jsVars.slug}/upsertPwaUser`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({pwaUserId})});if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);return await response.json()}catch(error){if(i===retries-1)throw console.error("Failed to send tracking data after retries:",error),error;await new Promise(resolve=>setTimeout(resolve,1e3*(i+1)))}}async function initPwaTracker(){try{setPwaSession(),await sendPwaUsageEventToServer()}catch(error){console.error("Failed to track PWA session:",error)}}var init_pwaTracker=__esm({"frontend/assets/js/dev/modules/pwaTracker.js"(){init_frontend(),init_pwaUserId()}}),pwaCustomCssAndJs_exports={};__export(pwaCustomCssAndJs_exports,{initPwaCustomCssAndJs:()=>initPwaCustomCssAndJs});async function initPwaCustomCssAndJs(){const style=document.createElement("style"),script=document.createElement("script");style.textContent=config.jsVars.settings.uiComponents.pwaCustomCssAndJs.css||"",script.textContent=config.jsVars.settings.uiComponents.pwaCustomCssAndJs.js||"",document.head.appendChild(style),document.body.appendChild(script)}var init_pwaCustomCssAndJs=__esm({"frontend/assets/js/dev/modules/pwaCustomCssAndJs.js"(){init_frontend()}});function performInstallation(){const existingPrompt=document.querySelector("pwa-install-prompt");existingPrompt&&existingPrompt.remove(),customElements.get("pwa-install-prompt")||customElements.define("pwa-install-prompt",PwaInstallPrompt),PwaInstallPrompt.show()}var deferredInstallPrompt,svg,PwaInstallPrompt,init_installPrompt=__esm({"frontend/assets/js/dev/components/installPrompt.js"(){init_frontend(),init_utils(),deferredInstallPrompt=null,window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),deferredInstallPrompt=e}),window.addEventListener("appinstalled",()=>{deferredInstallPrompt=null}),svg={vertThreeDots:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>',horizThreeDots:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z"/></svg>',iosShare:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M240-40q-33 0-56.5-23.5T160-120v-440q0-33 23.5-56.5T240-640h80q17 0 28.5 11.5T360-600q0 17-11.5 28.5T320-560h-80v440h480v-440h-80q-17 0-28.5-11.5T600-600q0-17 11.5-28.5T640-640h80q33 0 56.5 23.5T800-560v440q0 33-23.5 56.5T720-40H240Zm200-727-36 36q-12 12-28 11.5T348-732q-11-12-11.5-28t11.5-28l104-104q12-12 28-12t28 12l104 104q11 11 11 27.5T612-732q-12 12-28.5 12T555-732l-35-35v407q0 17-11.5 28.5T480-320q-17 0-28.5-11.5T440-360v-407Z"/></svg>',plusInBox:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M440-440v120q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-120h120q17 0 28.5-11.5T680-480q0-17-11.5-28.5T640-520H520v-120q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640v120H320q-17 0-28.5 11.5T280-480q0 17 11.5 28.5T320-440h120ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg>',tapFinger:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M419-80q-28 0-52.5-12T325-126L124-381q-8-9-7-21.5t9-20.5q20-21 48-25t52 11l74 45v-328q0-17 11.5-28.5T340-760q17 0 29 11.5t12 28.5v400q0 23-20.5 34.5T320-286l-36-22 104 133q6 7 14 11t17 4h221q33 0 56.5-23.5T720-240v-160q0-17-11.5-28.5T680-440H501q-17 0-28.5-11.5T461-480q0-17 11.5-28.5T501-520h179q50 0 85 35t35 85v160q0 66-47 113T640-80H419Zm83-260Zm-23-260q-17 0-28.5-11.5T439-640q0-2 5-20 8-14 12-28.5t4-31.5q0-50-35-85t-85-35q
1-50 0-85 35t-35 85q0 17 4 31.5t12 28.5q3 5 4 10t1 10q0 17-11 28.5T202-600q-11 0-20.5-6T167-621q-13-22-20-47t-7-52q0-83 58.5-141.5T340-920q83 0 141.5 58.5T540-720q0 27-7 52t-20 47q-5 9-14 15t-20 6Z"/></svg>',hamburgerMenu:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M160-240q-17 0-28.5-11.5T120-280q0-17 11.5-28.5T160-320h640q17 0 28.5 11.5T840-280q0 17-11.5 28.5T800-240H160Zm0-200q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520h640q17 0 28.5 11.5T840-480q0 17-11.5 28.5T800-440H160Zm0-200q-17 0-28.5-11.5T120-680q0-17 11.5-28.5T160-720h640q17 0 28.5 11.5T840-680q0 17-11.5 28.5T800-640H160Z"/></svg>',upload:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M240-160q-33 0-56.5-23.5T160-240v-80q0-17 11.5-28.5T200-360q17 0 28.5 11.5T240-320v80h480v-80q0-17 11.5-28.5T760-360q17 0 28.5 11.5T800-320v80q0 33-23.5 56.5T720-160H240Zm200-486-75 75q-12 12-28.5 11.5T308-572q-11-12-11.5-28t11.5-28l144-144q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l144 144q12 12 11.5 28T652-572q-12 12-28.5 12.5T595-571l-75-75v286q0 17-11.5 28.5T480-320q-17 0-28.5-11.5T440-360v-286Z"/></svg>',safari:'<svg style="width:1.5rem;height:1.5rem;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5120 5120"><linearGradient x2="0" y2="100%" id="a"><stop offset="0" stop-color="#19d7ff"/><stop offset="1" stop-color="#1e64f0"/></linearGradient><circle cx="2560" cy="2560" r="2240" fill="url(#a)"/><path fill="red" d="M4090 1020 2370 2370l4e2 4e2z"/><path fill="#fff" d="M1020 4090l1350-1720 4e2 4e2z"/><path stroke="#fff" stroke-width="30" d="M2560 540v330m0 3370v330m350-4e3-57 325m-586 3318-57 327M3250 662l-113 310M1984 4138l-113 310m339-3878 57 325m586 3318 57 327M1870 662l113 310m1152 3166 113 310M1552 810l166 286m1685 2918 165 286M1265 1010l212 253m2166 2582 212 253M1015 1258l253 212m2582 2168 253 212M813 1548l286 165m2920 1685 286 165M665 1866l310 113m3166 1150 310 113M574 2202l326 58m3320 588 325 57M545 2555h330m3370 0h330M575 2905l325-57m3320-586 325-57M668 3245l310-113m3165-1152 310-113M815 3563l286-165m2920-1685 286-165M1016 3850l253-212m2580-2166 253-212M1262 41e2l212-253m2166-2582 212-253M1552 43e2l166-286m1685-2918 165-286M2384 548l16 180m320 3656 16 180M2038 610l47 174m950 3544 47 174M1708 730l76 163m1550 3326 77 163M1404 904l103 148m2106 3006 103 148M1135 1130l127 127m2596 2596 127 127M910 14e2l148 103m3006 2107 146 1e2M734 1703l163 76m3326 1550 163 77M614 2033l174 47m3544 950 174 47M553 2380l180 16m3656 320 180 16m-4014 0 180-16m3656-320 180-16M614 3077l174-47m3544-950 174-47M734 3407l163-76m3326-1550 163-76M910 3710l148-103m3006-2107 146-1e2M1404 4206l103-148m2105-3006 104-148M1708 4380l77-163M3335 890l77-163M2038 45e2l47-174m950-3544 47-174m-698 3952 16-180m320-3656 16-180"/></svg>',googleChrome:'<svg style="width:1.5rem;height:1.5rem;" xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 276 276"><linearGradient id="a" x1="145" x2="34" y1="253" y2="61" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1e8e3e"/><stop offset="1" stop-color="#34a853"/></linearGradient><linearGradient id="b" x1="111" x2="222" y1="254" y2="62" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fcc934"/><stop offset="1" stop-color="#fbbc04"/></linearGradient><linearGradient id="c" x1="17" x2="239" y1="80" y2="80" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#d93025"/><stop offset="1" stop-color="#ea4335"/></linearGradient><circle cx="128" cy="128" r="64" fill="#fff"/><path fill="url(#a)" d="M96 183.4A63.7 63.7 0 0 1 72.6 160L17.2 64A128 128 0 0 0 128 256l55.4-96A64 64 0 0 1 96 183.4Z"/><path fill="url(#b)" d="M192 128a63.7 63.7 0 0 1-8.6 32L128 256A128 128 0 0 0 238.9 64h-111a64 64 0 0 1 64 64Z"/><circle cx="128" cy="128" r="52" fill="#1a73e8"/><path fill="url(#c)" d="M96 72.6a63.7 63.7 0 0 1 32-8.6h110.8a128 128 0 0 0-221.7 0l55.5 96A64 64 0 0 1 96 72.6Z"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-520q0-17 11.5-28.5T160-720q17 0 28.5 11.5T200-680v520h400q17 0 28.5 11.5T640-120q0 17-11.5 28.5T600-80H200Zm160-240v-480 480Z"/></svg>',pasteGo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M727-240H520q-17 0-28.5-11.5T480-280q0-17 11.5-28.5T520-320h207l-36-36q-11-11-11-27.5t12-28.5q11-11 28-11t28 11l104 104q12 12 12 28t-12 28L748-148q-12 12-28 11.5T692-149q-11-12-11.5-28t11.5-28l35-35ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h167q11-35 43-57.5t70-22.5q40 0 71.5 22.5T594-840h166q33 0 56.5 23.5T840-760v200q0 17-11.5 28.5T800-520q-17 0-28.5-11.5T760-560v-200h-80v80q0 17-11.5 28.5T640-640H320q-17 0-28.5-11.5T280-680v-80h-80v560h160q17 0 28.5 11.5T400-160q0 17-11.5 28.5T360-120H200Zm280-640q17 0 28.5-11.5T520-800q0-17-11.5-28.5T480-840q-1
17 0-28.5 11.5T440-800q0 17 11.5 28.5T480-760Z"/></svg>',installDesktop:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M320-160v-40H160q-33 0-56.5-23.5T80-280v-480q0-33 23.5-56.5T160-840h280q17 0 28.5 11.5T480-800q0 17-11.5 28.5T440-760H160v480h640v-80q0-17 11.5-28.5T840-400q17 0 28.5 11.5T880-360v80q0 33-23.5 56.5T800-200H640v40q0 17-11.5 28.5T600-120H360q-17 0-28.5-11.5T320-160Zm320-393v-247q0-17 11.5-28.5T680-840q17 0 28.5 11.5T720-800v247l76-75q11-11 27.5-11.5T852-628q11 11 11 28t-11 28L708-428q-12 12-28 12t-28-12L508-572q-11-11-11.5-27.5T508-628q11-11 28-11t28 11l76 75Z"/></svg>',installMobile:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-40q-33 0-56.5-23.5T200-120v-720q0-33 23.5-56.5T280-920h240q17 0 28.5 11.5T560-880q0 17-11.5 28.5T520-840H280v40h240q17 0 28.5 11.5T560-760q0 17-11.5 28.5T520-720H280v480h400v-40q0-17 11.5-28.5T720-320q17 0 28.5 11.5T760-280v160q0 33-23.5 56.5T680-40H280Zm0-120v40h400v-40H280Zm400-392v-248q0-17 11.5-28.5T720-840q17 0 28.5 11.5T760-800v248l76-76q11-11 28-11t28 11q11 11 11 28t-11 28L748-428q-12 12-28 12t-28-12L548-572q-11-11-11-28t11-28q11-11 28-11t28 11l76 76ZM280-800v-40 40Zm0 640v40-40Z"/></svg>',fileSave:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="m680-272-36-36q-11-11-28-11t-28 11q-11 11-11 28t11 28l104 104q12 12 28 12t28-12l104-104q11-11 11-28t-11-28q-11-11-28-11t-28 11l-36 36v-127q0-17-11.5-28.5T720-439q-17 0-28.5 11.5T680-399v127ZM600-80h240q17 0 28.5 11.5T880-40q0 17-11.5 28.5T840 0H600q-17 0-28.5-11.5T560-40q0-17 11.5-28.5T600-80Zm-360-80q-33 0-56.5-23.5T160-240v-560q0-33 23.5-56.5T240-880h247q16 0 30.5 6t25.5 17l194 194q11 11 17 25.5t6 30.5v48q0 17-11.5 28.5T720-519q-17 0-28.5-11.5T680-559v-41H540q-25 0-42.5-17.5T480-660v-140H240v560h200q17 0 28.5 11.5T480-200q0 17-11.5 28.5T440-160H240Zm0-80v-560 560Z"/></svg>',mouseClick:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M120-560h40q17 0 28.5 11.5T200-520q0 17-11.5 28.5T160-480h-40q-17 0-28.5-11.5T80-520q0-17 11.5-28.5T120-560Zm68 216 28-28q12-12 28-11.5t28 11.5q12 12 12.5 28.5T273-315l-28 28q-12 12-28.5 11.5T188-288q-11-12-11.5-28t11.5-28Zm28-324-28-28q-12-12-11.5-28t11.5-28q12-12 28.5-12.5T245-753l28 28q12 12 11.5 28.5T272-668q-12 11-28 11.5T216-668Zm476 480L530-350l-30 90q-2 7-7.5 10.5T481-246q-6 0-11.5-4t-7.5-11l-86-286q-2-8 .5-16t7.5-13q5-5 13-7.5t16-.5l288 86q7 2 10.5 7.5T715-479q0 6-3 11.5t-10 7.5l-90 32 160 160q12 12 12 28t-12 28l-24 24q-12 12-28 12t-28-12ZM400-760v-40q0-17 11.5-28.5T440-840q17 0 28.5 11.5T480-800v40q0 17-11.5 28.5T440-720q-17 0-28.5-11.5T400-760Zm207 35 29-29q11-11 27.5-11.5T692-754q11 11 11.5 27.5T693-698l-29 30q-11 12-27.5 11.5T608-668q-12-12-12.5-28.5T607-725Z"/></svg>',appsGrid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M638-468 468-638q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l170-170q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l170 170q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L694-468q-6 6-13 8.5t-15 2.5q-8 0-15-2.5t-13-8.5Zm-518-92v-240q0-17 11.5-28.5T160-840h240q17 0 28.5 11.5T440-800v240q0 17-11.5 28.5T400-520H160q-17 0-28.5-11.5T120-560Zm400 400v-240q0-17 11.5-28.5T560-440h240q17 0 28.5 11.5T840-400v240q0 17-11.5 28.5T800-120H560q-17 0-28.5-11.5T520-160Zm-400 0v-240q0-17 11.5-28.5T160-440h240q17 0 28.5 11.5T440-400v240q0 17-11.5 28.5T400-120H160q-17 0-28.5-11.5T120-160Zm80-440h160v-160H200v160Zm467 48 113-113-113-113-113 113 113 113Zm-67 352h160v-160H600v160Zm-400 0h160v-160H200v160Zm160-400Zm194-65ZM360-360Zm240 0Z"/></svg>',directionDown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M200-120q-17 0-28.5-11.5T160-160q0-17 11.5-28.5T200-200h560q17 0 28.5 11.5T800-160q0 17-11.5 28.5T760-120H200Zm280-177q-8 0-15-2.5t-13-8.5L308-452q-11-11-11-28t11-28q11-11 28-11t28 11l76 76v-368q0-17 11.5-28.5T480-840q17 0 28.5 11.5T520-800v368l76-76q11-11 28-11t28 11q11 11 11 28t-11 28L508-308q-6 6-13 8.5t-15 2.5Z"/></svg>',addToHomeScreen:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M320-40q-33 0-56.5-23.5T240-120v-120q0-17 11.5-28.5T280-280q17 0 28.5 11.5T320-240h400v-480H320q0 17-11.5 28.5T280-680q-17 0-28.5-11.5T240-720v-120q0-33 23.5-56.5T320-920h400q33 0 56.5 23.5T800-840v720q0 33-23.5 56.5T720-40H320Zm0-120v40h400v-40H320Zm80-344L204-308q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196H240q-17 0-28.5-11.5T200-600q0-17 11.5-28.5T240-640h200q17 0 28.5 11.5T480-600v200q0 17-11.5 28.5T440-360q-17 0-28.5-11.5T400-400v-104Zm-80-296h400v-40H320v40Zm0 0v-40 40Zm0 640v40-40Z"/></svg>',noInstallSupport:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
1<path d="M792-56 56-792q-11-11-11-28t11-28q11-11 28-11t28 11l736 736q11 11 11 28t-11 28q-11 11-28 11t-28-11ZM200-703l80 80v383h384l96 96v24q0 33-23.5 56.5T680-40H280q-33 0-56.5-23.5T200-120v-583Zm80 543v40h400v-40H280Zm0 0v40-40Zm79-560q-17 0-28-11.5T320-760q0-17 11.5-28.5T360-800h320v-40H260q-17 0-28.5-11.5T220-880q0-17 11.5-28.5T260-920h420q33 0 56.5 23.5T760-840v480q0 17-11.5 28.5T720-320q-17 0-28.5-11.5T680-360v-360H359Zm98-80Z"/></svg>'},PwaInstallPrompt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}async connectedCallback(){this.render(),this.handleRemove(),this.handleClipboard(),this.handleNativeInstall(),this.hasAttribute("loaded")||(await this.handleCheckInstallCapabilities(),this.setAttribute("loaded",""),this.handleUpdateContent())}static show(){let prompt=document.querySelector("pwa-install-prompt");return prompt||(prompt=document.createElement("pwa-install-prompt"),document.body.appendChild(prompt),requestAnimationFrame(()=>{const installPrompt=prompt.shadowRoot.querySelector(".install-prompt");document.documentElement.style.paddingRight=`${window.innerWidth-document.documentElement.offsetWidth}px`,document.documentElement.style.overflow="hidden",installPrompt.classList.add("visible")})),prompt}injectStyles(css){this.styles.add(css)}handleRemove(){const closeIcon=this.shadowRoot.querySelector(".install-prompt-close"),closeButton=this.shadowRoot.querySelector(".install-prompt-footer_close"),backdrop=this.shadowRoot.querySelector(".install-prompt"),handleClose=()=>{backdrop.classList.remove("visible"),backdrop.addEventListener("transitionend",()=>{document.documentElement.style.removeProperty("overflow"),document.documentElement.style.paddingRight="",this.remove()},{once:!0})};closeIcon.addEventListener("click",handleClose),closeButton.addEventListener("click",handleClose),backdrop.addEventListener("click",e=>{e.target===backdrop&&handleClose()})}handleClipboard(){this.shadowRoot.querySelectorAll("[data-clipboard-content]").forEach(button=>{button.addEventListener("click",async()=>{const content=button.getAttribute("data-clipboard-content"),defaultIcon=button.querySelector(".clipboard-default"),successIcon=button.querySelector(".clipboard-success"),tooltip=button.querySelector(".tooltip");try{await navigator.clipboard.writeText(content),defaultIcon.style.display="none",successIcon.style.display="block",tooltip.classList.add("visible"),button.disabled=!0,setTimeout(()=>{defaultIcon.style.display="block",successIcon.style.display="none",tooltip.classList.remove("visible"),button.disabled=!1},2e3)}catch(err){console.error("Failed to copy:",err)}})})}async handleCheckInstallCapabilities(){return new Promise(resolve=>{if(deferredInstallPrompt){resolve(!0);return}const timeout=setTimeout(()=>resolve(!1),1700);window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),clearTimeout(timeout),deferredInstallPrompt=e,resolve(!0)},{once:!0})})}handleUpdateContent(){const contentContainer=this.shadowRoot.querySelector(".install-prompt-body");if(contentContainer){contentContainer.innerHTML=this.renderContent();const styleTag=this.shadowRoot.querySelector("style");styleTag.textContent=Array.from(this.styles).join(` 2`),this.handleClipboard(),this.handleNativeInstall()}}handleNativeInstall(){const nativeButton=this.shadowRoot.querySelector("#native-install-btn");nativeButton&&deferredInstallPrompt&&nativeButton.addEventListener("click",async()=>{try{await deferredInstallPrompt.prompt();const result=await deferredInstallPrompt.userChoice;deferredInstallPrompt=null,result.outcome==="accepted"&&this.remove()}catch(error){console.error("Native installation failed:",error),this.handleUpdateContent()}})}renderAppIcon(){if(!config.jsVars.iconUrl)return"";this.injectStyles(` 3 .install-prompt-body-appinfo_icon { 4 border-radius: 9999px; 5 border: 1px solid #e5e7eb; 6 -ms-flex-negative: 0; 7 flex-shrink: 0; 8 height: 55px; 9 width: 55px; 10 display: inline-block; 11 } 12 `);const appName=config.jsVars.settings.webAppManifest.appIdentity.appName;return` 13 <img 14 class="install-prompt-body-appinfo_icon" 15 src="${config.jsVars.iconUrl}" 16 alt="${appName}" 17 onerror="this.style.display='none'" 18 > 19 `}renderAppName(){this.injectStyles(` 20 .install-prompt-body-appinfo_appname { 21 font-size: 1rem; 22 line-height: 1.5rem; 23 font-weight: 500; 24 color: #1f2937; 25 display: -webkit-box; 26 overflow: hidden; 27 -webkit-box-orient: vertical; 28 -webkit-line-clamp: 1; 29 } 30 `);const appName=config.jsVars.settings.webAppManifest.appIdentity.appName;return appName?` 31 <div class="install-prompt-body-appinfo_appname">${appName}</div> 32 `:""}renderAppDescription(){this.injectStyles(` 33 .install-prompt-body-appinfo_description { 34 font-size: 0.75rem; 35 line-height: 1rem; 36 font-weight: 400; 37 color: #6b7280; 38 margin-top: 0.12rem; 39 display: -webkit-box; 40 overflow: hidden; 41 -webkit-box-orient: vertical; 42 -webkit-line-clamp: 1; 43 } 44 `);const description=config.jsVars.settings.webAppManifest.appIdentity.description;return description?` 45 <div class="install-prompt-body-appinfo_description">${description}</div> 46 `:""}renderAppInfo(){return this.injectStyles(` 47 .install-prompt-body-appinfo { 48 display: -webkit-box; 49 display: -ms-flexbox; 50 display: flex; 51 -webkit-box-align: center; 52 -ms-flex-align: center; 53 align-items: center; 54 background: #f3f4f6; 55 padding: 0.5rem; 56 border-radius: 0.5rem; 57 border: 1px solid #e5e7eb; 58 } 59 60 .install-prompt-body-appinfo_texts { 61 padding-left: 0.5rem; 62 } 63 `),` 64 <div class="install-prompt-body-appinfo"> 65 ${this.renderAppIcon()} 66 <div class="install-prompt-body-appinfo_texts"> 67 ${this.renderAppName()} 68 ${this.renderAppDescription()} 69 </div> 70 </div> 71 `}renderCopyInstallUrlButton(){var _a;this.injectStyles(` 72 .install-prompt-body-instructions_step_copy { 73 position: relative; 74 display: -webkit-box; 75 display: -ms-flexbox; 76 display: flex; 77 font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 78 -webkit-box-pack: center; 79 -ms-flex-pack: center; 80 justify-content: center; 81 -webkit-box-align: center; 82 -ms-flex-align: center; 83 align-items: center; 84 -webkit-column-gap: 0.5rem; 85 -moz-column-gap: 0.5rem; 86 column-gap: 0.5rem; 87 font-size: 0.875rem; 88 line-height: 0.875rem; 89 padding: 10px 13px; 90 border-radius: 0.5rem; 91 border: 1px solid #e5e7eb; 92 background-color: #ffffff; 93 color: #1f2937; 94 -webkit-box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 95 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 96 outline: none; 97 -webkit-transition: all .1s ease; 98 -o-transition: all .1s ease; 99 transition: all .1s ease; 100 cursor: pointer; 101 margin-top: 0.5rem; 102 } 103 104 .install-prompt-body-instructions_step_copy:hover, 105 .install-prompt-body-instructions_step_copy:focus { 106 background-color: #f9fafb; 107 } 108 109 .install-prompt-body-instructions_step_copy_url { 110 -o-text-overflow: ellipsis; 111 text-overflow: ellipsis; 112 overflow: hidden; 113 -webkit-box-orient: vertical; 114 -webkit-line-clamp: 1; 115 max-width: 15rem; 116 } 117 118 .install-prompt-body-instructions_step_copy_icons { 119 display: -webkit-box; 120 display: -ms-flexbox; 121 display: flex; 122 -webkit-box-align: center; 123 -ms-flex-align: center; 124 align-items: center; 125 -webkit-box-pack: center; 126 -ms-flex-pack: center; 127 justify-content: center; 128 border-left: 1px solid #e5e7eb; 129 -webkit-padding-start: 0.75rem; 130 padding-inline-start: 0.75rem; 131 } 132 133 .install-prompt-body-instructions_step_copy_svg { 134 width: 1rem; 135 height: 1rem; 136 } 137 138 .install-prompt-body-instructions_step_copy_svg.clipboard-success { 139 display: none; 140 width: 1rem; 141 height: 1rem; 142 color: #2563eb; 143 } 144 145 .install-prompt-body-instructions_step_copy_tooltip { 146 display: none; 147 opacity: 0; 148 visibility: hidden; 149 position: absolute; 150 top: -2rem; 151 -webkit-transition: all 0.1s ease; 152 -o-transition: all 0.1s ease; 153 transition: all 0.1s ease; 154 z-index: 10; 155 padding: 0.25rem 0.5rem; 156 background-color: #111827; 157 font-size: 0.75rem; 158 line-height: 1rem; 159 font-weight: 500; 160 color: #ffffff; 161 border-radius: 0.5rem; 162 -webkit-box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 163 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 164 cursor: default; 165 } 166 167 .install-prompt-body-instructions_step_copy_tooltip.visible { 168 visibility: visible; 169 opacity: 1; 170 } 171 `);const startPagePath=(_a=config.jsVars.settings.webAppManifest.displaySettings)==null?void 0:_a.startPagePath;return startPagePath?` 172 <button type="button" class="install-prompt-body-instructions_step_copy" data-clipboard-content="${addParamToUrl("performInstallation","true",config.jsVars.homeUrl+startPagePath)}">
173 <span class="install-prompt-body-instructions_step_copy_url"> 174 ${config.jsVars.homeUrl+startPagePath} 175 </span> 176 <span class="install-prompt-body-instructions_step_copy_icons"> 177 <svg class="install-prompt-body-instructions_step_copy_svg clipboard-default" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> 178 <rect width="8" height="4" x="8" y="2" rx="1" ry="1"></rect> 179 <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path> 180 </svg> 181 <svg class="install-prompt-body-instructions_step_copy_svg clipboard-success" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> 182 <polyline points="20 6 9 17 4 12"></polyline> 183 </svg> 184 </span> 185 <span class="install-prompt-body-instructions_step_copy_tooltip" role="tooltip"> 186 ${wp.i18n.__("Copied",config.jsVars.slug)} 187 </span> 188 </button> 189 `:""}renderLoadingInstallCheck(){return this.injectStyles(` 190 .install-prompt-loading { 191 display: -webkit-box; 192 display: -ms-flexbox; 193 display: flex; 194 -webkit-box-orient: vertical; 195 -webkit-box-direction: normal; 196 -ms-flex-direction: column; 197 flex-direction: column; 198 -webkit-box-align: center; 199 -ms-flex-align: center; 200 align-items: center; 201 -webkit-box-pack: center; 202 -ms-flex-pack: center; 203 justify-content: center; 204 } 205 206 .install-prompt-loading-spinner { 207 width: 2rem; 208 height: 2rem; 209 border: 3px solid #f3f4f6; 210 border-top-color: #1f2937; 211 border-radius: 50%; 212 -webkit-animation: spinner 0.6s linear infinite; 213 animation: spinner 0.6s linear infinite; 214 } 215 216 @-webkit-keyframes spinner { 217 to { 218 -webkit-transform: rotate(360deg); 219 transform: rotate(360deg); 220 } 221 } 222 223 @keyframes spinner { 224 to { 225 -webkit-transform: rotate(360deg); 226 transform: rotate(360deg); 227 } 228 } 229 230 .install-prompt-loading-text { 231 margin-top: 1rem; 232 font-size: 0.875rem; 233 line-height: 1.25rem; 234 color: #374151; 235 } 236 `),` 237 <div class="install-prompt-loading"> 238 <div class="install-prompt-loading-spinner"></div> 239 <div class="install-prompt-loading-text">${wp.i18n.__("Checking installation capabilities...",config.jsVars.slug)}</div> 240 </div> 241 `}renderNativeInstallButton(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",textColor=getContrastTextColor(themeColor);this.injectStyles(` 242 .install-prompt-native-button { 243 width: 100%; 244 display: -webkit-box; 245 display: -ms-flexbox; 246 display: flex; 247 -webkit-box-pack: center; 248 -ms-flex-pack: center; 249 justify-content: center; 250 -webkit-box-align: center; 251 -ms-flex-align: center; 252 align-items: center; 253 gap: 0.5rem; 254 padding: 1rem; 255 font-weight: 500; 256 font-size: 0.875rem; 257 line-height: 1.25rem; 258 border-radius: 0.5rem; 259 color: ${textColor}; 260 background-color: ${themeColor}; 261 -webkit-transition: all 0.1s ease; 262 -o-transition: all 0.1s ease; 263 transition: all 0.1s ease; 264 cursor: pointer; 265 outline: none; 266 border: none; 267 margin-top: 1.5rem; 268 } 269 270 .install-prompt-native-button:hover { 271 opacity: 0.8; 272 } 273 274 .install-prompt-native-button:focus { 275 outline: 2px solid #60a5fa; 276 outline-offset: 2px; 277 } 278 279 .install-prompt-native-button svg { 280 width: 1.25rem; 281 height: 1.25rem; 282 } 283 `);const{device,os,browser}=config.jsVars.userData;let btnIconSvg="",btnIconText=wp.i18n.__("Click to Install",config.jsVars.slug);return device.isSmartphone||device.isTablet?(btnIconSvg=svg.installMobile,btnIconText=wp.i18n.__("Tap to Install",config.jsVars.slug)):device.isDesktop&&(btnIconSvg=svg.installDesktop),` 284 <button type="button" class="install-prompt-native-button" id="native-install-btn"> 285 ${btnIconSvg} 286 ${btnIconText} 287 </button> 288 `}renderContent(){return this.hasAttribute("loaded")?deferredInstallPrompt?` 289 ${this.renderAppInfo()} 290 ${this.renderNativeInstallButton()} 291 `:` 292 ${this.renderAppInfo()} 293 ${this.renderManualInstallInstructions()} 294 `:` 295 ${this.renderLoadingInstallCheck()} 296 `}renderStep(stepNumber,title="",description="",icon="",extraHtml=""){return this.injectStyles(` 297 .install-prompt-body-instructions_step { 298 position: relative; 299 -webkit-padding-start: 2.8rem; 300 padding-inline-start: 2.8rem; 301 padding-bottom: 2.2rem; 302 counter-increment: step 1; 303 } 304 305 .install-prompt-body-instructions_step:last-child { 306 padding-bottom: 0px; 307 } 308 309 .install-prompt-body-instructions_step-icon { 310 position: absolute; 311 display: -webkit-box; 312 display: -ms-flexbox; 313 display: flex; 314 inset-inline-start: 0px; 315 -webkit-box-align: center; 316 -ms-flex-align: center; 317 align-items: center; 318 -webkit-box-pack: center; 319 -ms-flex-pack: center; 320 justify-content: center; 321 width: 2rem; 322 height: 2rem; 323 color: #1f2937; 324 border-radius: 9999px; 325 background-color: #f3f4f6; 326 } 327 328 .install-prompt-body-instructions_step-icon svg { 329 width: 1.25rem; 330 height: 1.25rem; 331 -ms-flex-negative: 0; 332 flex-shrink: 0; 333 } 334 335 .install-prompt-body-instructions_step-icon:empty::before { 336 content: counter(step); 337 font-size: 0.75rem; 338 line-height: 1rem; 339 font-weight: 600; 340 } 341 342 .install-prompt-body-instructions_step { 343 counter-increment: step; 344 } 345 346 .install-prompt-body-instructions_step:last-child::after { 347 display: none; 348 } 349 350 .install-prompt-body-instructions_step::after { 351 content: ''; 352 position: absolute; 353 top: 2.5rem; 354 bottom: 0.5rem; 355 inset-inline-start: 0.95rem; 356 width: 1px; 357 -webkit-transform: translateX(0.5px); 358 -ms-transform: translateX(0.5px); 359 transform: translateX(0.5px); 360 background-color: #e5e7eb; 361 } 362 363 .install-prompt-body-instructions_step_title { 364 display: block; 365 font-weight: 600; 366 font-size: 0.875rem; 367 line-height: 1.25rem; 368 color: #1f2937; 369 } 370 371 .install-prompt-body-instructions_step_description { 372 font-size: 0.8rem; 373 color: #6b7280; 374 line-height: 1.1rem; 375 margin: 0; 376 padding: 0; 377 margin-top: 0.2rem; 378 } 379 `),` 380 <li class="install-prompt-body-instructions_step"> 381 ${icon?`<div class="install-prompt-body-instructions_step-icon">${icon}</div>`:'<div class="install-prompt-body-instructions_step-icon"></div>'}
382 <span class="install-prompt-body-instructions_step_title"> 383 ${stepNumber}. ${title} 384 </span> 385 <p class="install-prompt-body-instructions_step_description"> 386 ${description} 387 </p> 388 ${extraHtml} 389 </li> 390 `}renderManualInstallInstructions(){this.injectStyles(` 391 .install-prompt-body-instructions { 392 list-style: none; 393 margin: 0; 394 margin-top: 1.5rem; 395 padding: 0; 396 } 397 `);const{device,os,browser}=config.jsVars.userData;let steps=[],stepNumber=1;const renderStep=(...args)=>{steps.push(this.renderStep(stepNumber,...args)),stepNumber++};return device.isSmartphone||device.isTablet?os.isAndroid?browser.isChrome?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three dots), located at the top-right of your screen.",config.jsVars.slug),svg.vertThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option from the menu.',config.jsVars.slug),svg.addToHomeScreen),renderStep(wp.i18n.__('Confirm by Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" text on the browser installation dialog.',config.jsVars.slug),svg.tapFinger)):browser.isFirefox?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three dots), located at the top-right of your screen.",config.jsVars.slug),svg.vertThreeDots),renderStep(wp.i18n.__('Select "Install"',config.jsVars.slug),wp.i18n.__('Tap the "Install" option from the menu.',config.jsVars.slug),svg.addToHomeScreen),renderStep(wp.i18n.__('Confirm by Tapping "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" button on the browser installation dialog.',config.jsVars.slug),svg.tapFinger)):browser.isOpera?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three dots), located at the top-right of your screen.",config.jsVars.slug),svg.vertThreeDots),renderStep(wp.i18n.__('Select "Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Install" option from the menu.',config.jsVars.slug),svg.installMobile),renderStep(wp.i18n.__('Confirm by Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" text on the browser installation dialog.',config.jsVars.slug),svg.tapFinger)):browser.isEdge?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three horizontal lines) located at the bottom-right of your screen.",config.jsVars.slug),svg.hamburgerMenu),renderStep(wp.i18n.__('Select "Add to Phone"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Phone" option from the menu',config.jsVars.slug),svg.installMobile),renderStep(wp.i18n.__('Confirm by Tapping "Install"',config.jsVars.slug),wp.i18n.__('Tap the "Install" text on the browser installation dialog.',config.jsVars.slug),svg.tapFinger)):(renderStep(wp.i18n.__("Copy the Page URL",config.jsVars.slug),wp.i18n.__("Click the button below to copy the page's URL.",config.jsVars.slug),svg.copy,this.renderCopyInstallUrlButton()),renderStep(wp.i18n.__("Open the Google Chrome Browser",config.jsVars.slug),wp.i18n.__("Launch the Google Chrome web browser from your home screen.",config.jsVars.slug),svg.googleChrome),renderStep(wp.i18n.__("Paste and Open the URL",config.jsVars.slug),wp.i18n.__("Paste the copied URL into Google Chrome's address bar and open the page.",config.jsVars.slug),svg.pasteGo)):os.isIos?browser.isSafari?(renderStep(wp.i18n.__("Tap the Menu button",config.jsVars.slug),wp.i18n.__("Open Safari menu (three horizontal dots) located at the bottom-right of the address bar.",config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Share"',config.jsVars.slug),wp.i18n.__('Tap the "Share" option, which is the first item in the menu at the top-center of your screen.',config.jsVars.slug),svg.iosShare),renderStep(wp.i18n.__("Tap the More button",config.jsVars.slug),wp.i18n.__('Tap the "More" button (three horizontal dots) located at the bottom-right of the share dialog.',config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option, represented by the plus [+] icon.',config.jsVars.slug),svg.plusInBox),renderStep(wp.i18n.__('Confirm b
397y Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" button at the top-right corner of your screen.',config.jsVars.slug),svg.tapFinger)):browser.isChrome?(renderStep(wp.i18n.__("Tap the Share Icon",config.jsVars.slug),wp.i18n.__("Tap the share icon located at the top-right of your browser address bar.",config.jsVars.slug),svg.iosShare),renderStep(wp.i18n.__("Tap the More button",config.jsVars.slug),wp.i18n.__('Tap the "More" button (three horizontal dots) located at the bottom-right of the share dialog.',config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option, represented by the plus [+] icon.',config.jsVars.slug),svg.plusInBox),renderStep(wp.i18n.__('Confirm by Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" button at the top-right corner of your screen.',config.jsVars.slug),svg.tapFinger)):browser.isFirefox?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three horizontal lines) located at the bottom-right of your screen.",config.jsVars.slug),svg.hamburgerMenu),renderStep(wp.i18n.__("Tap the Share Icon",config.jsVars.slug),wp.i18n.__("Tap the share icon in the dialog overlay that the browser opens.",config.jsVars.slug),svg.iosShare),renderStep(wp.i18n.__("Tap the More button",config.jsVars.slug),wp.i18n.__('Tap the "More" button (three horizontal dots) located at the bottom-right of the share dialog.',config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option, represented by the plus [+] icon.',config.jsVars.slug),svg.plusInBox),renderStep(wp.i18n.__('Confirm by Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" button at the top-right corner of your screen.',config.jsVars.slug),svg.tapFinger)):browser.isOpera?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three dots), located at the bottom-right of your screen.",config.jsVars.slug),svg.vertThreeDots),renderStep(wp.i18n.__("Tap the Share Icon",config.jsVars.slug),wp.i18n.__("Tap the share icon located at the top of the dialog overlay that browser opens.",config.jsVars.slug),svg.upload),renderStep(wp.i18n.__("Tap the More button",config.jsVars.slug),wp.i18n.__('Tap the "More" button (three horizontal dots) located at the bottom-right of the share dialog.',config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option, represented by the plus [+] icon.',config.jsVars.slug),svg.plusInBox),renderStep(wp.i18n.__('Confirm by Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" button at the top-right corner of your screen.',config.jsVars.slug),svg.tapFinger)):browser.isEdge?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three horizontal lines) located at the bottom-right of your screen.",config.jsVars.slug),svg.hamburgerMenu),renderStep(wp.i18n.__("Tap the Share Icon",config.jsVars.slug),wp.i18n.__("Tap the share icon in the dialog overlay that the browser opens.",config.jsVars.slug),svg.upload),renderStep(wp.i18n.__("Tap the More button",config.jsVars.slug),wp.i18n.__('Tap the "More" button (three horizontal dots) located at the bottom-right of the share dialog.',config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option, represented by the plus [+] icon.',config.jsVars.slug),svg.plusInBox),renderStep(wp.i18n.__('Confirm by Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" button at the top-right corner of your screen.',config.jsVars.slug),svg.tapFinger)):browser.isDuckduckgo?(renderStep(wp.i18n.__("Tap the Share Icon",config.jsVars.slug),wp.i18n.__("Tap the share icon located at the right side of the browser's address bar.",config.jsVars.slug),svg.upload),renderStep(wp.i18n.__("Tap the More button",config.jsVars.slug),wp.i18n.__('Tap the "More" button (three horizontal dots) located at the bottom-right of the share dialog.',config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Select "Add to Home Screen"',config.jsVars.slug),wp.i18n.__('Tap the "Add to Home Screen" option, represented by the plus [+] icon.',config.jsVars.slug),svg.plusInBox),renderStep(wp.i18n.__('Confirm b
397y Tapping "Add"',config.jsVars.slug),wp.i18n.__('Tap the "Add" button at the top-right corner of your screen.',config.jsVars.slug),svg.tapFinger)):(renderStep(wp.i18n.__("Copy the Page URL",config.jsVars.slug),wp.i18n.__("Click the button below to copy the page's URL.",config.jsVars.slug),svg.copy,this.renderCopyInstallUrlButton()),renderStep(wp.i18n.__("Open the Safari Browser",config.jsVars.slug),wp.i18n.__("Launch the Safari web browser from your home screen.",config.jsVars.slug),svg.safari),renderStep(wp.i18n.__("Paste and Open the URL",config.jsVars.slug),wp.i18n.__("Paste the copied URL into Safari's address bar and open the page.",config.jsVars.slug),svg.pasteGo)):renderStep(wp.i18n.__("Installation Not Supported",config.jsVars.slug),wp.i18n.__("Your operating system does not support web app installation. Please try accessing the website on an Android or iOS mobile device.",config.jsVars.slug),svg.noInstallSupport):device.isDesktop?browser.isChrome?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three dots) in the top-right corner of your browser window.",config.jsVars.slug),svg.vertThreeDots),renderStep(wp.i18n.__('Expand "Cast, save and share"',config.jsVars.slug),wp.i18n.__('Hover over the "Cast, Save, and Share" menu item to expand its options.',config.jsVars.slug),svg.fileSave),renderStep(wp.i18n.__('Select "Install page as app..."',config.jsVars.slug),wp.i18n.__('Click on "Install page as app..." from the menu.',config.jsVars.slug),svg.installDesktop),renderStep(wp.i18n.__('Confirm by Clicking "Install"',config.jsVars.slug),wp.i18n.__(`Click the "Install" button in the browser's installation dialog.`,config.jsVars.slug),svg.mouseClick)):browser.isEdge?(renderStep(wp.i18n.__("Tap the Menu Icon",config.jsVars.slug),wp.i18n.__("Tap the menu icon (three dots) in the top-right corner of your browser window.",config.jsVars.slug),svg.horizThreeDots),renderStep(wp.i18n.__('Expand "Apps"',config.jsVars.slug),wp.i18n.__('Hover over the "Apps" menu item to expand its options.',config.jsVars.slug),svg.appsGrid),renderStep(wp.i18n.__('Select "Install this site as app"',config.jsVars.slug),wp.i18n.__('Click on "Install this site as app" from the menu.',config.jsVars.slug),svg.directionDown),renderStep(wp.i18n.__('Confirm by Clicking "Install"',config.jsVars.slug),wp.i18n.__(`Click the "Install" button in the browser's installation dialog.`,config.jsVars.slug),svg.mouseClick)):(renderStep(wp.i18n.__("Copy the Page URL",config.jsVars.slug),wp.i18n.__("Click the button below to copy the page's URL.",config.jsVars.slug),svg.copy,this.renderCopyInstallUrlButton()),renderStep(wp.i18n.__("Open the Google Chrome Browser",config.jsVars.slug),wp.i18n.__("Launch the Google Chrome web browser from your start menu.",config.jsVars.slug),svg.googleChrome),renderStep(wp.i18n.__("Paste and Open the URL",config.jsVars.slug),wp.i18n.__("Paste the copied URL into Google Chrome's address bar and open the page.",config.jsVars.slug),svg.pasteGo)):renderStep(wp.i18n.__("Installation Not Supported",config.jsVars.slug),wp.i18n.__("Your device does not support web app installation. Please try accessing the website on a mobile or desktop device.",config.jsVars.slug),svg.noInstallSupport),steps.length?`<ul class="install-prompt-body-instructions">${steps.join("")}</ul>`:""}render(){var _a,_b,_c;this.injectStyles(` 398 .install-prompt { 399 position: fixed; 400 top: 0; 401 left: 0; 402 right: 0; 403 bottom: 0; 404 z-index: 99999999999999999999; 405 background: rgba(0, 0, 0, 0); 406 -webkit-backdrop-filter: blur(0px); 407 backdrop-filter: blur(0px); 408 -webkit-transition: all 0.2s ease-out; 409 -o-transition: all 0.2s ease-out; 410 transition: all 0.2s ease-out; 411 opacity: 0; 412 visibility: hidden; 413 } 414 415 .install-prompt.visible { 416 background: rgba(0, 0, 0, 0.7); 417 -webkit-backdrop-filter: blur(5px); 418 backdrop-filter: blur(5px); 419 opacity: 1; 420 visibility: visible; 421 } 422 423 .install-prompt-container { 424 position: fixed; 425 top: 50%; 426 left: 50%; 427 -webkit-transform: translate(-50%, calc(-50% + 20px)); 428 -ms-transform: translate(-50%, calc(-50% + 20px)); 429 transform: translate(-50%, calc(-50% + 20px)); 430 background: white; 431 border-radius: 10px; 432 -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 433 box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 434 max-width: 32rem; 435 width: 95%; 436 overflow: hidden; 437 opacity: 0; 438 -webkit-transition: all 0.15s ease-out; 439 -o-transition: all 0.15s ease-out; 440 transition: all 0.15s ease-out; 441 z-index: 999999999999999999999; 442 } 443 444 .install-prompt.visible .install-prompt-container { 445 -webkit-transform: translate(-50%, -50%); 446 -ms-transform: translate(-50%, -50%); 447 transform: translate(-50%, -50%); 448 opacity: 1; 449 } 450 451 .install-prompt-header { 452 display: -webkit-box; 453 display: -ms-flexbox; 454 display: flex; 455 padding: 0.75rem 1rem; 456 gap: 1.5rem; 457 -webkit-box-pack: justify; 458 -ms-flex-pack: justify; 459 justify-content: space-between; 460 -webkit-box-align: center; 461 -ms-flex-align: center; 462 align-items: center; 463 border-bottom: 1px solid #e5e7eb; 464 } 465 466 .install-prompt-header-texts_title { 467 font-size: 1rem; 468 line-height: 1.5rem; 469 font-weight: 500; 470 color: #1f2937; 471 display: -webkit-box; 472 overflow: hidden; 473 -webkit-box-orient: vertical; 474 -webkit-line-clamp: 1; 475 } 476 477 .install-prompt-close { 478 display: -webkit-inline-box; 479 display: -ms-inline-flexbox; 480 display: inline-flex; 481 -webkit-box-pack: center; 482 -ms-flex-pack: center; 483 justify-content: center; 484 -webkit-box-align: center; 485 -ms-flex-align: center; 486 align-items: center; 487 width: 2rem; 488 height: 2rem; 489 color: #1f2937; 490 background: #f3f4f6; 491 border-radius: 9999px; 492 outline: none; 493 border: none; 494 cursor: pointer; 495 -webkit-transition: all 0.1s ease; 496 -o-transition: all 0.1s ease; 497 transition: all 0.1s ease; 498 -ms-flex-negative: 0; 499 flex-shrink: 0; 500 } 501 502 .install-prompt-close:hover { 503 background: #e5e7eb; 504 } 505 506 .install-prompt-close-icon { 507 display: block; 508 width: 1rem; 509 height: 1rem; 510 -ms-flex-negative: 0; 511 flex-shrink: 0; 512 vertical-align: middle; 513 } 514 515 .install-prompt-body { 516 padding: 1.5rem 1rem; 517 overflow-y: auto; 518 max-height: 34rem; 519 } 520 521 .install-prompt-body::-webkit-scrollbar {
522 width: .5rem; 523 } 524 525 .install-prompt-body::-webkit-scrollbar-thumb { 526 background-color: rgb(209 213 219 / 1); 527 border-radius: 9999px; 528 } 529 530 .install-prompt-body::-webkit-scrollbar-track { 531 background-color: rgb(243 244 246 / 1); 532 } 533 534 .install-prompt-footer { 535 display: none; 536 padding: 0.25rem; 537 border-top: 1px solid #e5e7eb; 538 } 539 540 .install-prompt-footer_close { 541 width: 100%; 542 display: -webkit-inline-box; 543 display: -ms-inline-flexbox; 544 display: inline-flex; 545 -webkit-box-pack: center; 546 -ms-flex-pack: center; 547 justify-content: center; 548 -webkit-box-align: center; 549 -ms-flex-align: center; 550 align-items: center; 551 -webkit-column-gap: 0.375rem; 552 -moz-column-gap: 0.375rem; 553 column-gap: 0.375rem; 554 padding: 0.75rem 1rem; 555 font-weight: 500; 556 font-size: 0.75rem; 557 line-height: 1rem; 558 border-radius: 0.5rem; 559 background-color: #ffffff; 560 color: #1f2937; 561 -webkit-transition: all 0.1s ease; 562 -o-transition: all 0.1s ease; 563 transition: all 0.1s ease; 564 cursor: pointer; 565 outline: none; 566 border: none; 567 } 568 569 .install-prompt-footer_close:hover { 570 background-color: #f3f4f6; 571 } 572 573 .install-prompt-footer_close:focus { 574 outline: none; 575 border: none; 576 background-color: #f3f4f6; 577 } 578 579 @media (max-width: 700px) { 580 .install-prompt-container { 581 width: 100%; 582 max-width: 100%; 583 top: unset; 584 bottom: 0; 585 left: 0; 586 border-top-left-radius: 1rem; 587 border-top-right-radius: 1rem; 588 border-bottom-left-radius: 0; 589 border-bottom-right-radius: 0; 590 -webkit-box-shadow: none; 591 box-shadow: none; 592 opacity: 1; 593 -webkit-transform: translateY(100%); 594 -ms-transform: translateY(100%); 595 transform: translateY(100%); 596 } 597 598 .install-prompt.visible .install-prompt-container { 599 -webkit-transform: translateY(0); 600 -ms-transform: translateY(0); 601 transform: translateY(0); 602 } 603 } 604 `);const content=this.renderContent(),promptTitle=(_c=(_b=(_a=config.jsVars.settings.installation)==null?void 0:_a.prompts)==null?void 0:_b.text)!=null?_c:wp.i18n.__("Install Web App",config.jsVars.slug),combinedStyles=Array.from(this.styles).join(` 605`);this.shadowRoot.innerHTML=` 606 <style>${combinedStyles}</style> 607 <div class="install-prompt"> 608 <div class="install-prompt-container"> 609 <div class="install-prompt-header"> 610 <div class="install-prompt-header-texts"> 611 <div class="install-prompt-header-texts_title">${promptTitle}</div> 612 </div> 613 <button type="button" class="install-prompt-close" aria-label="Close"> 614 <svg class="install-prompt-close-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg> 615 </button> 616 </div> 617 <div class="install-prompt-body"> 618 ${content} 619 </div> 620 <div class="install-prompt-footer"> 621 <button type="button" class="install-prompt-footer_close"> 622 ${wp.i18n.__("Close Dialog",config.jsVars.slug)} 623 </button> 624 </div> 625 </div> 626 </div> 627 `}}}}),installUrl_exports={};__export(installUrl_exports,{initInstallUrl:()=>initInstallUrl});async function initInstallUrl(){hasUrlParam("performInstallation","true")&&(performInstallation(),removeParamFromUrl("performInstallation"))}var init_installUrl=__esm({"frontend/assets/js/dev/modules/installUrl.js"(){init_installPrompt(),init_utils()}}),installButton_exports={};__export(installButton_exports,{initInstallButton:()=>initInstallButton});async function initInstallButton(){customElements.get("pwa-install-button")||customElements.define("pwa-install-button",PwaInstallButton)}var PwaInstallButton,init_installButton=__esm({"frontend/assets/js/dev/modules/installButton.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallButton=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handleClick()}injectStyles(css){this.styles.add(css)}handleClick(){this.shadowRoot.querySelector(".pwa-install-button").addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d,_e,_f;
627const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",textColor=getContrastTextColor(themeColor),buttonText=(_f=(_e=(_d=config.jsVars.settings.installation)==null?void 0:_d.prompts)==null?void 0:_e.text)!=null?_f:wp.i18n.__("Install Web App",config.jsVars.slug);this.injectStyles(` 628 :host(:active), 629 :host(:focus) { 630 outline: transparent; 631 border: none; 632 } 633 634 .pwa-install-button { 635 display: inline-block; 636 background-color: ${themeColor}; 637 color: ${textColor}; 638 vertical-align: middle; 639 text-decoration: none; 640 font-size: 0.875rem; 641 line-height: 1.25rem; 642 font-weight: 500; 643 padding: 0.5rem 1rem; 644 border: none; 645 outline: none; 646 border-radius: 9999px; 647 cursor: pointer; 648 } 649 650 .pwa-install-button:hover { 651 opacity: 0.8; 652 } 653 `);const combinedStyles=Array.from(this.styles).join(` 654`);this.shadowRoot.innerHTML=` 655 <style>${combinedStyles}</style> 656 <button class="pwa-install-button">${buttonText}</button> 657 `}}}}),installOverlayHeaderBanner_exports={};__export(installOverlayHeaderBanner_exports,{initInstallOverlayHeaderBanner:()=>initInstallOverlayHeaderBanner});async function initInstallOverlayHeaderBanner(){customElements.get("pwa-install-overlay-header-banner")||customElements.define("pwa-install-overlay-header-banner",PwaInstallOverlayHeaderBanner),PwaInstallOverlayHeaderBanner.show()}var PwaInstallOverlayHeaderBanner,init_installOverlayHeaderBanner=__esm({"frontend/assets/js/dev/modules/installOverlayHeaderBanner.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallOverlayHeaderBanner=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handleRemove(),this.handlePerformInstallation()}static show(){let banner=document.querySelector("pwa-install-overlay-header-banner");return banner||(banner=document.createElement("pwa-install-overlay-header-banner"),document.body.appendChild(banner),requestAnimationFrame(()=>{banner.shadowRoot.querySelector(".header-banner-overlay").classList.add("visible")})),banner}injectStyles(css){this.styles.add(css)}handleRemove(){const headerBanner=this.shadowRoot.querySelector(".header-banner-overlay"),closeButton=this.shadowRoot.querySelector(".header-banner-overlay-button_close"),handleClose=()=>{headerBanner.classList.remove("visible"),setTimeout(()=>this.remove(),300)};closeButton.addEventListener("click",handleClose)}handlePerformInstallation(){this.shadowRoot.querySelector(".header-banner-overlay-button_install").addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l;const appName=(_a=config.jsVars.settings.webAppManifest.appIdentity.appName)!=null?_a:"",themeColor=(_d=(_c=(_b=config.jsVars.settings.webAppManifest)==null?void 0:_b.appearance)==null?void 0:_c.themeColor)!=null?_d:"#000000",textColor=getContrastTextColor(themeColor),title=(_g=(_f=(_e=config.jsVars.settings.installation)==null?void 0:_e.prompts)==null?void 0:_f.text)!=null?_g:wp.i18n.__("Install Web App",config.jsVars.slug),message=(_l=(_k=(_j=(_i=(_h=config.jsVars.settings.installation)==null?void 0:_h.prompts)==null?void 0:_i.types)==null?void 0:_j.headerBanner)==null?void 0:_k.message)!=null?_l:wp.i18n.__("Get our web app. It won't take up space on your device.",config.jsVars.slug),appIconHtml=config.jsVars.iconUrl?`<img class="header-banner-overlay-appinfo_icon" src="${config.jsVars.iconUrl}" alt="${appName}" onerror="this.style.display='none'"></img>`:"";this.injectStyles(` 658 .header-banner-overlay { 659 display: flex; 660 align-items: center; 661 justify-content: space-between; 662 gap: 1rem; 663 position: fixed; 664 top: 0; 665 right: 0; 666 left: 0; 667 z-index: 99999; 668 padding: 0.75rem; 669 background-color: ${themeColor}; 670 color: ${textColor}; 671 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 672 -webkit-transition: all 0.2s ease-out; 673 -o-transition: all 0.2s ease-out; 674 transition: all 0.2s ease-out; 675 opacity: 0; 676 visibility: hidden; 677 } 678 679 .header-banner-overlay.visible { 680 opacity: 1; 681 visibility: visible; 682 } 683 684 .header-banner-overlay-appinfo { 685 display: -webkit-box; 686 display: -ms-flexbox; 687 display: flex; 688 -webkit-box-align: center; 689 -ms-flex-align: center; 690 align-items: center; 691 gap: 0.75rem; 692 } 693 694 .header-banner-overlay-appinfo_icon { 695 border-radius: 9999px; 696 border: 1px solid #e5e7eb; 697 -ms-flex-negative: 0; 698 flex-shrink: 0; 699 height: 50px; 700 width: 50px; 701 display: inline-block; 702 } 703 704 .header-banner-overlay-appinfo_title { 705 font-size: 0.875rem; 706 line-height: 1.25rem; 707 font-weight: 500; 708 color: ${textColor}; 709 display: -webkit-box; 710 overflow: hidden; 711 -webkit-box-orient: vertical; 712 -webkit-line-clamp: 1; 713 } 714 715 .header-banner-overlay-appinfo_description { 716 font-size: 0.75rem; 717 line-height: 1rem; 718 font-weight: 400; 719 color: ${textColor}cc; 720 margin-top: 0.12rem; 721 text-wrap: balance; 722 display: -webkit-box; 723 overflow: hidden; 724 -webkit-box-orient: vertical; 725 -webkit-line-clamp: 2; 726 } 727 728 .header-banner-overlay-buttons { 729 display: flex; 730 align-items: center; 731 gap: 0.5rem; 732 flex-shrink: 0; 733 } 734 735 .header-banner-overlay-button_install { 736 display: inline-block; 737 background-color: ${textColor};
738 color: ${themeColor}; 739 vertical-align: middle; 740 text-decoration: none; 741 font-size: 0.875rem; 742 line-height: 1.25rem; 743 font-weight: 600; 744 padding: 0.375rem 0.875rem; 745 border: none; 746 outline: none; 747 border-radius: 9999px; 748 cursor: pointer; 749 } 750 751 .header-banner-overlay-button_install:hover { 752 opacity: 0.8; 753 } 754 755 .header-banner-overlay-button_close { 756 display: inline-flex; 757 background-color: transparent; 758 color: ${textColor}cc; 759 padding: 0; 760 border-radius: 0.5rem; 761 cursor: pointer; 762 outline: none; 763 border: none; 764 } 765 766 .header-banner-overlay-button_close:hover { 767 background-color: ${textColor}1a; 768 } 769 770 .header-banner-overlay-button_close svg { 771 width: 1rem; 772 height: 1rem; 773 } 774 775 @media (min-width: 400px) { 776 .header-banner-overlay-appinfo_icon { 777 height: 45px; 778 width: 45px; 779 } 780 } 781 782 @media (min-width: 1200px) { 783 .header-banner-overlay { 784 justify-content: center; 785 gap: 5rem; 786 } 787 788 .header-banner-overlay-button_close { 789 padding: 0.375rem; 790 } 791 } 792 `);const combinedStyles=Array.from(this.styles).join(` 793`);this.shadowRoot.innerHTML=` 794 <style>${combinedStyles}</style> 795 <div class="header-banner-overlay"> 796 <div class="header-banner-overlay-appinfo"> 797 ${appIconHtml} 798 <div class="header-banner-overlay-appinfo_texts"> 799 <div class="header-banner-overlay-appinfo_title">${title}</div> 800 <div class="header-banner-overlay-appinfo_description">${message}</div> 801 </div> 802 </div> 803 <div class="header-banner-overlay-buttons"> 804 <button type="button" class="header-banner-overlay-button_install"> 805 ${wp.i18n.__("Install Now",config.jsVars.slug)} 806 </button> 807 <button type="button" class="header-banner-overlay-button_close" aria-label="Close"> 808 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg> 809 </button> 810 </div> 811 </div> 812 `}}}}),installOverlaySnackbar_exports={};__export(installOverlaySnackbar_exports,{initInstallOverlaySnackbar:()=>initInstallOverlaySnackbar});async function initInstallOverlaySnackbar(){let hasTriggered=!1;const scrollPercentTrigger=30;customElements.get("pwa-install-overlay-snackbar")||customElements.define("pwa-install-overlay-snackbar",PwaInstallOverlaySnackbar),window.addEventListener("scroll",()=>{if(hasTriggered)return;window.scrollY/(document.documentElement.scrollHeight-window.innerHeight)*100>=scrollPercentTrigger&&(PwaInstallOverlaySnackbar.show(),hasTriggered=!0)})}var PwaInstallOverlaySnackbar,init_installOverlaySnackbar=__esm({"frontend/assets/js/dev/modules/installOverlaySnackbar.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallOverlaySnackbar=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.displayDuration=7e3}connectedCallback(){this.render(),this.setupInstallHandler()}static show(){let snackbar=document.querySelector("pwa-install-overlay-snackbar");return snackbar||(snackbar=document.createElement("pwa-install-overlay-snackbar"),document.body.appendChild(snackbar),requestAnimationFrame(()=>{snackbar.shadowRoot.querySelector(".snackbar-overlay").classList.add("visible"),snackbar.startProgressBar(),snackbar.setupAutoHide()})),snackbar}injectStyles(css){this.styles.add(css)}startProgressBar(){const progressBar=this.shadowRoot.querySelector(".snackbar-overlay-progressbar_inner");progressBar.style.width="100%",progressBar.offsetHeight,requestAnimationFrame(()=>{progressBar.style.width="0%"})}setupAutoHide(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>{const snackbar=this.shadowRoot.querySelector(".snackbar-overlay");snackbar.classList.remove("visible"),snackbar.addEventListener("transitionend",()=>{this.remove()},{once:!0})},this.displayDuration)}setupInstallHandler(){this.shadowRoot.querySelector(".snackbar-overlay-button_install").addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k;
812const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",textColor=getContrastTextColor(themeColor),title=(_f=(_e=(_d=config.jsVars.settings.installation)==null?void 0:_d.prompts)==null?void 0:_e.text)!=null?_f:wp.i18n.__("Install Web App",config.jsVars.slug),message=(_k=(_j=(_i=(_h=(_g=config.jsVars.settings.installation)==null?void 0:_g.prompts)==null?void 0:_h.types)==null?void 0:_i.snackbar)==null?void 0:_j.message)!=null?_k:wp.i18n.__("Installing uses no storage and offers a quick way back to our web app.",config.jsVars.slug);this.injectStyles(` 813 .snackbar-overlay { 814 display: flex; 815 align-items: center; 816 justify-content: space-between; 817 gap: 1rem; 818 position: fixed; 819 right: 1rem; 820 left: 1rem; 821 bottom: 1rem; 822 border-radius: 0.5rem; 823 z-index: 9999999999; 824 padding: 1rem; 825 background-color: ${themeColor}; 826 color: ${textColor}; 827 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 828 transition: all 0.2s ease-out; 829 opacity: 0; 830 visibility: hidden; 831 overflow: hidden; 832 } 833 834 .snackbar-overlay.visible { 835 opacity: 1; 836 visibility: visible; 837 } 838 839 .snackbar-overlay-appinfo_title { 840 font-size: 0.875rem; 841 line-height: 1.25rem; 842 font-weight: 500; 843 color: ${textColor}; 844 display: -webkit-box; 845 overflow: hidden; 846 -webkit-box-orient: vertical; 847 -webkit-line-clamp: 1; 848 } 849 850 .snackbar-overlay-appinfo_description { 851 font-size: 0.75rem; 852 line-height: 1rem; 853 font-weight: 400; 854 color: ${textColor}cc; 855 margin-top: 0.12rem; 856 text-wrap: balance; 857 display: -webkit-box; 858 overflow: hidden; 859 -webkit-box-orient: vertical; 860 -webkit-line-clamp: 2; 861 } 862 863 .snackbar-overlay-button_install { 864 display: inline-block; 865 flex-shrink: 0; 866 background-color: ${textColor}; 867 color: ${themeColor}; 868 vertical-align: middle; 869 text-decoration: none; 870 font-size: 0.875rem; 871 line-height: 1.25rem; 872 font-weight: 600; 873 padding: 0.375rem 0.875rem; 874 border: none; 875 outline: none; 876 border-radius: 9999px; 877 cursor: pointer; 878 } 879 880 .snackbar-overlay-progressbar { 881 position: absolute; 882 bottom: 0; 883 left: 0; 884 width: 100%; 885 height: 0.25rem; 886 background-color: ${themeColor}; 887 overflow: hidden; 888 } 889 890 .snackbar-overlay-progressbar_inner { 891 width: 100%; 892 height: 100%; 893 background-color: ${textColor}80; 894 transition: width ${this.displayDuration}ms linear; 895 } 896 `);const combinedStyles=Array.from(this.styles).join(` 897`);this.shadowRoot.innerHTML=` 898 <style>${combinedStyles}</style> 899 <div class="snackbar-overlay"> 900 <div class="snackbar-overlay-appinfo"> 901 <div class="snackbar-overlay-appinfo_title">${title}</div> 902 <div class="snackbar-overlay-appinfo_description">${message}</div> 903 </div> 904 <button type="button" class="snackbar-overlay-button_install"> 905 ${wp.i18n.__("Install Now",config.jsVars.slug)} 906 </button> 907 <div class="snackbar-overlay-progressbar"> 908 <div class="snackbar-overlay-progressbar_inner"></div> 909 </div> 910 </div> 911 `}}}}),installOverlayBlogPopup_exports={};__export(installOverlayBlogPopup_exports,{initInstallOverlayBlogPopup:()=>initInstallOverlayBlogPopup});async function initInstallOverlayBlogPopup(){let hasTriggered=!1;const scrollPercentTrigger=10;customElements.get("pwa-install-overlay-blog-popup")||customElements.define("pwa-install-overlay-blog-popup",PwaInstallOverlayBlogPopup),window.addEventListener("scroll",()=>{if(hasTriggered)return;window.scrollY/(document.documentElement.scrollHeight-window.innerHeight)*100>=scrollPercentTrigger&&(PwaInstallOverlayBlogPopup.show(),hasTriggered=!0)})}var PwaInstallOverlayBlogPopup,init_installOverlayBlogPopup=__esm({"frontend/assets/js/dev/modules/installOverlayBlogPopup.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallOverlayBlogPopup=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handleRemove(),this.handlePerformInstallation()}static show(){let popup=document.querySelector("pwa-install-overlay-blog-popup");return popup||(popup=document.createElement("pwa-install-overlay-blog-popup"),document.body.appendChild(p
911opup),requestAnimationFrame(()=>{const blogPopup=popup.shadowRoot.querySelector(".blog-popup-overlay");document.documentElement.style.paddingRight=`${window.innerWidth-document.documentElement.offsetWidth}px`,document.documentElement.style.overflow="hidden",blogPopup.classList.add("visible")})),popup}injectStyles(css){this.styles.add(css)}handleRemove(){const continueButton=this.shadowRoot.querySelector(".blog-popup-overlay-button.-continue"),backdrop=this.shadowRoot.querySelector(".blog-popup-overlay"),handleClose=()=>{backdrop.classList.remove("visible"),backdrop.addEventListener("transitionend",()=>{document.documentElement.style.removeProperty("overflow"),document.documentElement.style.paddingRight="",this.remove()},{once:!0})};continueButton.addEventListener("click",handleClose),backdrop.addEventListener("click",e=>{e.target===backdrop&&handleClose()})}handlePerformInstallation(){this.shadowRoot.querySelector(".blog-popup-overlay-button.-install").addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d;const{device,os,browser}=config.jsVars.userData,appName=(_a=config.jsVars.settings.webAppManifest.appIdentity.appName)!=null?_a:"",themeColor=(_d=(_c=(_b=config.jsVars.settings.webAppManifest)==null?void 0:_b.appearance)==null?void 0:_c.themeColor)!=null?_d:"#000000",textColor=getContrastTextColor(themeColor),appIconHtml=config.jsVars.iconUrl?`<img class="blog-popup-overlay-appinfo_icon" src="${config.jsVars.iconUrl}" alt="${appName}" onerror="this.style.display='none'"></img>`:"";let browserTitle,browserIcon;switch(!0){case browser.isChrome:browserTitle="Chrome",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/chrome.png";break;case browser.isSafari:browserTitle="Safari",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/safari.png";break;case browser.isFirefox:browserTitle="Firefox",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/firefox.png";break;case browser.isOpera:browserTitle="Opera",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/opera.png";break;case browser.isEdge:browserTitle="Edge",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/edge.png";break;case browser.isSamsung:browserTitle="Samsung Browser",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/samsung.png";break;case browser.isYandex:browserTitle="Yandex Browser",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/yandex.png";break;case browser.isDuckduckgo:browserTitle="DuckDuckGo",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/duckduckgo.png";break;case browser.isBrave:browserTitle="Brave",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/brave.png";break;case browser.isQq:browserTitle="QQ Browser",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/qq.png";break;case browser.isUc:browserTitle="UC Browser",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/browsers/uc.png";break;default:browserTitle="Browser",browserIcon=config.jsVars.pluginsData.dirUrl+"/frontend/assets/media/icons/unknown.png";break}this.injectStyles(` 912 .blog-popup-overlay { 913 position: fixed; 914 top: 0; 915 left: 0; 916 right: 0; 917 bottom: 0; 918 z-index: 9999999999; 919 background: rgba(0, 0, 0, 0); 920 -webkit-backdrop-filter: blur(0px); 921 backdrop-filter: blur(0px); 922 -webkit-transition: all 0.2s ease-out; 923 -o-transition: all 0.2s ease-out; 924 transition: all 0.2s ease-out; 925 opacity: 0; 926 visibility: hidden; 927 } 928 929 .blog-popup-overlay.visible { 930 background: rgba(0, 0, 0, 0.7); 931 -webkit-backdrop-filter: blur(5px); 932 backdrop-filter: blur(5px); 933 opacity: 1; 934 visibility: visible; 935 } 936 937 .blog-popup-overlay-container { 938 position: fixed; 939 width: 100%; 940 bottom: 0; 941 left: 0; 942 background-color: #fff; 943 border-top-left-radius: 1rem; 944 border-top-right-radius: 1rem; 945 border-bottom-left-radius: 0; 946 border-bottom-right-radius: 0; 947 -webkit-transition: all 0.15s ease-out; 948 -o-transition: all 0.15s ease-out; 949 transition: all 0.15s ease-out; 950 z-index: 9999999999; 951 -webkit-transform: translateY(100%); 952 -ms-transform: translateY(100%); 953 transform: translateY(100%); 954 } 955 956 .blog-popup-overlay.visible .blog-popup-overlay-container { 957 -webkit-transform: translateY(0); 958 -ms-transform: translateY(0); 959 transform: translateY(0); 960 } 961 962 .blog-popup-overlay-header { 963 display: -webkit-box; 964 display: -ms-flexbox; 965 display: flex; 966 padding: 0.75rem 1rem; 967 gap: 1.5rem; 968 -webkit-box-pack: center; 969 -ms-flex-pack: center; 970 justify-content: center; 971 -webkit-box-align: center; 972 -ms-flex-align: center; 973 align-items: center; 974 border-bottom: 1px solid #e5e7eb; 975 } 976 977 .blog-popup-overlay-header_title { 978 font-size: 1rem; 979 line-height: 1.5rem; 980 font-weight: 500; 981 color: #1f2937; 982 display: -webkit-box; 983 overflow: hidden; 984 -webkit-box-orient: vertical; 985 -webkit-line-clamp: 1; 986 } 987 988 .blog-popup-overlay-body { 989 display: -webkit-box; 990 display: -ms-flexbox; 991 display: flex; 992 -webkit-box-orient: vertical; 993 -webkit-box-direction: normal; 994 -ms-flex-direction: column; 995 flex-direction: column; 996 gap: 1.25rem; 997 padding: 1.5rem; 998 overflow-y: auto; 999 } 1000 1001 .blog-popup-overlay-body::-webkit-scrollbar {
1002 width: .5rem; 1003 } 1004 1005 .blog-popup-overlay-body::-webkit-scrollbar-thumb { 1006 background-color: rgb(209 213 219 / 1); 1007 border-radius: 9999px; 1008 } 1009 1010 .blog-popup-overlay-body::-webkit-scrollbar-track { 1011 background-color: rgb(243 244 246 / 1); 1012 } 1013 1014 .blog-popup-overlay-appinfo, 1015 .blog-popup-overlay-browserinfo { 1016 display: -webkit-box; 1017 display: -ms-flexbox; 1018 display: flex; 1019 -webkit-box-pack: justify; 1020 -ms-flex-pack: justify; 1021 justify-content: space-between; 1022 -webkit-box-align: center; 1023 -ms-flex-align: center; 1024 align-items: center; 1025 gap: 1rem; 1026 } 1027 1028 .blog-popup-overlay-appinfo_media, 1029 .blog-popup-overlay-browserinfo_media { 1030 display: -webkit-box; 1031 display: -ms-flexbox; 1032 display: flex; 1033 -webkit-box-align: center; 1034 -ms-flex-align: center; 1035 align-items: center; 1036 gap: 0.5rem; 1037 } 1038 1039 .blog-popup-overlay-appinfo_icon, 1040 .blog-popup-overlay-browserinfo_icon { 1041 border-radius: 9999px; 1042 -ms-flex-negative: 0; 1043 flex-shrink: 0; 1044 height: 48px; 1045 width: 48px; 1046 display: inline-block; 1047 } 1048 1049 .blog-popup-overlay-appinfo_appname, 1050 .blog-popup-overlay-browserinfo_title { 1051 font-size: 1rem; 1052 line-height: 1.5rem; 1053 font-weight: 500; 1054 color: #1f2937; 1055 display: -webkit-box; 1056 overflow: hidden; 1057 -webkit-box-orient: vertical; 1058 -webkit-line-clamp: 1; 1059 } 1060 1061 .blog-popup-overlay-button { 1062 border-radius: 9999px; 1063 font-size: 0.875rem; 1064 line-height: 1.25rem; 1065 font-weight: 700; 1066 height: 2.5rem; 1067 border: none; 1068 outline: none; 1069 padding: 0; 1070 text-align: center; 1071 text-transform: capitalize; 1072 width: 6rem; 1073 } 1074 1075 .blog-popup-overlay-button.-install { 1076 background-color: ${themeColor}; 1077 color: ${textColor}; 1078 } 1079 1080 .blog-popup-overlay-button.-continue { 1081 background-color: #d9dee2; 1082 color: #787c7e; 1083 border: 1px solid #d3d6da; 1084 } 1085 `);const combinedStyles=Array.from(this.styles).join(` 1086`);this.shadowRoot.innerHTML=` 1087 <style>${combinedStyles}</style> 1088 <div class="blog-popup-overlay"> 1089 <div class="blog-popup-overlay-container"> 1090 <div class="blog-popup-overlay-header"> 1091 <div class="blog-popup-overlay-header_title">${wp.i18n.__("Read this article in our web app",config.jsVars.slug)}</div> 1092 </div> 1093 <div class="blog-popup-overlay-body"> 1094 <div class="blog-popup-overlay-appinfo"> 1095 <div class="blog-popup-overlay-appinfo_media"> 1096 ${appIconHtml} 1097 <div class="blog-popup-overlay-appinfo_appname">${appName}</div> 1098 </div> 1099 <button type="button" class="blog-popup-overlay-button -install"> 1100 ${wp.i18n.__("Open",config.jsVars.slug)} 1101 </button> 1102 </div> 1103 <div class="blog-popup-overlay-browserinfo"> 1104 <div class="blog-popup-overlay-browserinfo_media"> 1105 <img class="blog-popup-overlay-browserinfo_icon" src="${browserIcon}" alt="${browserTitle}" onerror="this.style.display='none'"></img> 1106 <div class="blog-popup-overlay-browserinfo_title">${browserTitle}</div> 1107 </div> 1108 <button type="button" class="blog-popup-overlay-button -continue"> 1109 ${wp.i18n.__("Continue",config.jsVars.slug)} 1110 </button> 1111 </div> 1112 </div> 1113 </div> 1114 </div> 1115 `}}}}),installOverlayNavigationMenu_exports={};__export(installOverlayNavigationMenu_exports,{initInstallOverlayNavigationMenu:()=>initInstallOverlayNavigationMenu});async function initInstallOverlayNavigationMenu(){customElements.get("pwa-install-overlay-navigation-menu")||customElements.define("pwa-install-overlay-navigation-menu",PwaInstallOverlayNavigationMenu),PwaInstallOverlayNavigationMenu.show(),setTimeout(()=>{PwaInstallOverlayNavigationMenu.show()},1e3)}var PwaInstallOverlayNavigationMenu,init_installOverlayNavigationMenu=__esm({"frontend/assets/js/dev/modules/installOverlayNavigationMenu.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallOverlayNavigationMenu=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handlePerformInstallation()}static findVisibleMenuElement(element){if(element.tagName.toLowerCase()==="ul"&&window.getComputedStyle(element).display!=="none"&&element.querySelector("li"))return element;for(const child of element.children){const found=this.findVisibleMenuElement(child);if(found)return found}return null}static findMobileMenu(){const mobileMenuSelectors=[".wp-block-navigation","#ast-mobile-header","#mobile-menu",".mobile-menu",".mobile-navigation",'[class*="mobile-header"]','[id*="mobile-header"]','[class*="mobile-menu"]','[id*="mobile-menu"]',"nav","header"];for(const selector of mobileMenuSelectors){const elements=document.querySelectorAll(selector);for(const element of elements)if(window.getComputedStyle(element).display!=="none"){const menuElement=this.findVisibleMenuElement(element);if(menuElement)return{container:element,menu:menuElement}}}return null}static show(){let overlay=document.querySelector("pwa-install-overlay-navigation-menu");if(!overlay){const menuData=this.findMobileMenu();if(menuData?.menu){overlay=document.createElement("pwa-install-overlay-navigation-menu");
1115const menuItem=document.createElement("li");menuItem.className="menu-item pwa-install-menu-item";const existingMenuItem=menuData.menu.querySelector("li");if(existingMenuItem){const classesToCopy=Array.from(existingMenuItem.classList).filter(cls=>!cls.includes("current")&&!cls.includes("active"));menuItem.classList.add(...classesToCopy)}menuItem.appendChild(overlay),menuData.menu.appendChild(menuItem)}}return overlay}injectStyles(css){this.styles.add(css)}handlePerformInstallation(){const installButton=this.shadowRoot.querySelector(".navigation-menu-overlay-button_install");installButton?.addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l;const appName=(_a=config.jsVars.settings.webAppManifest.appIdentity.appName)!=null?_a:"",themeColor=(_d=(_c=(_b=config.jsVars.settings.webAppManifest)==null?void 0:_b.appearance)==null?void 0:_c.themeColor)!=null?_d:"#000000",textColor=getContrastTextColor(themeColor),title=(_g=(_f=(_e=config.jsVars.settings.installation)==null?void 0:_e.prompts)==null?void 0:_f.text)!=null?_g:wp.i18n.__("Install Web App",config.jsVars.slug),message=(_l=(_k=(_j=(_i=(_h=config.jsVars.settings.installation)==null?void 0:_h.prompts)==null?void 0:_i.types)==null?void 0:_j.navigationMenu)==null?void 0:_k.message)!=null?_l:wp.i18n.__("Find what you need faster by installing our web app!",config.jsVars.slug),appIconHtml=config.jsVars.iconUrl?`<img class="navigation-menu-overlay-appinfo_icon" src="${config.jsVars.iconUrl}" alt="${appName}" onerror="this.style.display='none'"/>`:"";this.injectStyles(` 1116 .navigation-menu-overlay { 1117 position: relative; 1118 border-radius: 0.5rem; 1119 padding: 1rem; 1120 background-color: ${themeColor}; 1121 color: ${textColor}; 1122 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 1123 -webkit-transition: all 0.2s ease-out; 1124 -o-transition: all 0.2s ease-out; 1125 transition: all 0.2s ease-out; 1126 overflow: hidden; 1127 text-transform: none; 1128 } 1129 1130 .navigation-menu-overlay-appinfo { 1131 display: flex; 1132 align-items: center; 1133 gap: 0.75rem; 1134 flex: 1; 1135 } 1136 1137 .navigation-menu-overlay-appinfo_icon { 1138 border-radius: 9999px; 1139 border: 1px solid #e5e7eb; 1140 flex-shrink: 0; 1141 height: 50px; 1142 width: 50px; 1143 display: inline-block; 1144 } 1145 1146 .navigation-menu-overlay-appinfo_texts { 1147 flex: 1; 1148 min-width: 0; 1149 } 1150 1151 .navigation-menu-overlay-appinfo_title { 1152 font-size: 0.875rem; 1153 line-height: 1.25rem; 1154 font-weight: 500; 1155 color: ${textColor}; 1156 display: -webkit-box; 1157 overflow: hidden; 1158 -webkit-box-orient: vertical; 1159 -webkit-line-clamp: 1; 1160 } 1161 1162 .navigation-menu-overlay-appinfo_description { 1163 font-size: 0.75rem; 1164 line-height: 1rem; 1165 font-weight: 400; 1166 color: ${textColor}cc; 1167 margin-top: 0.12rem; 1168 display: -webkit-box; 1169 overflow: hidden; 1170 -webkit-box-orient: vertical; 1171 -webkit-line-clamp: 2; 1172 } 1173 1174 .navigation-menu-overlay-button_install { 1175 display: block; 1176 background-color: ${textColor}; 1177 color: ${themeColor}; 1178 vertical-align: middle; 1179 text-decoration: none; 1180 font-size: 0.875rem; 1181 line-height: 1.25rem; 1182 font-weight: 600; 1183 padding: 0.375rem 0.875rem; 1184 margin-left: auto; 1185 margin-top: 1rem; 1186 border: none; 1187 outline: none; 1188 border-radius: 9999px; 1189 cursor: pointer; 1190 } 1191 `);const combinedStyles=Array.from(this.styles).join(` 1192`);this.shadowRoot.innerHTML=` 1193 <style>${combinedStyles}</style> 1194 <div class="navigation-menu-overlay"> 1195 <div class="navigation-menu-overlay-appinfo"> 1196 ${appIconHtml} 1197 <div class="navigation-menu-overlay-appinfo_texts"> 1198 <div class="navigation-menu-overlay-appinfo_title">${title}</div> 1199 <div class="navigation-menu-overlay-appinfo_description">${message}</div> 1200 </div> 1201 </div> 1202 <button type="button" class="navigation-menu-overlay-button_install"> 1203 ${wp.i18n.__("Install Now",config.jsVars.slug)} 1204 </button> 1205 </div> 1206 `}}}}),installOverlayInFeed_exports={};__export(installOverlayInFeed_exports,{initInstallOverlayInFeed:()=>initInstallOverlayInFeed});async function initInstallOverlayInFeed(){customElements.get("pwa-install-overlay-in-feed")||customElements.define("pwa-install-overlay-in-feed",PwaInstallOverlayInFeed),PwaInstallOverlayInFeed.show(),setTimeout(()=>{PwaInstallOverlayInFeed.show()},1e3)}var PwaInstallOverlayInFeed,init_installOverlayInFeed=__esm({"frontend/assets/js/dev/modules/installOverlayInFeed.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallOverlayInFeed=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handlePerformInstallation()}static async findFeedContainer(){const feedSelectors=[".post-list",".posts",".post-loop",".blog-posts",".content-area",".site-main","#main","#content","main",".entry-content"],feedItemSelectors=[".post",".entry",".article",".blog-post",".hentry","article"];let feedContainer=null;for(const selector of feedSelectors){const element=document.querySelector(selector);if(element){feedContainer=element;break}}if(!feedContainer)return null;let feedItems=null;for(const selector of feedItemSelectors){const items=feedContainer.querySelectorAll(selector);if(items.length>0){feedItems=items;break}}return{feedContainer,feedItems}}static async show(){var _a;let overlay=document.querySelector("pwa-install-overlay-in-feed");if(!overlay){overlay=document.createElement("pwa-install-overlay-in-feed");const feed=await this.findFeedContainer();if(feed&&((_a=feed.feedItems)==null?void 0:_a.length)>=4){const targetItem=feed.feedItems[3],overlayWrapper=document.createElement("div");overlayWrapper.className="pwa-install-overlay-wrapper",overlayWrapper.appendChild(overlay),targetItem.parentNode.insertBefore(overlayWrapper,targetItem.nextSibling)}}return overlay}injectStyles(css){this.styles.add(css)}handlePerformInstallation(){const installButton=this.shadowRoot.querySelector(".in-feed-overlay-button_install");installButton?.addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l;const appName=(_a=config.jsVars.settings.webAppManifest.appIdentity.appName)!=null?_a:"",themeColor=(_d=(_c=(_b=config.jsVars.settings.webAppManifest)==null?void 0:_b.appearance)==null?void 0:_c.themeColor)!=null?_d:"#000000",textColor=getContrastTextColor(themeColor),title=(_g=(_f=(_e=config.jsVars.settings.installation)==null?void 0:_e.prompts)==null?void 0:_f.text)!=null?_g:wp.i18n.__("Install Web App",config.jsVars.slug),message=(_l=(_k=(_j=(_i=(_h=config.jsVars.settings.installation)==null?void 0:_h.prompts)==null?void 0:_i.types)==null?void 0:_j.inFeed)==null?void 0:_k.message)!=null?_l:wp.i18n.__("Keep reading, even when you're on the train!",config.jsVars.slug),appIconHtml=config.jsVars.iconUrl?`<img class="in-feed-overlay-appinfo_icon" src="${config.jsVars.iconUrl}" alt="${appName}" onerror="this.style.display='none'"/>
1206`:"";this.injectStyles(` 1207 .in-feed-overlay { 1208 position: relative; 1209 border-radius: 0.5rem; 1210 padding: 1rem; 1211 background-color: ${themeColor}; 1212 color: ${textColor}; 1213 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 1214 -webkit-transition: all 0.2s ease-out; 1215 -o-transition: all 0.2s ease-out; 1216 transition: all 0.2s ease-out; 1217 overflow: hidden; 1218 text-transform: none; 1219 } 1220 1221 .in-feed-overlay-appinfo { 1222 display: flex; 1223 align-items: center; 1224 gap: 0.75rem; 1225 flex: 1; 1226 } 1227 1228 .in-feed-overlay-appinfo_icon { 1229 border-radius: 9999px; 1230 border: 1px solid #e5e7eb; 1231 flex-shrink: 0; 1232 height: 50px; 1233 width: 50px; 1234 display: inline-block; 1235 } 1236 1237 .in-feed-overlay-appinfo_texts { 1238 flex: 1; 1239 min-width: 0; 1240 } 1241 1242 .in-feed-overlay-appinfo_title { 1243 font-size: 0.875rem; 1244 line-height: 1.25rem; 1245 font-weight: 500; 1246 color: ${textColor}; 1247 display: -webkit-box; 1248 overflow: hidden; 1249 -webkit-box-orient: vertical; 1250 -webkit-line-clamp: 1; 1251 } 1252 1253 .in-feed-overlay-appinfo_description { 1254 font-size: 0.75rem; 1255 line-height: 1rem; 1256 font-weight: 400; 1257 color: ${textColor}cc; 1258 margin-top: 0.12rem; 1259 display: -webkit-box; 1260 overflow: hidden; 1261 -webkit-box-orient: vertical; 1262 -webkit-line-clamp: 2; 1263 } 1264 1265 .in-feed-overlay-button_install { 1266 display: block; 1267 background-color: ${textColor}; 1268 color: ${themeColor}; 1269 vertical-align: middle; 1270 text-decoration: none; 1271 font-size: 0.875rem; 1272 line-height: 1.25rem; 1273 font-weight: 600; 1274 padding: 0.375rem 0.875rem; 1275 margin-left: auto; 1276 margin-top: 1rem; 1277 border: none; 1278 outline: none; 1279 border-radius: 9999px; 1280 cursor: pointer; 1281 } 1282 `);const combinedStyles=Array.from(this.styles).join(` 1283`);this.shadowRoot.innerHTML=` 1284 <style>${combinedStyles}</style> 1285 <div class="in-feed-overlay"> 1286 <div class="in-feed-overlay-appinfo"> 1287 ${appIconHtml} 1288 <div class="in-feed-overlay-appinfo_texts"> 1289 <div class="in-feed-overlay-appinfo_title">${title}</div> 1290 <div class="in-feed-overlay-appinfo_description">${message}</div> 1291 </div> 1292 </div> 1293 <button type="button" class="in-feed-overlay-button_install"> 1294 ${wp.i18n.__("Install Now",config.jsVars.slug)} 1295 </button> 1296 </div> 1297 `}}}}),installOverlayWoocommerceCheckout_exports={};__export(installOverlayWoocommerceCheckout_exports,{initInstallOverlayWoocommerceCheckout:()=>initInstallOverlayWoocommerceCheckout});async function initInstallOverlayWoocommerceCheckout(){customElements.get("pwa-install-overlay-woocommerce-checkout")||customElements.define("pwa-install-overlay-woocommerce-checkout",PwaInstallOverlayWoocommerceCheckout),PwaInstallOverlayWoocommerceCheckout.show(),setTimeout(()=>{PwaInstallOverlayWoocommerceCheckout.show()},1e3)}var PwaInstallOverlayWoocommerceCheckout,init_installOverlayWoocommerceCheckout=__esm({"frontend/assets/js/dev/modules/installOverlayWoocommerceCheckout.js"(){init_frontend(),init_installPrompt(),init_utils(),PwaInstallOverlayWoocommerceCheckout=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handlePerformInstallation()}static findCheckoutForm(){const checkoutFormSelectors=["form.wc-block-checkout__form","form.woocommerce-checkout"];for(const selector of checkoutFormSelectors){const form=document.querySelector(selector);if(form)return form}return null}static show(){let overlay=document.querySelector("pwa-install-overlay-woocommerce-checkout");if(!overlay){const checkoutForm=this.findCheckoutForm();checkoutForm&&(overlay=document.createElement("pwa-install-overlay-woocommerce-checkout"),checkoutForm.parentNode.insertBefore(overlay,checkoutForm.nextSibling))}return overlay}injectStyles(css){this.styles.add(css)}handlePerformInstallation(){const installButton=this.shadowRoot.querySelector(".woocommerce-checkout-overlay-button_install");installButton?.addEventListener("click",()=>{performInstallation()})}render(){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l;const appName=(_a=config.jsVars.settings.webAppManifest.appIdentity.appName)!=null?_a:"",themeColor=(_d=(_c=(_b=config.jsVars.settings.webAppManifest)==null?void 0:_b.appearance)==null?void 0:_c.themeColor)!=null?_d:"#000000",textColor=getContrastTextColor(themeColor),title=(_g=(_f=(_e=config.jsVars.settings.installation)==null?void 0:_e.prompts)==null?void 0:_f.text)!=null?_g:wp.i18n.__("Install Web App",config.jsVars.slug),message=(_l=(_k=(_j=(_i=(_h=config.jsVars.settings.installation)==null?void 0:_h.prompts)==null?void 0:_i.types)==null?void 0:_j.woocommerceCheckout)==null?void 0:_k.message)!=null?_l:wp.i18n.__("Keep track of your orders. Our web app is fast, small and works offline.",config.jsVars.slug),appIconHtml=config.jsVars.iconUrl?`<img class="woocommerce-checkout-overlay-appinfo_icon" src="${config.jsVars.iconUrl}" alt="${appName}" onerror="this.style.display='none'"/>
1297`:"";this.injectStyles(` 1298 .woocommerce-checkout-overlay { 1299 position: relative; 1300 border-radius: 0.5rem; 1301 padding: 1rem; 1302 margin-top: 2rem; 1303 background-color: ${themeColor}; 1304 color: ${textColor}; 1305 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 1306 -webkit-transition: all 0.2s ease-out; 1307 -o-transition: all 0.2s ease-out; 1308 transition: all 0.2s ease-out; 1309 overflow: hidden; 1310 text-transform: none; 1311 } 1312 1313 .woocommerce-checkout-overlay-appinfo { 1314 display: flex; 1315 align-items: center; 1316 gap: 0.75rem; 1317 flex: 1; 1318 } 1319 1320 .woocommerce-checkout-overlay-appinfo_icon { 1321 border-radius: 9999px; 1322 border: 1px solid #e5e7eb; 1323 flex-shrink: 0; 1324 height: 50px; 1325 width: 50px; 1326 display: inline-block; 1327 } 1328 1329 .woocommerce-checkout-overlay-appinfo_texts { 1330 flex: 1; 1331 min-width: 0; 1332 } 1333 1334 .woocommerce-checkout-overlay-appinfo_title { 1335 font-size: 0.875rem; 1336 line-height: 1.25rem; 1337 font-weight: 500; 1338 color: ${textColor}; 1339 display: -webkit-box; 1340 overflow: hidden; 1341 -webkit-box-orient: vertical; 1342 -webkit-line-clamp: 1; 1343 } 1344 1345 .woocommerce-checkout-overlay-appinfo_description { 1346 font-size: 0.75rem; 1347 line-height: 1rem; 1348 font-weight: 400; 1349 color: ${textColor}cc; 1350 margin-top: 0.12rem; 1351 display: -webkit-box; 1352 overflow: hidden; 1353 -webkit-box-orient: vertical; 1354 -webkit-line-clamp: 2; 1355 } 1356 1357 .woocommerce-checkout-overlay-button_install { 1358 display: block; 1359 background-color: ${textColor}; 1360 color: ${themeColor}; 1361 vertical-align: middle; 1362 text-decoration: none; 1363 font-size: 0.875rem; 1364 line-height: 1.25rem; 1365 font-weight: 600; 1366 padding: 0.375rem 0.875rem; 1367 margin-left: auto; 1368 margin-top: 1rem; 1369 border: none; 1370 outline: none; 1371 border-radius: 9999px; 1372 cursor: pointer; 1373 } 1374 `);const combinedStyles=Array.from(this.styles).join(` 1375`);this.shadowRoot.innerHTML=` 1376 <style>${combinedStyles}</style> 1377 <div class="woocommerce-checkout-overlay"> 1378 <div class="woocommerce-checkout-overlay-appinfo"> 1379 ${appIconHtml} 1380 <div class="woocommerce-checkout-overlay-appinfo_texts"> 1381 <div class="woocommerce-checkout-overlay-appinfo_title">${title}</div> 1382 <div class="woocommerce-checkout-overlay-appinfo_description">${message}</div> 1383 </div> 1384 </div> 1385 <button type="button" class="woocommerce-checkout-overlay-button_install"> 1386 ${wp.i18n.__("Install Now",config.jsVars.slug)} 1387 </button> 1388 </div> 1389 `}}}}),pageLoader_exports={};__export(pageLoader_exports,{initPageLoader:()=>initPageLoader});async function initPageLoader(){customElements.get("pwa-page-loader")||customElements.define("pwa-page-loader",PwaPageLoader),PwaPageLoader.show()}var PwaPageLoader,init_pageLoader=__esm({"frontend/assets/js/dev/modules/pageLoader.js"(){init_frontend(),init_utils(),PwaPageLoader=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.type=config.jsVars.settings.uiComponents.pageLoader.type,this.performanceData={startTime:performance.now(),estimatedDuration:2e3,loadHistory:[],current:0,target:90,isLoading:!1},this.updateProgress=this.updateProgress.bind(this),this.onResourceLoad=this.onResourceLoad.bind(this),this.resourcesTotal=0,this.resourcesLoaded=0}connectedCallback(){this.render(),this.initialShow(),this.setupNavigationHandlers()}injectStyles(css){this.styles.add(css)}static show(){let pageLoader=document.querySelector("pwa-page-loader");return pageLoader||(pageLoader=document.createElement("pwa-page-loader"),document.body.appendChild(pageLoader)),pageLoader}setupNavigationHandlers(){window.addEventListener("beforeunload",()=>{this.showPageLoaderBeforeUnload()}),document.readyState==="complete"?this.hidePageLoader():window.addEventListener("load",()=>{this.hidePageLoader()})}initialShow(){const pageLoader=this.shadowRoot.querySelector(".pageLoader");
1389pageLoader&&(this.type==="skeleton"?this.showSkeletonPageLoader():(document.documentElement.style.paddingRight=`${window.innerWidth-document.documentElement.offsetWidth}px`,document.documentElement.style.overflow="hidden",pageLoader.classList.add("visible"),pageLoader.classList.add("no-transition"),requestAnimationFrame(()=>{pageLoader.classList.remove("no-transition")}),this.type==="percent"&&this.startProgressTracking()))}showPageLoaderBeforeUnload(){const pageLoader=this.shadowRoot.querySelector(".pageLoader");pageLoader&&(this.type==="percent"&&this.resetProgress(),requestAnimationFrame(()=>{document.documentElement.style.paddingRight=`${window.innerWidth-document.documentElement.offsetWidth}px`,document.documentElement.style.overflow="hidden",pageLoader.classList.add("visible")}))}hidePageLoader(){const pageLoader=this.shadowRoot.querySelector(".pageLoader");pageLoader&&(this.type==="skeleton"?this.removeSkeletonPageLoader():this.type==="percent"?(this.performanceData.isLoading=!1,this.updateProgress(100),setTimeout(()=>this.fadeOutPageLoader(pageLoader),200)):this.fadeOutPageLoader(pageLoader))}fadeOutPageLoader(pageLoader){pageLoader.offsetHeight,pageLoader.style.display="flex";const handleTransitionEnd=()=>{document.documentElement.style.removeProperty("overflow"),document.documentElement.style.paddingRight="",pageLoader.style.display="none",pageLoader.removeEventListener("transitionend",handleTransitionEnd)};pageLoader.addEventListener("transitionend",handleTransitionEnd),requestAnimationFrame(()=>{pageLoader.classList.remove("visible")})}startProgressTracking(){if(this.performanceData.isLoading)return;this.performanceData.isLoading=!0,this.performanceData.startTime=performance.now(),this.resourcesTotal=0,this.resourcesLoaded=0,this.startResourceTracking();let lastUpdate=performance.now();const animate=()=>{if(!this.performanceData.isLoading)return;const now=performance.now(),delta=now-lastUpdate;lastUpdate=now;const progress=this.calculateProgress();this.updateProgress(progress),progress<100&&requestAnimationFrame(animate)};requestAnimationFrame(animate)}resetProgress(){if(this.type!=="percent")return;const progressBar=this.shadowRoot.querySelector(".pageLoader_progress-fill"),counter=this.shadowRoot.querySelector(".pageLoader_counter");progressBar&&counter&&(progressBar.style.transition="none",progressBar.style.width="0%",counter.textContent="0%",progressBar.offsetHeight,progressBar.style.transition="width 0.05s ease-out")}startResourceTracking(){const resources=performance.getEntriesByType("resource");this.resourcesTotal=resources.length,new PerformanceObserver(list=>{for(const entry of list.getEntries())entry.entryType==="resource"&&(this.resourcesTotal++,this.onResourceLoad())}).observe({entryTypes:["resource"]}),document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{this.resourcesLoaded=this.resourcesTotal,this.updateEstimatedDuration()})}onResourceLoad(){this.resourcesLoaded++,this.updateEstimatedDuration()}updateEstimatedDuration(){const elapsed=performance.now()-this.performanceData.startTime;this.performanceData.loadHistory.push(elapsed),this.performanceData.loadHistory.length>5&&this.performanceData.loadHistory.shift();const avgLoadTime=this.performanceData.loadHistory.reduce((a,b)=>a+b,0)/this.performanceData.loadHistory.length;this.performanceData.estimatedDuration=Math.max(avgLoadTime,2e3)}calculateProgress(){const elapsed=performance.now()-this.performanceData.startTime,resourceProgress=this.resourcesTotal?this.resourcesLoaded/this.resourcesTotal*100:0,timeProgress=Math.min(100,elapsed/this.performanceData.estimatedDuration*this.performanceData.target),progress=Math.max(timeProgress,resourceProgress);return Math.min(progress,this.performanceData.target)}updateProgress(progress){if(this.type!=="percent")return;const progressBar=this.shadowRoot.querySelector(".pageLoader_progress-fill"),counter=this.shadowRoot.querySelector(".pageLoader_counter");progressBar&&counter&&(progressBar.style.width=`${progress}%`,counter.textContent=`${Math.round(progress)}%`)}showSkeletonPageLoader(){document.documentElement.classList.add("skeleton");const styleSheet=document.createElement("style");styleSheet.textContent=` 1390 :root.skeleton:-webkit-input-placeholder { 1391 pointer-events: none!important; 1392 border: none!important; 1393 -webkit-box-shadow: none!important; 1394 box-shadow: none!important; 1395 text-decoration: none!important; 1396 color: transparent!important; 1397 background-color: #e6e9ef!important; 1398 background-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(rgba(255, 255, 255, 0.6)), to(rgba(255, 255, 255, 0))); 1399 background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); 1400 background-size: 500px 100%!important; 1401 background-repeat: no-repeat!important; 1402 border-radius: 4px!important; 1403 -webkit-animation: skeletonLoad 1s ease-in-out infinite!important; 1404 animation: skeletonLoad 1s ease-in-out infinite!important; 1405 } 1406 1407 :root.skeleton::-moz-placeholder { 1408 pointer-events: none!important; 1409 border: none!important; 1410 box-shadow: none!important; 1411 text-decoration: none!important; 1412 color: transparent!important; 1413 background-color: #e6e9ef!important; 1414 background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); 1415 background-size: 500px 100%!important; 1416 background-repeat: no-repeat!important; 1417 border-radius: 4px!important; 1418 -webkit-animation: skeletonLoad 1s ease-in-out infinite!important; 1419 animation: skeletonLoad 1s ease-in-out infinite!important; 1420 } 1421 1422 :root.skeleton:-ms-input-placeholder { 1423 pointer-events: none!important; 1424 border: none!important; 1425 box-shadow: none!important; 1426 text-decoration: none!important; 1427 color: transparent!important; 1428 background-color: #e6e9ef!important; 1429 background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); 1430 background-size: 500px 100%!important; 1431 background-repeat: no-repeat!important; 1432 border-radius: 4px!important; 1433 -webkit-animation: skeletonLoad 1s ease-in-out infinite!important; 1434 animation: skeletonLoad 1s ease-in-out infinite!important; 1435 } 1436 1437 :root.skeleton::-ms-input-placeholder { 1438 pointer-events: none!important; 1439 border: none!important; 1440 box-shadow: none!important; 1441 text-decoration: none!important; 1442 color: transparent!important; 1443 background-color: #e6e9ef!important; 1444 background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); 1445 background-size: 500px 100%!important; 1446 background-repeat: no-repeat!important; 1447 border-radius: 4px!important; 1448 -webkit-animation: skeletonLoad 1s ease-in-out infinite!important; 1449 animation: skeletonLoad 1s ease-in-out infinite!important; 1450 } 1451 1452 :root.skeleton *:not(script):not(style):not(link):not(meta):not(pwa-page-loader), 1453 :root.skeleton::placeholder, 1454 :root.skeleton::before, 1455 :root.skeleton::after { 1456 pointer-events: none!important; 1457 border: none!important; 1458 -webkit-box-shadow: none!important; 1459 box-shadow: none!important; 1460 text-decoration: none!important; 1461 color: transparent!important; 1462 background-color: #e6e9ef!important; 1463 background-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(rgba(255, 255, 255, 0.6)), to(rgba(255, 255, 255, 0))); 1464 background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); 1465 background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)); 1466 background-size: 500px 100%!important; 1467 background-repeat: no-repeat!important; 1468 border-radius: 4px!important; 1469 -webkit-animation: skeletonLoad 1s ease-in-out infinite!important; 1470 animation: skeletonLoad 1s ease-in-out infinite!important; 1471 } 1472 1473 @-webkit-keyframes skeletonLoad { 1474 from { 1475 background-position: -500px 0; 1476 } 1477 to { 1478 background-position: calc(500px + 100%) 0; 1479 } 1480 } 1481 1482 @keyframes skeletonLoad { 1483 from { 1484 background-position: -500px 0; 1485 } 1486 to { 1487 background-position: calc(500px + 100%) 0; 1488 } 1489 } 1490 `,document.head.appendChild(styleSheet),this.skeletonStyleSheet=styleSheet,document.querySelectorAll("*:not(script):not(style):not(link):not(meta):not(pwa-page-loader)").forEach(element=>{if(element.matches("img, video, iframe")){const wrapper=document.createElement("div");wrapper.className="skeleton-media",wrapper.style.width=`${element.offsetWidth||element.getAttribute("width")||300}px`,wrapper.style.height=`${element.offsetHeight||element.getAttribute("height")||200}px`,element.parentNode.insertBefore(wrapper,element),wrapper.appendChild(element)}})}removeSkeletonPageLoader(){document.documentElement.classList.remove("skeleton"),this.skeletonStyleSheet&&this.skeletonStyleSheet.remove(),document.querySelectorAll(".skeleton-media").forEach(wrapper=>{const element=wrapper.firstElementChild;wrapper.parentNode.insertBefore(element,wrapper),wrapper.remove()})}renderDefaultPageLoader(){var _a,_b,_c,_d;const backgroundColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.backgroundColor)!=null?_c:"#ffffff",appIcon=(_d=config.jsVars.iconUrl)!=null?_d:"";return this.injectStyles(` 1491 .pageLoader.-default { 1492 background-color: ${backgroundColor}; 1493 } 1494 1495 .pageLoader_icon { 1496 width: 150px; 1497 height: 150px; 1498 background: url(${appIcon}) no-repeat center; 1499 background-size: contain; 1500 -webkit-animation: bounce .4s infinite alternate; 1501 animation: bounce .4s infinite alternate; 1502 } 1503 1504 @-webkit-keyframes bounce { 1505 to { 1506 -webkit-transform: scale(1.07); 1507 transform: scale(1.07); 1508 } 1509 } 1510 1511 @keyframes bounce { 1512 to { 1513 -webkit-transform: scale(1.07); 1514 transform: scale(1.07); 1515 } 1516 } 1517 `),` 1518 <div class="pageLoader -default"> 1519 <div class="pageLoader_icon"></div> 1520 </div> 1521 `}renderSkeletonPageLoader(){var _a,_b,_c;const backgroundColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.backgroundColor)!=null?_c:"#ffffff";return this.injectStyles(` 1522 .pageLoader.-skeleton { 1523 background-color: ${backgroundColor}; 1524 } 1525 `),` 1526 <div class="pageLoader -skeleton" style="background-color: ${backgroundColor}"></div> 1527 `}renderSpinnerPageLoader(){var _a,_b,_c;const backgroundColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.backgroundColor)!=null?_c:"#ffffff",spinnerColor=getContrastTextColor(backgroundColor);return this.injectStyles(` 1528 .pageLoader.-spinner { 1529 background-color: ${backgroundColor}; 1530 } 1531 1532 .pageLoader_svg { 1533 -webkit-animation: rotate 2s linear infinite; 1534 animation: rotate 2s linear infinite; 1535 z-index: 2; 1536 position: absolute; 1537 width: 70px; 1538 height: 70px; 1539 } 1540 1541 .pageLoader_svg circle { 1542 stroke: ${spinnerColor}; 1543 stroke-linecap: round; 1544 -webkit-animation: dash 1.5s ease-in-out infinite; 1545 animation: dash 1.5s ease-in-out infinite; 1546 } 1547 1548 @-webkit-keyframes rotate { 1549 100% { 1550 transform: rotate(360deg); 1551 } 1552 } 1553 1554 @keyframes rotate { 1555 100% { 1556 transform: rotate(360deg); 1557 } 1558 } 1559 1560 @-webkit-keyframes dash { 1561 0% { 1562 stroke-dasharray: 1, 150; 1563 stroke-dashoffset: 0; 1564 } 1565 50% { 1566 stroke-dasharray: 90, 150; 1567 stroke-dashoffset: -35; 1568 } 1569 100% { 1570 stroke-dasharray: 90, 150; 1571 stroke-dashoffset: -124; 1572 } 1573 } 1574 1575 @keyframes dash { 1576 0% { 1577 stroke-dasharray: 1, 150; 1578 stroke-dashoffset: 0; 1579 } 1580 50% { 1581 stroke-dasharray: 90, 150; 1582 stroke-dashoffset: -35; 1583 } 1584 100% { 1585 stroke-dasharray: 90, 150; 1586 stroke-dashoffset: -124; 1587 } 1588 } 1589 `),` 1590 <div class="pageLoader -spinner"> 1591 <svg class="pageLoader_svg" viewBox="0 0 50 50"> 1592 <circle cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle> 1593 </svg> 1594 </div> 1595 `}renderRedirectPageLoader(){return this.injectStyles(` 1596 .pageLoader.-redirect { 1597 background-color: #f1c40f; 1598 } 1599 1600 .pageLoader_body { 1601 position: absolute; 1602 top: 50%; 1603 margin-left: -50px; 1604 left: 50%; 1605 -webkit-animation: speeder .4s linear infinite; 1606 animation: speeder .4s linear infinite; 1607 } 1608 1609 .pageLoader_body > span { 1610 height: 5px; 1611 width: 35px; 1612 background: #000; 1613 position: absolute; 1614 top: -19px; 1615 left: 60px; 1616 border-radius: 2px 10px 1px 0; 1617 } 1618 1619 .pageLoader_base span { 1620 position: absolute; 1621 width: 0; 1622 height: 0; 1623 border-top: 6px solid transparent; 1624 border-right: 100px solid #000; 1625 border-bottom: 6px solid transparent; 1626 } 1627 1628 .pageLoader_base span::before { 1629 content: ""; 1630 height: 22px; 1631 width: 22px; 1632 border-radius: 50%; 1633 background: #000; 1634 position: absolute; 1635 right: -110px; 1636 top: -16px; 1637 } 1638 1639 .pageLoader_base span::after { 1640 content: ""; 1641 position: absolute; 1642 width: 0; 1643 height: 0; 1644 border-top: 0 solid transparent; 1645 border-right: 55px solid #000; 1646 border-bottom: 16px solid transparent; 1647 top: -16px; 1648 right: -98px; 1649 } 1650 1651 .pageLoader_face { 1652 position: absolute; 1653 height: 12px;
1654 width: 20px; 1655 background: #000; 1656 border-radius: 20px 20px 0 0; 1657 -webkit-transform: rotate(-40deg); 1658 -ms-transform: rotate(-40deg); 1659 transform: rotate(-40deg); 1660 right: -125px; 1661 top: -15px; 1662 } 1663 1664 .pageLoader_face::after { 1665 content: ""; 1666 height: 12px; 1667 width: 12px; 1668 background: #000; 1669 right: 4px; 1670 top: 7px; 1671 position: absolute; 1672 -webkit-transform: rotate(40deg); 1673 -ms-transform: rotate(40deg); 1674 transform: rotate(40deg); 1675 -webkit-transform-origin: 50% 50%; 1676 -ms-transform-origin: 50% 50%; 1677 transform-origin: 50% 50%; 1678 border-radius: 0 0 0 2px; 1679 } 1680 1681 .pageLoader_body > span > span:nth-child(1), 1682 .pageLoader_body > span > span:nth-child(2), 1683 .pageLoader_body > span > span:nth-child(3), 1684 .pageLoader_body > span > span:nth-child(4) { 1685 width: 30px; 1686 height: 1px; 1687 background: #000; 1688 position: absolute; 1689 -webkit-animation: fazer1 .2s linear infinite; 1690 animation: fazer1 .2s linear infinite; 1691 } 1692 1693 .pageLoader_body > span > span:nth-child(2) { 1694 top: 3px; 1695 -webkit-animation: fazer2 .4s linear infinite; 1696 animation: fazer2 .4s linear infinite; 1697 } 1698 1699 .pageLoader_body > span > span:nth-child(3) { 1700 top: 1px; 1701 -webkit-animation: fazer3 .4s linear infinite; 1702 animation: fazer3 .4s linear infinite; 1703 -webkit-animation-delay: -1s; 1704 animation-delay: -1s; 1705 } 1706 1707 .pageLoader_body > span > span:nth-child(4) { 1708 top: 4px; 1709 -webkit-animation: fazer4 1s linear infinite; 1710 animation: fazer4 1s linear infinite; 1711 -webkit-animation-delay: -1s; 1712 animation-delay: -1s; 1713 } 1714 1715 .pageLoader_fazers { 1716 position: absolute; 1717 width: 100%; 1718 height: 100%; 1719 } 1720 1721 .pageLoader_fazers span { 1722 position: absolute; 1723 height: 2px; 1724 width: 20%; 1725 background: #000; 1726 } 1727 1728 .pageLoader_fazers span:nth-child(1) { 1729 top: 20%; 1730 -webkit-animation: fazers1 .6s linear infinite; 1731 animation: fazers1 .6s linear infinite; 1732 -webkit-animation-delay: -5s; 1733 animation-delay: -5s; 1734 } 1735 1736 .pageLoader_fazers span:nth-child(2) { 1737 top: 40%; 1738 -webkit-animation: fazers2 .8s linear infinite; 1739 animation: fazers2 .8s linear infinite; 1740 -webkit-animation-delay: -1s; 1741 animation-delay: -1s; 1742 } 1743 1744 .pageLoader_fazers span:nth-child(3) { 1745 top: 60%; 1746 -webkit-animation: fazers3 .6s linear infinite; 1747 animation: fazers3 .6s linear infinite; 1748 } 1749 1750 .pageLoader_fazers span:nth-child(4) { 1751 top: 80%; 1752 -webkit-animation: fazers4 .5s linear infinite; 1753 animation: fazers4 .5s linear infinite; 1754 -webkit-animation-delay: -3s; 1755 animation-delay: -3s; 1756 } 1757 1758 @-webkit-keyframes fazers1 { 1759 0% { 1760 left: 200%; 1761 } 1762 100% { 1763 left: -200%; 1764 opacity: 0; 1765 } 1766 } 1767 1768 @keyframes fazers1 { 1769 0% { 1770 left: 200%; 1771 } 1772 100% { 1773 left: -200%; 1774 opacity: 0; 1775 } 1776 } 1777 1778 @-webkit-keyframes fazers2 { 1779 0% { 1780 left: 200%; 1781 } 1782 100% { 1783 left: -200%; 1784 opacity: 0; 1785 } 1786 } 1787 1788 @keyframes fazers2 { 1789 0% { 1790 left: 200%; 1791 } 1792 100% { 1793 left: -200%; 1794 opacity: 0; 1795 } 1796 } 1797 1798 @-webkit-keyframes fazers3 { 1799 0% { 1800 left: 200%; 1801 } 1802 100% { 1803 left: -100%; 1804 opacity: 0; 1805 } 1806 } 1807 1808 @keyframes fazers3 { 1809 0% { 1810 left: 200%; 1811 } 1812 100% { 1813 left: -100%; 1814 opacity: 0; 1815 } 1816 } 1817 1818 @-webkit-keyframes fazers4 { 1819 0% { 1820 left: 200%; 1821 } 1822 100% { 1823 left: -100%; 1824 opacity: 0; 1825 } 1826 } 1827 1828 @keyframes fazers4 { 1829 0% { 1830 left: 200%; 1831 } 1832 100% { 1833 left: -100%; 1834 opacity: 0; 1835 } 1836 } 1837 1838 @-webkit-keyframes fazer1 { 1839 0% { 1840 left: 0; 1841 } 1842 100% { 1843 left: -80px; 1844 opacity: 0; 1845 } 1846 } 1847 1848 @keyframes fazer1 { 1849 0% { 1850 left: 0; 1851 } 1852 100% { 1853 left: -80px; 1854 opacity: 0; 1855 } 1856 } 1857 1858 @-webkit-keyframes fazer2 { 1859 0% { 1860 left: 0; 1861 } 1862 100% { 1863 left: -100px; 1864 opacity: 0; 1865 } 1866 } 1867 1868 @keyframes fazer2 { 1869 0% { 1870 left: 0; 1871 } 1872 100% { 1873 left: -100px; 1874 opacity: 0; 1875 } 1876 } 1877 1878 @-webkit-keyframes fazer3 { 1879 0% { 1880 left: 0; 1881 } 1882 100% { 1883 left: -50px; 1884 opacity: 0; 1885 } 1886 } 1887 1888 @keyframes fazer3 { 1889 0% { 1890 left: 0; 1891 } 1892 100% { 1893 left: -50px; 1894 opacity: 0; 1895 } 1896 } 1897 1898 @-webkit-keyframes fazer4 { 1899 0% { 1900 left: 0; 1901 } 1902 100% { 1903 left: -150px; 1904 opacity: 0; 1905 } 1906 } 1907 1908 @keyframes fazer4 { 1909 0% { 1910 left: 0; 1911 } 1912 100% { 1913 left: -150px; 1914 opacity: 0; 1915 } 1916 } 1917 1918 @-webkit-keyframes speeder { 1919 0% { 1920 -webkit-transform: translate(2px, 1px) rotate(0deg); 1921 transform: translate(2px, 1px) rotate(0deg); 1922 } 1923 10% { 1924 -webkit-transform: translate(-1px, -3px) rotate(-1deg); 1925 transform: translate(-1px, -3px) rotate(-1deg); 1926 } 1927 20% { 1928 -webkit-transform: translate(-2px, 0px) rotate(1deg); 1929 transform: translate(-2px, 0px) rotate(1deg); 1930 } 1931 30% { 1932 -webkit-transform: translate(1px, 2px) rotate(0deg); 1933 transform: translate(1px, 2px) rotate(0deg); 1934 } 1935 40% { 1936 -webkit-transform: translate(1px, -1px) rotate(1deg); 1937 transform: translate(1px, -1px) rotate(1deg); 1938 } 1939 50% { 1940 -webkit-transform: translate(-1px, 3px) rotate(-1deg); 1941 transform: translate(-1px, 3px) rotate(-1deg); 1942 } 1943 60% { 1944 -webkit-transform: translate(-1px, 1px) rotate(0deg); 1945 transform: translate(-1px, 1px) rotate(0deg); 1946 } 1947 70% { 1948 -webkit-transform: translate(3px, 1px) rotate(-1deg); 1949 transform: translate(3px, 1px) rotate(-1deg); 1950 } 1951 80% { 1952 -webkit-transform: translate(-2px, -1px) rotate(1deg); 1953 transform: translate(-2px, -1px) rotate(1deg); 1954 } 1955 90% { 1956 -webkit-transform: translate(2px, 1px) rotate(0deg); 1957 transform: translate(2px, 1px) rotate(0deg); 1958 } 1959 100% { 1960 -webkit-transform: translate(1px, -2px) rotate(-1deg); 1961 transform: translate(1px, -2px) rotate(-1deg); 1962 } 1963 } 1964 1965 @keyframes speeder { 1966 0% { 1967 -webkit-transform: translate(2px, 1px) rotate(0deg); 1968 transform: translate(2px, 1px) rotate(0deg); 1969 } 1970 10% { 1971 -webkit-transform: translate(-1px, -3px) rotate(-1deg); 1972 transform: translate(-1px, -3px) rotate(-1deg); 1973 } 1974 20% { 1975 -webkit-transform: translate(-2px, 0px) rotate(1deg); 1976 transform: translate(-2px, 0px) rotate(1deg); 1977 } 1978 30% { 1979 -webkit-transform: translate(1px, 2px) rotate(0deg); 1980 transform: translate(1px, 2px) rotate(0deg); 1981 } 1982 40% { 1983 -webkit-transform: translate(1px, -1px) rotate(1deg); 1984 transform: translate(1px, -1px) rotate(1deg); 1985 } 1986 50% { 1987 -webkit-transform: translate(-1px, 3px) rotate(-1deg); 1988 transform: translate(-1px, 3px) rotate(-1deg); 1989 } 1990 60% { 1991 -webkit-transform: translate(-1px, 1px) rotate(0deg); 1992 transform: translate(-1px, 1px) rotate(0deg); 1993 } 1994 70% { 1995 -webkit-transform: translate(3px, 1px) rotate(-1deg); 1996 transform: translate(3px, 1px) rotate(-1deg); 1997 } 1998 80% { 1999 -webkit-transform: translate(-2px, -1px) rotate(1deg); 2000 transform: translate(-2px, -1px) rotate(1deg); 2001 } 2002 90% { 2003 -webkit-transform: translate(2px, 1px) rotate(0deg); 2004 transform: translate(2px, 1px) rotate(0deg); 2005 } 2006 100% { 2007 -webkit-transform: translate(1px, -2px) rotate(-1deg); 2008 transform: translate(1px, -2px) rotate(-1deg); 2009 } 2010 } 2011 `),` 2012 <div class="pageLoader -redirect"> 2013 <div class="pageLoader_body">
2014 <span> 2015 <span></span> 2016 <span></span> 2017 <span></span> 2018 <span></span> 2019 </span> 2020 <div class="pageLoader_base"> 2021 <span></span> 2022 <div class="pageLoader_face"></div> 2023 </div> 2024 </div> 2025 <div class="pageLoader_fazers"> 2026 <span></span> 2027 <span></span> 2028 <span></span> 2029 <span></span> 2030 </div> 2031 </div> 2032 `}renderPercentPageLoader(){var _a,_b,_c;const backgroundColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.backgroundColor)!=null?_c:"#ffffff",percentColor=getContrastTextColor(backgroundColor);return this.injectStyles(` 2033 .pageLoader.-percent { 2034 background-color: ${backgroundColor}; 2035 flex-direction: column; 2036 } 2037 2038 .pageLoader_counter { 2039 font-size: 38px; 2040 color: ${percentColor}; 2041 margin-bottom: 20px; 2042 } 2043 2044 .pageLoader_progress { 2045 width: 400px; 2046 max-width: 85vw; 2047 height: 4px; 2048 position: relative; 2049 border-radius: 4px; 2050 background: ${percentColor}80; 2051 overflow: hidden; 2052 } 2053 2054 .pageLoader_progress-fill { 2055 display: block; 2056 width: 0; 2057 height: 100%; 2058 background: ${percentColor}; 2059 transition: width 0.05s ease-out; 2060 } 2061 `),` 2062 <div class="pageLoader -percent"> 2063 <span class="pageLoader_counter">0%</span> 2064 <div class="pageLoader_progress"> 2065 <span class="pageLoader_progress-fill"></span> 2066 </div> 2067 </div> 2068 `}renderFadePageLoader(){var _a,_b,_c;const backgroundColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.backgroundColor)!=null?_c:"#ffffff";return this.injectStyles(` 2069 .pageLoader.-fade { 2070 background-color: ${backgroundColor}; 2071 } 2072 `),'<div class="pageLoader -fade"></div>'}render(){this.injectStyles(` 2073 .pageLoader { 2074 display: none; 2075 justify-content: center; 2076 align-items: center; 2077 position: fixed; 2078 top: 0; 2079 left: 0; 2080 right: 0; 2081 bottom: 0; 2082 opacity: 0; 2083 z-index: 9999999999999999; 2084 transition: opacity 0.3s ease-out; 2085 } 2086 2087 .pageLoader.no-transition { 2088 transition: none !important; 2089 } 2090 2091 .pageLoader.visible { 2092 opacity: 1; 2093 visibility: visible; 2094 display: flex !important; 2095 } 2096 `);let pageLoaderContent;switch(this.type){case"default":pageLoaderContent=this.renderDefaultPageLoader();break;case"skeleton":pageLoaderContent=this.renderSkeletonPageLoader();break;case"spinner":pageLoaderContent=this.renderSpinnerPageLoader();break;case"redirect":pageLoaderContent=this.renderRedirectPageLoader();break;case"percent":pageLoaderContent=this.renderPercentPageLoader();break;case"fade":pageLoaderContent=this.renderFadePageLoader();break;default:break}const combinedStyles=Array.from(this.styles).join(` 2097`);this.shadowRoot.innerHTML=` 2098 <style> 2099 ${combinedStyles} 2100 </style> 2101 ${pageLoaderContent} 2102 `}}}}),orientationLock_exports={};__export(orientationLock_exports,{initOrientationLock:()=>initOrientationLock});function applyCssOrientationLock(targetOrientation){const existingStyle=document.getElementById("orientation-lock-style");if(existingStyle&&existingStyle.remove(),targetOrientation==="portrait"||targetOrientation==="landscape"){const oppositeOrientation=targetOrientation==="portrait"?"landscape":"portrait",style=document.createElement("style");style.id="orientation-lock-style",targetOrientation==="portrait"?style.textContent=` 2103 @media screen and (min-width: 320px) and (max-width: 767px) and (orientation: ${oppositeOrientation}) { 2104 html { 2105 transform: rotate(-90deg); 2106 transform-origin: left top; 2107 width: 100vh; 2108 overflow-x: hidden; 2109 position: absolute; 2110 top: 100%; 2111 left: 0; 2112 } 2113 } 2114 `:style.textContent=` 2115 @media screen and (min-width: 320px) and (max-width: 767px) and (orientation: ${oppositeOrientation}) { 2116 html { 2117 transform: rotate(90deg); 2118 transform-origin: right top; 2119 width: 100vh; 2120 overflow-x: hidden; 2121 position: absolute; 2122 top: 0; 2123 right: 0; 2124 } 2125 } 2126 `,document.head.appendChild(style)}}async function initOrientationLock(){const orientation=config.jsVars.settings.webAppManifest.displaySettings.orientation;if(orientation!=="any")try{window.screen&&window.screen.orientation&&window.screen.orientation.lock?await window.screen.orientation.lock(orientation):applyCssOr
2126ientationLock(orientation)}catch(error){console.warn("Orientation lock failed:",error.message),applyCssOrientationLock(orientation)}}var init_orientationLock=__esm({"frontend/assets/js/dev/modules/orientationLock.js"(){init_frontend()}}),toastMessages_exports={};__export(toastMessages_exports,{initToastMessages:()=>initToastMessages});async function initToastMessages(){customElements.get("pwa-toast-messages")||customElements.define("pwa-toast-messages",PwaToastMessages),PwaToastMessages.show()}var PwaToastMessages,init_toastMessages=__esm({"frontend/assets/js/dev/modules/toastMessages.js"(){init_frontend(),init_utils(),PwaToastMessages=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render()}injectStyles(css){this.styles.add(css)}static show(){let toastMessages=document.querySelector("pwa-toast-messages");return toastMessages||(toastMessages=document.createElement("pwa-toast-messages"),document.body.appendChild(toastMessages)),requestAnimationFrame(()=>{const toastMessage=toastMessages.shadowRoot.querySelector(".toast-message");setTimeout(()=>{toastMessage.classList.add("visible")},300),setTimeout(()=>{toastMessage.classList.remove("visible"),toastMessage.addEventListener("transitionend",()=>{toastMessages.remove()},{once:!0})},2800)}),toastMessages}render(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",backgroundColor=getContrastTextColor(themeColor),textColor=getContrastTextColor(backgroundColor);this.injectStyles(` 2127 .toast-message { 2128 position: fixed; 2129 bottom: 0; 2130 left: 50%; 2131 -webkit-transform: translateX(-50%) translateY(100%); 2132 -ms-transform: translateX(-50%) translateY(100%); 2133 transform: translateX(-50%) translateY(100%); 2134 display: -webkit-box; 2135 display: -ms-flexbox; 2136 display: flex; 2137 -webkit-box-align: center; 2138 -ms-flex-align: center; 2139 align-items: center; 2140 padding: 0.75rem 1rem; 2141 gap: 0.75rem; 2142 width: auto; 2143 max-width: 85%; 2144 background-color: ${backgroundColor}; 2145 color: ${textColor}; 2146 border: 1px solid ${textColor}15; 2147 border-radius: 0.75rem; 2148 -webkit-box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 2149 box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 2150 z-index: 99999999999999999999999999; 2151 -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2152 -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2153 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2154 opacity: 0; 2155 } 2156 2157 .toast-message.visible { 2158 opacity: 1; 2159 -webkit-transform: translateX(-50%) translateY(-1rem); 2160 -ms-transform: translateX(-50%) translateY(-1rem); 2161 transform: translateX(-50%) translateY(-1rem); 2162 } 2163 2164 .toast-message_text { 2165 font-size: 0.875rem; 2166 line-height: 1.25rem; 2167 font-weight: 500; 2168 } 2169 `);let message;switch(!0){case config.jsVars.pageData.type.isHome:message=wp.i18n.__("Homepage Opened",config.jsVars.slug);break;case config.jsVars.pageData.type.is404:message=wp.i18n.__("Page Not Found",config.jsVars.slug);break;case config.jsVars.pageData.type.isSearch:message=wp.i18n.__("Search Results",config.jsVars.slug);break;case config.jsVars.pageData.type.isBlogPost:message=wp.i18n.__("Article Opened",config.jsVars.slug);break;case config.jsVars.pageData.type.isWooShop:message=wp.i18n.__("Shop Opened",config.jsVars.slug);break;case config.jsVars.pageData.type.isWooProduct:message=wp.i18n.__("Product Opened",config.jsVars.slug);break;default:message=wp.i18n.__("Page Opened",config.jsVars.slug);break}const combinedStyles=Array.from(this.styles).join(` 2170`);this.shadowRoot.innerHTML=` 2171 <style>${combinedStyles}</style> 2172 <div class="toast-message" role="alert" tabindex="-1"> 2173 <span class="toast-message_text"> 2174 ${message} 2175 </span> 2176 </div> 2177 `}}}}),navigationTabBar_exports={};__export(navigationTabBar_exports,{initNavigationTabBar:()=>initNavigationTabBar});async function initNavigationTabBar(){customElements.get("pwa-navigation-tab-bar")||customElements.define("pwa-navigation-tab-bar",PwaNavigationTabBar),PwaNavigationTabBar.show()}var PwaNavigationTabBar,init_navigationTabBar=__esm({"frontend/assets/js/dev/modules/navigationTabBar.js"(){init_frontend(),init_utils(),PwaNavigationTabBar=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render()}static show(){let navigationTabBar=document.querySelector("pwa-navigation-tab-bar");return navigationTabBar||(navigationTabBar=document.createElement("pwa-navigation-tab-bar"),document.body.appendChild(navigationTabBar)),navigationTabBar}injectStyles(css){this.styles.add(css)}async renderTabBarItems(){const navigationItems=config.jsVars.settings.uiComponents.navigationTabBar.navigationItems||[],currentUrl=new URL(window.location.href),cleanCurrentUrl=currentUrl.origin+currentUrl.pathname;return(await Promise.all(navigationItems.map(async item=>{const{icon,label,page}=item;let svgContent="";try{svgContent=await(await fetch(icon)).text()}catch(e){console.error(`Failed to load SVG from ${icon}`,e)}
2177return` 2178 <li class="navigation-tab-bar_item ${cleanCurrentUrl===page?"-active":""}"> 2179 <a class="navigation-tab-bar_link" href="${page}"> 2180 <span class="navigation-tab-bar_icon"> 2181 ${svgContent} 2182 </span> 2183 <span class="navigation-tab-bar_label">${label}</span> 2184 </a> 2185 </li> 2186 `}))).join("")}async render(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",backgroundColor=getContrastTextColor(themeColor),textColor=getContrastTextColor(backgroundColor),borderColor=backgroundColor==="#ffffff"?"#e5e7eb":"#404040";parseInt(getComputedStyle(document.body).paddingBottom)<57&&(document.body.style.paddingBottom="57px"),this.injectStyles(` 2187 .navigation-tab-bar { 2188 position: fixed; 2189 display: flex; 2190 justify-content: center; 2191 align-items: center; 2192 bottom: 0; 2193 left: 0; 2194 right: 0; 2195 margin: 0; 2196 padding: 0; 2197 padding-bottom: env(safe-area-inset-bottom); 2198 transition: padding-bottom 250ms cubic-bezier(0.42, 0, 0.58, 1); 2199 touch-action: none; 2200 user-select: none; 2201 width: 100%; 2202 z-index: 999999999; 2203 height: 3.5rem; 2204 background-color: ${backgroundColor}; 2205 border-top: 1px solid ${borderColor}; 2206 } 2207 2208 .navigation-tab-bar_list { 2209 position: relative; 2210 display: flex; 2211 align-items: center; 2212 justify-content: space-around; 2213 list-style: none; 2214 width: 95%; 2215 height: 100%; 2216 margin: 0; 2217 padding: 0; 2218 } 2219 2220 .navigation-tab-bar_item { 2221 margin: 0; 2222 padding: 0; 2223 display: flex; 2224 justify-content: center; 2225 flex: 1 1 0; 2226 width: 0; 2227 overflow: hidden; 2228 text-overflow: ellipsis; 2229 white-space: nowrap; 2230 } 2231 2232 .navigation-tab-bar_link { 2233 display: flex; 2234 flex-direction: column; 2235 justify-content: center; 2236 align-items: center; 2237 padding: 0.5rem; 2238 text-decoration: none; 2239 transition: all 0.2s ease; 2240 } 2241 2242 .navigation-tab-bar_icon { 2243 display: flex; 2244 align-items: center; 2245 justify-content: center; 2246 margin-bottom: 0.125rem; 2247 } 2248 2249 .navigation-tab-bar_icon svg { 2250 width: 1.25rem; 2251 height: 1.25rem; 2252 color: ${textColor}99; 2253 } 2254 2255 .navigation-tab-bar_label { 2256 display: block; 2257 font-size: 0.75rem; 2258 line-height: 1rem; 2259 font-weight: 500; 2260 text-align: center; 2261 color: ${textColor}99; 2262 } 2263 2264 .navigation-tab-bar_item.-active .navigation-tab-bar_icon svg { 2265 color: ${themeColor}; 2266 stroke-width: 2.25; 2267 } 2268 2269 .navigation-tab-bar_item.-active .navigation-tab-bar_label { 2270 font-weight: 700; 2271 color: ${themeColor}; 2272 } 2273 `);const combinedStyles=Array.from(this.styles).join(` 2274`),itemsHtml=await this.renderTabBarItems();this.shadowRoot.innerHTML=` 2275 <style>${combinedStyles}</style> 2276 <nav class="navigation-tab-bar"> 2277 <ul class="navigation-tab-bar_list"> 2278 ${itemsHtml} 2279 </ul> 2280 </nav> 2281 `}}}}),scrollProgressBar_exports={};__export(scrollProgressBar_exports,{initScrollProgressBar:()=>initScrollProgressBar});async function initScrollProgressBar(){customElements.get("pwa-scroll-progress-bar")||customElements.define("pwa-scroll-progress-bar",PwaScrollProgressBar),PwaScrollProgressBar.show()}var PwaScrollProgressBar,init_scrollProgressBar=__esm({"frontend/assets/js/dev/modules/scrollProgressBar.js"(){init_frontend(),PwaScrollProgressBar=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handleScrollProgress()}static show(){let scrollProgressBar=document.querySelector("pwa-scroll-progress-bar");return scrollProgressBar||(scrollProgressBar=document.createElement("pwa-scroll-progress-bar"),document.body.appendChild(scrollProgressBar)),scrollProgressBar}injectStyles(css){this.styles.add(css)}handleScrollProgress(){const progressBarFill=this.shadowRoot.querySelector(".scroll-progress-bar_fill");let ticking=!1;const updateProgress=()=>{const pixelsFromTop=window.scrollY||window.pageYOffset,pageHeight=document.documentElement.scrollHeight-window.innerHeight,progress=pixelsFromTop/pageHeight*100;progressBarFill.style.width=`${progress}%`,ticking=!1};document.addEventListener("scroll",()=>{ticking||(window.requestAnimationFrame(()=>{updateProgress()}),ticking=!0)}),updateProgress()}render(){var _a,_b,_c;
2281const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000";this.injectStyles(` 2282 .scroll-progress-bar { 2283 position: fixed; 2284 top: 0; 2285 left: 0; 2286 width: 100%; 2287 height: 0.25rem; 2288 background-color: #ccc; 2289 z-index: 999999999; 2290 padding-top: env(safe-area-inset-top); 2291 } 2292 2293 .scroll-progress-bar_fill { 2294 width: 100%; 2295 height: 100%; 2296 background-color: ${themeColor}; 2297 transition: width 0.01s ease-out; 2298 } 2299 `);const combinedStyles=Array.from(this.styles).join(` 2300`);this.shadowRoot.innerHTML=` 2301 <style>${combinedStyles}</style> 2302 <div class="scroll-progress-bar"> 2303 <div class="scroll-progress-bar_fill"></div> 2304 </div> 2305 `}}}}),darkMode_exports={};__export(darkMode_exports,{initDarkMode:()=>initDarkMode});async function initDarkMode(){customElements.get("pwa-dark-mode")||customElements.define("pwa-dark-mode",PwaDarkMode),PwaDarkMode.show(),setTimeout(()=>{PwaDarkMode.show()},1e3)}var PwaDarkMode,init_darkMode=__esm({"frontend/assets/js/dev/modules/darkMode.js"(){init_frontend(),PwaDarkMode=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.darkMode=localStorage.getItem("darkMode")==="enabled",this.switchType=config.jsVars.settings.uiComponents.darkMode.type,this.icons={light:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>',dark:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg>'},this.darkColorScheme={background:"#1c1c1c",surface:"#2d2d2d",surfaceLighter:"#404040",text:"#ffffff",textSecondary:"#e0e0e0",border:"#404040",link:"#66b3ff",linkVisited:"#b366ff",input:"#2d2d2d"}}connectedCallback(){this.injectGlobalStyles(),this.render(),this.handleModeChange(),this.checkSystemPreference(),this.checkBatteryLevel()}injectStyles(css){this.styles.add(css)}injectGlobalStyles(){const styleSheet=document.createElement("style");styleSheet.textContent=` 2306 /* Dark mode CSS variables */ 2307 :root.dark { 2308 ${Object.entries(this.darkColorScheme).map(([key,value])=>`--dm-${key}: ${value};`).join(` 2309`)} 2310 } 2311 2312 :root.dark * { 2313 background-color: var(--dm-background) !important; 2314 color: var(--dm-text) !important; 2315 } 2316 2317 /* Element specific styles */ 2318 :root.dark img:not([src*=".svg"]), 2319 :root.dark video, 2320 :root.dark iframe { 2321 opacity: 0.8 !important; 2322 -webkit-filter: brightness(0.9) !important; 2323 filter: brightness(0.9) !important; 2324 } 2325 2326 :root.dark img[src*=".svg"] { 2327 -webkit-filter: brightness(0.9) invert(1) !important; 2328 filter: brightness(0.9) invert(1) !important; 2329 } 2330 2331 :root.dark input, 2332 :root.dark textarea, 2333 :root.dark select { 2334 background-color: var(--dm-input) !important; 2335 color: var(--dm-text) !important; 2336 border-color: var(--dm-border) !important; 2337 } 2338 2339 :root.dark a:not([class]) { 2340 color: var(--dm-link) !important; 2341 } 2342 2343 :root.dark a:not([class]):visited { 2344 color: var(--dm-linkVisited) !important; 2345 } 2346 2347 :root.dark [class*="shadow"], 2348 :root.dark [class*="Shadow"] { 2349 -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important; 2350 box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important; 2351 } 2352 2353 :root.dark pre, 2354 :root.dark code { 2355 background-color: var(--dm-surfaceLighter) !important; 2356 } 2357 2358 :root.dark table, 2359 :root.dark th, 2360 :root.dark td { 2361 border-color: var(--dm-border) !important; 2362 } 2363 2364 :root.dark th { 2365 background-color: var(--dm-surface) !important; 2366 } 2367 2368 :root.dark tr:nth-child(even) { 2369 background-color: var(--dm-surfaceLighter) !important; 2370 } 2371 2372 :root.dark blockquote { 2373 background-color: var(--dm-surface) !important; 2374 border-left-color: var(--dm-border) !important; 2375 } 2376 2377 /* Handle common components and frameworks */ 2378 :root.dark header, 2379 :root.dark nav, 2380 :root.dark footer { 2381 background-color: var(--dm-surface) !important; 2382 } 2383 2384 :root.dark [class*="card"], 2385 :root.dark [class*="panel"],
2386 :root.dark [class*="box"] { 2387 background-color: var(--dm-surface) !important; 2388 border-color: var(--dm-border) !important; 2389 } 2390 2391 /* Handle WordPress specific elements */ 2392 :root.dark .wp-block-button__link { 2393 background-color: var(--dm-surface) !important; 2394 color: var(--dm-text) !important; 2395 } 2396 2397 :root.dark .wp-block-quote { 2398 border-color: var(--dm-border) !important; 2399 } 2400 `,document.head.appendChild(styleSheet)}static findMenuElement(element){const menuSelectors=["ul.menu","ul.nav-menu",".wp-block-navigation__container",".main-navigation ul",".primary-menu",".menu-primary"];for(const selector of menuSelectors){const menu=element.querySelector(selector);if(menu&&window.getComputedStyle(menu).display!=="none"&&menu.querySelector("li"))return menu}for(const child of element.children){if(child.tagName.toLowerCase()==="ul"&&window.getComputedStyle(child).display!=="none"&&child.querySelector("li"))return child;const found=this.findMenuElement(child);if(found)return found}return null}static findHeader(){const headerSelectors=[".site-header","#masthead",".main-header","#site-header","#ast-mobile-header","#mobile-menu",".mobile-menu",".mobile-navigation",'[class*="header"]','[id*="header"]',"header","nav"];for(const selector of headerSelectors){const elements=document.querySelectorAll(selector);for(const element of elements)if(window.getComputedStyle(element).display!=="none"){const menuElement=this.findMenuElement(element);if(menuElement)return{container:element,menu:menuElement}}}return null}static show(){let darkModeSwitch=document.querySelector("pwa-dark-mode");const switchType=config.jsVars.settings.uiComponents.darkMode.type;if(!darkModeSwitch)if(darkModeSwitch=document.createElement("pwa-dark-mode"),switchType==="menu-switch"){const headerData=this.findHeader();if(headerData?.menu){const menuItem=document.createElement("li");menuItem.className="menu-item pwa-dark-mode-item";const existingMenuItem=headerData.menu.querySelector("li");if(existingMenuItem){const classesToCopy=Array.from(existingMenuItem.classList).filter(cls=>!cls.includes("current")&&!cls.includes("active"));menuItem.classList.add(...classesToCopy)}menuItem.appendChild(darkModeSwitch),headerData.menu.appendChild(menuItem)}}else document.body.appendChild(darkModeSwitch);return darkModeSwitch}async checkBatteryLevel(){if(config.jsVars.settings.uiComponents.darkMode.batteryLow==="on"&&"getBattery"in navigator)try{const battery=await navigator.getBattery();battery.level<.1&&this.enableDarkMode(),battery.addEventListener("levelchange",()=>{battery.level<.1&&this.enableDarkMode()})}catch(error){console.warn("Battery status check failed:",error)}}checkSystemPreference(){if(config.jsVars.settings.uiComponents.darkMode.osAware==="on"){const metaTag=document.createElement("meta");metaTag.setAttribute("name","color-scheme"),metaTag.setAttribute("content","dark light"),document.head.appendChild(metaTag),window.matchMedia("(prefers-color-scheme: dark)").matches&&this.enableDarkMode(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{e.matches?this.enableDarkMode():this.disableDarkMode()})}}enableDarkMode(){document.documentElement.classList.add("dark"),localStorage.setItem("darkMode","enabled"),this.shadowRoot.querySelector(".dark-mode-floating, .dark-mode-menu").classList.add("-dark"),this.darkMode=!0,this.updateIcon(),this.dispatchEvent(new CustomEvent("darkModeChange",{detail:{enabled:!0},bubbles:!0}))}disableDarkMode(){document.documentElement.classList.remove("dark"),localStorage.setItem("darkMode","disabled"),this.shadowRoot.querySelector(".dark-mode-floating, .dark-mode-menu").classList.remove("-dark"),this.darkMode=!1,this.updateIcon(),this.dispatchEvent(new CustomEvent("darkModeChange",{detail:{enabled:!1},bubbles:!0}))}updateIcon(){const iconElement=this.shadowRoot.querySelector(".dark-mode-floating-icon, .dark-mode-menu-icon");iconElement&&(iconElement.innerHTML=this.darkMode?this.icons.dark:this.icons.light)}handleModeChange(){const button=this.shadowRoot.querySelector(".dark-mode-floating, .dark-mode-menu");button&&button.addEventListener("click",e=>{this.darkMode?this.disableDarkMode():this.enableDarkMode()}),localStorage.getItem("darkMode")==="enabled"&&this.enableDarkMode()}renderMenuSwitch(){return this.injectStyles(` 2401 .dark-mode-menu { 2402 display: -webkit-box; 2403 display: -ms-flexbox; 2404 display: flex; 2405 -webkit-box-align: center; 2406 -ms-flex-align: center; 2407 align-items: center; 2408 position: relative; 2409 border-radius: 9999px; 2410 width: 40px; 2411 height: 22px; 2412 -ms-flex-negative: 0; 2413 flex-shrink: 0; 2414 border: 1px solid #c2c2c4; 2415 background-color: #eff0f3; 2416 outline: none; 2417 cursor: pointer; 2418 } 2419 2420 .dark-mode-menu.-dark { 2421 border: 1px solid #3c3f44; 2422 background-color: #272a2f; 2423 } 2424 2425 .dark-mode-menu-icon { 2426 display: -webkit-box; 2427 display: -ms-flexbox; 2428 display: flex; 2429 -webkit-box-align: center; 2430 -ms-flex-align: center; 2431 align-items: center; 2432 -webkit-box-pack: center; 2433 -ms-flex-pack: center; 2434 justify-content: center; 2435 position: absolute; 2436 left: 1px; 2437 width: 12px; 2438 height: 12px; 2439 padding: 4px; 2440 border-radius: 50%; 2441 color: #48484e; 2442 background-color: #ffffff; 2443 -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06); 2444 box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06); 2445 -webkit-transition: -webkit-transform .25s !important; 2446 transition: -webkit-transform .25s !important; 2447 -o-transition: transform .25s !important; 2448 transition: transform .25s !important; 2449 transition: transform .25s, -webkit-transform .25s !important; 2450 } 2451 2452 .dark-mode-menu.-dark .dark-mode-menu-icon { 2453 background-color: #000000; 2454 color: #ffffff; 2455 -webkit-transform: translate(18px); 2456 -ms-transform: translate(18px); 2457 transform: translate(18px); 2458 } 2459 `),` 2460 <div class="dark-mode-menu ${this.darkMode?"-dark":""}" aria-label="${wp.i18n.__("Toggle dark mode")}">
2461 <span class="dark-mode-menu-icon"> 2462 ${this.darkMode?this.icons.dark:this.icons.light} 2463 </span> 2464 </div> 2465 `}renderFloatingButton(){return this.injectStyles(` 2466 .dark-mode-floating { 2467 position: fixed; 2468 bottom: ${document.querySelector("pwa-navigation-tab-bar")?"70px":"20px"}; 2469 right: 20px; 2470 z-index: 999; 2471 display: -webkit-box; 2472 display: -ms-flexbox; 2473 display: flex; 2474 -webkit-box-align: center; 2475 -ms-flex-align: center; 2476 align-items: center; 2477 -webkit-box-pack: center; 2478 -ms-flex-pack: center; 2479 justify-content: center; 2480 width: 50px; 2481 height: 50px; 2482 background: #eff0f3; 2483 border: none; 2484 border-radius: 50%; 2485 cursor: pointer; 2486 -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 2487 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 2488 } 2489 2490 .dark-mode-floating.-dark { 2491 background: #000000; 2492 } 2493 2494 .dark-mode-floating-icon { 2495 display: -webkit-box; 2496 display: -ms-flexbox; 2497 display: flex; 2498 -webkit-box-align: center; 2499 -ms-flex-align: center; 2500 align-items: center; 2501 -webkit-box-pack: center; 2502 -ms-flex-pack: center; 2503 justify-content: center; 2504 width: 18px; 2505 height: 18px; 2506 color: #48484e; 2507 } 2508 2509 .dark-mode-floating.-dark .dark-mode-floating-icon { 2510 color: #ffffff; 2511 } 2512 `),` 2513 <div class="dark-mode-floating" aria-label="${wp.i18n.__("Toggle dark mode")}"> 2514 <span class="dark-mode-floating-icon"> 2515 ${this.darkMode?this.icons.dark:this.icons.light} 2516 </span> 2517 </div> 2518 `}render(){let switchContent;switch(this.switchType){case"menu-switch":switchContent=this.renderMenuSwitch();break;case"floating-button":switchContent=this.renderFloatingButton();break;default:break}const combinedStyles=Array.from(this.styles).join(` 2519`);this.shadowRoot.innerHTML=` 2520 <style> 2521 ${combinedStyles} 2522 </style> 2523 ${switchContent} 2524 `}}}}),shareButton_exports={};__export(shareButton_exports,{initShareButton:()=>initShareButton});async function initShareButton(){customElements.get("pwa-share-button")||customElements.define("pwa-share-button",PwaShareButton),PwaShareButton.show()}var PwaShareButton,init_shareButton=__esm({"frontend/assets/js/dev/modules/shareButton.js"(){init_frontend(),init_utils(),PwaShareButton=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.position=config.jsVars.settings.uiComponents.shareButton.position}async connectedCallback(){this.render(),this.handleShare()}static show(){let shareButton=document.querySelector("pwa-share-button");return shareButton||(shareButton=document.createElement("pwa-share-button"),document.body.appendChild(shareButton)),shareButton}injectStyles(css){this.styles.add(css)}handleShare(){this.shadowRoot.querySelector(".share-button").addEventListener("click",async()=>{try{await navigator.share({title:document.title,url:document.querySelector("link[rel=canonical]")?document.querySelector("link[rel=canonical]").href:document.location.href})}catch(error){console.error(error)}})}render(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",iconColor=getContrastTextColor(themeColor),positionStyles={"bottom-right":document.querySelector("pwa-navigation-tab-bar")?"bottom: 70px; right: 20px;":"bottom: 20px; right: 20px;","bottom-left":document.querySelector("pwa-navigation-tab-bar")?"bottom: 70px; left: 20px;":"bottom: 20px; left: 20px;","top-right":"top: 20px; right: 20px;","top-left":"top: 20px; left: 20px;"}[this.position];this.injectStyles(` 2525 .share-button { 2526 position: fixed; 2527 ${positionStyles} 2528 z-index: 999; 2529 display: -webkit-box; 2530 display: -ms-flexbox; 2531 display: flex; 2532 -webkit-box-align: center; 2533 -ms-flex-align: center; 2534 align-items: center; 2535 -webkit-box-pack: center; 2536 -ms-flex-pack: center; 2537 justify-content: center; 2538 width: 50px; 2539 height: 50px;
2540 background: ${themeColor}; 2541 border: none; 2542 border-radius: 50%; 2543 cursor: pointer; 2544 -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 2545 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 2546 } 2547 2548 .share-button:hover { 2549 opacity: 0.8; 2550 } 2551 2552 .share-button_icon { 2553 display: -webkit-box; 2554 display: -ms-flexbox; 2555 display: flex; 2556 -webkit-box-align: center; 2557 -ms-flex-align: center; 2558 align-items: center; 2559 -webkit-box-pack: center; 2560 -ms-flex-pack: center; 2561 justify-content: center; 2562 width: 1.25rem; 2563 height: 1.25rem; 2564 color: ${iconColor}; 2565 } 2566 `);const combinedStyles=Array.from(this.styles).join(` 2567`);this.shadowRoot.innerHTML=` 2568 <style>${combinedStyles}</style> 2569 <div class="share-button" aria-label="${wp.i18n.__("Share")}"> 2570 <span class="share-button_icon"> 2571 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v13"/><path d="m16 6-4-4-4 4"/><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/></svg> 2572 </span> 2573 </div> 2574 `}}}}),swup_exports={};__export(swup_exports,{initSwup:()=>initSwup,initSwupFadeTheme:()=>initSwupFadeTheme,initSwupHeadPlugin:()=>initSwupHeadPlugin,initSwupProgressBarPlugin:()=>initSwupProgressBarPlugin,initSwupScriptsPlugin:()=>initSwupScriptsPlugin,initSwupSlideTheme:()=>initSwupSlideTheme});function initSwup(){(function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t||self).Swup=e()})(this,function(){const t=new WeakMap;function e(e2,n2,o2,i2){var _a,_b;if(!e2&&!t.has(n2))return!1;const r2=(_a=t.get(n2))!=null?_a:new WeakMap;t.set(n2,r2);const s2=(_b=r2.get(o2))!=null?_b:new Set;r2.set(o2,s2);const a2=s2.has(i2);return e2?s2.add(i2):s2.delete(i2),a2&&e2}const n=(t2,e2)=>String(t2).toLowerCase().replace(/[\s/_.]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")||e2||"",o=function(t2){let{hash:e2}=t2===void 0?{}:t2;return window.location.pathname+window.location.search+(e2?window.location.hash:"")},i=function(t2,e2){t2===void 0&&(t2=null),e2===void 0&&(e2={}),t2=t2||o({hash:!0});const n2={...window.history.state||{},url:t2,random:Math.random(),source:"swup",...e2};window.history.replaceState(n2,"",t2)},r=(t2,n2,o2,i2)=>{const r2=new AbortController;return function(t3,n3,o3,i3={}){const{signal:r3,base:s2=document}=i3;if(r3?.aborted)return;const{once:a2,...c2}=i3,l2=s2 instanceof Document?s2.documentElement:s2,h2=!!(typeof i3=="object"?i3.capture:i3),u2=i4=>{const r4=function(t4,e2){let n4=t4.target;if(n4 instanceof Text&&(n4=n4.parentElement),n4 instanceof Element&&t4.currentTarget instanceof Element){const o4=n4.closest(e2);if(o4&&t4.currentTarget.contains(o4))return o4}}(i4,String(t3));if(r4){const t4=Object.assign(i4,{delegateTarget:r4});o3.call(l2,t4),a2&&(l2.removeEventListener(n3,u2,c2),e(!1,l2,o3,d2))}},d2=JSON.stringify({selector:t3,type:n3,capture:h2});e(!0,l2,o3,d2)||l2.addEventListener(n3,u2,c2),r3?.addEventListener("abort",()=>{e(!1,l2,o3,d2)})}(t2,n2,o2,i2={...i2,signal:r2.signal}),{destroy:()=>r2.abort()}};class s extends URL{constructor(t2,e2){e2===void 0&&(e2=document.baseURI),super(t2.toString(),e2),Object.setPrototypeOf(this,s.prototype)}get url(){return this.pathname+this.search}static fromElement(t2){const e2=t2.getAttribute("href")||t2.getAttribute("xlink:href")||"";return new s(e2)}static fromUrl(t2){return new s(t2)}}const a=function(t2,e2){var _a;e2===void 0&&(e2={});try{let n2=function(n3){const{status:r3,url:a3}=u2;return Promise.resolve(u2.text()).then(function(n4){if(r3===500)throw o2.hooks.call("fetch:error",i2,{status:r3,response:u2,url:a3}),new c(`Server error: ${a3}`,{status:r3,url:a3});if(!n4)throw new c(`Empty response: ${a3}`,{status:r3,url:a3});const{url:l3}=s.fromUrl(a3),h3={url:l3,html:n4};return!i2.cache.write||e2.method&&e2.method!=="GET"||t2!==l3||o2.cache.set(h3.url,h3),h3})};const o2=this;t2=s.fromUrl(t2).url;const{visit:i2=o2.visit}=e2,r2={...o2.options.requestHeaders,...e2.headers},a2=(_a=e2.timeout)!=null?_a:o2.options.timeout,l2=new AbortController,{signal:h2}=l2;e2={...e2,headers:r2,signal:h2};let u2,d2=!1,f2=null;a2&&a2>0&&(f2=setTimeout(()=>{d2=!0,l2.abort("timeout")},a2));const m2=function(n3,r3){try{var s2=Promise.resolve(o2.hooks.call("fetch:request",i2,{url:t2,options:e2},(t3,e3)=>{let{url:n4,options:o3}=e3;return fetch(n4,o3)})).then(function(t3){u2=t3,f2&&clearTimeout(f2)})}catch(t3){return r3(t3)}return s2&&s2.then?s2.then(void 0,r3):s2}(0,function(e3){throw d2?(o2.hooks.call("fetch:timeout",i2,{url:t2}),new c(`Request timed out: ${t2}`,{url:t2,timedOut:d2})):e3?.name==="AbortError"||h2.aborted?new c(`Request aborted: ${t2}`,{url:t2,aborted:!0}):e3});
vendor: 4,803 bytes, line 2574
2574return Promise.resolve(m2&&m2.then?m2.then(n2):n2())}catch(p2){return Promise.reject(p2)}};class c extends Error{constructor(t2,e2){super(t2),this.url=void 0,this.status=void 0,this.aborted=void 0,this.timedOut=void 0,this.name="FetchError",this.url=e2.url,this.status=e2.status,this.aborted=e2.aborted||!1,this.timedOut=e2.timedOut||!1}}class l{constructor(t2){this.swup=void 0,this.pages=new Map,this.swup=t2}get size(){return this.pages.size}get all(){const t2=new Map;return this.pages.forEach((e2,n2)=>{t2.set(n2,{...e2})}),t2}has(t2){return this.pages.has(this.resolve(t2))}get(t2){const e2=this.pages.get(this.resolve(t2));return e2&&{...e2}}set(t2,e2){t2=this.resolve(t2),e2={...e2,url:t2},this.pages.set(t2,e2),this.swup.hooks.callSync("cache:set",void 0,{page:e2})}update(t2,e2){t2=this.resolve(t2);const n2={...this.get(t2),...e2,url:t2};this.pages.set(t2,n2)}delete(t2){this.pages.delete(this.resolve(t2))}clear(){this.pages.clear(),this.swup.hooks.callSync("cache:clear",void 0,void 0)}prune(t2){this.pages.forEach((e2,n2)=>{t2(n2,e2)&&this.delete(n2)})}resolve(t2){const{url:e2}=s.fromUrl(t2);return this.swup.resolveUrl(e2)}}const h=function(t2,e2){return e2===void 0&&(e2=document),e2.querySelector(t2)},u=function(t2,e2){return e2===void 0&&(e2=document),Array.from(e2.querySelectorAll(t2))},d=()=>new Promise(t2=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t2()})})});function f(t2){return!!t2&&(typeof t2=="object"||typeof t2=="function")&&typeof t2.then=="function"}function m(t2,e2){const n2=t2?.closest(`[${e2}]`);return n2?.hasAttribute(e2)?n2?.getAttribute(e2)||!0:void 0}class p{constructor(t2){this.swup=void 0,this.swupClasses=["to-","is-changing","is-rendering","is-popstate","is-animating","is-leaving"],this.swup=t2}get selectors(){const{scope:t2}=this.swup.visit.animation;return t2==="containers"?this.swup.visit.containers:t2==="html"?["html"]:Array.isArray(t2)?t2:[]}get selector(){return this.selectors.join(",")}get targets(){return this.selector.trim()?u(this.selector):[]}add(){this.targets.forEach(t2=>t2.classList.add(...[].slice.call(arguments)))}remove(){this.targets.forEach(t2=>t2.classList.remove(...[].slice.call(arguments)))}clear(){this.targets.forEach(t2=>{const e2=t2.className.split(" ").filter(t3=>this.isSwupClass(t3));t2.classList.remove(...e2)})}isSwupClass(t2){return this.swupClasses.some(e2=>t2.startsWith(e2))}}class v{constructor(t2,e2){this.id=void 0,this.state=void 0,this.from=void 0,this.to=void 0,this.containers=void 0,this.animation=void 0,this.trigger=void 0,this.cache=void 0,this.history=void 0,this.scroll=void 0,this.meta=void 0;const{to:n2,from:o2,hash:i2,el:r2,event:s2}=e2;this.id=Math.random(),this.state=1,this.from={url:o2??t2.location.url,hash:t2.location.hash},this.to={url:n2,hash:i2},this.containers=t2.options.containers,this.animation={animate:!0,wait:!1,name:void 0,native:t2.options.native,scope:t2.options.animationScope,selector:t2.options.animationSelector},this.trigger={el:r2,event:s2},this.cache={read:t2.options.cache,write:t2.options.cache},this.history={action:"push",popstate:!1,direction:void 0},this.scroll={reset:!0,target:void 0},this.meta={}}advance(t2){this.state<t2&&(this.state=t2)}abort(){this.state=8}get done(){return this.state>=7}}function g(t2){return new v(this,t2)}const w=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function y(t2,e2,n2){if(!t2.s){if(n2 instanceof k){if(!n2.s)return void(n2.o=y.bind(null,t2,e2));1&e2&&(e2=n2.s),n2=n2.v}if(n2&&n2.then)return void n2.then(y.bind(null,t2,e2),y.bind(null,t2,2));t2.s=e2,t2.v=n2;const o2=t2.o;o2&&o2(t2)}}const k=function(){function t2(){}return t2.prototype.then=function(e2,n2){const o2=new t2,i2=this.s;if(i2){const t3=1&i2?e2:n2;if(t3){try{y(o2,1,t3(this.v))}catch(t4){y(o2,2,t4)}return o2}return this}return this.o=function(t3){try{const i3=t3.v;1&t3.s?y(o2,1,e2?e2(i3):i3):n2?y(o2,1,n2(i3)):y(o2,2,i3)}catch(t4){y(o2,2,t4)}},o2},t2}();function P(t2){return t2 instanceof k&&1&t2.s}class b{constructor(t2){this.swup=void 0,this.registry=new Map,this.hooks=["animation:out:start","animation:out:await","animation:out:end","animation:in:start","animation:in:await","animation:in:end","animation:skip","cache:clear","cache:set","content:replace","content:scroll","enable","disable","fetch:request","fetch:error","fetch:timeout","history:popstate","link:click","link:self","link:anchor","link:newtab","page:load","page:view","scroll:top","scroll:anchor","visit:start","visit:transition","visit:abort","visit:end"],this.swup=t2,this.init()}init(){this.hooks.forEach(t2=>this.create(t2))}create(t2){this.registry.has(t2)||this.registry.set(t2,new Map)}exists(t2){return this.registry.has(t2)}get(t2){const e2=this.registry.get(t2);if(e2)return e2;console.error(`Unknown hook '${t2}'`)}
2574clear(){this.registry.forEach(t2=>t2.clear())}on(t2,e2,n2){n2===void 0&&(n2={});const o2=this.get(t2);if(!o2)return console.warn(`Hook '${t2}' not found.`),()=>{};const i2=o2.size+1,r2={...n2,id:i2,hook:t2,handler:e2};return o2.set(e2,r2),()=>this.off(t2,e2)}before(t2,e2,n2){return n2===void 0&&(n2={}),this.on(t2,e2,{...n2,before:!0})}replace(t2,e2,n2){return n2===void 0&&(n2={}),this.on(t2,e2,{...n2,replace:!0})}once(t2,e2,n2){return n2===void 0&&(n2={}),this.on(t2,e2,{...n2,once:!0})}off(t2,e2){const n2=this.get(t2);n2&&e2?n2.delete(e2)||console.warn(`Handler for hook '${t2}' not found.`):n2&&n2.clear()}call(t2,e2,n2,o2){try{const i2=this,[r2,s2,a2]=i2.parseCallArgs(t2,e2,n2,o2),{before:c2,handler:l2,after:h2}=i2.getHandlers(t2,a2);return Promise.resolve(i2.run(c2,r2,s2)).then(function(){return Promise.resolve(i2.run(l2,r2,s2,!0)).then(function(e3){let[n3]=e3;return Promise.resolve(i2.run(h2,r2,s2)).then(function(){return i2.dispatchDomEvent(t2,r2,s2),n3})})})}catch(t3){return Promise.reject(t3)}}callSync(t2,e2,n2,o2){const[i2,r2,s2]=this.parseCallArgs(t2,e2,n2,o2),{before:a2,handler:c2,after:l2}=this.getHandlers(t2,s2);this.runSync(a2,i2,r2);const[h2]=this.runSync(c2,i2,r2,!0);return this.runSync(l2,i2,r2),this.dispatchDomEvent(t2,i2,r2),h2}parseCallArgs(t2,e2,n2,o2){return e2 instanceof v||typeof e2!="object"&&typeof n2!="function"?[e2,n2,o2]:[void 0,e2,n2]}run(t2,e2,n2,o2){o2===void 0&&(o2=!1);try{let i2;const r2=this;e2===void 0&&(e2=r2.swup.visit);const s2=[],a2=function(t3,e3,n3){if(typeof t3[w]=="function"){var o3,i3,r3,s3=t3[w]();if(function t4(a4){try{for(;!((o3=s3.next()).done||n3&&n3());)if((a4=e3(o3.value))&&a4.then){if(!P(a4))return void a4.then(t4,r3||(r3=y.bind(null,i3=new k,2)));a4=a4.v}i3?y(i3,1,a4):i3=a4}catch(t5){y(i3||(i3=new k),2,t5)}}(),s3.return){var a3=function(t4){try{o3.done||s3.return()}catch{}return t4};if(i3&&i3.then)return i3.then(a3,function(t4){throw a3(t4)});a3()}return i3}if(!("length"in t3))throw new TypeError("Object is not iterable");for(var c2=[],l2=0;l2<t3.length;l2++)c2.push(t3[l2]);return function(t4,e4,n4){var o4,i4,r4=-1;return function s4(a4){try{for(;++r4<t4.length&&(!n4||!n4());)if((a4=e4(r4))&&a4.then){if(!P(a4))return void a4.then(s4,i4||(i4=y.bind(null,o4=new k,2)));a4=a4.v}o4?y(o4,1,a4):o4=a4}catch(t5){y(o4||(o4=new k),2,t5)}}(),o4}(c2,function(t4){return e3(c2[t4])},n3)}(t2,function(t3){let{hook:i3,handler:a3,defaultHandler:c2,once:l2}=t3;if(!e2?.done)return l2&&r2.off(i3,a3),function(t4,o3){try{var i4=Promise.resolve(function(t5,e3){return e3===void 0&&(e3=[]),new Promise((n3,o4)=>{const i5=t5(...e3);f(i5)?i5.then(n3,o4):n3(i5)})}(a3,[e2,n2,c2])).then(function(t5){s2.push(t5)})}catch(t5){return o3(t5)}return i4&&i4.then?i4.then(void 0,o3):i4}(0,function(t4){if(o2)throw t4;console.error(`Error in hook '${i3}':`,t4)})},function(){return i2});return Promise.resolve(a2&&a2.then?a2.then(function(t3){return i2?t3:s2}):i2?a2:s2)}catch(t3){return Promise.reject(t3)}}runSync(t2,e2,n2,o2){e2===void 0&&(e2=this.swup.visit),o2===void 0&&(o2=!1);const i2=[];for(const{hook:r2,handler:s2,defaultHandler:a2,once:c2}of t2)if(!e2?.done){c2&&this.off(r2,s2);try{const t3=s2(e2,n2,a2);i2.push(t3),f(t3)&&console.warn(`Swup will not await Promises in handler for synchronous hook '${r2}'.`)}catch(t3){if(o2)throw t3;console.error(`Error in hook '${r2}':`,t3)}}return i2}getHandlers(t2,e2){const n2=this.get(t2);if(!n2)return{found:!1,before:[],handler:[],after:[],replaced:!1};const o2=Array.from(n2.values()),i2=this.sortRegistrations,r2=o2.filter(t3=>{let{before:e3,replace:n3}=t3;return e3&&!n3}).sort(i2),s2=o2.filter(t3=>{let{replace:e3}=t3;return e3}).filter(t3=>!0).sort(i2),a2=o2.filter(t3=>{let{before:e3,replace:n3}=t3;return!e3&&!n3}).sort(i2),c2=s2.length>0;let l2=[];if(e2&&(l2=[{id:0,hook:t2,handler:e2}],c2)){const n3=s2.length-1,{handler:o3,once:i3}=s2[n3],r3=t3=>{const n4=s2[t3-1];return n4?(e3,o4)=>n4.handler(e3,o4,r3(t3-1)):e2};l2=[{id:0,hook:t2,once:i3,handler:o3,defaultHandler:r3(n3)}]}return{found:!0,before:r2,handler:l2,after:a2,replaced:c2}}sortRegistrations(t2,e2){var _a,_b2;return((_a=t2.priority)!=null?_a:0)-((_b2=e2.priority)!=null?_b2:0)||t2.id-e2.id||0}dispatchDomEvent(t2,e2,n2){if(e2?.done)return;const o2={hook:t2,args:n2,visit:e2||this.swup.visit};document.dispatchEvent(new CustomEvent("swup:any",{detail:o2,bubbles:!0})),document.dispatchEvent(new CustomEvent(`swup:${t2}`,{detail:o2,bubbles:!0}))}parseName(t2){const[e2,...n2]=t2.split(".");return[e2,n2.reduce((t3,e3)=>({...t3,[e3]:!0}),{})]}}const S=t2=>{if(t2&&t2.charAt(0)==="#"&&(t2=t2.substring(1)),!t2)return null;const e2=decodeURIComponent(t2);let n2=document.getElementById(t2)||document.getElementById(e2)||h(`a[name='${CSS.escape(t2)}']`)||h(`a[name='${CSS.escape(e2)}']`);return n2||t2!=="top"||(n2=document.body),n2},E=function(t2){let{selector:e2,elements:n2}=t2;try{if(e2===!1&&!n2)return Promise.resolve();let t3=[];if(n2)t3=Array.from(n2);else if(e2&&(t3=u(e2,document.body),!t3.length))return console.warn(`[swup] No elements found matching animationSelector \`${e2}\``),Promise.resolve();const o2=t3.map(t4=>function(t5){const{type:e3,timeout:n3,propCount:o3}=function(t6){const e4=window.getComputedStyle(t6),n4=x(e4,`${C}Delay`),o4=x(e4,`${C}Duration`),i2=$(n4,o4),r2=x(e4,`${U}Delay`),s2=x(e4,`${U}Duration`),a2=$(r2,s2),c2=Math.max(i2,a2),l2=c2>0?i2>a2?C:U:null;return{type:l2,timeout:c2,propCount:l2?l2===C?o4.length:s2.length:0}}(t5);return!(!e3||!n3)&&new Promise(i2=>{const r2=`${e3}end`,s2=performance.now();let a2=0;const c2=()=>{t5.removeEventListener(r2,l2),i2()},l2=e4=>{e4.target===t5&&((performance.now()-s2)/1e3<e4.elapsedTime||++a2>=o3&&c2())};setTimeout(()=>{a2<o3&&c2()},n3+1),t5.addEventListener(r2,l2)})}(t4));return o2.filter(Boolean).length>0?Promise.resolve(Promise.all(o2)).then(function(){}):(e2&&console.warn(`[swup] No CSS animation duration defined on elements matching \`${e2}\``),Promise.resolve())}catch(t3){return Promise.reject(t3)}},C="transition",U="animation";function x(t2,e2){return(t2[e2]||"").split(", ")}function $(t2,e2){for(;t2.length<e2.length;)t2=t2.concat(t2);return Math.max(...e2.map((e3,n2)=>A(e3)+A(t2[n2])))}function A(t2){return 1e3*parseFloat(t2)}const H=function(t2,e2){e2===void 0&&(e2={});try{let r2=function(r3){var _a,_b;if(a2)return r3;c2.navigating=!0,c2.visit=t2;const{el:l3}=t2.trigger;e2.referrer=e2.referrer||c2.location.url,e2.animate===!1&&(t2.animation.animate=!1),t2.animation.animate||c2.classes.clear();const h2=e2.history||m(l3,"data-swup-history");typeof h2=="string"&&["push","replace"].includes(h2)&&(t2.history.action=h2);const u2=e2.animation||m(l3,"data-swup-animation");return typeof u2=="string"&&(t2.animation.name=u2),t2.meta=e2.meta||{},typeof e2.cache=="object"?(t2.cache.read=(_a=e2.cache.read)!=null?_a:t2.cac
2574he.read,t2.cache.write=(_b=e2.cache.write)!=null?_b:t2.cache.write):e2.cache!==void 0&&(t2.cache={read:!!e2.cache,write:!!e2.cache}),delete e2.cache,function(r4,a3){try{var l4=function(r5,a4){try{var l5=Promise.resolve(c2.hooks.call("visit:start",t2,void 0)).then(function(){function r6(){if(!t2.done)return Promise.resolve(c2.hooks.call("visit:transition",t2,void 0,function(){try{let e3=function(e4){return n2?e4:(t2.advance(4),Promise.resolve(c2.animatePageOut(t2)).then(function(){function e5(){return Promise.resolve(c2.animatePageIn(t2)).then(function(){})}const n3=function(){if(t2.animation.native&&document.startViewTransition)return Promise.resolve(document.startViewTransition(function(){try{const e6=c2.renderPage;return Promise.resolve(a5).then(function(n4){return Promise.resolve(e6.call(c2,t2,n4))})}catch(t3){return Promise.reject(t3)}}).finished).then(function(){});{const e6=c2.renderPage;return Promise.resolve(a5).then(function(n4){return Promise.resolve(e6.call(c2,t2,n4)).then(function(){})})}}();return n3&&n3.then?n3.then(e5):e5()}))},n2;const o2=function(){if(!t2.animation.animate)return Promise.resolve(c2.hooks.call("animation:skip",void 0)).then(function(){const e4=c2.renderPage;return Promise.resolve(a5).then(function(o3){return Promise.resolve(e4.call(c2,t2,o3)).then(function(){n2=1})})})}();return Promise.resolve(o2&&o2.then?o2.then(e3):e3(o2))}catch(i2){return Promise.reject(i2)}})).then(function(){if(!t2.done)return Promise.resolve(c2.hooks.call("visit:end",t2,void 0,()=>c2.classes.clear())).then(function(){t2.state=7,c2.navigating=!1,c2.onVisitEnd&&(c2.onVisitEnd(),c2.onVisitEnd=void 0)})})}t2.state=3;const a5=c2.hooks.call("page:load",t2,{options:e2},function(t3,e3){try{let n2=function(t4){return e3.page=t4,e3.cache=!!o2,e3.page},o2;return t3.cache.read&&(o2=c2.cache.get(t3.to.url)),Promise.resolve(o2?n2(o2):Promise.resolve(c2.fetchPage(t3.to.url,e3.options)).then(n2))}catch(i2){return Promise.reject(i2)}});a5.then(e3=>{let{html:n2}=e3;t2.advance(5),t2.to.html=n2,t2.to.document=new DOMParser().parseFromString(n2,"text/html")});const l6=t2.to.url+t2.to.hash;t2.history.popstate||(t2.history.action==="replace"||t2.to.url===c2.location.url?i(l6):(c2.currentHistoryIndex++,function(t3,e3){e3===void 0&&(e3={});const n2={url:t3=t3||o({hash:!0}),random:Math.random(),source:"swup",...e3};window.history.pushState(n2,"",t3)}(l6,{index:c2.currentHistoryIndex}))),c2.location=s.fromUrl(l6),t2.history.popstate&&c2.classes.add("is-popstate"),t2.animation.name&&c2.classes.add(`to-${n(t2.animation.name)}`);const h3=function(){if(t2.animation.wait)return Promise.resolve(a5).then(function(){})}();return h3&&h3.then?h3.then(r6):r6()})}catch(t3){return a4(t3)}return l5&&l5.then?l5.then(void 0,a4):l5}(0,function(e3){e3&&!e3?.aborted?(t2.state=9,console.error(e3),c2.options.skipPopStateHandling=()=>(window.location.assign(t2.to.url+t2.to.hash),!0),window.history.back()):t2.state=8})}catch(t3){return a3(!0,t3)}return l4&&l4.then?l4.then(a3.bind(null,!1),a3.bind(null,!0)):a3(!1,l4)}(0,function(e3,n2){if(delete t2.to.document,e3)throw n2;return n2})},a2;const c2=this,l2=function(){if(c2.navigating)return function(){if(!(c2.visit.state>=6))return Promise.resolve(c2.hooks.call("visit:abort",c2.visit,void 0)).then(function(){delete c2.visit.to.document,c2.visit.state=8});t2.state=2,c2.onVisitEnd=()=>c2.performNavigation(t2,e2),a2=1}()}();return Promise.resolve(l2&&l2.then?l2.then(r2):r2(l2))}catch(h2){return Promise.reject(h2)}};function T(t2,e2,n2){if(e2===void 0&&(e2={}),n2===void 0&&(n2={}),typeof t2!="string")throw new Error("swup.navigate() requires a URL parameter");if(this.shouldIgnoreVisit(t2,{el:n2.el,event:n2.event}))return void window.location.assign(t2);const{url:o2,hash:i2}=s.fromUrl(t2),r2=this.createVisit({...n2,to:o2,hash:i2});this.performNavigation(r2,e2)}const j=function(t2){try{const e2=this;return Promise.resolve(e2.hooks.call("animation:out:start",t2,void 0,()=>{e2.classes.add("is-changing","is-animating","is-leaving")})).then(function(){return Promise.resolve(e2.hooks.call("animation:out:await",t2,{skip:!1},(t3,n2)=>{let{skip:o2}=n2;if(!o2)return e2.awaitAnimations({selector:t3.animation.selector})})).then(function(){return Promise.resolve(e2.hooks.call("animation:out:end",t2,void 0)).then(function(){})})})}catch(t3){return Promise.reject(t3)}},L=function(t2){var _a;const e2=t2.to.document;if(!e2)return!1;const n2=((_a=e2.querySelector("title"))==null?void 0:_a.innerText)||"";document.title=n2;const o2=u('[data-swup-persist]:not([data-swup-persist=""])'),i2=t2.containers.map(t3=>{const n3=document.querySelector(t3),o3=e2.querySelector(t3);return n3&&o3?(n3.replaceWith(o3.cloneNode(!0)),!0):(n3||console.warn(`[swup] Container missing in current document: ${t3}`),o3||console.warn(`[swup] Container missing in incoming document: ${t3}`),!1)}
2574).filter(Boolean);return o2.forEach(t3=>{const e3=t3.getAttribute("data-swup-persist"),n3=h(`[data-swup-persist="${e3}"]`);n3&&n3!==t3&&n3.replaceWith(t3)}),i2.length===t2.containers.length},V=function(t2){const e2={behavior:"auto"},{target:n2,reset:o2}=t2.scroll,i2=n2??t2.to.hash;let r2=!1;return i2&&(r2=this.hooks.callSync("scroll:anchor",t2,{hash:i2,options:e2},(t3,e3)=>{let{hash:n3,options:o3}=e3;const i3=this.getAnchorElement(n3);return i3&&i3.scrollIntoView(o3),!!i3})),o2&&!r2&&(r2=this.hooks.callSync("scroll:top",t2,{options:e2},(t3,e3)=>{let{options:n3}=e3;return window.scrollTo({top:0,left:0,...n3}),!0})),r2},I=function(t2){try{const e2=this;if(t2.done)return Promise.resolve();const n2=e2.hooks.call("animation:in:await",t2,{skip:!1},(t3,n3)=>{let{skip:o2}=n3;if(!o2)return e2.awaitAnimations({selector:t3.animation.selector})});return Promise.resolve(d()).then(function(){return Promise.resolve(e2.hooks.call("animation:in:start",t2,void 0,()=>{e2.classes.remove("is-animating")})).then(function(){return Promise.resolve(n2).then(function(){return Promise.resolve(e2.hooks.call("animation:in:end",t2,void 0)).then(function(){})})})})}catch(t3){return Promise.reject(t3)}},q=function(t2,e2){try{const r2=this;if(t2.done)return Promise.resolve();t2.advance(6);const{url:a2}=e2;return r2.isSameResolvedUrl(o(),a2)||(i(a2),r2.location=s.fromUrl(a2),t2.to.url=r2.location.url,t2.to.hash=r2.location.hash),Promise.resolve(r2.hooks.call("content:replace",t2,{page:e2},(t3,e3)=>{if(r2.classes.remove("is-leaving"),t3.animation.animate&&r2.classes.add("is-rendering"),!r2.replaceContent(t3))throw new Error("[swup] Container mismatch, aborting");t3.animation.animate&&(r2.classes.add("is-changing","is-animating","is-rendering"),t3.animation.name&&r2.classes.add(`to-${n(t3.animation.name)}`))})).then(function(){return Promise.resolve(r2.hooks.call("content:scroll",t2,void 0,()=>r2.scrollToContent(t2))).then(function(){return Promise.resolve(r2.hooks.call("page:view",t2,{url:r2.location.url,title:document.title})).then(function(){})})})}catch(t3){return Promise.reject(t3)}},N=function(t2){var e2;if(e2=t2,!!e2?.isSwupPlugin){if(t2.swup=this,!t2._checkRequirements||t2._checkRequirements())return t2._beforeMount&&t2._beforeMount(),t2.mount(),this.plugins.push(t2),this.plugins}else console.error("Not a swup plugin instance",t2)};function R(t2){const e2=this.findPlugin(t2);if(e2)return e2.unmount(),e2._afterUnmount&&e2._afterUnmount(),this.plugins=this.plugins.filter(t3=>t3!==e2),this.plugins;console.error("No such plugin",e2)}function O(t2){return this.plugins.find(e2=>e2===t2||e2.name===t2||e2.name===`Swup${String(t2)}`)}function D(t2){if(typeof this.options.resolveUrl!="function")return console.warn("[swup] options.resolveUrl expects a callback function."),t2;const e2=this.options.resolveUrl(t2);return e2&&typeof e2=="string"?e2.startsWith("//")||e2.startsWith("http")?(console.warn("[swup] options.resolveUrl needs to return a relative url"),t2):e2:(console.warn("[swup] options.resolveUrl needs to return a url"),t2)}function M(t2,e2){return this.resolveUrl(t2)===this.resolveUrl(e2)}const W={animateHistoryBrowsing:!1,animationSelector:'[class*="transition-"]',animationScope:"html",cache:!0,containers:["#swup"],hooks:{},ignoreVisit:function(t2,e2){let{el:n2}=e2===void 0?{}:e2;return!!n2?.closest("[data-no-swup]")},linkSelector:"a[href]",linkToSelf:"scroll",native:!1,plugins:[],resolveUrl:t2=>t2,requestHeaders:{"X-Requested-With":"swup",Accept:"text/html, application/xhtml+xml"},skipPopStateHandling:t2=>{var _a;return((_a=t2.state)==null?void 0:_a.source)!=="swup"},timeout:0};return class{get currentPageUrl(){return this.location.url}constructor(t2){var _a,_b;t2===void 0&&(t2={}),this.version="4.8.1",this.options=void 0,this.defaults=W,this.plugins=[],this.visit=void 0,this.cache=void 0,this.hooks=void 0,this.classes=void 0,this.location=s.fromUrl(window.location.href),this.currentHistoryIndex=void 0,this.clickDelegate=void 0,this.navigating=!1,this.onVisitEnd=void 0,this.use=N,this.unuse=R,this.findPlugin=O,this.log=()=>{},this.navigate=T,this.performNavigation=H,this.createVisit=g,this.delegateEvent=r,this.fetchPage=a,this.awaitAnimations=E,this.renderPage=q,this.replaceContent=L,this.animatePageIn=I,this.animatePageOut=j,this.scrollToContent=V,this.getAnchorElement=S,this.getCurrentUrl=o,this.resolveUrl=D,this.isSameResolvedUrl=M,this.options={...this.defaults,...t2},this.handleLinkClick=this.handleLinkClick.bind(this),this.handlePopState=this.handlePopState.bind(this),this.cache=new l(this),this.classes=new p(this),this.hooks=new b(this),this.visit=this.createVisit({to:""}),this.currentHistoryIndex=(_b=(_a=window.history.state)==null?void 0:_a.index)!=null?_b:1,this.enable()}enable(){var _a;try{const t2=this,{linkSelector:e2}=t2.options;t2.clickDelegate=t2.delegateEvent(e2,"click",t2.handleLinkClick),window.addEventListener("popstate",t2.handlePopState),t2.options.animateHistoryBrowsing&&(window.history.scrollRestoration="manual"),t2.options.native=t2.options.native&&!!document.startViewTransition,t2.options.plugins.forEach(e3=>t2.use(e3));for(const[e3,n2]of Object.entries(t2.options.hooks)){const[o2,i2]=t2.hooks.parseName(e3);t2.hooks.on(o2,n2,i2)}return((_a=window.history.state)==null?void 0:_a.source)!=="swup"&&i(null,{index:t2.currentHistoryIndex}),Promise.resolve(d()).then(function(){return Promise.resolve(t2.hooks.call("enable",void 0,void 0,()=>{const e3=document.documentElement;e3.classList.add("swup-enabled"),e3.classList.toggle("swup-native",t2.options.native)})).then(function(){})})}catch(t2){return Promise.reject(t2)}}destroy(){try{const t2=this;return t2.clickDelegate.destroy(),window.removeEventListener("popstate",t2.handlePopState),t2.cache.clear(),t2.options.plugins.forEach(e2=>t2.unuse(e2)),Promise.resolve(t2.hooks.call("disable",void 0,void 0,()=>{const t3=document.documentElement;t3.classList.remove("swup-enabled"),t3.classList.remove("swup-native")}
2574)).then(function(){t2.hooks.clear()})}catch(t2){return Promise.reject(t2)}}shouldIgnoreVisit(t2,e2){let{el:n2,event:o2}=e2===void 0?{}:e2;const{origin:i2,url:r2,hash:a2}=s.fromUrl(t2);return i2!==window.location.origin||!(!n2||!this.triggerWillOpenNewWindow(n2))||!!this.options.ignoreVisit(r2+a2,{el:n2,event:o2})}handleLinkClick(t2){const e2=t2.delegateTarget,{href:n2,url:o2,hash:r2}=s.fromElement(e2);if(this.shouldIgnoreVisit(n2,{el:e2,event:t2}))return;if(this.navigating&&o2===this.visit.to.url)return void t2.preventDefault();const a2=this.createVisit({to:o2,hash:r2,el:e2,event:t2});t2.metaKey||t2.ctrlKey||t2.shiftKey||t2.altKey?this.hooks.callSync("link:newtab",a2,{href:n2}):t2.button===0&&this.hooks.callSync("link:click",a2,{el:e2,event:t2},()=>{var _a;const e3=(_a=a2.from.url)!=null?_a:"";t2.preventDefault(),o2&&o2!==e3?this.isSameResolvedUrl(o2,e3)||this.performNavigation(a2):r2?this.hooks.callSync("link:anchor",a2,{hash:r2},()=>{i(o2+r2),this.scrollToContent(a2)}):this.hooks.callSync("link:self",a2,void 0,()=>{this.options.linkToSelf==="navigate"?this.performNavigation(a2):(i(o2),this.scrollToContent(a2))})})}handlePopState(t2){var _a,_b,_c,_d;const e2=(_b=(_a=t2.state)==null?void 0:_a.url)!=null?_b:window.location.href;if(this.options.skipPopStateHandling(t2)||this.isSameResolvedUrl(o(),this.location.url))return;const{url:n2,hash:i2}=s.fromUrl(e2),r2=this.createVisit({to:n2,hash:i2,event:t2});r2.history.popstate=!0;const a2=(_d=(_c=t2.state)==null?void 0:_c.index)!=null?_d:0;a2&&a2!==this.currentHistoryIndex&&(r2.history.direction=a2-this.currentHistoryIndex>0?"forwards":"backwards",this.currentHistoryIndex=a2),r2.animation.animate=!1,r2.scroll.reset=!1,r2.scroll.target=!1,this.options.animateHistoryBrowsing&&(r2.animation.animate=!0,r2.scroll.reset=!0),this.hooks.callSync("history:popstate",r2,{event:t2},()=>{this.performNavigation(r2)})}triggerWillOpenNewWindow(t2){return!!t2.matches('[download], [target="_blank"]')}}})}function initSwupScriptsPlugin(){(function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()})(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t2){for(var e2=1;e2<arguments.length;e2++){var n2=arguments[e2];for(var r in n2)Object.prototype.hasOwnProperty.call(n2,r)&&(t2[r]=n2[r])}return t2},t.apply(this,arguments)}const e=t2=>String(t2).split(".").map(t3=>String(parseInt(t3||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t2=>t2()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([t2,n2])=>{if(!function(t3,n3,r){const o=function(t4,e2){var n4;if(t4==="swup")return(n4=e2.version)!=null?n4:"";{var r2;const n5=e2.findPlugin(t4);return(r2=n5?.version)!=null?r2:""}}(t3,r);return!!o&&((t4,n4)=>n4.every(n5=>{const[,r2,o2]=n5.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t5,e2)=>{const n6={"":t6=>t6===0,">":t6=>t6>0,">=":t6=>t6>=0,"<":t6=>t6<0,"<=":t6=>t6<=0};return(n6[e2]||n6[""])(t5)})((i=o2,s=e(s=t4),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r2||">=")}))(o,n3)}(t2,n2=Array.isArray(n2)?n2:[n2],this.swup)){const e2=`${t2} ${n2.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e2}`)}}),!0}on(t2,e2,n2={}){var r;e2=!(r=e2).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e2.bind(this):e2;const o=this.swup.hooks.on(t2,e2,n2);return this.handlersToUnregister.push(o),o}once(e2,n2,r={}){return this.on(e2,n2,t({},r,{once:!0}))}before(e2,n2,r={}){return this.on(e2,n2,t({},r,{before:!0}))}replace(e2,n2,r={}){return this.on(e2,n2,t({},r,{replace:!0}))}off(t2,e2){return this.swup.hooks.off(t2,e2)}}return class extends n{constructor(t2){t2===void 0&&(t2={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t2}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t2,body:e2,optin:n2}=this.options,r=this.getScope({head:t2,body:e2});if(!r)return;const o=Array.from(r.querySelectorAll(n2?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t3=>this.runScript(t3)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t2){const e2=document.createElement("script");for(const{name:n2,value:r}of t2.attributes)e2.setAttribute(n2,r);return e2.textContent=t2.textContent,t2.replaceWith(e2),e2}getScope(t2){let{head:e2,body:n2}=t2;return e2&&n2?document:e2?document.head:n2?document.body:null}}})}function initSwupHeadPlugin(){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e||self).SwupHeadPlugin=t()})(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e2){for(var t2=1;t2<arguments.length;t2++){var n2=arguments[t2];for(var r2 in n2)Object.prototype.hasOwnProperty.call(n2,r2)&&(e2[r2]=n2[r2])}return e2},e.apply(this,arguments)}const t=e2=>String(e2).split(".").map(e3=>String(parseInt(e3||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e2=>e2()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEac
vendor: 4,948 bytes, line 2574
2574h(([e2,n2])=>{if(!function(e3,n3,r2){const s2=function(e4,t2){var n4;if(e4==="swup")return(n4=t2.version)!=null?n4:"";{var r3;const n5=t2.findPlugin(e4);return(r3=n5?.version)!=null?r3:""}}(e3,r2);return!!s2&&((e4,n4)=>n4.every(n5=>{const[,r3,s3]=n5.match(/^([\D]+)?(.*)$/)||[];var o2,i2;return((e5,t2)=>{const n6={"":e6=>e6===0,">":e6=>e6>0,">=":e6=>e6>=0,"<":e6=>e6<0,"<=":e6=>e6<=0};return(n6[t2]||n6[""])(e5)})((i2=s3,o2=t(o2=e4),i2=t(i2),o2.localeCompare(i2,void 0,{numeric:!0})),r3||">=")}))(s2,n3)}(e2,n2=Array.isArray(n2)?n2:[n2],this.swup)){const t2=`${e2} ${n2.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t2}`)}}),!0}on(e2,t2,n2={}){var r2;t2=!(r2=t2).name.startsWith("bound ")||r2.hasOwnProperty("prototype")?t2.bind(this):t2;const s2=this.swup.hooks.on(e2,t2,n2);return this.handlersToUnregister.push(s2),s2}once(t2,n2,r2={}){return this.on(t2,n2,e({},r2,{once:!0}))}before(t2,n2,r2={}){return this.on(t2,n2,e({},r2,{before:!0}))}replace(t2,n2,r2={}){return this.on(t2,n2,e({},r2,{replace:!0}))}off(e2,t2){return this.swup.hooks.off(e2,t2)}}function r(e2){return e2.localName!=="title"&&!e2.matches("[data-swup-theme]")}function s(e2,t2){return e2.outerHTML===t2.outerHTML}function o(e2,t2){t2===void 0&&(t2=[]);const n2=Array.from(e2.attributes);return t2.length?n2.filter(e3=>{let{name:n3}=e3;return t2.some(e4=>e4 instanceof RegExp?e4.test(n3):n3===e4)}):n2}function i(e2){return e2.matches("link[rel=stylesheet][href]")}return class extends n{constructor(e2){e2===void 0&&(e2={}),super();const t2=this;this.name="SwupHeadPlugin",this.requires={swup:">=4.6"},this.defaults={persistTags:!1,persistAssets:!1,awaitAssets:!1,attributes:["lang","dir"],timeout:3e3},this.options=void 0,this.updateHead=function(e3,n2){try{const{awaitAssets:n3,attributes:u,timeout:a}=t2.options,l=e3.to.document,{removed:c,added:h}=function(e4,t3,n4){let{shouldPersist:o2=()=>!1}=n4===void 0?{}:n4;const i2=Array.from(e4.children),u2=Array.from(t3.children),a2=(l2=i2,u2.reduce((e5,t4,n5)=>(l2.some(e6=>s(t4,e6))||e5.push({el:t4,index:n5}),e5),[]));var l2;const c2=function(e5,t4){return e5.reduce((e6,n5)=>(t4.some(e7=>s(n5,e7))||e6.push({el:n5}),e6),[])}(i2,u2);c2.reverse().filter(e5=>{let{el:t4}=e5;return r(t4)}).filter(e5=>{let{el:t4}=e5;return!o2(t4)}).forEach(t4=>{let{el:n5}=t4;return e4.removeChild(n5)});const h2=a2.filter(e5=>{let{el:t4}=e5;return r(t4)}).map(t4=>{let n5=t4.el.cloneNode(!0);return e4.insertBefore(n5,e4.children[(t4.index||0)+1]||null),{...t4,el:n5}});return{removed:c2.map(e5=>{let{el:t4}=e5;return t4}),added:h2.map(e5=>{let{el:t4}=e5;return t4})}}(document.head,l.head,{shouldPersist:e4=>t2.isPersistentTag(e4)});t2.swup.log(`Removed ${c.length} / added ${h.length} tags in head`),u?.length&&function(e4,t3,n4){n4===void 0&&(n4=[]);const r2=new Set;for(const{name:s2,value:i2}of o(t3,n4))e4.setAttribute(s2,i2),r2.add(s2);for(const{name:t4}of o(e4,n4))r2.has(t4)||e4.removeAttribute(t4)}(document.documentElement,l.documentElement,u);const d=function(){if(n3){const n4=((e4=a)===void 0&&(e4=0),h.filter(i).map(t3=>function(e5,t4){let n5;t4===void 0&&(t4=0);const r3=t5=>{e5.sheet?t5():n5=setTimeout(()=>r3(t5),10)};return new Promise(s2=>{r3(()=>s2(e5)),t4>0&&setTimeout(()=>{n5&&clearTimeout(n5),s2(e5)},t4)})}(t3,e4))),r2=function(){if(n4.length)return t2.swup.log(`Waiting for ${n4.length} assets to load`),Promise.resolve(Promise.all(n4)).then(function(){})}();if(r2&&r2.then)return r2.then(function(){})}var e4}();return Promise.resolve(d&&d.then?d.then(function(){}):void 0)}catch(e4){return Promise.reject(e4)}},this.options={...this.defaults,...e2},this.options.persistAssets&&!this.options.persistTags&&(this.options.persistTags="link[rel=stylesheet], script[src], style")}mount(){this.before("content:replace",this.updateHead)}isPersistentTag(e2){const{persistTags:t2}=this.options;return typeof t2=="function"?t2(e2):typeof t2=="string"&&t2.length>0?e2.matches(t2):!!t2}}})}function initSwupProgressBarPlugin(){(function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t||self).SwupProgressPlugin=e()})(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t2){for(var e2=1;e2<arguments.length;e2++){var s2=arguments[e2];for(var i2 in s2)Object.prototype.hasOwnProperty.call(s2,i2)&&(t2[i2]=s2[i2])}return t2},t.apply(this,arguments)}const e=t2=>String(t2).split(".").map(t3=>String(parseInt(t3||"0",10))).concat(["0","0"]).slice(0,3).join(".");class s{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t2=>t2()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEac
2574h(([t2,s2])=>{if(!function(t3,s3,i2){const r=function(t4,e2){var s4;if(t4==="swup")return(s4=e2.version)!=null?s4:"";{var i3;const s5=e2.findPlugin(t4);return(i3=s5?.version)!=null?i3:""}}(t3,i2);return!!r&&((t4,s4)=>s4.every(s5=>{const[,i3,r2]=s5.match(/^([\D]+)?(.*)$/)||[];var n,o;return((t5,e2)=>{const s6={"":t6=>t6===0,">":t6=>t6>0,">=":t6=>t6>=0,"<":t6=>t6<0,"<=":t6=>t6<=0};return(s6[e2]||s6[""])(t5)})((o=r2,n=e(n=t4),o=e(o),n.localeCompare(o,void 0,{numeric:!0})),i3||">=")}))(r,s3)}(t2,s2=Array.isArray(s2)?s2:[s2],this.swup)){const e2=`${t2} ${s2.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e2}`)}}),!0}on(t2,e2,s2={}){var i2;e2=!(i2=e2).name.startsWith("bound ")||i2.hasOwnProperty("prototype")?e2.bind(this):e2;const r=this.swup.hooks.on(t2,e2,s2);return this.handlersToUnregister.push(r),r}once(e2,s2,i2={}){return this.on(e2,s2,t({},i2,{once:!0}))}before(e2,s2,i2={}){return this.on(e2,s2,t({},i2,{before:!0}))}replace(e2,s2,i2={}){return this.on(e2,s2,t({},i2,{replace:!0}))}off(t2,e2){return this.swup.hooks.off(t2,e2)}}class i{constructor(t2){let{className:e2,styleAttr:s2,animationDuration:i2,minValue:r,initialValue:n,trickleValue:o}=t2===void 0?{}:t2;this.value=0,this.visible=!1,this.hiding=!1,this.className="progress-bar",this.styleAttr="data-progressbar-styles data-swup-theme",this.animationDuration=300,this.minValue=.1,this.initialValue=.25,this.trickleValue=.03,this.trickleInterval=void 0,this.styleElement=void 0,this.progressElement=void 0,this.trickle=()=>{const t3=Math.random()*this.trickleValue;this.setValue(this.value+t3)},e2!==void 0&&(this.className=String(e2)),s2!==void 0&&(this.styleAttr=String(s2)),i2!==void 0&&(this.animationDuration=Number(i2)),r!==void 0&&(this.minValue=Number(r)),n!==void 0&&(this.initialValue=Number(n)),o!==void 0&&(this.trickleValue=Number(o)),this.styleElement=this.createStyleElement(),this.progressElement=this.createProgressElement()}get defaultStyles(){return` 2575 .${this.className} { 2576 position: fixed; 2577 display: block; 2578 top: 0; 2579 left: 0; 2580 width: 100%; 2581 height: 3px; 2582 background-color: black; 2583 z-index: 9999; 2584 transition: 2585 transform ${this.animationDuration}ms ease-out, 2586 opacity ${this.animationDuration/2}ms ${this.animationDuration/2}ms ease-in; 2587 transform: translate3d(0, 0, 0) scaleX(var(--progress, 0)); 2588 transform-origin: 0; 2589 } 2590 `}show(){this.visible||(this.visible=!0,this.installStyleElement(),this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(t2){this.value=Math.min(1,Math.max(this.minValue,t2)),this.refresh()}installStyleElement(){document.head.prepend(this.styleElement)}installProgressElement(){this.progressElement.style.setProperty("--progress",String(0)),this.progressElement.style.opacity="1",document.body.prepend(this.progressElement),this.progressElement.scrollTop=0,this.setValue(Math.random()*this.initialValue)}fadeProgressElement(t2){this.progressElement.style.opacity="0",setTimeout(t2,1.5*this.animationDuration)}uninstallProgressElement(){this.progressElement.remove()}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,this.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.setProperty("--progress",String(this.value))})}createStyleElement(){const t2=document.createElement("style");return this.styleAttr.split(" ").forEach(e2=>t2.setAttribute(e2,"")),t2.textContent=this.defaultStyles,t2}createProgressElement(){const t2=document.createElement("div");return t2.className=this.className,t2.setAttribute("aria-hidden","true"),t2}}return class extends s{constructor(t2){t2===void 0&&(t2={}),super(),this.name="SwupProgressPlugin",this.defaults={className:"swup-progress-bar",delay:300,transition:300,minValue:.1,initialValue:.25,finishAnimation:!0},this.options=void 0,this.progressBar=void 0,this.showProgressBarTimeout=void 0,this.hideProgressBarTimeout=void 0,this.options={...this.defaults,...t2};const{className:e2,minValue:s2,initialValue:r,transition:n}=this.options;this.progressBar=new i({className:e2,minValue:s2,initialValue:r,animationDuration:n})}mount(){this.on("visit:start",this.startShowingProgress),this.on("page:view",this.stopShowingProgress)}startShowingProgress(){this.progressBar.setValue(0),this.showProgressBarAfterDelay()}
2590stopShowingProgress(){this.progressBar.setValue(1),this.options.finishAnimation?this.finishAnimationAndHideProgressBar():this.hideProgressBar()}showProgressBar(){this.cancelHideProgressBarTimeout(),this.progressBar.show()}showProgressBarAfterDelay(){this.cancelShowProgressBarTimeout(),this.cancelHideProgressBarTimeout(),this.showProgressBarTimeout=window.setTimeout(this.showProgressBar.bind(this),this.options.delay)}hideProgressBar(){this.cancelShowProgressBarTimeout(),this.progressBar.hide()}finishAnimationAndHideProgressBar(){this.cancelShowProgressBarTimeout(),this.hideProgressBarTimeout=window.setTimeout(this.hideProgressBar.bind(this),this.options.transition)}cancelShowProgressBarTimeout(){window.clearTimeout(this.showProgressBarTimeout),delete this.showProgressBarTimeout}cancelHideProgressBarTimeout(){window.clearTimeout(this.hideProgressBarTimeout),delete this.hideProgressBarTimeout}}})}function initSwupSlideTheme(){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e||self).SwupSlideTheme=t()})(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e2){for(var t2=1;t2<arguments.length;t2++){var s2=arguments[t2];for(var n2 in s2)Object.prototype.hasOwnProperty.call(s2,n2)&&(e2[n2]=s2[n2])}return e2},e.apply(this,arguments)}const t=e2=>String(e2).split(".").map(e3=>String(parseInt(e3||"0",10))).concat(["0","0"]).slice(0,3).join(".");class s{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e2=>e2()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([e2,s2])=>{if(!function(e3,s3,n2){const i=function(e4,t2){var s4;if(e4==="swup")return(s4=t2.version)!=null?s4:"";{var n3;const s5=t2.findPlugin(e4);return(n3=s5?.version)!=null?n3:""}}(e3,n2);return!!i&&((e4,s4)=>s4.every(s5=>{const[,n3,i2]=s5.match(/^([\D]+)?(.*)$/)||[];var r,o;return((e5,t2)=>{const s6={"":e6=>e6===0,">":e6=>e6>0,">=":e6=>e6>=0,"<":e6=>e6<0,"<=":e6=>e6<=0};return(s6[t2]||s6[""])(e5)})((o=i2,r=t(r=e4),o=t(o),r.localeCompare(o,void 0,{numeric:!0})),n3||">=")}))(i,s3)}(e2,s2=Array.isArray(s2)?s2:[s2],this.swup)){const t2=`${e2} ${s2.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t2}`)}}),!0}on(e2,t2,s2={}){var n2;t2=!(n2=t2).name.startsWith("bound ")||n2.hasOwnProperty("prototype")?t2.bind(this):t2;const i=this.swup.hooks.on(e2,t2,s2);return this.handlersToUnregister.push(i),i}once(t2,s2,n2={}){return this.on(t2,s2,e({},n2,{once:!0}))}before(t2,s2,n2={}){return this.on(t2,s2,e({},n2,{before:!0}))}replace(t2,s2,n2={}){return this.on(t2,s2,e({},n2,{replace:!0}))}off(e2,t2){return this.swup.hooks.off(e2,t2)}}class n extends s{constructor(...e2){super(...e2),this._originalAnimationSelectorOption="",this._addedStyleElements=[],this._addedHTMLContent=[],this._classNameAddedToElements=[],this._addClassNameToElement=()=>{this._classNameAddedToElements.forEach(e3=>{Array.from(document.querySelectorAll(e3.selector)).forEach(t2=>{t2.classList.add(`swup-transition-${e3.name}`)})})}}_beforeMount(){this._originalAnimationSelectorOption=String(this.swup.options.animationSelector),this.swup.options.animationSelector='[class*="swup-transition-"]',this.swup.hooks.on("content:replace",this._addClassNameToElement)}_afterUnmount(){this.swup.options.animationSelector=this._originalAnimationSelectorOption,this._addedStyleElements.forEach(e2=>{e2.outerHTML=""}),this._addedStyleElements=[],this._addedHTMLContent.forEach(e2=>{e2.outerHTML=""}),this._addedHTMLContent=[],this._classNameAddedToElements.forEach(e2=>{Array.from(document.querySelectorAll(e2.selector)).forEach(e3=>{e3.className.split(" ").forEach(t2=>{new RegExp("^swup-transition-").test(t2)&&e3.classList.remove(t2)})})}),this.swup.hooks.off("content:replace",this._addClassNameToElement)}applyStyles(e2){const t2=document.createElement("style");t2.setAttribute("data-swup-theme",""),t2.appendChild(document.createTextNode(e2)),document.head.prepend(t2),this._addedStyleElements.push(t2)}
vendor: 4,269 bytes, line 2590
2590applyHTML(e2){const t2=document.createElement("div");t2.innerHTML=e2,document.body.appendChild(t2),this._addedHTMLContent.push(t2)}addClassName(e2,t2){this._classNameAddedToElements.push({selector:e2,name:t2}),this._addClassNameToElement()}}return class extends n{constructor(e2){e2===void 0&&(e2={}),super(),this.name="SwupSlideTheme",this.defaults={mainElement:"#swup",reversed:!1},this.options={...this.defaults,...e2}}mount(){this.applyStyles("html{--swup-slide-theme-direction:1;--swup-slide-theme-translate:60px;--swup-slide-theme-duration-fade:.3s;--swup-slide-theme-duration-slide:.4s;--swup-slide-theme-translate-forward:calc(var(--swup-slide-theme-direction)*var(--swup-slide-theme-translate));--swup-slide-theme-translate-backward:calc(var(--swup-slide-theme-translate-forward)*-1)}html.swup-theme-reverse{--swup-slide-theme-direction:-1}html.is-changing .swup-transition-main{opacity:1;transform:translateZ(0);transition:opacity var(--swup-slide-theme-duration-fade),transform var(--swup-slide-theme-duration-slide)}html.is-animating .swup-transition-main{opacity:0;transform:translate3d(0,var(--swup-slide-theme-translate-backward),0)}html.is-animating.is-leaving .swup-transition-main{transform:translate3d(0,var(--swup-slide-theme-translate-forward),0)}"),this.addClassName(this.options.mainElement,"main"),this.options.reversed&&document.documentElement.classList.add("swup-theme-reverse")}unmount(){document.documentElement.classList.remove("swup-theme-reverse")}}})}function initSwupFadeTheme(){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e||self).SwupFadeTheme=t()})(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e2){for(var t2=1;t2<arguments.length;t2++){var n2=arguments[t2];for(var s2 in n2)Object.prototype.hasOwnProperty.call(n2,s2)&&(e2[s2]=n2[s2])}return e2},e.apply(this,arguments)}const t=e2=>String(e2).split(".").map(e3=>String(parseInt(e3||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e2=>e2()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([e2,n2])=>{if(!function(e3,n3,s2){const o=function(e4,t2){var n4;if(e4==="swup")return(n4=t2.version)!=null?n4:"";{var s3;const n5=t2.findPlugin(e4);return(s3=n5?.version)!=null?s3:""}}(e3,s2);return!!o&&((e4,n4)=>n4.every(n5=>{const[,s3,o2]=n5.match(/^([\D]+)?(.*)$/)||[];var i,r;return((e5,t2)=>{const n6={"":e6=>e6===0,">":e6=>e6>0,">=":e6=>e6>=0,"<":e6=>e6<0,"<=":e6=>e6<=0};return(n6[t2]||n6[""])(e5)})((r=o2,i=t(i=e4),r=t(r),i.localeCompare(r,void 0,{numeric:!0})),s3||">=")}))(o,n3)}(e2,n2=Array.isArray(n2)?n2:[n2],this.swup)){const t2=`${e2} ${n2.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t2}`)}}),!0}on(e2,t2,n2={}){var s2;t2=!(s2=t2).name.startsWith("bound ")||s2.hasOwnProperty("prototype")?t2.bind(this):t2;const o=this.swup.hooks.on(e2,t2,n2);return this.handlersToUnregister.push(o),o}once(t2,n2,s2={}){return this.on(t2,n2,e({},s2,{once:!0}))}before(t2,n2,s2={}){return this.on(t2,n2,e({},s2,{before:!0}))}replace(t2,n2,s2={}){return this.on(t2,n2,e({},s2,{replace:!0}))}off(e2,t2){return this.swup.hooks.off(e2,t2)}}class s extends n{constructor(...e2){super(...e2),this._originalAnimationSelectorOption="",this._addedStyleElements=[],this._addedHTMLContent=[],this._classNameAddedToElements=[],this._addClassNameToElement=()=>{this._classNameAddedToElements.forEach(e3=>{Array.from(document.querySelectorAll(e3.selector)).forEach(t2=>{t2.classList.add(`swup-transition-${e3.name}`)})})}}_beforeMount(){this._originalAnimationSelectorOption=String(this.swup.options.animationSelector),this.swup.options.animationSelector='[class*="swup-transition-"]',this.swup.hooks.on("content:replace",this._addClassNameToElement)}_afterUnmount(){this.swup.options.animationSelector=this._originalAnimationSelectorOption,this._addedStyleElements.forEac
2590h(e2=>{e2.outerHTML=""}),this._addedStyleElements=[],this._addedHTMLContent.forEach(e2=>{e2.outerHTML=""}),this._addedHTMLContent=[],this._classNameAddedToElements.forEach(e2=>{Array.from(document.querySelectorAll(e2.selector)).forEach(e3=>{e3.className.split(" ").forEach(t2=>{new RegExp("^swup-transition-").test(t2)&&e3.classList.remove(t2)})})}),this.swup.hooks.off("content:replace",this._addClassNameToElement)}applyStyles(e2){const t2=document.createElement("style");t2.setAttribute("data-swup-theme",""),t2.appendChild(document.createTextNode(e2)),document.head.prepend(t2),this._addedStyleElements.push(t2)}applyHTML(e2){const t2=document.createElement("div");t2.innerHTML=e2,document.body.appendChild(t2),this._addedHTMLContent.push(t2)}addClassName(e2,t2){this._classNameAddedToElements.push({selector:e2,name:t2}),this._addClassNameToElement()}}return class extends s{constructor(e2){e2===void 0&&(e2={}),super(),this.name="SwupFadeTheme",this.defaults={mainElement:"#swup"},this.options={...this.defaults,...e2}}mount(){this.applyStyles("html{--swup-fade-theme-duration:.4s}html.is-changing .swup-transition-main{opacity:1;transition:opacity var(--swup-fade-theme-duration)}html.is-animating .swup-transition-main{opacity:0}"),this.addClassName(this.options.mainElement,"main")}}})}var init_swup=__esm({"frontend/assets/js/dev/components/swup.js"(){}}),smoothPageTransitions_exports={};__export(smoothPageTransitions_exports,{initSmoothPageTransitions:()=>initSmoothPageTransitions});async function initSmoothPageTransitions(){initSwup(),initSwupHeadPlugin();let containerSelector,swupPlugins=[new SwupHeadPlugin];switch(config.jsVars.pageData.builder){case"elementor":containerSelector=".elementor";break;case"divi":containerSelector="#page-container";break;case"oxygen":containerSelector=".ct-inner-content";break;case"beaver":containerSelector=".fl-builder-content";break;case"bricks":containerSelector="#brx-content";break;case"block-editor":containerSelector=".wp-site-blocks";break;default:containerSelector="#swup";break}if(config.jsVars.settings.appCapabilities.smoothPageTransitions.progressBar==="on"){const{initSwupProgressBarPlugin:initSwupProgressBarPlugin2}=await Promise.resolve().then(()=>(init_swup(),swup_exports));initSwupProgressBarPlugin2(),swupPlugins.push(new SwupProgressPlugin),document.head.insertAdjacentHTML("beforeend","<style>.swup-progress-bar { background-color: "+config.jsVars.settings.webAppManifest.appearance.themeColor+" !important; }</style>")}if(config.jsVars.settings.appCapabilities.smoothPageTransitions.transition==="slide"){const{initSwupSlideTheme:initSwupSlideTheme2}=await Promise.resolve().then(()=>(init_swup(),swup_exports));initSwupSlideTheme2(),swupPlugins.push(new SwupSlideTheme({mainElement:containerSelector}))}else{const{initSwupFadeTheme:initSwupFadeTheme2}=await Promise.resolve().then(()=>(init_swup(),swup_exports));initSwupFadeTheme2(),swupPlugins.push(new SwupFadeTheme({mainElement:containerSelector}))}if(config.jsVars.settings.appCapabilities.smoothPageTransitions.compatibilityMode==="on"){const{initSwupScriptsPlugin:initSwupScriptsPlugin2}=await Promise.resolve().then(()=>(init_swup(),swup_exports));initSwupScriptsPlugin2(),swupPlugins.push(new SwupScriptsPlugin),containerSelector="#swup"}new Swup({containers:[containerSelector],plugins:swupPlugins})}var init_smoothPageTransitions=__esm({"frontend/assets/js/dev/modules/smoothPageTransitions.js"(){init_frontend(),init_swup()}}),pushNotificationsPrompt_exports={};__export(pushNotificationsPrompt_exports,{initPushNotificationsPrompt:()=>initPushNotificationsPrompt});async function initPushNotificationsPrompt(){customElements.get("pwa-push-notifications-prompt")||customElements.define("pwa-push-notifications-prompt",PwaPushNotificationsPrompt),PwaPushNotificationsPrompt.show()}var PwaPushNotificationsPrompt,init_pushNotificationsPrompt=__esm({"frontend/assets/js/dev/modules/pushNotificationsPrompt.js"(){init_frontend(),init_pushNotificationsSubscription(),init_utils(),PwaPushNotificationsPrompt=class _PwaPushNotificationsPrompt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}async connectedCallback(){this.render(),this.unsubscribe=pushNotificationsSubscription_default.subscribe(this.handleStateChange.bind(this)),this.handleSubscription(),this.handleDismiss()}handleStateChange(state){["subscribed","blocked","loading"].includes(state)?this.hide():state==="unsubscribed"&&_PwaPushNotificationsPrompt.show()}injectStyles(css){this.styles.add(css)}static show(){let pushNotificationsPrompt=document.querySelector("pwa-push-notifications-prompt");return pushNotificationsPrompt||(pushNotificationsPrompt=document.createElement("pwa-push-notifications-prompt"),document.body.appendChild(pushNotificationsPrompt)),requestAnimationFrame(()=>{const prompt=pushNotificationsPrompt.shadowRoot.querySelector(".push-notifications-prompt");setTimeout(()=>{prompt.classList.add("visible")},300)}),pushNotificationsPrompt}hide(){const prompt=this.shadowRoot.querySelector(".push-notifications-prompt");prompt.classList.remove("visible"),prompt.addEventListener("transitionend",()=>{this.remove()},{once:!0})}handleSubscription(){this.shadowRoot.querySelector(".push-notifications-prompt-button_allow").addEventListener("click",async()=>{try{await pushNotificationsSubscription_default.addSubscription()}catch(error){console.error(error)}})}handleDismiss(){this.shadowRoot.querySelector(".push-notifications-prompt-button_dismiss").addEventListener("click",async()=>{this.hide()})}render(){var _a,_b,_c,_d,_e,_f,_g;
2590const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",backgroundColor=getContrastTextColor(themeColor),textColor=getContrastTextColor(backgroundColor),promptMessage=(_f=(_e=(_d=config.jsVars.settings.pushNotifications)==null?void 0:_d.prompt)==null?void 0:_e.message)!=null?_f:wp.i18n.__("We would like to show you notifications for the latest news and updates.",config.jsVars.slug),appName=(_g=config.jsVars.settings.webAppManifest.appIdentity.appName)!=null?_g:"",appIconHtml=config.jsVars.iconUrl?`<img class="push-notifications-prompt-media_icon" src="${config.jsVars.iconUrl}" alt="${appName}" onerror="this.style.display='none'"/>`:"";this.injectStyles(` 2591 .push-notifications-prompt { 2592 position: fixed; 2593 top: 0; 2594 left: 50%; 2595 -webkit-transform: translateX(-50%) translateY(-100%); 2596 -ms-transform: translateX(-50%) translateY(-100%); 2597 transform: translateX(-50%) translateY(-100%); 2598 padding: 1rem; 2599 width: 25rem; 2600 max-width: 85%; 2601 background-color: ${backgroundColor}; 2602 color: ${textColor}; 2603 border: 1px solid ${textColor}15; 2604 border-radius: 0.75rem; 2605 -webkit-box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 2606 box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 2607 z-index: 9999999999999999; 2608 -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2609 -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2610 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2611 opacity: 0; 2612 visibility: hidden; 2613 } 2614 2615 .push-notifications-prompt.visible { 2616 opacity: 1; 2617 visibility: visible; 2618 -webkit-transform: translateX(-50%) translateY(1rem); 2619 -ms-transform: translateX(-50%) translateY(1rem); 2620 transform: translateX(-50%) translateY(1rem); 2621 } 2622 2623 .push-notifications-prompt-media { 2624 display: flex; 2625 align-items: center; 2626 gap: 0.75rem; 2627 flex: 1; 2628 } 2629 2630 .push-notifications-prompt-media_icon { 2631 border-radius: 9999px; 2632 border: 1px solid #e5e7eb; 2633 flex-shrink: 0; 2634 height: 50px; 2635 width: 50px; 2636 display: inline-block; 2637 } 2638 2639 .push-notifications-prompt-media_texts { 2640 flex: 1; 2641 min-width: 0; 2642 } 2643 2644 .push-notifications-prompt-media_title { 2645 font-size: 0.875rem; 2646 line-height: 1.25rem; 2647 font-weight: 500; 2648 color: ${textColor}; 2649 display: -webkit-box; 2650 overflow: hidden; 2651 -webkit-box-orient: vertical; 2652 -webkit-line-clamp: 1; 2653 } 2654 2655 .push-notifications-prompt-media_message { 2656 font-size: 0.75rem; 2657 line-height: 1rem; 2658 font-weight: 400; 2659 color: ${textColor}cc; 2660 margin-top: 0.12rem; 2661 display: -webkit-box; 2662 overflow: hidden; 2663 -webkit-box-orient: vertical; 2664 -webkit-line-clamp: 2; 2665 } 2666 2667 .push-notifications-prompt-buttons { 2668 display: flex; 2669 align-items: center; 2670 justify-content: flex-end; 2671 gap: 0.75rem; 2672 margin-top: 1.25rem; 2673 } 2674 2675 .push-notifications-prompt-button_dismiss { 2676 font-size: 0.875rem; 2677 line-height: 1.25rem; 2678 color: ${textColor}59; 2679 background: none; 2680 font-weight: 600; 2681 border: none; 2682 outline: none; 2683 padding: 0; 2684 margin: 0; 2685 cursor: pointer; 2686 } 2687 2688 .push-notifications-prompt-button_allow { 2689 display: block; 2690 background-color: ${themeColor}; 2691 color: ${backgroundColor}; 2692 vertical-align: middle; 2693 text-decoration: none; 2694 font-size: 0.875rem; 2695 line-height: 1.25rem; 2696 font-weight: 600; 2697 padding: 0.375rem 0.875rem; 2698 border: none; 2699 outline: none; 2700 border-radius: 9999px; 2701 cursor: pointer; 2702 } 2703 2704 .push-notifications-prompt-button_allow:hover { 2705 opacity: 0.8; 2706 } 2707 `);const combinedStyles=Array.from(this.styles).join(` 2708`);this.shadowRoot.innerHTML=` 2709 <style>${combinedStyles}</style> 2710 <div class="push-notifications-prompt"> 2711 <div class="push-notifications-prompt-media"> 2712 ${appIconHtml} 2713 <div class="push-notifications-prompt-media_texts"> 2714 <div class="push-notifications-prompt-media_title">${wp.i18n.__("Push Notifications",config.jsVars.slug)}</div> 2715 <div class="push-notifications-prompt-media_message">${promptMessage}</div> 2716 </div> 2717 </div> 2718 <div class="push-notifications-prompt-buttons"> 2719 <button type="button" class="push-notifications-prompt-button_dismiss"> 2720 ${wp.i18n.__("Dismiss",config.jsVars.slug)} 2721 </button> 2722 <button type="button" class="push-notifications-prompt-button_allow"> 2723 ${wp.i18n.__("Allow Notifications",config.jsVars.slug)} 2724 </button> 2725 </div> 2726 </div> 2727 `}}}}),pushNotificationsButton_exports={};__export(pushNotificationsButton_exports,{initPushNotificationsButton:()=>initPushNotificationsButton});async function initPushNotificationsButton(){customElements.get("pwa-push-notifications-button")||customElements.define("pwa-push-notifications-button",PwaPushNotificationsButton),PwaPushNotificationsButton.show()}var PwaPushNotificationsButton,init_pushNotificationsButton=__esm({"frontend/assets/js/dev/modules/pushNotificationsButton.js"(){init_frontend(),init_pushNotificationsSubscription(),init_utils(),PwaPushNotificationsButton=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.position=config.jsVars.settings.pushNotifications.button.position,this.behavior=config.jsVars.settings.pushNotifications.button.behavior,this.icons={subscribe:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.268 21a2 2 0 0 0 3.464 0"/><path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/></svg>',unsubscribe:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.268 21a2 2 0 0 0 3.464 0"/><path d="M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742"/><path d="m2 2 20 20"/><path d="M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05"/></svg>'}}async connectedCallback(){this.render(),this.unsubscribe=pushNotificationsSubscription_default.subscribe(this.handleStateChange.bind(this)),this.handleSubscription()}static show(){let pushNotificationsButton=document.querySelector("pwa-push-notifications-button");return pushNotificationsButton||(pushNotificationsButton=document.createElement("pwa-push-notifications-button"),document.body.appendChild(pushNotificationsButton)),pushNotificationsButton}injectStyles(css){this.styles.add(css)}handleStateChange(state){const iconSpan=this.shadowRoot.querySelector(".push-notifications-button_icon"),spinner=this.shadowRoot.querySelector(".push-notifications-button_spinner"),pushButton=this.shadowRoot.querySelector(".push-notifications-button");switch(state){case"loading":iconSpan.style.display="none",spinner.style.display="block",pushButton.classList.add("-disabled");break;case"subscribed":iconSpan.style.display="flex",spinner.style.display="none",pushButton.classList.remove("-disabled"),iconS
2727pan.innerHTML=this.icons.unsubscribe,this.behavior==="hidden"&&this.remove();break;case"unsubscribed":iconSpan.style.display="flex",spinner.style.display="none",pushButton.classList.remove("-disabled"),iconSpan.innerHTML=this.icons.subscribe;break;case"blocked":iconSpan.style.display="flex",spinner.style.display="none",iconSpan.innerHTML=this.icons.subscribe,Notification.permission==="denied"&&this.remove();break}}handleSubscription(){this.shadowRoot.querySelector(".push-notifications-button").addEventListener("click",async()=>{try{pushNotificationsSubscription_default.currentState==="subscribed"?await pushNotificationsSubscription_default.removeSubscription():pushNotificationsSubscription_default.currentState==="unsubscribed"&&await pushNotificationsSubscription_default.addSubscription()}catch(error){console.error(error)}})}render(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",iconColor=getContrastTextColor(themeColor),positionStyles={"bottom-right":document.querySelector("pwa-navigation-tab-bar")?"bottom: 70px; right: 20px;":"bottom: 20px; right: 20px;","bottom-left":document.querySelector("pwa-navigation-tab-bar")?"bottom: 70px; left: 20px;":"bottom: 20px; left: 20px;","top-right":"top: 20px; right: 20px;","top-left":"top: 20px; left: 20px;"}[this.position];this.injectStyles(` 2728 .push-notifications-button { 2729 position: fixed; 2730 ${positionStyles} 2731 z-index: 999; 2732 display: -webkit-box; 2733 display: -ms-flexbox; 2734 display: flex; 2735 -webkit-box-align: center; 2736 -ms-flex-align: center; 2737 align-items: center; 2738 -webkit-box-pack: center; 2739 -ms-flex-pack: center; 2740 justify-content: center; 2741 width: 50px; 2742 height: 50px; 2743 background: ${themeColor}; 2744 border: none; 2745 border-radius: 50%; 2746 cursor: pointer; 2747 -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 2748 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 2749 } 2750 2751 .push-notifications-button:hover { 2752 opacity: 0.8; 2753 } 2754 2755 .push-notifications-button.-disabled { 2756 pointer-events: none !important; 2757 } 2758 2759 .push-notifications-button_icon { 2760 display: -webkit-box; 2761 display: -ms-flexbox; 2762 display: flex; 2763 -webkit-box-align: center; 2764 -ms-flex-align: center; 2765 align-items: center; 2766 -webkit-box-pack: center; 2767 -ms-flex-pack: center; 2768 justify-content: center; 2769 width: 1.25rem; 2770 height: 1.25rem; 2771 color: ${iconColor}; 2772 } 2773 2774 .push-notifications-button_spinner { 2775 display: none; 2776 width: 1rem; 2777 height: 1rem; 2778 border: 2px solid ${iconColor}40; 2779 border-top-color: ${iconColor}; 2780 border-radius: 50%; 2781 -webkit-animation: spinner 0.8s linear infinite; 2782 animation: spinner 0.8s linear infinite; 2783 } 2784 2785 @-webkit-keyframes spinner { 2786 to { 2787 -webkit-transform: rotate(360deg); 2788 transform: rotate(360deg); 2789 } 2790 } 2791 2792 @keyframes spinner { 2793 to { 2794 -webkit-transform: rotate(360deg); 2795 transform: rotate(360deg); 2796 } 2797 } 2798 `);const combinedStyles=Array.from(this.styles).join(` 2799`);this.shadowRoot.innerHTML=` 2800 <style>${combinedStyles}</style> 2801 <div class="push-notifications-button" aria-label="${wp.i18n.__("Enable / Disable Push Notifications")}"> 2802 <span class="push-notifications-button_spinner"></span> 2803 <span class="push-notifications-button_icon"></span> 2804 </div> 2805 `}}}}),offlineNotification_exports={};__export(offlineNotification_exports,{initOfflineNotification:()=>initOfflineNotification});async function initOfflineNotification(){customElements.get("pwa-offline-notification")||customElements.define("pwa-offline-notification",PwaOfflineNotification),navigator.onLine||PwaOfflineNotification.showReconnecting(),window.addEventListener("offline",()=>{PwaOfflineNotification.showReconnecting()}),window.addEventListener("online",()=>{PwaOfflineNotification.showReconnected()})}var PwaOfflineNotification,init_offlineNotification=__esm({"frontend/assets/js/dev/modules/offlineNotification.js"(){init_frontend(),init_utils(),PwaOfflineNotification=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render()}injectStyles(css){this.styles.add(css)}static showReconnecting(){let offlineNotification=document.querySelector("pwa-offline-notification");return offlineNotification||(offlineNotification=document.createElement("pwa-offline-notification"),document.body.appendChild(offlineNotification)),requestAnimationFrame(()=>{const notification=offlineNotification.shadowRoot.querySelector(".offline-notification"),icon=notification.querySelector(".offline-notification_icon"),text=notification.querySelector(".offline-notification_text");notification.classList.remove("reconnected"),icon.classList.add("spinner"),icon.classList.remove("success"),text.textContent=wp.i18n.__("Connection lost. Attempting to re
2805connect...",config.jsVars.slug),setTimeout(()=>{notification.classList.add("visible")},300)}),offlineNotification}static showReconnected(){const offlineNotification=document.querySelector("pwa-offline-notification");if(!offlineNotification)return;const notification=offlineNotification.shadowRoot.querySelector(".offline-notification"),icon=notification.querySelector(".offline-notification_icon"),text=notification.querySelector(".offline-notification_text");notification.classList.add("reconnected"),icon.classList.remove("spinner"),icon.classList.add("success"),text.textContent=wp.i18n.__("Successfully reconnected to the internet!",config.jsVars.slug),offlineNotification._removeTimeout&&clearTimeout(offlineNotification._removeTimeout),offlineNotification._removeTimeout=setTimeout(()=>{notification.classList.remove("visible"),notification.addEventListener("transitionend",()=>{offlineNotification.remove()},{once:!0})},2e3)}render(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",backgroundColor=getContrastTextColor(themeColor),textColor=getContrastTextColor(backgroundColor);this.injectStyles(` 2806 .offline-notification { 2807 position: fixed; 2808 top: 0; 2809 left: 50%; 2810 -webkit-transform: translateX(-50%) translateY(-100%); 2811 -ms-transform: translateX(-50%) translateY(-100%); 2812 transform: translateX(-50%) translateY(-100%); 2813 display: -webkit-box; 2814 display: -ms-flexbox; 2815 display: flex; 2816 -webkit-box-align: center; 2817 -ms-flex-align: center; 2818 align-items: center; 2819 padding: 0.75rem 1rem; 2820 gap: 0.75rem; 2821 width: 30rem; 2822 max-width: 85%; 2823 background-color: ${backgroundColor}; 2824 color: ${textColor}; 2825 border: 1px solid ${textColor}15; 2826 border-radius: 0.75rem; 2827 -webkit-box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 2828 box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 2829 z-index: 9999999999999999; 2830 -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2831 -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2832 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 2833 opacity: 0; 2834 visibility: hidden; 2835 } 2836 2837 .offline-notification.visible { 2838 opacity: 1; 2839 visibility: visible; 2840 -webkit-transform: translateX(-50%) translateY(1rem); 2841 -ms-transform: translateX(-50%) translateY(1rem); 2842 transform: translateX(-50%) translateY(1rem); 2843 } 2844 2845 .offline-notification_icon { 2846 display: inline-block; 2847 flex-shrink: 0; 2848 width: 12px; 2849 height: 12px; 2850 border-radius: 9999px; 2851 } 2852 2853 .offline-notification_icon.spinner { 2854 -webkit-animation: spin 1s linear infinite; 2855 animation: spin 1s linear infinite; 2856 border: 3px solid ${themeColor}; 2857 border-top-color: transparent; 2858 } 2859 2860 .offline-notification_icon.success { 2861 background-color: #22c55e; 2862 border-radius: 9999px; 2863 } 2864 2865 .offline-notification_text { 2866 font-size: 0.875rem; 2867 line-height: 1.25rem; 2868 } 2869 2870 @-webkit-keyframes spin { 2871 to { 2872 -webkit-transform: rotate(360deg); 2873 transform: rotate(360deg); 2874 } 2875 } 2876 2877 @keyframes spin { 2878 to { 2879 -webkit-transform: rotate(360deg); 2880 transform: rotate(360deg); 2881 } 2882 } 2883 `);const combinedStyles=Array.from(this.styles).join(` 2884`);this.shadowRoot.innerHTML=` 2885 <style>${combinedStyles}</style> 2886 <div class="offline-notification" role="alert" tabindex="-1"> 2887 <div class="offline-notification_icon spinner" role="status" aria-label="loading"></div> 2888 <span class="offline-notification_text"> 2889 ${wp.i18n.__("Connection lost. Attempting to reconnect...",config.jsVars.slug)} 2890 </span> 2891 </div> 2892 `}}}}),offlineForms_exports={};__export(offlineForms_exports,{initOfflineForms:()=>initOfflineForms});function handleFormSubmit(e){if(!navigator.onLine){e.preventDefault(),e.stopPropagation();const form=e.target,formData2=new FormData(form),submitData={formId:form.id||`pwa-form-${Math.random().toString(36).slice(2,9)}`,submitId:`${form.id}-${Date.now()}`,url:form.action||window.location.href,method:(form.method||"POST").toUpperCase(),timestamp:Date.now(),data:Object.fromEntries(formData2),contentType:form.enctype||"application/x-www-form-urlencoded"};PwaOfflineFormHandler.show(submitData)}}async function initOfflineForms(){customElements.get("pwa-offline-form-handler")||customElements.define("pwa-offline-form-handler",PwaOfflineFormHandler),document.querySelectorAll("form:not([data-no-offline])").forEach(form=>{form.addEventListener("submit",handleFormSubmit,!0)}),navigator.onLine&&PwaOfflineFormHandler.submitStoredForms(),window.addEventListener("online",()=>{PwaOfflineFormHandler.submitStoredForms()})}var PwaOfflineFormHandler,init_offlineForms=__esm({"frontend/assets/js/dev/modules/offlineForms.js"(){init_frontend(),init_utils(),PwaOfflineFormHandler=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.formData=null}connectedCallback(){this.render(),this.setupEventHandlers()}injectStyles(css){this.styles.add(css)}static show(formData2){let handler=document.querySelector("pwa-offline-form-handler");
2892return handler||(handler=document.createElement("pwa-offline-form-handler"),handler.formData=formData2,document.body.appendChild(handler),requestAnimationFrame(()=>{const backdrop=handler.shadowRoot.querySelector(".offline-form-handler");document.documentElement.style.paddingRight=`${window.innerWidth-document.documentElement.offsetWidth}px`,document.documentElement.style.overflow="hidden",backdrop.classList.add("visible")})),handler}setupEventHandlers(){const cancelButton=this.shadowRoot.querySelector(".offline-form-handler-footer-button.-cancel"),proceedButton=this.shadowRoot.querySelector(".offline-form-handler-footer-button.-proceed"),container=this.shadowRoot.querySelector(".offline-form-handler-container"),backdrop=this.shadowRoot.querySelector(".offline-form-handler"),handleClose=()=>{backdrop.classList.remove("visible"),backdrop.addEventListener("transitionend",()=>{document.documentElement.style.removeProperty("overflow"),document.documentElement.style.paddingRight="",this.remove()},{once:!0})},handleProceed=async()=>{container.classList.add("-proceeding"),await this.storeFormSubmission(this.formData),handleClose()};cancelButton.addEventListener("click",handleClose),proceedButton.addEventListener("click",handleProceed),backdrop.addEventListener("click",e=>{e.target===backdrop&&handleClose()})}async storeFormSubmission(data){try{const storedForms=JSON.parse(localStorage.getItem("pwaOfflineForms"))||{};return storedForms[data.submitId]=data,localStorage.setItem("pwaOfflineForms",JSON.stringify(storedForms)),!0}catch(error){return console.error("Failed to store form data:",error),!1}}static async submitStoredForms(){const processingKey="pwaOfflineFormsProcessing",processingStart=localStorage.getItem(processingKey);if(processingStart&&Date.now()-parseInt(processingStart)>60*1e3&&localStorage.removeItem(processingKey),!localStorage.getItem(processingKey))try{localStorage.setItem(processingKey,Date.now().toString());let storedForms=JSON.parse(localStorage.getItem("pwaOfflineForms"))||{};for(const submitId in storedForms){const storedForm=storedForms[submitId];if(Date.now()-storedForm.timestamp>24*60*60*1e3){delete storedForms[submitId];continue}try{await this.submitForm(storedForm),delete storedForms[submitId]}catch(error){console.error("Failed to submit stored form:",error),!error.message.includes("Failed to fetch")&&!error.message.includes("NetworkError")&&delete storedForms[submitId]}localStorage.setItem("pwaOfflineForms",JSON.stringify(storedForms))}}catch(error){console.error("Error processing offline forms:",error)}finally{localStorage.removeItem(processingKey)}}static async submitForm(storedForm){const{url,method,data,contentType}=storedForm,isGet=method.toUpperCase()==="GET";let finalUrl=url,body;const headers=new Headers({"X-Requested-With":"XMLHttpRequest"});if(typeof wpApiSettings<"u"&&wpApiSettings.nonce&&headers.append("X-WP-Nonce",wpApiSettings.nonce),isGet){const params=new URLSearchParams;Object.entries(data).forEach(([key,value])=>{Array.isArray(value)?value.forEach(item=>params.append(`${key}[]`,item)):params.append(key,value)}),finalUrl=`${url}${url.includes("?")?"&":"?"}${params.toString()}`}else if(contentType.includes("multipart/form-data"))body=new FormData,Object.entries(data).forEach(([key,value])=>{Array.isArray(value)?value.forEach(item=>body.append(`${key}[]`,item)):body.append(key,value)});else if(headers.append("Content-Type",contentType),contentType.includes("json"))body=JSON.stringify(data);else{const params=new URLSearchParams;Object.entries(data).forEach(([key,value])=>{Array.isArray(value)?value.forEach(item=>params.append(`${key}[]`,item)):params.append(key,value)}),body=params.toString()}const fetchOptions={method,headers,credentials:"same-origin"};isGet||(fetchOptions.body=body);const response=await fetch(finalUrl,fetchOptions);if(!response.ok)throw new Error(`Server returned ${response.status}: ${response.statusText}`);return response}render(){var _a,_b,_c;const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",backgroundColor=getContrastTextColor(themeColor),textColor=getContrastTextColor(backgroundColor);this.injectStyles(` 2893 .offline-form-handler { 2894 position: fixed; 2895 top: 0; 2896 left: 0; 2897 right: 0; 2898 bottom: 0; 2899 z-index: 9999999; 2900 background: rgba(0, 0, 0, 0); 2901 -webkit-backdrop-filter: blur(0px); 2902 backdrop-filter: blur(0px); 2903 -webkit-transition: all 0.2s ease-out; 2904 -o-transition: all 0.2s ease-out; 2905 transition: all 0.2s ease-out; 2906 opacity: 0; 2907 visibility: hidden; 2908 } 2909 2910 .offline-form-handler.visible { 2911 background: rgba(0, 0, 0, 0.7); 2912 -webkit-backdrop-filter: blur(5px); 2913 backdrop-filter: blur(5px); 2914 opacity: 1; 2915 visibility: visible; 2916 } 2917 2918 .offline-form-handler-container { 2919 position: fixed; 2920 top: 50%; 2921 left: 50%; 2922 -webkit-transform: translate(-50%, calc(-50% + 20px)); 2923 -ms-transform: translate(-50%, calc(-50% + 20px)); 2924 transform: translate(-50%, calc(-50% + 20px)); 2925 background: ${backgroundColor}; 2926 border-radius: 10px; 2927 -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 2928 box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 2929 max-width: 29rem; 2930 width: 95%; 2931 padding: 0.75rem 1rem; 2932 overflow: hidden; 2933 opacity: 0; 2934 -webkit-transition: all 0.15s ease-out; 2935 -o-transition: all 0.15s ease-out; 2936 transition: all 0.15s ease-out; 2937 z-index: 999999999999999999999; 2938 } 2939 2940 .offline-form-handler.visible .offline-form-handler-container { 2941 -webkit-transform: translate(-50%, -50%); 2942 -ms-transform: translate(-50%, -50%); 2943 transform: translate(-50%, -50%); 2944 opacity: 1; 2945 } 2946 2947 .offline-form-handler.visible:has(.offline-form-handler-container.-proceeding) { 2948 pointer-events: none; 2949 } 2950 2951 .offline-form-handler.visible .offline-form-handler-container.-proceeding { 2952 display: -webkit-box; 2953 display: -ms-flexbox; 2954 display: flex; 2955 -webkit-box-orient: vertical; 2956 -webkit-box-direction: normal; 2957 -ms-flex-direction: column; 2958 flex-direction: column; 2959 -webkit-box-align: center; 2960 -ms-flex-align: center; 2961 align-items: center; 2962 -webkit-box-pack: center; 2963 -ms-flex-pack: center; 2964 justify-content: center; 2965 } 2966 2967 .offline-form-handler.visible .offline-form-handler-container.-proceeding::before { 2968 content: ''; 2969 position: absolute; 2970 background: rgb(255 255 255 / 0.5); 2971 z-index: 2; 2972 width: 100%; 2973 height: 100%; 2974 top: 0; 2975 left: 0; 2976 } 2977 2978 .offline-form-handler.visible .offline-form-handler-container.-proceeding::after { 2979 content: ''; 2980 position: absolute; 2981 display: inline-block;
2982 border: 3px solid ${themeColor}; 2983 border-top-color: transparent; 2984 border-radius: 9999px; 2985 width: 1.5rem; 2986 height: 1.5rem; 2987 z-index: 5; 2988 -webkit-animation: spin 1s linear infinite; 2989 animation: spin 1s linear infinite; 2990 } 2991 2992 .offline-form-handler-header { 2993 width: 100%; 2994 } 2995 2996 .offline-form-handler-header-texts { 2997 display: -webkit-box; 2998 display: -ms-flexbox; 2999 display: flex; 3000 -webkit-box-align: center; 3001 -ms-flex-align: center; 3002 align-items: center; 3003 gap: 0.5rem; 3004 } 3005 3006 .offline-form-handler-header-texts_icon { 3007 width: 1.5rem; 3008 height: 1.5rem; 3009 color: ${textColor}b3; 3010 } 3011 3012 .offline-form-handler-header-texts_title { 3013 font-size: 1.125rem; 3014 line-height: 1.75rem; 3015 font-weight: 500; 3016 color: ${textColor}; 3017 display: -webkit-box; 3018 overflow: hidden; 3019 -webkit-box-orient: vertical; 3020 -webkit-line-clamp: 1; 3021 } 3022 3023 .offline-form-handler-body { 3024 margin-top: 0.75rem; 3025 overflow-y: auto; 3026 max-height: 34rem; 3027 } 3028 3029 .offline-form-handler-body_message { 3030 font-size: 0.875rem; 3031 line-height: 1.25rem; 3032 color: ${textColor}b3; 3033 } 3034 3035 .offline-form-handler-footer { 3036 margin-top: 0.75rem; 3037 width: 100%; 3038 } 3039 3040 .offline-form-handler-footer-buttons { 3041 display: -webkit-box; 3042 display: -ms-flexbox; 3043 display: flex; 3044 -webkit-box-pack: end; 3045 -ms-flex-pack: end; 3046 justify-content: flex-end; 3047 gap: 0.5rem; 3048 margin-top: 1rem; 3049 } 3050 3051 .offline-form-handler-footer-button { 3052 display: -webkit-inline-box; 3053 display: -ms-inline-flexbox; 3054 display: inline-flex; 3055 -webkit-box-pack: center; 3056 -ms-flex-pack: center; 3057 justify-content: center; 3058 -webkit-box-align: center; 3059 -ms-flex-align: center; 3060 align-items: center; 3061 padding: 0.5rem 0.75rem; 3062 font-weight: 500; 3063 font-size: 0.75rem; 3064 line-height: 1rem; 3065 border-radius: 0.5rem; 3066 -webkit-transition: all 0.1s ease; 3067 -o-transition: all 0.1s ease; 3068 transition: all 0.1s ease; 3069 cursor: pointer; 3070 outline: none; 3071 border: none; 3072 } 3073 3074 .offline-form-handler-footer-button:hover { 3075 opacity: 0.8; 3076 } 3077 3078 .offline-form-handler-footer-button:focus { 3079 outline: none; 3080 border: none; 3081 } 3082 3083 .offline-form-handler-footer-button.-cancel { 3084 -webkit-box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 3085 box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 3086 color: ${textColor}; 3087 background: ${backgroundColor}; 3088 border: 1px solid ${textColor}1a; 3089 } 3090 3091 .offline-form-handler-footer-button.-proceed { 3092 color: ${backgroundColor}; 3093 background: ${themeColor}; 3094 } 3095 3096 @media (max-width: 700px) { 3097 .offline-form-handler-container { 3098 max-width: 100%; 3099 top: unset; 3100 bottom: 0; 3101 left: 0; 3102 border-top-left-radius: 1rem; 3103 border-top-right-radius: 1rem; 3104 border-bottom-left-radius: 0; 3105 border-bottom-right-radius: 0; 3106 -webkit-box-shadow: none; 3107 box-shadow: none; 3108 opacity: 1; 3109 -webkit-transform: translateY(100%); 3110 -ms-transform: translateY(100%); 3111 transform: translateY(100%); 3112 } 3113 3114 .offline-form-handler.visible .offline-form-handler-container { 3115 -webkit-transform: translateY(0); 3116 -ms-transform: translateY(0); 3117 transform: translateY(0); 3118 } 3119 3120 .offline-form-handler-footer-buttons { 3121 -webkit-box-orient: vertical; 3122 -webkit-box-direction: reverse; 3123 -ms-flex-direction: column-reverse; 3124 flex-direction: column-reverse; 3125 } 3126 3127 .offline-form-handler-footer-button { 3128 padding: 0.75rem; 3129 } 3130 } 3131 3132 @-webkit-keyframes spin { 3133 to { 3134 -webkit-transform: rotate(360deg); 3135 transform: rotate(360deg); 3136 } 3137 } 3138 3139 @keyframes spin { 3140 to { 3141 -webkit-transform: rotate(360deg); 3142 transform: rotate(360deg); 3143 } 3144 } 3145 `);const combinedStyles=Array.from(this.styles).join(` 3146`);this.shadowRoot.innerHTML=` 3147 <style>${combinedStyles}</style> 3148 <div class="offline-form-handler"> 3149 <div class="offline-form-handler-container"> 3150 <div class="offline-form-handler-header"> 3151 <div class="offline-form-handler-header-texts"> 3152 <svg class="offline-form-handler-header-texts_icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wifi-off"><path d="M12 20h.01"/><path d="M8.5 16.429a5 5 0 0 1 7 0"/><path d="M5 12.859a10 10 0 0 1 5.17-2.69"/><path d="M19 12.859a10 10 0 0 0-2.007-1.523"/>
3152<path d="M2 8.82a15 15 0 0 1 4.177-2.643"/><path d="M22 8.82a15 15 0 0 0-11.288-3.764"/><path d="m2 2 20 20"/></svg> 3153 <div class="offline-form-handler-header-texts_title">${wp.i18n.__("No Internet Connection",config.jsVars.slug)}</div> 3154 </div> 3155 </div> 3156 <div class="offline-form-handler-body"> 3157 <div class="offline-form-handler-body_message">${wp.i18n.__("You\u2019re currently offline. Your form submission data will be saved and be automatically processed in the background when you\u2019re back online within 24 hours. Would you like to proceed?",config.jsVars.slug)}</div> 3158 </div> 3159 <div class="offline-form-handler-footer"> 3160 <div class="offline-form-handler-footer-buttons"> 3161 <button type="button" class="offline-form-handler-footer-button -cancel"> 3162 Cancel 3163 </button> 3164 <button type="button" class="offline-form-handler-footer-button -proceed"> 3165 Yes, Please 3166 </button> 3167 </div> 3168 </div> 3169 </div> 3170 </div> 3171 `}}}}),pullDownRefresh_exports={};__export(pullDownRefresh_exports,{initPullDownRefresh:()=>initPullDownRefresh});async function initPullDownRefresh(){document.body.style.overscrollBehaviorY="contain",customElements.get("pwa-pull-down-refresh")||customElements.define("pwa-pull-down-refresh",PwaPullDownRefresh),PwaPullDownRefresh.show()}var PwaPullDownRefresh,init_pullDownRefresh=__esm({"frontend/assets/js/dev/modules/pullDownRefresh.js"(){init_frontend(),init_utils(),PwaPullDownRefresh=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set,this.tracking=!1,this.refreshing=!1,this.startY=0,this.currentY=0,this.dragResistance=.4,this.threshold=70}connectedCallback(){this.render(),this.setupEventListeners()}static show(){let pullDownRefresh=document.querySelector("pwa-pull-down-refresh");return pullDownRefresh||(pullDownRefresh=document.createElement("pwa-pull-down-refresh"),document.body.insertAdjacentElement("afterbegin",pullDownRefresh)),pullDownRefresh}injectStyles(css){this.styles.add(css)}setupEventListeners(){document.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!1}),document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this))}handleTouchStart(e){if(window.scrollY!==0)return;const touchY=e.touches[0].pageY;this._touchStartY=touchY;const refreshContainer=this.shadowRoot.querySelector(".pull-down-refresh");refreshContainer.style.transition="none";const currentHeight=refreshContainer.offsetHeight;currentHeight>0?(refreshContainer.style.height=`${currentHeight}px`,this.startY=touchY-currentHeight):this.startY=touchY,this.currentY=this.startY,this.tracking=!0,refreshContainer.style.visibility="visible",refreshContainer.offsetHeight}handleTouchMove(e){if(!this.tracking)return;this.currentY=e.touches[0].pageY;const pullDistance=(this.currentY-this.startY)*this.dragResistance;if(pullDistance>=0){this.currentY-this.startY>10&&e.preventDefault();const refreshContainer=this.shadowRoot.querySelector(".pull-down-refresh"),statusText=this.shadowRoot.querySelector(".pull-down-refresh_text");refreshContainer.style.transition="none",refreshContainer.style.height=`${pullDistance}px`,pullDistance>this.threshold?statusText.textContent=wp.i18n.__("Release to refresh",config.jsVars.slug):statusText.textContent=wp.i18n.__("Pull down to refresh",config.jsVars.slug)}}async handleTouchEnd(){if(!this.tracking)return;this.tracking=!1;const pullDistance=(this.currentY-this.startY)*this.dragResistance,refreshContainer=this.shadowRoot.querySelector(".pull-down-refresh"),statusText=this.shadowRoot.querySelector(".pull-down-refresh_text"),spinner=this.shadowRoot.querySelector(".pull-down-refresh_spinner");refreshContainer.style.transition="height 0.3s cubic-bezier(0.4, 0, 0.2, 1)",pullDistance>this.threshold?(this.refreshing=!0,refreshContainer.style.height="60px",statusText.textContent=wp.i18n.__("Refreshing...",config.jsVars.slug),spinner.style.display="block",location.reload()):this.resetPosition()}resetPosition(){const refreshContainer=this.shadowRoot.querySelector(".pull-down-refresh");refreshContainer.style.transition="height 0.3s cubic-bezier(0.4, 0, 0.2, 1)",refreshContainer.style.height="0",refreshContainer.addEventListener("transitionend",()=>{refreshContainer.style.transition="",refreshContainer.style.visibility="hidden",this.tracking=!1,this.refreshing=!1},{once:!0})}render(){var _a,_b,_c;
3171const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",textColor=getContrastTextColor(themeColor);this.injectStyles(` 3172 :host { 3173 display: block; 3174 width: 100%; 3175 overflow: hidden; 3176 } 3177 3178 .pull-down-refresh { 3179 height: 0; 3180 visibility: hidden; 3181 display: -webkit-box; 3182 display: -ms-flexbox; 3183 display: flex; 3184 -webkit-box-align: center; 3185 -ms-flex-align: center; 3186 align-items: center; 3187 -webkit-box-pack: center; 3188 -ms-flex-pack: center; 3189 justify-content: center; 3190 background-color: ${themeColor}; 3191 color: ${textColor}; 3192 gap: 0.5rem; 3193 overflow: hidden; 3194 will-change: height; 3195 } 3196 3197 .pull-down-refresh_content { 3198 padding: 1rem; 3199 display: -webkit-box; 3200 display: -ms-flexbox; 3201 display: flex; 3202 -webkit-box-align: center; 3203 -ms-flex-align: center; 3204 align-items: center; 3205 -webkit-box-pack: center; 3206 -ms-flex-pack: center; 3207 justify-content: center; 3208 gap: 0.75rem; 3209 min-height: 60px; 3210 } 3211 3212 .pull-down-refresh_spinner { 3213 display: none; 3214 width: 0.75rem; 3215 height: 0.75rem; 3216 border: 0.1875rem solid ${textColor}; 3217 border-top-color: transparent; 3218 border-radius: 9999px; 3219 -webkit-animation: spin 1s linear infinite; 3220 animation: spin 1s linear infinite; 3221 } 3222 3223 .pull-down-refresh_text { 3224 font-size: 0.875rem; 3225 line-height: 1.25rem; 3226 } 3227 3228 @-webkit-keyframes spin { 3229 to { 3230 -webkit-transform: rotate(360deg); 3231 transform: rotate(360deg); 3232 } 3233 } 3234 3235 @keyframes spin { 3236 to { 3237 -webkit-transform: rotate(360deg); 3238 transform: rotate(360deg); 3239 } 3240 } 3241 `);const combinedStyles=Array.from(this.styles).join(` 3242`);this.shadowRoot.innerHTML=` 3243 <style>${combinedStyles}</style> 3244 <div class="pull-down-refresh" role="alert"> 3245 <div class="pull-down-refresh_content"> 3246 <div class="pull-down-refresh_spinner" role="status" aria-label="loading"></div> 3247 <span class="pull-down-refresh_text"> 3248 ${wp.i18n.__("Pull down to refresh",config.jsVars.slug)} 3249 </span> 3250 </div> 3251 </div> 3252 `}}}}),shakeRefresh_exports={};__export(shakeRefresh_exports,{initShakeRefresh:()=>initShakeRefresh});async function initShakeRefresh(){customElements.get("pwa-shake-refresh")||customElements.define("pwa-shake-refresh",PwaShakeRefresh),PwaShakeRefresh.show()}var PwaShakeRefresh,init_shakeRefresh=__esm({"frontend/assets/js/dev/modules/shakeRefresh.js"(){init_frontend(),init_utils(),PwaShakeRefresh=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handleDetectShake()}static show(){let shakeRefresh=document.querySelector("pwa-shake-refresh");return shakeRefresh||(shakeRefresh=document.createElement("pwa-shake-refresh"),document.body.appendChild(shakeRefresh)),shakeRefresh}injectStyles(css){this.styles.add(css)}handleDetectShake(){let x1=0,y1=0,z1=0,x2=0,y2=0,z2=0;window.addEventListener("devicemotion",e=>{x1=e.accelerationIncludingGravity.x,y1=e.accelerationIncludingGravity.y,z1=e.accelerationIncludingGravity.z},!1);const component=this;setInterval(()=>{Math.abs(x1-x2+y1-y2+z1-z2)>16&&(component.shadowRoot.querySelector(".shake-notification").classList.add("visible"),setTimeout(()=>
3252location.reload(),500)),x2=x1,y2=y1,z2=z1},200)}render(){var _a,_b,_c;const backgroundColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.backgroundColor)!=null?_c:"#ffffff",textColor=getContrastTextColor(backgroundColor);this.injectStyles(` 3253 .shake-notification { 3254 position: fixed; 3255 top: 0; 3256 left: 50%; 3257 -webkit-transform: translateX(-50%) translateY(-100%); 3258 -ms-transform: translateX(-50%) translateY(-100%); 3259 transform: translateX(-50%) translateY(-100%); 3260 display: -webkit-box; 3261 display: -ms-flexbox; 3262 display: flex; 3263 -webkit-box-align: center; 3264 -ms-flex-align: center; 3265 align-items: center; 3266 padding: 0.75rem 1rem; 3267 gap: 0.5rem; 3268 width: 30rem; 3269 max-width: 85%; 3270 background-color: ${backgroundColor}; 3271 color: ${textColor}; 3272 border: 1px solid ${textColor}15; 3273 border-radius: 0.75rem; 3274 -webkit-box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 3275 box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 3276 z-index: 9999999999999999; 3277 -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3278 -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3279 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3280 opacity: 0; 3281 } 3282 3283 .shake-notification.visible { 3284 opacity: 1; 3285 -webkit-transform: translateX(-50%) translateY(1rem); 3286 -ms-transform: translateX(-50%) translateY(1rem); 3287 transform: translateX(-50%) translateY(1rem); 3288 } 3289 3290 .shake-notification_spinner { 3291 width: 0.75rem; 3292 height: 0.75rem; 3293 border: 0.1875rem solid ${textColor}; 3294 border-top-color: transparent; 3295 border-radius: 9999px; 3296 -webkit-animation: spin 1s linear infinite; 3297 animation: spin 1s linear infinite; 3298 } 3299 3300 .shake-notification_text { 3301 font-size: 0.875rem; 3302 line-height: 1.25rem; 3303 } 3304 3305 @-webkit-keyframes spin { 3306 to { 3307 -webkit-transform: rotate(360deg); 3308 transform: rotate(360deg); 3309 } 3310 } 3311 3312 @keyframes spin { 3313 to { 3314 -webkit-transform: rotate(360deg); 3315 transform: rotate(360deg); 3316 } 3317 } 3318 `);const combinedStyles=Array.from(this.styles).join(` 3319`);this.shadowRoot.innerHTML=` 3320 <style>${combinedStyles}</style> 3321 <div class="shake-notification" role="alert"> 3322 <div class="shake-notification_spinner" role="status" aria-label="loading"></div> 3323 <span class="shake-notification_text"> 3324 ${wp.i18n.__("Shake detected! Refreshing the page...",config.jsVars.slug)} 3325 </span> 3326 </div> 3327 `}}}}),inactiveBlur_exports={};__export(inactiveBlur_exports,{initInactiveBlur:()=>initInactiveBlur});function toggleBlur(isBlur){var val=isBlur?"blur(3px)":"initial";document.documentElement.style.transition="filter 0.15s ease",document.documentElement.style["-webkit-transition"]="-webkit-filter 0.15s ease",document.documentElement.style["-moz-transition"]="-moz-filter 0.15s ease",document.documentElement.style["-o-transition"]="-o-filter 0.15s ease",document.documentElement.style["-ms-transition"]="-ms-filter 0.15s ease",["filter","-webkit-filter","-moz-filter","-o-filter","-ms-filter"].forEach(function(prop){document.documentElement.style[prop]=val})}async function initInactiveBlur(){["visibilitychange","pageshow","pagehide","focus","blur","resume","freeze"].forEach(function(evt){window.addEventListener(evt,function(e){document.hidden||!document.hasFocus()||e.type==="pagehide"||e.type==="blur"||e.type==="freeze"?toggleBlur(!0):toggleBlur(!1)})})}var init_inactiveBlur=__esm({"frontend/assets/js/dev/modules/inactiveBlur.js"(){}}),autosaveForms_exports={};__export(autosaveForms_exports,{initAutosaveForms:()=>initAutosaveForms});function persist(form){if(formData.has(form))return;load(form);const saveForm=()=>save(form),inputHandler=debounce(()=>save(form),500),saveFormBeforeUnload=()=>{window.removeEventListener("unload",saveForm),saveForm()},submitHandler=()=>{cleanup(form),config.jsVars.settings.appCapabilities.autosaveForms.persistOnSubmit!=="on"&&clearStorage(form)};formData.set(form,{saveForm,inputHandler,saveFormBeforeUnload,submitHandler}),window.addEventListener("beforeunload",saveFormBeforeUnload),window.addEventListener("unload",saveForm),form.addEventListener("input",inputHandler),form.addEventListener("change",inputHandler),form.addEventListener("submit",submitHandler)}function serialize(form){const data={};for(const element of form.elements){if(!element.name||element.disabled)continue;const tag=element.tagName,type=element.type;tag==="INPUT"&&(type==="password"||type==="file")||tag==="INPUT"&&(type==="submit"||type==="button"||type==="reset"||type==="image")||(tag==="INPUT"?type==="radio"?element.checked&&(data[element.name]=element.value):type==="checkbox"?(data[element.name]||(data[element.name]=[]),element.checked&&data[element.name].push(element.value)):data[element.name]=element.value:tag==="TEXTAREA"?data[element.name]=element.value:tag==="SELECT"&&(element.multiple?data[element.name]=Array.from(element.selectedOptions).map(option=>option.value):data[element.name]=element.value))}return data}function save(form){try{const data=serialize(form),key=getStorageKey(form);Object.keys(data).length>0&&(data._timestamp=Date.now(),localStorage.setItem(key,JSON.stringify(data)))}catch(error){console.warn("Failed to save form data:",error)}}function deserialize(form,data){for(const name in data){if(name.startsWith("_"))continue;Array.from(form.elements).filter(element=>element.name===name).forEach(element=>{applyValues(element,data[name])})}}function applyValues(element,value){const tag=element.tagName,type=element.type;try{tag==="INPUT"?type==="radio"?element.checked=element.value===value:type==="checkbox"?Array.isArray(value)?element.checked=value.includes(element.value):element.checked=!!value:element.value=value||"":tag==="TEXTAREA"?element.value=value||"":tag==="SELECT"&&(element.multiple&&Array.isArray(value)?Array.from(element.options).forEac
3327h(option=>{option.selected=value.includes(option.value)}):element.value=value||"")}catch(error){console.warn("Failed to apply value to element:",element,error)}}function load(form){try{const json=localStorage.getItem(getStorageKey(form));if(json){const data=JSON.parse(json);deserialize(form,data)}}catch(error){console.warn("Failed to load form data:",error),clearStorage(form)}}function clearStorage(form){try{localStorage.removeItem(getStorageKey(form))}catch(error){console.warn("Failed to clear form storage:",error)}}function getStorageKey(form){let identifier=form.id;if(!identifier){const formStructure={action:form.action||"",method:form.method||"get",fieldCount:form.elements.length,fieldNames:Array.from(form.elements).filter(el=>el.name).slice(0,5).map(el=>el.name).sort().join(",")};identifier=btoa(JSON.stringify(formStructure)).replace(/[^a-zA-Z0-9]/g,"").substring(0,16)}return`autosave_${window.location.pathname.replace(/[^a-zA-Z0-9]/g,"_")}_${identifier}`}function debounce(func,wait){let timeout;return function(...args){const later=()=>{clearTimeout(timeout),func(...args)};clearTimeout(timeout),timeout=setTimeout(later,wait)}}function cleanup(form){const handlers=formData.get(form);handlers&&(window.removeEventListener("beforeunload",handlers.saveFormBeforeUnload),window.removeEventListener("unload",handlers.saveForm),form.removeEventListener("input",handlers.inputHandler),form.removeEventListener("change",handlers.inputHandler),form.removeEventListener("submit",handlers.submitHandler),formData.delete(form))}function cleanupOldStorage(){try{const now=Date.now(),maxAge=7*24*60*60*1e3;for(let i=localStorage.length-1;i>=0;i--){const key=localStorage.key(i);if(key&&key.startsWith("autosave_"))try{const data=JSON.parse(localStorage.getItem(key));data&&data._timestamp&&now-data._timestamp>maxAge&&localStorage.removeItem(key)}catch{localStorage.removeItem(key)}}}catch(error){console.warn("Failed to cleanup old storage:",error)}}async function initAutosaveForms(){try{Array.from(document.forms).forEach(form=>{persist(form)}),new MutationObserver(mutations=>{mutations.forEach(mutation=>{mutation.addedNodes.forEach(node=>{node.nodeType===Node.ELEMENT_NODE&&(node.tagName==="FORM"&&persist(node),(node.querySelectorAll?node.querySelectorAll("form"):[]).forEach(form=>persist(form)))})})}).observe(document.body,{childList:!0,subtree:!0}),cleanupOldStorage()}catch(error){console.error("Failed to initialize autosave forms:",error)}}var formData,init_autosaveForms=__esm({"frontend/assets/js/dev/modules/autosaveForms.js"(){init_frontend(),formData=new WeakMap}}),vibrations_exports={};__export(vibrations_exports,{initVibrations:()=>initVibrations});async function initVibrations(){document.addEventListener("touchstart",function(event){if(!(event.target.tagName==="INPUT"||event.target.tagName==="TEXTAREA"||event.target.isContentEditable))try{navigator.vibrate(50)}catch(error){console.error("Error triggering vibration:",error)}},{passive:!0})}var init_vibrations=__esm({"frontend/assets/js/dev/modules/vibrations.js"(){}}),idleDetection_exports={};__export(idleDetection_exports,{initIdleDetection:()=>initIdleDetection});async function initIdleDetection(){customElements.get("pwa-idle-detection")||customElements.define("pwa-idle-detection",PwaIdleDetection);const requestPermission=async()=>{try{if(await IdleDetector.requestPermission()==="granted")try{const controller=new AbortController,idleDetector=new IdleDetector;idleDetector.addEventListener("change",()=>{idleDetector.userState==="idle"?PwaIdleDetection.show():PwaIdleDetection.hide()}),await idleDetector.start({threshold:config.jsVars.settings.appCapabilities.idleDetection.threshold*6e4,signal:controller.signal})}catch(error){console.error("Error initializing idle detector:",error)}else console.log("Idle detection permission not granted.")}catch(error){console.error("Error requesting idle detection permission:",error)}document.removeEventListener("click",requestPermission)};document.addEventListener("click",requestPermission)}var PwaIdleDetection,init_idleDetection=__esm({"frontend/assets/js/dev/modules/idleDetection.js"(){init_frontend(),init_utils(),PwaIdleDetection=class _PwaIdleDetection extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.styles=new Set}connectedCallback(){this.render(),this.handlePageReload()}static show(){let idleDetection=document.querySelector("pwa-idle-detection");return idleDetection||(idleDetection=document.createElement("pwa-idle-detection"),document.body.appendChild(idleDetection)),requestAnimationFrame(()=>{idleDetection.shadowRoot.querySelector(".idle-notification").classList.add("visible")}),idleDetection}static hide(){const idleDetection=document.querySelector("pwa-idle-detection");if(idleDetection){const idleNotification=idleDetection.shadowRoot.querySelector(".idle-notification");idleNotification.classList.remove("visible"),idleNotification.addEventListener("transitionend",()=>{idleDetection.remove()},{once:!0})}}injectStyles(css){this.styles.add(css)}handlePageReload(){this.shadowRoot.querySelector(".idle-notification").querySelector(".idle-notification-button_reload").addEventListener("click",()=>{_PwaIdleDetection.hide(),location.reload()})}render(){var _a,_b,_c;
3327const themeColor=(_c=(_b=(_a=config.jsVars.settings.webAppManifest)==null?void 0:_a.appearance)==null?void 0:_b.themeColor)!=null?_c:"#000000",backgroundColor=getContrastTextColor(themeColor),textColor=getContrastTextColor(backgroundColor);this.injectStyles(` 3328 .idle-notification { 3329 position: fixed; 3330 top: 0; 3331 left: 50%; 3332 -webkit-transform: translateX(-50%) translateY(-100%); 3333 -ms-transform: translateX(-50%) translateY(-100%); 3334 transform: translateX(-50%) translateY(-100%); 3335 display: -webkit-box; 3336 display: -ms-flexbox; 3337 display: flex; 3338 -webkit-box-align: center; 3339 -ms-flex-align: center; 3340 align-items: center; 3341 justify-content: space-between; 3342 padding: 0.75rem 1rem; 3343 gap: 1rem; 3344 width: 30rem; 3345 max-width: 85%; 3346 background-color: ${backgroundColor}; 3347 color: ${textColor}; 3348 border: 1px solid ${textColor}15; 3349 border-radius: 0.75rem; 3350 -webkit-box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 3351 box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 3352 z-index: 9999999999999999; 3353 -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3354 -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3355 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3356 opacity: 0; 3357 } 3358 3359 .idle-notification.visible { 3360 opacity: 1; 3361 -webkit-transform: translateX(-50%) translateY(1rem); 3362 -ms-transform: translateX(-50%) translateY(1rem); 3363 transform: translateX(-50%) translateY(1rem); 3364 } 3365 3366 .idle-notification_icon { 3367 display: inline-block; 3368 flex-shrink: 0; 3369 width: 1.5rem; 3370 height: 1.5rem; 3371 color: ${textColor}; 3372 } 3373 3374 .idle-notification_texts { 3375 display: -webkit-box; 3376 display: -ms-flexbox; 3377 display: flex; 3378 -webkit-box-align: center; 3379 -ms-flex-align: center; 3380 align-items: center; 3381 gap: 0.325rem; 3382 } 3383 3384 .idle-notification_text { 3385 font-size: 0.875rem; 3386 line-height: 1.25rem; 3387 } 3388 3389 .idle-notification-button_reload { 3390 display: inline-block; 3391 background-color: ${textColor}; 3392 color: ${backgroundColor}; 3393 vertical-align: middle; 3394 text-decoration: none; 3395 font-size: 0.75rem; 3396 line-height: 1rem; 3397 font-weight: 500; 3398 padding: 0.375rem 0.875rem; 3399 border: none; 3400 outline: none; 3401 border-radius: 9999px; 3402 cursor: pointer; 3403 } 3404 3405 .idle-notification-button_reload:hover { 3406 opacity: 0.8; 3407 } 3408 `);const combinedStyles=Array.from(this.styles).join(` 3409`);this.shadowRoot.innerHTML=` 3410 <style>${combinedStyles}</style> 3411 <div class="idle-notification" role="alert" tabindex="-1"> 3412 <div class="idle-notification_texts"> 3413 <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor" class="idle-notification_icon"><path d="m520-496 120 120q11 11 11 28t-11 28q-11 11-28 11t-28-11L452-452q-6-6-9-13.5t-3-15.5v-159q0-17 11.5-28.5T480-680q17 0 28.5 11.5T520-640v144Zm90-264q-21 0-35.5-14.5T560-810q0-21 14.5-35.5T610-860q21 0 35.5 14.5T660-810q0 21-14.5 35.5T610-760Zm0 660q-21 0-35.5-14.5T560-150q0-21 14.5-35.5T610-200q21 0 35.5 14.5T660-150q0 21-14.5 35.5T610-100Zm160-520q-2
34131 0-35.5-14.5T720-670q0-21 14.5-35.5T770-720q21 0 35.5 14.5T820-670q0 21-14.5 35.5T770-620Zm0 380q-21 0-35.5-14.5T720-290q0-21 14.5-35.5T770-340q21 0 35.5 14.5T820-290q0 21-14.5 35.5T770-240Zm60-190q-21 0-35.5-14.5T780-480q0-21 14.5-35.5T830-530q21 0 35.5 14.5T880-480q0 21-14.5 35.5T830-430ZM80-480q0-157 104.5-270T441-878q16-2 27.5 9.5T480-840q0 16-10.5 28T443-798q-121 14-202 104t-81 214q0 125 81 214.5T443-162q16 2 26.5 14t10.5 28q0 17-11.5 28.5T441-82Q288-97 184-210T80-480Z"/></svg> 3414 <span class="idle-notification_text"> 3415 ${wp.i18n.__("You've been idle for a while.",config.jsVars.slug)} 3416 </span> 3417 </div> 3418 <button type="button" class="idle-notification-button_reload">Reload Page</button> 3419 </div> 3420 `}}}}),screenWakeLock_exports={};__export(screenWakeLock_exports,{initScreenWakeLock:()=>initScreenWakeLock});async function initScreenWakeLock(){let wakeLock=null;const requestWakeLock=async()=>{try{wakeLock=await navigator.wakeLock.request("screen"),wakeLock.addEventListener("release",()=>{wakeLock=null})}catch(error){console.error("Error requesting screen wake lock:",error)}},handleVisibilityChange=async()=>{document.visibilityState==="visible"&&await requestWakeLock()};await requestWakeLock(),document.addEventListener("visibilitychange",handleVisibilityChange),document.addEventListener("fullscreenchange",handleVisibilityChange)}var init_screenWakeLock=__esm({"frontend/assets/js/dev/modules/screenWakeLock.js"(){}}),config,settings,userData,pluginsData,pageData,init_frontend=__esm({"frontend/assets/js/dev/frontend.js"(){init_utils(),init_pushNotificationsSubscription(),config=(()=>{const optionName="daftplug_progressify",jsVars=window[optionName+"_frontend_js_vars"]||{};return{optionName,jsVars}})(),{settings,userData,pluginsData,pageData}=config.jsVars,document.addEventListener("DOMContentLoaded",async function(){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q,_r,_s,_t,_u,_v,_w,_x,_y,_z,_A,_B,_C,_D,_E,_F,_G,_H,_I,_J,_K,_L,_M,_N,_O,_P,_Q,_R,_S,_T,_U,_V,_W,_X,_Y,_Z,__,_$,_aa,_ba,_ca,_da,_ea,_fa,_ga,_ha,_ia,_ja,_ka,_la,_ma,_na,_oa,_pa,_qa,_ra,_sa,_ta,_ua,_va,_wa,_xa,_ya,_za,_Aa,_Ba,_Ca,_Da,_Ea,_Fa,_Ga,_Ha,_Ia,_Ja,_Ka,_La,_Ma,_Na,_Oa,_Pa,_Qa,_Ra,_Sa,_Ta,_Ua,_Va,_Wa,_Xa,_Ya,_Za,__a,_$a,_ab,_bb,_cb,_db,_eb,_fb,_gb,_hb,_ib,_jb,_kb,_lb,_mb,_nb,_ob,_pb,_qb,_rb,_sb,_tb,_ub,_vb;if(isPwa()){const{initPwaTracker:initPwaTracker2}=await Promise.resolve().then(()=>(init_pwaTracker(),pwaTracker_exports));if(await initPwaTracker2(),((_b=(_a=settings?.uiComponents)==null?void 0:_a.pwaCustomCssAndJs)==null?void 0:_b.feature)==="on"){const{initPwaCustomCssAndJs:initPwaCustomCssAndJs2}=await Promise.resolve().then(()=>(init_pwaCustomCssAndJs(),pwaCustomCssAndJs_exports));await initPwaCustomCssAndJs2()}}if(!isPwa()&&((_d=(_c=settings?.installation)==null?void 0:_c.prompts)==null?void 0:_d.feature)==="on"){const{initInstallUrl:initInstallUrl2}=await Promise.resolve().then(()=>(init_installUrl(),installUrl_exports));await initInstallUrl2();const{initInstallButton:initInstallButton2}=await Promise.resolve().then(()=>(init_installButton(),installButton_exports));if(await initInstallButton2(),((_f=(_e=settings?.installation)==null?void 0:_e.prompts)==null?void 0:_f.skipFirstVisit)!=="on"||isReturningVisitor()){if(((_j=(_i=(_h=(_g=settings?.installation)==null?void 0:_g.prompts)==null?void 0:_h.types)==null?void 0:_i.headerBanner)==null?void 0:_j.feature)==="on"&&!getCookie("pwa_header_banner_overlay_shown")){const{initInstallOverlayHeaderBanner:initInstallOverlayHeaderBanner2}=await Promise.resolve().then(()=>(init_installOverlayHeaderBanner(),installOverlayHeaderBanner_exports));await initInstallOverlayHeaderBanner2(),setCookie("pwa_header_banner_overlay_shown","true",(_m=(_l=(_k=settings?.installation)==null?void 0:_k.prompts)==null?void 0:_l.timeout)!=null?_m:1)}if(((_q=(_p=(_o=(_n=settings?.installation)==null?void 0:_n.prompts)==null?void 0:_o.types)==null?void 0:_p.snackbar)==null?void 0:_q.feature)==="on"&&((_r=userData?.device)!=null&&_r.isSmartphone||(_s=userData?.device)!=null&&_s.isTablet)&&!getCookie("pwa_snackbar_overlay_shown")){const{initInstallOverlaySnackbar:initInstallOverlaySnackbar2}=await Promise.resolve().then(()=>
3420(init_installOverlaySnackbar(),installOverlaySnackbar_exports));await initInstallOverlaySnackbar2(),setCookie("pwa_snackbar_overlay_shown","true",(_v=(_u=(_t=settings?.installation)==null?void 0:_t.prompts)==null?void 0:_u.timeout)!=null?_v:1)}if(((_z=(_y=(_x=(_w=settings?.installation)==null?void 0:_w.prompts)==null?void 0:_x.types)==null?void 0:_y.blogPopup)==null?void 0:_z.feature)==="on"&&((_A=pageData?.type)!=null&&_A.isBlogPost)&&((_B=userData?.device)!=null&&_B.isSmartphone||(_C=userData?.device)!=null&&_C.isTablet)&&!getCookie("pwa_blog_popup_overlay_shown")){const{initInstallOverlayBlogPopup:initInstallOverlayBlogPopup2}=await Promise.resolve().then(()=>(init_installOverlayBlogPopup(),installOverlayBlogPopup_exports));await initInstallOverlayBlogPopup2(),setCookie("pwa_blog_popup_overlay_shown","true",(_F=(_E=(_D=settings?.installation)==null?void 0:_D.prompts)==null?void 0:_E.timeout)!=null?_F:1)}if(((_J=(_I=(_H=(_G=settings?.installation)==null?void 0:_G.prompts)==null?void 0:_H.types)==null?void 0:_I.navigationMenu)==null?void 0:_J.feature)==="on"&&((_K=userData?.device)!=null&&_K.isSmartphone||(_L=userData?.device)!=null&&_L.isTablet)){const{initInstallOverlayNavigationMenu:initInstallOverlayNavigationMenu2}=await Promise.resolve().then(()=>(init_installOverlayNavigationMenu(),installOverlayNavigationMenu_exports));await initInstallOverlayNavigationMenu2()}if(((_P=(_O=(_N=(_M=settings?.installation)==null?void 0:_M.prompts)==null?void 0:_N.types)==null?void 0:_O.inFeed)==null?void 0:_P.feature)==="on"&&((_Q=userData?.device)!=null&&_Q.isSmartphone||(_R=userData?.device)!=null&&_R.isTablet)){const{initInstallOverlayInFeed:initInstallOverlayInFeed2}=await Promise.resolve().then(()=>(init_installOverlayInFeed(),installOverlayInFeed_exports));await initInstallOverlayInFeed2()}if(((_V=(_U=(_T=(_S=settings?.installation)==null?void 0:_S.prompts)==null?void 0:_T.types)==null?void 0:_U.woocommerceCheckout)==null?void 0:_V.feature)==="on"&&((_W=pluginsData?.isActive)!=null&&_W.woocommerce)&&document.body.classList.contains("woocommerce-checkout")&&((_X=userData?.device)!=null&&_X.isSmartphone||(_Y=userData?.device)!=null&&_Y.isTablet)){const{initInstallOverlayWoocommerceCheckout:initInstallOverlayWoocommerceCheckout2}=await Promise.resolve().then(()=>(init_installOverlayWoocommerceCheckout(),installOverlayWoocommerceCheckout_exports));await initInstallOverlayWoocommerceCheckout2()}}}if(((__=(_Z=settings?.appCapabilities)==null?void 0:_Z.smoothPageTransitions)==null?void 0:__.feature)==="off"&&((_aa=(_$=settings?.uiComponents)==null?void 0:_$.pageLoader)==null?void 0:_aa.feature)==="on"&&((_ca=(_ba=settings?.uiComponents)==null?void 0:_ba.pageLoader)!=null&&_ca.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initPageLoader:initPageLoader2}=await Promise.resolve().then(()=>(init_pageLoader(),pageLoader_exports));await initPageLoader2()}if(((_ea=(_da=settings?.webAppManifest)==null?void 0:_da.displaySettings)==null?void 0:_ea.orientationLock)==="on"){const{initOrientationLock:initOrientationLock2}=await Promise.resolve().then(()=>(init_orientationLock(),orientationLock_exports));await initOrientationLock2()}if(((_ga=(_fa=settings?.uiComponents)==null?void 0:_fa.toastMessages)==null?void 0:_ga.feature)==="on"&&((_ia=(_ha=settings?.uiComponents)==null?void 0:_ha.toastMessages)!=null&&_ia.supportedDevices.some(supported=>{var _a2,_b2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)}))){const{initToastMessages:initToastMessages2}=await Promise.resolve().then(()=>(init_toastMessages(),toastMessages_exports));await initToastMessages2()}if(((_ka=(_ja=settings?.uiComponents)==null?void 0:_ja.navigationTabBar)==null?void 0:_ka.feature)==="on"&&((_ma=(_la=settings?.uiComponents)==null?void 0:_la.navigationTabBar)!=null&&_ma.navigationItems.some(item=>item.icon&&item.label&&item.page))&&((_oa=(_na=settings?.uiComponents)==null?void 0:_na.navigationTabBar)!=null&&_oa.supportedDevices.some(supported=>{var _a2,_b2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)}))){const{initNavigationTabBar:initNavigationTabBar2}=await Promise.resolve().then(()=>
3420(init_navigationTabBar(),navigationTabBar_exports));await initNavigationTabBar2()}if(((_qa=(_pa=settings?.uiComponents)==null?void 0:_pa.scrollProgressBar)==null?void 0:_qa.feature)==="on"&&((_sa=(_ra=settings?.uiComponents)==null?void 0:_ra.scrollProgressBar)!=null&&_sa.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initScrollProgressBar:initScrollProgressBar2}=await Promise.resolve().then(()=>(init_scrollProgressBar(),scrollProgressBar_exports));await initScrollProgressBar2()}if(((_ua=(_ta=settings?.uiComponents)==null?void 0:_ta.darkMode)==null?void 0:_ua.feature)==="on"&&((_wa=(_va=settings?.uiComponents)==null?void 0:_va.darkMode)!=null&&_wa.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initDarkMode:initDarkMode2}=await Promise.resolve().then(()=>(init_darkMode(),darkMode_exports));await initDarkMode2()}if(((_ya=(_xa=settings?.uiComponents)==null?void 0:_xa.shareButton)==null?void 0:_ya.feature)==="on"&&navigator.share&&((_Aa=(_za=settings?.uiComponents)==null?void 0:_za.shareButton)!=null&&_Aa.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initShareButton:initShareButton2}=await Promise.resolve().then(()=>(init_shareButton(),shareButton_exports));await initShareButton2()}if(((_Ca=(_Ba=settings?.appCapabilities)==null?void 0:_Ba.smoothPageTransitions)==null?void 0:_Ca.feature)==="on"&&((_Ea=(_Da=settings?.appCapabilities)==null?void 0:_Da.smoothPageTransitions)!=null&&_Ea.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initSmoothPageTransitions:initSmoothPageTransitions2}=await Promise.resolve().then(()=>(init_smoothPageTransitions(),smoothPageTransitions_exports));await initSmoothPageTransitions2()}if(((_Ga=(_Fa=settings?.pushNotifications)==null?void 0:_Fa.prompt)==null?void 0:_Ga.feature)==="on"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&!["subscribed","blocked"].includes(await pushNotificationsSubscription_default.getSubscriptionState())&&!getCookie("pwa_push_notifications_prompt_shown")&&(((_Ia=(_Ha=settings?.pushNotifications)==null?void 0:_Ha.prompt)==null?void 0:_Ia.skipFirstVisit)!=="on"||isReturningVisitor())){const{initPushNotificationsPrompt:initPushNotificationsPrompt2}=await Promise.resolve().then(()=>(init_pushNotificationsPrompt(),pushNotificationsPrompt_exports));await initPushNotificationsPrompt2(),setCookie("pwa_push_notifications_prompt_shown","true",(_La=(_Ka=(_Ja=settings?.pushNotifications)==null?void 0:_Ja.prompt)==null?void 0:_Ka.timeout)!=null?_La:1)}if(((_Na=(_Ma=settings?.pushNotifications)==null?void 0:_Ma.button)==null?void 0:_Na.feature)==="on"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&await pushNotificationsSubscription_default.getSubscriptionState()!=="blocked"&&(await pushNotificationsSubscription_default.getSubscriptionState()!=="subscribed"||((_Pa=(_Oa=settings?.pushNotifications)==null?void 0:_Oa.button)==null?void 0:_Pa.behavior)==="shown")){const{initPushNotificationsButton:initPushNotificationsButton2}=await Promise.resolve().then(()=>(init_pushNotificationsButton(),pushNotificationsButton_exports));await initPushNotificationsButton2()}if(((_Ra=(_Qa=settings?.offlineUsage)==null?void 0:_Qa.capabilities)==null?void 0:_Ra.feature)==="on"){if(((_Ua=(_Ta=(_Sa=settings?.offlineUsage)==null?void 0:_Sa.capabilities)==null?void 0:_Ta.notification)==null?void 0:_Ua.feature)==="on"){const{initOfflineNotification:initOfflineNotification2}=await Promise.resolve().then(()=>(init_offlineNotification(),offlineNotification_exports));await initOfflineNotification2()}if(((_Xa=(_Wa=(_Va=settings?.offlineUsage)==null?void 0:_Va.capabilities)==null?void 0:_Wa.forms)==null?void 0:_Xa.feature)==="on"){const{initOfflineForms:initOfflineForms2}=await Promise.resolve().then(()=>(init_offlineForms(),offlineForms_exports));await initOfflineForms2()}}if(((_Za=(_Ya=settings?.uiComponents)==null?void 0:_Ya.pullDownRefresh)==null?void 0:_Za.feature)==="on"&&((_$a=(__a=settings?.uiComponents)==null?void 0:__a.pullDownRefresh)!=null&&_$a.supportedDevices.some(supported=>{var _a2,_b2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)}))){const{initPullDownRefresh:initPullDownRefresh2}=await Promise.resolve().then(()=>(init_pullDownRefresh(),pullDownRefresh_exports));await initPullDownRefresh2()}if(((_bb=(_ab=settings?.uiComponents)==null?void 0:_ab.shakeRefresh)==null?void 0:_bb.feature)==="on"&&"DeviceMotionEvent"in window&&((_db=(_cb=settings?.uiComponents)==null?void 0:_cb.shakeRefresh)!=null&&_db.supportedDevices.some(supported=>{var _a2,_b2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)}))){const{initShakeRefresh:initShakeRefresh2}=await Promise.resolve().then(()=>(init_shakeRefresh(),shakeRefresh_exports));await initShakeRefresh2()}if(((_fb=(_eb=settings?.uiComponents)==null?void 0:_eb.inactiveBlur)==null?void 0:_fb.feature)==="on"&&((_hb=(_gb=settings?.uiComponents)==null?void 0:_gb.inactiveBlur)!=null&&_hb.supportedDevices.some(supported=>{var _a2,_b2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)}))){const{initInactiveBlur:initInactiveBlur2}=await Promise.resolve().then(()=>
3420(init_inactiveBlur(),inactiveBlur_exports));await initInactiveBlur2()}if(((_jb=(_ib=settings?.appCapabilities)==null?void 0:_ib.autosaveForms)==null?void 0:_jb.feature)==="on"){const{initAutosaveForms:initAutosaveForms2}=await Promise.resolve().then(()=>(init_autosaveForms(),autosaveForms_exports));await initAutosaveForms2()}if(((_lb=(_kb=settings?.appCapabilities)==null?void 0:_kb.vibrations)==null?void 0:_lb.feature)==="on"&&navigator.vibrate&&((_nb=(_mb=settings?.appCapabilities)==null?void 0:_mb.vibrations)!=null&&_nb.supportedDevices.some(supported=>{var _a2,_b2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)}))){const{initVibrations:initVibrations2}=await Promise.resolve().then(()=>(init_vibrations(),vibrations_exports));await initVibrations2()}if(((_pb=(_ob=settings?.appCapabilities)==null?void 0:_ob.idleDetection)==null?void 0:_pb.feature)==="on"&&"IdleDetector"in window&&((_rb=(_qb=settings?.appCapabilities)==null?void 0:_qb.idleDetection)!=null&&_rb.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initIdleDetection:initIdleDetection2}=await Promise.resolve().then(()=>(init_idleDetection(),idleDetection_exports));await initIdleDetection2()}if(((_tb=(_sb=settings?.appCapabilities)==null?void 0:_sb.screenWakeLock)==null?void 0:_tb.feature)==="on"&&navigator.wakeLock&&((_vb=(_ub=settings?.appCapabilities)==null?void 0:_ub.screenWakeLock)!=null&&_vb.supportedDevices.some(supported=>{var _a2,_b2,_c2;return supported==="smartphone"&&((_a2=userData?.device)==null?void 0:_a2.isSmartphone)||supported==="tablet"&&((_b2=userData?.device)==null?void 0:_b2.isTablet)||supported==="desktop"&&((_c2=userData?.device)==null?void 0:_c2.isDesktop)}))){const{initScreenWakeLock:initScreenWakeLock2}=await Promise.resolve().then(()=>(init_screenWakeLock(),screenWakeLock_exports));await initScreenWakeLock2()}})}});init_frontend()})();
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.