!function(){"use strict";var e;async function t(t,n){const r=function(e,t){return e+t},o=function(e,t){return e(t)},i=function(e,t){return e===t};if(typeof window==="undefined"||!window.location||!window.fetch)return e.INVALID_ENVIRONMENT;const s=window.location.href;let a=n;a.endsWith("/")&&(a=a.slice(0,-1));let c;try{const e=new URL(r(a,"/accessControl/domain")),n=new URLSearchParams({id:t,url:s});e.search=n.toString(),c=e.toString()}catch(t){return e.TRANSMISSION_RETRY}try{const t=await o(fetch,c);return t.ok?e.SUCCESS:403===t.status||i(t.status,400)?e.UNAUTHORIZED:t.status>=500?e.TRANSMISSION_RETRY:e.UNAUTHORIZED}catch(t){return e.TRANSMISSION_RETRY}}!function(e){const t="UNAUTHORIZED",n="TRANSMISSION_RETRY",r="INVALID_ENVIRONMENT";e.SUCCESS="SUCCESS",e.UNAUTHORIZED=t,e.TRANSMISSION_RETRY=n,e.INVALID_ENVIRONMENT=r}(e||(e={}));const n=e=>new Promise(t=>setTimeout(t,e)),r="https://api.easepop.dev";const o="https://api.easepop.dev";function i(e,t){const n=new URL(window.location.href);return{popupId:e,domain:n.hostname,subpage:(r=n.pathname,o=n.search,r+o+n.hash),userAgent:navigator.userAgent,userId:t};var r,o}class s{popup;popupManager;constructor(e,t){this.popup=e,this.popupManager=t}isPopupTriggerAllowed(){return!this.popupManager.isViewingDisabled()&&(!!this.isPopupPathAllowed(this.popup)&&(!!this.isTargetingAllowed(this.popup)&&!!this.isPopupAllowedToReappear(this.popup)))}isPopupPathAllowed(e){const t=e.config.paths.domains.filter(t=>t.domainId===e.domainId);if(t.length===0)return!1;const n=t[0];return!n.showOnSpecificPages||n.paths.some(e=>{let t;if(e.endsWith("/*")){t="^"+e.slice(0,-2).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"/.*"}else t="^"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$";return new RegExp(t,"i").test(window.location.pathname)})}isPopupAllowedToReappear(e){const t=e.config.trigger.reappearance;return"once-per-page"===t?!this.popupManager.hasPopupBeenShownOnCurrentPage(e.popupId):"once-per-session"!==t||!this.popupManager.hasPopupBeenShownInCurrentSession(e.popupId)}isTargetingAllowed(e){const t=e.config.targeting,n=this.detectDevice();if(!t.devices.includes(n))return!1;const r=this.popupManager.getIsNewVisitor();return!("new"===t.visitorType&&!r)&&(t.visitorType!=="recurring"||!r)}detectDevice(){const e="tablet",t="mobile",n=navigator.userAgent,r=/iPad|Android(?!.*Mobile)/i.test(n),o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(n);return r?e:o?t:"desktop"}}class a extends s{timerId;constructor(e,t){if("page-load"!==e.config.trigger.type)throw new Error("PageLoadTrigger can only be used with pageLoad trigger type");super(e,t)}addTrigger(){if(this.timerId)return;const e=this.popup.config.trigger;this.timerId=setTimeout(()=>{this.isPopupTriggerAllowed()&&(this.popupManager.triggerPopup(this.popup),this.removeTrigger())},1e3*e.delay)}removeTrigger(){var e,t;this.timerId&&(e=clearTimeout,t=this.timerId,e(t),this.timerId=void 0)}}class c extends s{listener;constructor(e,t){const n="scroll-percentage";if(function(e,t){return e!==t}(e.config.trigger.type,n))throw new Error("ScrollPercentageTrigger can only be used with scroll percentage trigger type");super(e,t)}addTrigger(){const e=function(e,t){return e*t},t=function(e,t){return e/t},n="scroll";if(this.listener)return;const r=this.popup.config.trigger;this.listener=(()=>{const n=window.pageYOffset||document.documentElement.scrollTop,o=document.documentElement.scrollHeight-document.documentElement.clientHeight;if(e(t(n,o),100)>=r.percentage){if(!this.isPopupTriggerAllowed())return;this.popupManager.triggerPopup(this.popup),this.removeTrigger()}}).bind(this),window.addEventListener(n,this.listener,{passive:!0})}removeTrigger(){this.listener&&(window.removeEventListener("scroll",this.listener),this.listener=void 0)}}class l extends s{assignedElements=new Set;mutationObserver=void 0;handleClick=this.handleClickMethod.bind(this);constructor(e,t){if("element-click"!==e.config.trigger.type)throw new Error("ElementClickTrigger can only be used with element click trigger type");super(e,t)}handleClickMethod(){this.isPopupTriggerAllowed()&&this.popupManager.triggerPopup(this.popup)}addTrigger(){const e="click";if(this.assignedElements.size>0)return;const t=this.popup.config.trigger;t.selector&&(document.querySelectorAll(t.selector).forEach(t=>{!this.assignedElements.has(t)&&(t.addEventListener(e,this.handleClick),this.assignedElements.add(t))}),this.mutationObserver=new MutationObserver(async e=>{const n="click",r=function(e,t){return e===t},o=function(e,t){return e instanceof t};e.forEach(e=>{if("childList"===e.type){for(const t of e.removedNodes)t instanceof HTMLElement&&this.assignedElements.has(t)&&(t.removeEventListener(n,this.handleClick),this.assignedElements.delete(t));for(const r of e.addedNodes)if(r instanceof HTMLElement){r.querySelectorAll(t.selector).forEach(e=>{!this.assignedElements.has(e)&&(e.addEventListener("click",this.handleClick),this.assignedElements.add(e))}),r.matches(t.selector)&&!this.assignedElements.has(r)&&(r.addEventListener(n,this.handleClick),this.assignedElements.add(r))}}r(e.type,"attributes")&&(o(e.target,HTMLElement)&&this.assignedElements.has(e.target)&&!e.target.matches(t.selector)&&(e.target.removeEventListener(n,this.handleClick),this.assignedElements.delete(e.target)),o(e.target,HTMLElement)&&e.target.matches(t.selector)&&!this.assignedElements.has(e.target)&&(e.target.addEventListener("click",this.handleClick),this.assignedElements.add(e.target)))})}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","id"]}))}removeTrigger(){if(0!==this.assignedElements.size){for(const e of this.assignedElements)e.removeEventListener("click",this.handleClick);this.assignedElements.clear(),this.mutationObserver?.disconnect(),this.mutationObserver=void 0}}}class u extends s{boundScrollListener=this.scrollListener.bind(this);constructor(e,t){var n="exit-intent",r="ExitIntentTrigger can only be used with exit intent trigger type";if(e.config.trigger.type!==n)throw new Error(r);super(e,t)}scrollListener(e){if(e.clientY<=0){if(!this.isPopupTriggerAllowed())return;this.popupManager.triggerPopup(this.popup),this.removeTrigger()}}addTrigger(){document.addEventListener("mouseleave",this.boundScrollListener)}removeTrigger(){document.removeEventListener("mouseleave",this.boundScrollListener)}}var d={popups:{modal:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",display:"flex",flexDirection:"column",gap:"8px",backgroundColor:"white",borderRadius:"12px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1)",position:"relative",zIndex:2,minWidth:"300px"},banner:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"8px",backgroundColor:"white",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",position:"absolute",left:0,right:0,zIndex:2,width:"100%",minHeight:"60px"},side:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",display:"flex",flexDirection:"column",gap:"8px",backgroundColor:"white",boxShadow:"0 8px 24px rgba(0,0,0,0.15)",position:"absolute",top:0,bottom:0,width:"340px",zIndex:2,minHeight:"100vh"},corner:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",display:"flex",flexDirection:"column",gap:"8px",backgroundColor:"white",borderRadius:"12px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)",position:"absolute",zIndex:2,width:"280px",maxWidth:"280px"}},screenOverlay:{modal:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},other:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},elements:{button:{borderTop:"none",borderLeft:"none",borderBottom:"none",borderRight:"none",borderRadius:"6px",cursor:"pointer",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",transition:"all 0.15s ease",whiteSpace:"pre",width:"100%"},text:{margin:0,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",whiteSpace:"pre",width:"100%",height:"auto"},input:{borderTop:"none",borderLeft:"none",borderBottom:"none",borderRight:"none",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",boxSizing:"border-box",transition:"all 0.15s ease",width:"100%"},media:{overflow:"hidden",display:"block",objectFit:"contain"},container:{display:"grid",width:"100%",overflow:"hidden"},countdown:{width:"100%",lineHeight:"1.4"},countdownCard:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#f3f4f6",textAlign:"center"},countdownCardLabel:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",textAlign:"center",marginTop:"4px",opacity:"0.7",letterSpacing:"0.5px"},countdownCardsContainer:{display:"flex",gap:"8px",alignItems:"center"},countdownCardWrapper:{display:"flex",flexDirection:"column",alignItems:"center"},countdownCardFlip:{position:"relative",perspective:"1000px"},countdownCardFlipInner:{position:"relative",width:"100%",height:"100%",transformStyle:"preserve-3d",transition:"transform 0.65s cubic-bezier(0.4, 0.0, 0.2, 1)"},countdownCardFlipFace:{position:"absolute",width:"100%",height:"100%",backfaceVisibility:"hidden",display:"flex",alignItems:"center",justifyContent:"center",WebkitBackfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},countdownCardFlipBack:{transform:"rotateX(180deg)"},countdownCardRotate:{position:"relative"},countdownCardRotateInner:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},countdownCardRotateContainer:{position:"absolute",width:"100%",height:"200%"},countdownCardRotateNumber:{position:"absolute",width:"100%",height:"50%",display:"flex",alignItems:"center",justifyContent:"center"},wrapperElement:{display:"flex",flexDirection:"row",width:"100%"}}};function p(e){const t=function(e,t,n){return e(t,n)},n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!n)return null;const[,r,o,i]=n,s=t(parseInt,r,10),a=parseInt(o,10),c=t(parseInt,i,10);return[s,a,c].some(e=>Number.isNaN(e))?null:{r:s,g:a,b:c}}function h(e,t){const n="url(",r=function(e,t){return e>=t},o="rgb",i=function(e,t){return e(t)};if(!e)return;const s=e.trim();if(""===s||"transparent"===s||s.startsWith(n))return e;const a=function(e){const t=function(e,t){return e>t};return"number"!=typeof e||Number.isNaN(e)?1:e<0?0:t(e,1)?1:e}(t);if(r(a,1))return e;if(s.startsWith("#")){const t=function(e){const t=function(e,t){return e!==t},n=function(e,t){return e!==t},r=function(e,t,n){return e(t,n)},o=e.replace("#","");if(t(o.length,3)&&n(o.length,6))return null;const i=3===o.length?o.split("").map(e=>""+e+e).join(""):o,s=r(parseInt,i.substring(0,2),16),a=r(parseInt,i.substring(2,4),16),c=parseInt(i.substring(4,6),16);return[s,a,c].some(e=>Number.isNaN(e))?null:{r:s,g:a,b:c}}(s);return t?"rgba("+t.r+", "+t.g+", "+t.b+", "+a+")":e}if(s.startsWith(o)){const t=i(p,s);return t?"rgba("+t.r+", "+t.g+", "+t.b+", "+a+")":e}return e}function f(e,t,n){const r="url",o="no-repeat",i=function(e,t){return e===t},s="none";t&&(t.trim().startsWith(r)?(e.backgroundImage=t,e.backgroundSize="cover",e.backgroundRepeat=o,e.backgroundPosition="center"):e.backgroundColor=h(t,n),i(t,"transparent")&&(e.boxShadow=s))}function m(e,t){const n="bottom",r="left",o="right";if(t&&t.width>0){const i=t.lineStyle||"solid",s=t.width+"px "+i+" "+t.color;switch(t.style){case"top":e.borderTop=s;break;case n:e.borderBottom=s;break;case r:e.borderLeft=s;break;case o:e.borderRight=s;break;case"top-bottom":e.borderTop=s,e.borderBottom=s;break;case"left-right":e.borderLeft=s,e.borderRight=s;break;default:e.borderTop=s,e.borderRight=s,e.borderBottom=s,e.borderLeft=s}}}function g(e,t){const n="center",r=function(e,t){return e===t},o="right";t&&(function(e,t){return e===t}(t,n)?e.textAlign=n:r(t,o)?e.textAlign="right":e.textAlign="left")}function y(e,t){const n="italic",r="normal",o="bold",i="underline";Array.isArray(t)&&(t.includes(n)?e.fontStyle=n:e.fontStyle=r,t.includes("bold")?e.fontWeight=o:e.fontWeight="normal",t.includes(i)&&(e.textDecoration=e.textDecoration?e.textDecoration+" underline":"underline"))}function b(e,t){t&&(e.fontFamily=t)}function x(e,t){t&&(e.width=t)}function w(){const e="banner",t="top",n=function(e,t){return e===t},r="flex-end",o="top-left",i="20px",s=function(e,t){return e===t},a="bottom-right",c=function(e,t){return e===t},l="auto",u=function(e,t){return e===t},p="center",h="right",w=function(e,t,n){return e(t,n)},v=function(e,t,n){return e(t,n)},C=function(e,t,n){return e(t,n)},E=function(e,t){return e<=t},k="80px",S=function(e,t){return e===t},I="start",A=function(e,t){return e!==t},T="100%",P=function(e,t,n){return e(t,n)},L=function(e,t){return e*t},F=function(e,t){return e*t},R=function(e,t,n){return e(t,n)},M=function(e,t){return e*t},N=function(e,t){return e===t},D="flex-start",O=function(e,t,n){return e(t,n)},j=function(e,t,n){return e(t,n)},z=function(e,t,n,r){return e(t,n,r)},q=d;return{popup:(c,l)=>{let u={};switch(c.type){case"modal":u={...q.popups.modal};break;case e:u={...q.popups.banner},c.location===t?u.top=0:u.bottom=0,"justify"in c&&(n(c.justify,"center")?u.justifyContent="center":"end"===c.justify?u.justifyContent=r:u.justifyContent="flex-start");break;case"side":u={...q.popups.side},"left"===c.location?(u.left=0,u.right=void 0):(u.right=0,u.left=void 0);break;case"corner":u={...q.popups.corner},c.location===o?(u.top=i,u.left="20px"):"top-right"===c.location?(u.top="20px",u.right=i):"bottom-left"===c.location?(u.bottom=i,u.left=i):s(c.location,a)&&(u.bottom="20px",u.right=i);break;default:u={...q.popups.modal}}if(u.padding=l.padding+"px",f(u,l.backgroundColor,l.backgroundOpacity),"modal"===c.type||"side"===c.type||"corner"===c.type){const e=Math.max(100,Math.min(1600,l.preferredWidthPx||560)),t=Math.max(40,Math.min(100,l.fluidWidthPercent||92));u.width="min("+e+"px, "+t+"vw)"}return u},modalGrayoutOverlay:e=>c(e.type,"modal")||"overlayEnabled"in e&&e.overlayEnabled?q.screenOverlay.modal:q.screenOverlay.other,wrapperElement:e=>{const t={...q.elements.wrapperElement};return t.width=l,t.minWidth=0,u(e.justify,p)?{...t,justifyContent:"center"}:s(e.justify,h)?{...t,justifyContent:r}:{...t,justifyContent:"flex-start"}},textElement:e=>{const t={...q.elements.text,fontSize:e.size+"px",color:e.color,borderRadius:e.border.radius+"px",padding:e.padding+"px"};return f(t,e.backgroundColor,e.backgroundOpacity),g(t,e.align),w(y,t,e.style),m(t,e.border),w(b,t,e.fontFamily),(n=t).whiteSpace="pre-wrap",n.wordWrap="break-word",t;var n},buttonElement:e=>{const t={...q.elements.button,color:e.color,fontSize:e.size+"px",borderRadius:e.border.radius+"px",padding:e.padding+"px"};return f(t,e.backgroundColor,e.backgroundOpacity),m(t,e.border),w(g,t,e.align),v(y,t,e.style),w(b,t,e.fontFamily),x(t,e.width),String(e.backgroundColor).trim().startsWith("url")&&e.backgroundImageAutoHeight&&(t.height=void 0,t.lineHeight="0",t.padding="0"),t},inputElement:e=>{const t={...q.elements.input,color:e.color,fontSize:e.size+"px",borderRadius:e.border.radius+"px",padding:e.padding+"px"};return f(t,e.backgroundColor,e.backgroundOpacity),m(t,e.border),g(t,e.align),y(t,e.style),b(t,e.fontFamily),w(x,t,e.width),t},mediaElement:e=>{const t={...q.elements.media,borderRadius:e.border.radius+"px",padding:e.padding+"px"};return v(x,t,e.width),C(m,t,e.border),t},containerElement:(e,t=!1)=>{const n=function(e,t){return E(e,t)},r=e.elements.every(e=>void 0===e),o={...q.elements.container,borderRadius:e.border.radius+"px",gap:e.gap+"px",height:r?k:"auto"};S(e.justification,"center")?o.alignItems="center":"end"===e.justification?o.alignItems="end":o.alignItems=I;const i=e.columnWidths.reduce((e,t)=>e+t.width,0),s=e.columnWidths.map(e=>{if(n(e.width,0))return null;return(i>0?e.width/i:0)+"fr"}).filter(Boolean).join(" ");if(o.gridTemplateColumns=s,t)if(e.width&&A(e.width,T))o.width=e.width,o.maxWidth=e.width,o.flexShrink="0",o.flexGrow="0",o.flexBasis="auto";else{const e="2|0|1|4|3".split("|");let t=0;for(;;){switch(e[t++]){case"0":o.maxWidth="100%";continue;case"1":o.flexGrow="1";continue;case"2":o.width="100%";continue;case"3":o.flexBasis="0";continue;case"4":o.flexShrink="1";continue}break}}return P(m,o,e.border),f(o,e.backgroundColor,e.backgroundOpacity),o},countdownElement:e=>{const t={...q.elements.countdown,fontSize:e.size+"px",color:e.color,borderRadius:e.border.radius+"px"};return f(t,e.backgroundColor,e.backgroundOpacity),m(t,e.border),P(g,t,e.align),y(t,e.style),b(t,e.fontFamily),t},countdownCard:(e,t=!0)=>{const n=Math.max(L(e.size,2),40)+Math.max(.8*e.size,16),r={...q.elements.countdownCard,color:e.color,fontSize:e.size+"px",borderRadius:(e.border.radius??8)+"px",width:Math.max(F(e.size,2.5),50)+"px",height:n+"px"};return f(r,e.backgroundColor,e.backgroundOpacity),m(r,e.border),y(r,e.style),R(b,r,e.fontFamily),r},countdownCardLabel:e=>{const t={...q.elements.countdownCardLabel,fontSize:Math.max(10,M(e.size,.6))+"px",color:e.border.color,width:Math.max(50,M(e.size,2.5))+"px"};return y(t,e.style),b(t,e.fontFamily),t},countdownCardsContainer:e=>({...q.elements.countdownCardsContainer,justifyContent:N(e.align,"center")?"center":e.align===h?r:D}),countdownCardWrapper:()=>({...q.elements.countdownCardWrapper}),countdownCardFlip:(e,t=!0)=>{const n=Math.max(2*e.size,40)+Math.max(.8*e.size,16),r={...q.elements.countdownCard,...q.elements.countdownCardFlip,color:e.color,fontSize:e.size+"px",borderRadius:(e.border.radius??8)+"px",width:Math.max(2.5*e.size,50)+"px",height:n+"px"};return f(r,e.backgroundColor,e.backgroundOpacity),m(r,e.border),y(r,e.style),b(r,e.fontFamily),r},countdownCardFlipInner:()=>({...q.elements.countdownCardFlipInner}),countdownCardFlipFace:e=>{const t={...q.elements.countdownCardFlipFace};return e&&(O(y,t,e.style),j(b,t,e.fontFamily)),t},countdownCardFlipBack:()=>({...q.elements.countdownCardFlipBack}),countdownCardRotate:(e,t=!0)=>{const n=Math.max(M(e.size,2),40)+Math.max(.8*e.size,16),r={...q.elements.countdownCard,...q.elements.countdownCardRotate,color:e.color,fontSize:e.size+"px",borderRadius:(e.border.radius??8)+"px",width:Math.max(2.5*e.size,50)+"px",height:n+"px"};return z(f,r,e.backgroundColor,e.backgroundOpacity),m(r,e.border),C(y,r,e.style),C(b,r,e.fontFamily),r},countdownCardRotateInner:()=>({...q.elements.countdownCardRotateInner}),countdownCardRotateContainer:()=>({...q.elements.countdownCardRotateContainer}),countdownCardRotateNumber:e=>{const t={...q.elements.countdownCardRotateNumber};return e&&(w(y,t,e.style),v(b,t,e.fontFamily)),t}}}class v{popupManager;overlay;activeIntervals=new Set;activeTimeouts=new Set;constructor(e){this.popupManager=e}isLeapYear(e){const t=function(e,t){return e!==t},n=function(e,t){return e===t},r=function(e,t){return e%t};return function(e,t){return e===t}(function(e,t){return e%t}(e,4),0)&&t(e%100,0)||n(r(e,400),0)}getDaysInMonth(e,t){return 2===e?this.isLeapYear(t)?29:28:[4,6,9,11].includes(e)?30:31}dispatchInputEvents(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}getAsteriskPosition(e,t=!1){const n=e.border?.width||0,r=e.border?.radius||0;if(t)return{top:"-8px",right:"-10px"};const o=4+n+(r>0?Math.min(r*.3,4):0);return{top:n+(r>0?Math.min(.2*r,3):0)+"px",right:o+"px"}}getRequiredPaddingRight(e){const t=function(e,t){return e+t},n=function(e,t){return e+t},r=function(e,t){return e*t},o=e.border?.width||0,i=e.border?.radius||0,s=t(n(4,.3*o),i>0?Math.min(.3*i,4):0),a=r(e.size,.7)+s;return Math.max(a,14,e.padding??0)}createAsterisk(e,t,n={}){const r="span",o="none",i=document.createElement(r);i.textContent="*",i.style.position="absolute";const s=this.getAsteriskPosition(e,n.isCheckbox);i.style.top=s.top,i.style.right=s.right,i.style.pointerEvents=o,i.style.color=e.color,i.style.fontSize=e.size+"px",i.style.fontFamily=e.fontFamily,n.zIndex&&(i.style.zIndex=n.zIndex),t.appendChild(i)}createRatingAsterisk(e,t,n){const r="none",o=function(e,t){return e*t},i="-1px",s=function(e,t){return e+t},a="flex",c="center",l="inline-block",u=document.createElement("span");u.textContent="*",u.style.pointerEvents=r,u.style.color=e.border.color,u.style.fontSize=(n?Math.max(16,e.size):Math.max(14,o(e.size,.8)))+"px",u.style.fontFamily=e.fontFamily,u.style.marginLeft=i,u.style.transform="translateY(-"+s(5,e.size*(n?.25:.2))+"px)",n?(u.style.display=a,u.style.alignItems=c,u.style.alignSelf=c):(u.style.display=l,u.style.verticalAlign="middle",u.style.height="100%"),t.appendChild(u)}formatCountdownValue(e){return e.toString().padStart(2,"0")}clearActiveIntervals(){const e=function(e,t){return e(t)};this.activeIntervals.forEach(t=>{e(clearInterval,t)}),this.activeIntervals.clear(),this.activeTimeouts.forEach(t=>{e(clearTimeout,t)}),this.activeTimeouts.clear()}renderFrame(e,t){const n=this.renderFramePopup(e,t),r=this.frameNeedsOverlay(e),o=this.overlay&&this.overlay.parentNode;if(r&&!o){this.overlay&&this.overlay.remove();const n=this.createOverlay(e,t);n&&(this.overlay=n,document.body.appendChild(n))}else!r&&o&&(this.overlay.remove(),this.overlay=void 0);return document.body.appendChild(n),this.applyEntryAnimation(e,n),n}frameNeedsOverlay(e){if("modal"===e.selectedType)return!0;const t=e.configurations[e.selectedType];return!(!t||!("overlayEnabled"in t))&&!0===t.overlayEnabled}createOverlay(e,t){const n=function(e,t,n){return e(t,n)},r="div",o="9998",i="click",s=function(e,t){return e(t)},a=document.createElement(r);return Object.assign(a.style,w().modalGrayoutOverlay(e.configurations[e.selectedType])),a.style.opacity="0",a.style.transition="opacity 0.3s ease",a.style.zIndex=o,a.style.position="fixed",a.addEventListener(i,()=>this.popupManager.hidePopup(t)),s(requestAnimationFrame,()=>{n(setTimeout,()=>{a.style.opacity="1"},10)}),a}applyEntryAnimation(e,t){const n="opacity 0.3s ease",r="opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",o="modal",i=this.getAnimationType(e);t.style.opacity="0";const s=t.style.transform||"";switch(i){case"fade-in":t.style.transition=n;break;case"zoom-in":t.style.transform=(s+" scale(0.8)").trim(),t.style.transition=r;break;case"slide-in":{const n=this.getSlideDirection(e);e.selectedType===o?t.style.transform="translate(-50%, -50%) translate"+n.axis+"("+n.distance+")":t.style.transform=(s+" translate"+n.axis+"("+n.distance+")").trim(),t.style.transition="opacity 0.3s ease, transform 0.3s ease";break}}requestAnimationFrame(()=>{const n=function(e,t){return e===t},r="zoom-in",o="modal";setTimeout(()=>{t.style.opacity="1",n(i,r)?t.style.transform=s:"slide-in"===i&&(e.selectedType===o?t.style.transform="translate(-50%, -50%)":t.style.transform=s)},10)})}applyExitAnimation(e,t,n){const r=function(e){return e()},o="fade-in",i="opacity 0.25s ease",s="zoom-in",a=this.getAnimationType(t);this.overlay&&(this.overlay.style.transition="opacity 0.25s ease",this.overlay.style.opacity="0");const c=n.style.transform||"";switch(a){case o:n.style.transition=i,n.style.opacity="0";break;case s:n.style.transition="opacity 0.25s ease, transform 0.25s cubic-bezier(0.55, 0.055, 0.675, 0.19)",n.style.opacity="0",n.style.transform=(c+" scale(0.8)").trim();break;case"slide-in":{const e=this.getSlideDirection(t);n.style.transition="opacity 0.25s ease, transform 0.25s ease",n.style.opacity="0","modal"===t.selectedType?n.style.transform="translate(-50%, -50%) translate"+e.axis+"("+e.distance+")":n.style.transform=(c+" translate"+e.axis+"("+e.distance+")").trim();break}}setTimeout(()=>{this.overlay&&(this.overlay.remove(),this.overlay=void 0),n.remove(),this.clearActiveIntervals(),r(e)},250)}applyTransitionAnimation(e,t,n){const r=function(e){return e()},o=function(e,t){return e===t},i="zoom-in",s=this.getAnimationType(t);if(n.style.transition="opacity 0.2s ease, transform 0.2s ease",n.style.opacity="0",o(s,i)){const e=n.style.transform||"";n.style.transform=(e+" scale(0.95)").trim()}setTimeout(()=>{n.remove(),this.clearActiveIntervals(),r(e)},200)}getAnimationType(e){const t="banner",n="side",r="corner",o="fade-in";switch(e.selectedType){case"modal":return e.configurations.modal.animation;case t:return e.configurations.banner.animation;case n:return e.configurations.side.animation;case r:return e.configurations.corner.animation;default:return o}}getSlideDirection(e){const t="banner",n="top",r="-100%",o="side",i="left",s="corner",a="100%",c="20px";switch(e.selectedType){case t:return{axis:"Y",distance:(e.configurations.banner?.location||"top")===n?r:"100%"};case o:return{axis:"X",distance:(e.configurations.side?.location||"right")===i?"-100%":"100%"};case s:return(e.configurations.corner?.location||"bottom-right").includes("left")?{axis:"X",distance:"-100%"}:{axis:"X",distance:a};default:return{axis:"Y",distance:c}}}renderFramePopup(e,t){const n=function(e){return e()},r=function(e,t){return e===t},o="banner",i=function(e,t){return e in t},s="justify",a="span",c="flex",l="0px",u="13px",d=' EasePop';if(0===e.elements.length)return document.createElement("div");const p=document.createElement("div");Object.assign(p.style,n(w).popup(e.configurations[e.selectedType],e)),p.style.zIndex="9999",p.style.overflow="visible",this.processPopupPosition(e,p);const h=e.configurations[e.selectedType],f=r(h.type,o)&&i(s,h)&&"even-space"===h.justify;if([...e.elements].sort((e,t)=>e.order-t.order).forEach(n=>{const r=this.createElement(n,t,e);r&&(f&&(r.style.flex="1"),p.appendChild(r))}),t.branding){const e=document.createElement(a);e.style.position="absolute",e.style.display=c,e.style.alignItems="center",e.style.gap="4px",e.style.bottom=l,e.style.right="2px",e.style.fontSize=u,e.style.color="#000",e.textContent="Created using",e.innerHTML+=d,p.appendChild(e)}return p}processPopupPosition(e,t){const n=function(e,t){return e===t},r="50%",o="top",i="20px";if(t.style.position="fixed",n(e.selectedType,"modal"))t.style.top=r,t.style.left="50%",t.style.transform="translate(-50%, -50%)";else if(n(e.selectedType,"corner")){const n=e.configurations.corner.location;n.includes(o)?t.style.top="20px":t.style.bottom="20px",n.includes("left")?t.style.left="20px":t.style.right=i}}createElement(e,t,n){const r=function(e,t){return e===t},o="justify",i=function(e,t){return e===t},s="media",a="spacer",c=function(e,t){return e===t},l="banner",u=function(e,t){return e!==t},d=function(e,t){return e!==t},p="auto",h=n.configurations[n.selectedType],f=r(h.type,"banner")&&o in h&&i(h.justify,"even-space");let m=null;switch(e.type){case"text":m=this.createTextElement(e.config,t,n,f);break;case"button":m=this.createButtonElement(e.config,t,n,f);break;case"input":m=this.createInputElement(e.config,f);break;case s:m=this.createMediaElement(e.config,f);break;case"countdown":m=this.createCountdownElement(e.config,f);break;case"container":m=this.createContainerElement(e.config,t,n,f);break;case"vertical-container":m=this.createVerticalContainerElement(e.config,t,n);break;case a:m=this.createSpacerElement(e.config,n);break;default:m=null}return c(n.selectedType,l)&&m&&u(e.type,a)&&d(e.type,"container")&&"vertical-container"!==e.type&&(m.style.width="auto",m.style.minWidth="0",m.style.flexGrow="0",m.style.flexBasis=p),m}createWrapperElement(e){const t=function(e,t){return e===t},n="flex-end",r="auto",o=document.createElement("div");return Object.assign(o.style,w().wrapperElement(e)),"center"===e.justify?o.style.alignItems="center":t(e.justify,"right")?o.style.alignItems=n:t(e.justify,"left")&&(o.style.alignItems="flex-start"),o.style.width=r,o.style.minWidth="0",o}createTextElement(e,t,n,r){const o="0.9",i="link",s="url",a="transparent",c="left",l="inline-block",u=document.createElement("p");e.textParts.forEach(r=>{const d={oEuUF:o};if(r.type===i){const o={text:r.content,action:s,param:r.url,color:e.color,backgroundColor:a,size:e.size,border:{color:"transparent",width:0,radius:0,style:"all",lineStyle:"solid"},align:c,style:[...e.style,"underline"],fontFamily:e.fontFamily,width:"fit-content",justify:"left",padding:0,backgroundImageAutoHeight:!1,advancedActionMode:!1,backgroundOpacity:1},i=document.createElement("button");i.textContent=o.text,i.title=r.url,i.type="button",Object.assign(i.style,w().buttonElement(o)),i.style.display=l,i.style.verticalAlign="baseline",i.style.cursor="pointer",i.style.fontWeight="inherit",i.addEventListener("mouseenter",()=>{i.style.opacity=d.oEuUF}),i.addEventListener("mouseleave",()=>{i.style.opacity="1"}),i.addEventListener("click",()=>{this.popupManager.handleButtonPress(o,t,n)}),u.appendChild(i)}else{const e=document.createTextNode(r.content);u.appendChild(e)}}),Object.assign(u.style,w().textElement(e));const d=this.createWrapperElement({...e,justify:c});return d.style.flexDirection="column",d.style.minWidth="0",r&&(d.style.width="100%"),d.appendChild(u),d}hexToRgb(e){const t=function(e,t,n){return e(t,n)},n=function(e,t,n){return e(t,n)},r=function(e,t){return e+t},o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(o)return{r:parseInt(o[1],16),g:parseInt(o[2],16),b:t(parseInt,o[3],16)};const i=/^#?([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);return i?{r:n(parseInt,r(i[1],i[1]),16),g:parseInt(i[2]+i[2],16),b:parseInt(i[3]+i[3],16)}:null}rgbToHex(e,t,n){const r=e=>{const t=Math.round(Math.max(0,Math.min(255,e))).toString(16);return 1===t.length?"0"+t:t};return"#"+r(e)+r(t)+r(n)}lightenColor(e,t){const n=this.hexToRgb(e);if(!n)return e;const r=Math.min(255,n.r+(255-n.r)*t),o=Math.min(255,n.g+(255-n.g)*t),i=Math.min(255,n.b+(255-n.b)*t);return this.rgbToHex(r,o,i)}darkenColor(e,t){const n=function(e,t){return e-t},r=function(e,t){return e*t},o=this.hexToRgb(e);if(!o)return e;const i=Math.max(0,o.r*n(1,t)),s=Math.max(0,r(o.g,n(1,t))),a=Math.max(0,o.b*(1-t));return this.rgbToHex(i,s,a)}isColorDark(e){const t=function(e,t){return e/t},n=function(e,t){return e*t},r=this.hexToRgb(e);if(!r)return!1;return t(n(.299,r.r)+n(.587,r.g)+.114*r.b,255)<.2}isBackgroundColor(e){const t="url",n="transparent",r=String(e||"").trim();return Boolean(r&&!r.startsWith(t)&&r!==n)}createButtonElement(e,t,n,r){const o=function(e,t){return e(t)},i=function(e,t){return e&&t},s="mouseenter",a="mouseleave",c="100%",l=document.createElement("button"),u=String(e.backgroundColor||"").trim(),d=e.text&&o(String,e.text).trim().length>0,p=u.startsWith("url")&&e.backgroundImageAutoHeight;l.textContent=d||p?e.text:" ",l.title=e.text||"",Object.assign(l.style,w().buttonElement(e)),i(!d,!p)&&(l.style.color="transparent"),l.style.transition="background-color 0.2s ease";const f=this.isBackgroundColor(u),m=u,g=h(m,e.backgroundOpacity)||m;if(f&&this.hexToRgb(u)){const t=this.isColorDark(u),n=t?this.lightenColor(u,.15):this.darkenColor(u,.15),r=t?this.lightenColor(u,.25):this.darkenColor(u,.25),o=h(n,e.backgroundOpacity)||n,i=h(r,e.backgroundOpacity)||r;l.addEventListener("mouseenter",()=>{l.style.backgroundColor=o}),l.addEventListener("mouseleave",()=>{l.style.backgroundColor=g}),l.addEventListener("mousedown",()=>{l.style.backgroundColor=i}),l.addEventListener("mouseup",()=>{l.style.backgroundColor=o})}else l.addEventListener(s,()=>{l.style.opacity="0.9"}),l.addEventListener(a,()=>{l.style.opacity="1"});try{const t=e.backgroundImageAutoHeight;if(u.startsWith("url")&&t){const e=u.match(/^url\((['"]?)(.*?)\1\)$/),t=e&&e[2];if(t){const e=new Image;e.onload=()=>{const t=e.naturalWidth||1,n=e.naturalHeight||1;l.style.aspectRatio=t+" / "+n,l.style.padding="0",l.style.lineHeight="0"},e.src=t}}}catch{}l.addEventListener("click",()=>{this.popupManager.handleButtonPress(e,t,n)});const y=this.createWrapperElement(e);return r&&(y.style.width=c),y.appendChild(l),y}addCustomPlaceholder(e,t,n){const r="right",o="left",i=function(e,t){return e+t},s="0.6",a="ellipsis",c="change",l=function(e){return e()};if(!n.placeholder)return;e.placeholder="";const u=document.createElement("span");u.textContent=n.placeholder,u.style.position="absolute";const d="center"===n.align?"center":n.align===r?r:o,p=n.padding??0,h=p+2,f=i(n.required?this.getRequiredPaddingRight(n):p,2);u.style.left=h+"px",u.style.right=f+"px",u.style.textAlign=d,u.style.display="block";"textarea"===e.tagName.toLowerCase()?u.style.top=n.padding+"px":(u.style.top="50%",u.style.transform="translateY(-50%)"),u.style.pointerEvents="none",u.style.color=n.color,u.style.opacity=s,u.style.fontSize=n.size+"px",u.style.fontFamily=n.fontFamily,u.style.whiteSpace="nowrap",u.style.overflow="hidden",u.style.textOverflow=a,u.style.maxWidth="calc(100% - "+(h+f)+"px)";const m=()=>{const t=e.value&&""!==e.value.trim();u.style.display=t?"none":"block"};e.addEventListener("input",m),e.addEventListener(c,m),l(m),t.appendChild(u)}createDigitInputComponent(e,t){const n="text-decoration-thickness",r="0.5",o="text-decoration-line",i="text-decoration",s=function(e,t){return e(t)},a=function(e,t){return e-t},c=function(e,t,n){return e(t,n)},l="text",u="Backspace",d=function(e,t){return e===t},p="ArrowLeft",h="ArrowRight",f=function(e,t){return e=t},F="relative",R="input",M="div",N="100%",D="center",O="flex-start",j="border-box",z=function(e,t){return e(t)},q=function(e,t){return e*t},H="click",V=document.createElement("div");V.style.position=F,V.style.width=e.width||"100%",V.dataset.digitInputContainer="true";const B=document.createElement(R);B.type="hidden",B.id="epi-"+e.dataKey,B.required=e.required,B.dataset.digitInput="true",V.appendChild(B);const W=document.createElement(M);W.style.display="flex",W.style.alignItems="center",W.style.gap="0",W.style.width=N,W.style.position=F,W.dataset.digitInputWrapper="true";const U=w().inputElement(e),K=e.align===D?D:"right"===e.align?"flex-end":O;Object.assign(W.style,{backgroundColor:U.backgroundColor,borderTop:U.borderTop,borderRight:U.borderRight,borderBottom:U.borderBottom,borderLeft:U.borderLeft,borderRadius:U.borderRadius,width:"100%",padding:e.padding+"px",display:"flex",alignItems:D,justifyContent:K,gap:"2px",cursor:l,boxSizing:j}),e.required&&(W.style.paddingRight=this.getRequiredPaddingRight(e)+"px");const Y=new Array(t.digitCount).fill(""),Z=[],Q={current:0},_=e=>{const t="6|0|5|2|4|1|3".split("|");let i=0;for(;;){switch(t[i++]){case"0":e.style.removeProperty("text-decoration");continue;case"1":e.style.textDecoration="none";continue;case"2":e.style.removeProperty(n);continue;case"3":e.style.opacity=r;continue;case"4":e.style.removeProperty(o);continue;case"5":e.style.removeProperty("text-decoration-color");continue;case"6":e.value="_";continue}break}},X=(e,t)=>{e.value=t,e.style.removeProperty(i),e.style.removeProperty("text-decoration-color"),e.style.removeProperty("text-decoration-thickness"),e.style.removeProperty("text-decoration-line"),e.style.textDecoration="none",e.style.opacity="1"},G=(e,t)=>{""===Y[t]?s(_,e):e.value=Y[t],e.setSelectionRange(0,1)},J=()=>{t.updateHiddenValue(Y,B)},$=n=>{const r=function(e,t,n){return e(t,n)},o=document.createElement("input");o.type="text",o.maxLength=1,o.inputMode=E;const i=(e.digitWidth??Math.ceil(.8*e.size))+"px";return o.style.width=i,o.style.minWidth=i,o.style.maxWidth=i,o.style.textAlign="center",o.style.border="none",o.style.outline=k,o.style.background="transparent",o.style.color=e.color,o.style.fontSize=e.size+"px",o.style.fontFamily=e.fontFamily,o.style.padding="0",o.style.margin="0",o.style.caretColor=e.color,o.style.letterSpacing=S,o.style.textDecoration="none",Array.isArray(e.style)&&(e.style.includes(I)&&(o.style.fontStyle="italic"),e.style.includes(A)&&(o.style.fontWeight="bold")),""===Y[n]?T(_,o):X(o,Y[n]),o.addEventListener("mousedown",e=>{e.preventDefault(),Q.current=n,o.focus(),r(setTimeout,()=>{o.select()},0)}),o.addEventListener("focus",()=>{Q.current=n,s(requestAnimationFrame,()=>{o.select()})}),o.addEventListener("click",e=>{e.preventDefault(),Q.current=n,o.focus(),requestAnimationFrame(()=>{o.select()})}),o.addEventListener("mouseup",e=>{e.preventDefault(),requestAnimationFrame(()=>{o.select()})}),o.addEventListener("select",()=>{(0!==o.selectionStart||o.selectionEnd!==o.value.length)&&s(requestAnimationFrame,()=>{o.select()})}),o.addEventListener("input",e=>{const r=e.target;let i=r.value.replace(/\D/g,"");if(""===i&&r.value.includes("_"))return i="",r.value="_",void r.setSelectionRange(0,1);if(i.length>0){const s=i[i.length-1];if(!t.isValidDigit(s,n,Y))return c(G,r,n),void e.preventDefault();Y[n]=s,X(o,s),J(),Q.current{e.preventDefault();const n=(e.clipboardData||window.clipboardData).getData(l);t.handlePaste(n,Y,Z,X,J,Q)&&J()}),o.addEventListener("keydown",e=>{if(1!==e.key.length||!/[0-9]/.test(e.key)||(o.selectionStart===o.selectionEnd&&o.select(),t.isValidDigit(e.key,n,Y))){if(e.key===u)if(e.preventDefault(),""!==Y[Q.current])Y[Q.current]="",_(o),J(),requestAnimationFrame(()=>{o.setSelectionRange(0,1),o.focus()});else if(Q.current>0)Q.current--,Y[Q.current]="",s(_,Z[Q.current]),Z[Q.current].focus(),requestAnimationFrame(()=>{Z[Q.current].setSelectionRange(0,1)}),J();else{const e="0|2|1|4|5|3".split("|");let n=0;for(;;){switch(e[n++]){case"0":Q.current=a(t.digitCount,1);continue;case"1":s(_,Z[Q.current]);continue;case"2":Y[Q.current]="";continue;case"3":J();continue;case"4":Z[Q.current].focus();continue;case"5":requestAnimationFrame(()=>{Z[Q.current].setSelectionRange(0,1)});continue}break}}else if(d(e.key,p)&&Q.current>0)Q.current--,Z[Q.current].focus(),Z[Q.current].select(),e.preventDefault();else if(e.key===h&&f(Q.current,a(t.digitCount,1)))Q.current++,Z[Q.current].focus(),Z[Q.current].select(),e.preventDefault();else if(m(e.key,"Delete"))if(e.preventDefault(),g(Y[Q.current],""))Y[Q.current]="",_(o),J(),s(requestAnimationFrame,()=>{o.setSelectionRange(0,1),o.focus()});else if(f(Q.current,y(t.digitCount,1))){const e="1|3|4|5|2|0".split("|");let t=0;for(;;){switch(e[t++]){case"0":J();continue;case"1":Q.current++;continue;case"2":b(requestAnimationFrame,()=>{Z[Q.current].setSelectionRange(0,1)});continue;case"3":Y[Q.current]="";continue;case"4":_(Z[Q.current]);continue;case"5":Z[Q.current].focus();continue}break}}else{const e="1|0|4|2|5|3".split("|");let t=0;for(;;){switch(e[t++]){case"0":Y[Q.current]="";continue;case"1":Q.current=0;continue;case"2":Z[Q.current].focus();continue;case"3":x(J);continue;case"4":_(Z[Q.current]);continue;case"5":v(requestAnimationFrame,()=>{Z[Q.current].setSelectionRange(0,1)});continue}break}}}else e.preventDefault()}),o.addEventListener(P,()=>{C(Y[n],"")&&_(o)}),o};for(let n=0;ne.position===n);if(o){const t=document.createElement("span");t.textContent=o.char,t.style.color=e.color,t.style.fontSize=e.size+"px",t.style.fontFamily=e.fontFamily,t.style.padding="0",t.style.margin="0",t.style.userSelect="none",t.style.letterSpacing="normal"," "===o.char&&(t.style.paddingLeft=.3*e.size+"px",t.style.paddingRight=q(e.size,.3)+"px"),t.style.textDecoration=k,Array.isArray(e.style)&&(e.style.includes(I)&&(t.style.fontStyle="italic"),e.style.includes(A)&&(t.style.fontWeight="bold")),W.appendChild(t)}}return W.addEventListener(H,e=>{const n=e.target,r=t.separators.map(e=>e.char);if(C(n,W)||"SPAN"===n.tagName&&r.includes(n.textContent||"")){const e=Y.findIndex(e=>""===e),t=L(e,0)?e:0;Q.current=t,Z[t].focus(),Z[t].select()}}),V.appendChild(W),e.required&&this.createAsterisk(e,V),{container:V,hiddenInput:B}}createInputElement(e,t){const n={wUYZJ:"block",EQHLl:"none",aMZTr:function(e,t){return e+t},dNzNr:function(e,t){return e>=t},kwLIk:function(e,t){return e>=t},xqjUv:"fill",AzGPV:function(e){return e()},bBUPc:"stars",AjcLv:function(e){return e()},BKUhz:function(e,t){return e<=t},iZQMA:function(e,t){return e===t},SSxbI:function(e,t,n){return e(t,n)},MtvkF:function(e,t){return e>=t},ANXtJ:function(e,t){return e<=t},KCOHx:function(e,t){return e+t},nmxib:function(e,t){return e&&t},iDeYg:function(e,t){return e===t},etBEA:function(e,t){return e<=t},waQMv:function(e,t){return e<=t},TYIvK:function(e,t){return e=t},knOzM:"5|1|6|2|4|3|0",BdZif:function(e,t){return e+t},HDBlJ:function(e,t){return e>=t},tWbYj:function(e,t,n){return e(t,n)},uWEkz:function(e,t){return e<=t},NndQU:function(e,t){return e===t},kLfbD:function(e,t){return e<=t},XFTSd:function(e,t){return e+t},pbrZp:function(e,t){return e>=t},HkJPy:function(e,t){return e<=t},rtWLc:function(e,t){return e>=t},ieJmY:function(e,t,n){return e(t,n)},FKyBh:function(e,t){return e<=t},cdFEG:function(e,t){return e(t)},bBCNa:function(e,t){return e||t},WUxHf:"rgb",EEewy:function(e,t){return e(t)},WsudQ:"rgba(0, 0, 0, 0.1)",ktskl:function(e,t,n){return e(t,n)},AeqDO:"transparent",VPhXU:"url(",nBvlR:function(e,t){return e*t},aMbfK:function(e,t){return e-t},VSfol:function(e,t){return e(t)},sZhYz:function(e,t){return e-t},FZYLl:"aria-expanded",iWarS:function(e,t){return e||t},rbosE:"true",qWPxo:"aria-selected",rQeUI:"pointer",nmwEP:function(e,t){return e-t},MyYvy:"mouseenter",sbqyQ:"background-color",KACJi:"ArrowDown",bhPpm:function(e){return e()},VPFSP:function(e,t){return e===t},gfDSc:function(e,t){return e+t},LXnLJ:function(e,t){return e===t},UneIt:function(e,t){return e-t},isURB:"Escape",umlXF:"checkbox",ZFxfp:"flex",FSZje:"relative",YOUPx:"div",dKtrY:"input",qfwtC:"16px",GwRPg:"svg",BvsAB:"0 0 24 24",xEcas:"round",TiLke:"absolute",iVXGN:"0px",NoExO:"http://www.w3.org/2000/svg",NaStT:"vertical",accoZ:"--ep-input-color",NsyLk:"span",ufCGh:"center",tRsam:function(e,t){return e>t},BFqbb:"100%",EkHFN:"number",lsjcf:"width",TqbpM:function(e,t){return e===t},osMNj:"flex-end",BODVY:"4px",QsQzY:"hidden",WlACs:"button",KOHLh:"viewBox",DScMR:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",tbjhO:"stroke-width",TYvas:"stroke-linecap",lOCdI:function(e,t){return e===t},ucPCs:function(e,t){return e+t},MxyPj:function(e,t){return e+t},IVLRh:"italic",eYfKi:"bold",HZZpF:"mouseleave",MfkeN:"date",OCuVP:"time",dbEPm:"combobox",zRrAN:"false",HStdI:"aria-haspopup",eiATc:"aria-label",oInWh:"aria-required",DEnHy:"left",QtCwC:"space-between",RGiVq:"role",mXCAV:"1000",EVbVl:"auto",IaKxo:"0 4px 6px rgba(0, 0, 0, 0.1)",nhOBk:"mousedown",cXuQe:"url"},r=this.createWrapperElement(e);if(e.type===n.umlXF){const t=document.createElement("div");t.style.display=n.ZFxfp,t.style.gap="8px",t.style.position=n.FSZje,t.style.alignItems="center",t.style.marginRight="8px";const o=document.createElement(n.YOUPx);o.style.position="relative";const i=document.createElement(n.dKtrY);i.type="checkbox",i.id="epi-"+e.dataKey,i.required=e.required,i.style.appearance="none",i.style.position="relative",i.style.width=n.qfwtC,i.style.height="16px",i.style.marginTop="4px",i.style.flexShrink="0",i.style.borderRadius=e.border.radius+"px",i.style.border=e.border.width+"px "+(e.border.lineStyle||"solid")+" "+e.border.color,i.style.backgroundColor=h(e.backgroundColor,e.backgroundOpacity)||e.backgroundColor,i.style.cursor="pointer",i.style.padding=Math.max(2,.5*e.border.width)+"px";const s=document.createElementNS("http://www.w3.org/2000/svg",n.GwRPg);s.setAttribute("viewBox",n.BvsAB),s.setAttribute(n.xqjUv,"none"),s.setAttribute("stroke",e.color),s.setAttribute("stroke-width","4"),s.setAttribute("stroke-linecap",n.xEcas),s.setAttribute("stroke-linejoin","round"),s.style.position=n.TiLke,s.style.top="4px",s.style.left=n.iVXGN,s.style.width="16px",s.style.height="16px",s.style.pointerEvents="none",s.style.display="none";const a=document.createElementNS(n.NoExO,"polyline");a.setAttribute("points","20 6 9 17 4 12"),s.appendChild(a),i.addEventListener("change",()=>{s.style.display=i.checked?n.wUYZJ:n.EQHLl}),o.appendChild(i),o.appendChild(s),e.required&&this.createAsterisk(e,o,{isCheckbox:!0,zIndex:"10"}),t.appendChild(o),r.appendChild(t)}else if("text"===e.type&&e.multiline){const t=document.createElement("div");t.style.position=n.FSZje,t.style.width=e.width||"100%";const o=document.createElement("textarea");o.placeholder="",o.required=e.required,o.id="epi-"+e.dataKey,o.rows=3,o.style.resize=n.NaStT,o.style.minHeight="60px",o.style.setProperty(n.accoZ,e.color),Object.assign(o.style,w().inputElement(e)),o.style.width="100%",e.required&&(o.style.paddingRight=this.getRequiredPaddingRight(e)+"px"),t.appendChild(o),this.addCustomPlaceholder(o,t,e),e.required&&this.createAsterisk(e,t),r.appendChild(t)}else if("phone"===e.type){const t=document.createElement("div");t.style.display=n.ZFxfp,t.style.alignItems="stretch",t.style.width=e.width||"100%";const o=w().inputElement(e),i=document.createElement(n.NsyLk);i.style.display=n.ZFxfp,i.style.alignItems=n.ufCGh,i.style.justifyContent="center",Object.assign(i.style,o),i.style.color=e.color,i.style.fontSize=e.size+"px",i.style.fontFamily=e.fontFamily,i.style.paddingRight=Math.max(4,e.padding)+"px",i.style.paddingLeft=Math.max(4,e.padding)+"px",i.style.borderRight=(n.tRsam(e.border.width,2)?e.border.width:2)+"px "+(e.border.lineStyle||"solid")+" "+e.border.color,i.style.borderRadius="0",i.style.borderTopLeftRadius=e.border.radius+"px",i.style.borderBottomLeftRadius=e.border.radius+"px",i.style.borderTopRightRadius="0",i.style.borderBottomRightRadius="0",i.style.width="auto",i.style.flexShrink="0",i.style.flexGrow="0",i.style.minHeight=n.BFqbb;const s=document.createElement(n.NsyLk);s.textContent="+",s.style.marginTop="-2px",i.appendChild(s);const a=document.createElement(n.YOUPx);a.style.position="relative",a.style.flex="1",a.style.minWidth="0";const c=document.createElement(n.dKtrY);c.type=n.EkHFN,c.placeholder="",c.required=e.required,c.id="epi-"+e.dataKey,c.style.setProperty(n.accoZ,e.color),Object.assign(c.style,o),c.style.removeProperty(n.lsjcf),c.style.width="100%",c.style.borderLeft=n.EQHLl,c.style.borderRadius="0",c.style.borderTopLeftRadius="0",c.style.borderBottomLeftRadius="0",c.style.borderTopRightRadius=e.border.radius+"px",c.style.borderBottomRightRadius=e.border.radius+"px";const l=e.padding;c.style.paddingLeft=l+"px",e.required&&(c.style.paddingRight=this.getRequiredPaddingRight(e)+"px"),a.appendChild(c);const u={...e,padding:l};this.addCustomPlaceholder(c,a,u),e.required&&this.createAsterisk(e,a),t.appendChild(i),t.appendChild(a),r.appendChild(t)}else if(n.TqbpM(e.type,"rating")){const t=document.createElement(n.YOUPx);t.style.position="relative",t.style.width="auto",t.style.display=n.ZFxfp,t.style.alignItems=n.ufCGh,t.style.justifyContent=e.justify===n.ufCGh?"center":"right"===e.justify?n.osMNj:"flex-start",t.style.gap=n.BODVY;const o=document.createElement("input");o.type=n.QsQzY,o.id="epi-"+e.dataKey,o.name=e.dataKey,e.required&&o.setAttribute("data-required","true");let i=0,s=0;const a=()=>{c.forEach((t,r)=>{const o=n.aMZTr(r,1),a=n.dNzNr(s,o)||!s&&n.kwLIk(i,o);t.path.setAttribute(n.xqjUv,a?e.color:n.EQHLl),t.path.setAttribute("stroke",e.border.color)})},c=[];if(e.ratingDisplayMode===n.bBUPc){for(let r=1;r<=5;r++){const l=document.createElement("button");l.type=n.WlACs,l.style.background="none",l.style.border="none",l.style.padding="0",l.style.cursor="pointer",l.style.display="flex",l.style.alignItems="center",l.style.justifyContent="center";const u=e.size+24,d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("width",u.toString()),d.setAttribute("height",u.toString()),d.setAttribute(n.KOHLh,"0 0 24 24"),d.setAttribute(n.xqjUv,n.EQHLl),d.style.display="block";const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d",n.DScMR),p.setAttribute(n.xqjUv,"none"),p.setAttribute("stroke",e.border.color),p.setAttribute(n.tbjhO,(e.border.width/2).toString()),p.setAttribute(n.TYvas,n.xEcas),p.setAttribute("stroke-linejoin",n.xEcas),d.appendChild(p),l.appendChild(d),l.addEventListener("mouseenter",()=>{s=r,n.AzGPV(a)}),l.addEventListener("click",()=>{i=r,s=0,o.value=r.toString(),a()}),c.push({svg:d,path:p}),t.appendChild(l)}n.AjcLv(a),e.required&&this.createRatingAsterisk(e,t,!0)}else{const r=n.ktskl(h,e.backgroundColor,e.backgroundOpacity)||e.backgroundColor;for(let s=1;s<=5;s++){const a=document.createElement(n.WlACs);a.type="button",a.textContent=s.toString(),a.style.color=i===s?e.backgroundColor:e.color,a.style.backgroundColor=n.lOCdI(i,s)?e.color:r,a.style.borderRadius=e.border.radius+"px",a.style.fontFamily=e.fontFamily,a.style.fontSize=e.size+6+"px",a.style.width=e.size+10+"px",a.style.height=n.ucPCs(e.size,10)+"px",a.style.padding=n.MxyPj(Math.max(4,2+e.border.width),e.padding)+n.nBvlR(e.size,.5)+"px",a.style.display=n.ZFxfp,a.style.alignItems="center",a.style.justifyContent=n.ufCGh,a.style.cursor="pointer",a.style.transition="all 0.2s",m(a.style,e.border),Array.isArray(e.style)&&(e.style.includes(n.IVLRh)&&(a.style.fontStyle="italic"),e.style.includes("bold")&&(a.style.fontWeight=n.eYfKi),e.style.includes("underline")&&(a.style.textDecoration=a.style.textDecoration?a.style.textDecoration+" underline":"underline")),a.addEventListener("click",()=>{i=s,o.value=s.toString();for(let n=1;n<=5;n++){const o=t.children[n-1];n===s?(o.style.backgroundColor=e.color,o.style.color=e.backgroundColor):(o.style.backgroundColor=r,o.style.color=e.color)}}),t.appendChild(a)}e.required&&this.createRatingAsterisk(e,t,!1)}t.addEventListener(n.HZZpF,()=>{e.ratingDisplayMode===n.bBUPc&&(s=0,n.AjcLv(a))}),t.appendChild(o),r.appendChild(t)}else if(e.type===n.MfkeN){const{container:t,hiddenInput:o}=this.createDigitInputComponent(e,{digitCount:8,separators:[{position:1,char:"/"},{position:3,char:"/"}],isValidDigit:(e,t,r)=>{if(0===t)return n.BKUhz(parseInt(e,10),3);if(n.iZQMA(t,1)){const t=parseInt(r[0]+e,10);return t>=1&&n.BKUhz(t,31)}if(2===t)return n.SSxbI(parseInt,e,10)<=1;if(3===t){const t=parseInt(r[2]+e,10);return n.MtvkF(t,1)&&n.ANXtJ(t,12)}return!0},updateHiddenValue:(e,t)=>{const r=n.aMZTr(e[0],e[1]),o=e[2]+e[3],i=n.aMZTr(n.aMZTr(n.KCOHx(e[4],e[5]),e[6]),e[7]);if(n.nmxib(r,o)&&i&&2===r.length&&2===o.length&&n.iDeYg(i.length,4)){const e=parseInt(r,10),s=parseInt(o,10),a=parseInt(i,10);if(n.MtvkF(s,1)&&s<=12&&a>=1e3&&a<=9999){const c=this.getDaysInMonth(s,a);if(e>=1&&n.ANXtJ(e,c))return t.value=i+"-"+o.padStart(2,"0")+"-"+r.padStart(2,"0"),void this.dispatchInputEvents(t)}}t.value=""},handlePaste:(e,t,r,o,i,s)=>{const a=e.match(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/);if(a){const e=a[1].padStart(2,"0"),i=a[2].padStart(2,"0"),c=a[3],l=parseInt(e,10),u=parseInt(i,10),d=parseInt(c,10);if(n.kwLIk(u,1)&&n.etBEA(u,12)&&n.MtvkF(d,1e3)&&n.waQMv(d,9999)){const a=this.getDaysInMonth(u,d);if(n.dNzNr(l,1)&&l<=a)return t[0]=e[0],t[1]=e[1],t[2]=i[0],t[3]=i[1],t[4]=c[0],t[5]=c[1],t[6]=c[2],t[7]=c[3],r.forEach((e,n)=>{o(e,t[n])}),n.TYIvK(s.current,7)&&(s.current=7,r[s.current].focus(),r[s.current].select()),!0}}return!1}});r.appendChild(t)}else if(e.type===n.OCuVP){const{container:t}=this.createDigitInputComponent(e,{digitCount:4,separators:[{position:1,char:":"}],isValidDigit:(e,t,n)=>{if(0===t&&parseInt(e,10)>2)return!1;if(1===t&&""!==n[0]){if(parseInt(n[0]+e,10)>23)return!1}return!(2===t&&parseInt(e,10)>5)},updateHiddenValue:(e,t)=>{const r=e[0]+e[1],o=e[2]+e[3];if(r&&o&&2===r.length&&2===o.length){const e=parseInt(r,10),i=parseInt(o,10);e>=0&&n.ayHIJ(e,23)&&i>=0&&n.VcxRh(i,59)?(t.value=r.padStart(2,"0")+":"+o.padStart(2,"0"),this.dispatchInputEvents(t)):t.value=""}else t.value=""},handlePaste:(e,t,r,o,i,s)=>{const a=e.match(/(\d{1,2}):?(\d{2})/);if(a){const e=a[1].padStart(2,"0"),i=a[2].padStart(2,"0"),c=parseInt(e,10),l=parseInt(i,10);if(n.lYNga(c,0)&&c<=23&&n.kwLIk(l,0)&&n.VcxRh(l,59)){const a=n.knOzM.split("|");let c=0;for(;;){switch(a[c++]){case"0":return!0;case"1":t[1]=e[1];continue;case"2":t[3]=i[1];continue;case"3":n.TYIvK(s.current,3)&&(s.current=3,r[s.current].focus(),r[s.current].select());continue;case"4":r.forEach((e,n)=>{o(e,t[n])});continue;case"5":t[0]=e[0];continue;case"6":t[2]=i[0];continue}break}}}return!1}});r.appendChild(t)}else if(n.iDeYg(e.type,"datetime-local")){const{container:t}=this.createDigitInputComponent(e,{digitCount:12,separators:[{position:1,char:"/"},{position:3,char:"/"},{position:7,char:" "},{position:9,char:":"}],isValidDigit:(e,t,r)=>{if(n.iDeYg(t,0))return n.SSxbI(parseInt,e,10)<=3;if(n.iZQMA(t,1)){const t=n.SSxbI(parseInt,n.BdZif(r[0],e),10);return n.HDBlJ(t,1)&&t<=31}if(2===t)return parseInt(e,10)<=1;if(3===t){const t=n.tWbYj(parseInt,r[2]+e,10);return n.dNzNr(t,1)&&n.uWEkz(t,12)}if(n.NndQU(t,8))return parseInt(e,10)<=2;if(9===t){return parseInt(r[8]+e,10)<=23}return!n.iDeYg(t,10)||n.kLfbD(parseInt(e,10),5)},updateHiddenValue:(e,t)=>{const r=n.aMZTr(e[0],e[1]),o=n.BdZif(e[2],e[3]),i=n.BdZif(e[4],e[5])+e[6]+e[7],s=n.XFTSd(e[8],e[9]),a=e[10]+e[11];if(r&&o&&i&&s&&a&&n.iDeYg(r.length,2)&&2===o.length&&4===i.length&&2===s.length&&2===a.length){const e=n.SSxbI(parseInt,r,10),c=parseInt(o,10),l=parseInt(i,10),u=parseInt(s,10),d=n.SSxbI(parseInt,a,10);if(c>=1&&n.VcxRh(c,12)&&n.pbrZp(l,1e3)&&l<=9999&&n.dNzNr(u,0)&&n.HkJPy(u,23)&&d>=0&&d<=59){const u=this.getDaysInMonth(c,l);if(n.rtWLc(e,1)&&n.uWEkz(e,u))return t.value=i+"-"+o.padStart(2,"0")+"-"+r.padStart(2,"0")+"T"+s.padStart(2,"0")+":"+a.padStart(2,"0"),void this.dispatchInputEvents(t)}}t.value=""},handlePaste:(e,t,r,o,i,s)=>{const a=e.match(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})\s+(\d{1,2}):(\d{2})/),c=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);let l,u,d,p,h;if(a)l=a[1].padStart(2,"0"),u=a[2].padStart(2,"0"),d=a[3],p=a[4].padStart(2,"0"),h=a[5].padStart(2,"0");else{if(!c)return!1;{const e="2|0|3|4|1".split("|");let t=0;for(;;){switch(e[t++]){case"0":u=c[2].padStart(2,"0");continue;case"1":h=c[5].padStart(2,"0");continue;case"2":d=c[1];continue;case"3":l=c[3].padStart(2,"0");continue;case"4":p=c[4].padStart(2,"0");continue}break}}}const f=parseInt(l,10),m=n.SSxbI(parseInt,u,10),g=parseInt(d,10),y=n.ieJmY(parseInt,p,10),b=parseInt(h,10);if(m>=1&&n.FKyBh(m,12)&&n.MtvkF(g,1e3)&&g<=9999&&y>=0&&n.kLfbD(y,23)&&b>=0&&n.uWEkz(b,59)){const e=this.getDaysInMonth(m,g);if(f>=1&&f<=e)return t[0]=l[0],t[1]=l[1],t[2]=u[0],t[3]=u[1],t[4]=d[0],t[5]=d[1],t[6]=d[2],t[7]=d[3],t[8]=p[0],t[9]=p[1],t[10]=h[0],t[11]=h[1],r.forEach((e,n)=>{o(e,t[n])}),s.current<11&&(s.current=11,r[s.current].focus(),r[s.current].select()),!0}return!1}});r.appendChild(t)}else if("select"===e.type){const t=document.createElement(n.YOUPx);t.style.position=n.FSZje,t.style.width=e.width||"100%";const o=w().inputElement(e),i=document.createElement("button"),s=n.ktskl(h,e.backgroundColor,e.backgroundOpacity)||e.backgroundColor;i.type=n.WlACs,i.setAttribute("role",n.dbEPm),i.setAttribute("aria-expanded",n.zRrAN),i.setAttribute(n.HStdI,"listbox"),i.setAttribute(n.eiATc,"Select an option"),i.id="epi-"+e.dataKey,i.name=e.dataKey,e.required&&i.setAttribute(n.oInWh,n.rbosE),Object.assign(i.style,o),i.style.width="100%",i.style.cursor="pointer",i.style.textAlign=n.DEnHy,i.style.display=n.ZFxfp,i.style.alignItems="center",i.style.justifyContent=n.QtCwC,e.required&&(i.style.paddingRight=this.getRequiredPaddingRight(e)+"px");const a=document.createElement("span");a.textContent=e.placeholder||"Select an option",a.style.flex="1",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.style.whiteSpace="nowrap",i.appendChild(a);const c=document.createElement("div");c.setAttribute(n.RGiVq,"listbox"),c.id="epi-select-list-"+e.dataKey,c.style.position="absolute",c.style.top="100%",c.style.left="0",c.style.right="0",c.style.zIndex=n.mXCAV,c.style.marginTop="4px",c.style.backgroundColor=s,c.style.border=e.border.width+"px "+(e.border.lineStyle||"solid")+" "+e.border.color,c.style.borderRadius=e.border.radius+"px",c.style.maxHeight="200px",c.style.overflowY=n.EVbVl,c.style.boxShadow=n.IaKxo,c.style.display="none";let l=!1,u=-1,d=!1;const p=document.createElement("input");p.type="hidden",p.id="epi-hidden-"+e.dataKey,p.name=e.dataKey,p.value=e.placeholder||"";const f=(e,t=.15)=>{const r=n.cdFEG(String,n.bBCNa(e,"")).trim();if("transparent"===r||r.startsWith("url("))return"rgba(0, 0, 0, 0.1)";let o=null;if(r.startsWith("#"))o=r;else if(r.startsWith(n.WUxHf)){const e=r.match(/\d+/g);if(e&&n.MtvkF(e.length,3)){const t=parseInt(e[0]),r=n.cdFEG(parseInt,e[1]),i=n.EEewy(parseInt,e[2]);o=this.rgbToHex(t,r,i)}}if(!o)return"rgba(0, 0, 0, 0.1)";if(!this.hexToRgb(o))return n.WsudQ;const i=this.isColorDark(o)?this.lightenColor(o,t):this.darkenColor(o,t),s=this.hexToRgb(i);return s?"rgb("+s.r+", "+s.g+", "+s.b+")":"rgba(0, 0, 0, 0.1)"},m=()=>{const t=f(e.backgroundColor);return n.ktskl(h,t,e.backgroundOpacity)||t},g=(e,t=.15)=>{if(e===n.AeqDO||e.startsWith(n.VPhXU))return n.WsudQ;if(e.startsWith("#")){const r=e.replace("#",""),o=parseInt(r.substring(0,2),16),i=parseInt(r.substring(2,4),16),s=parseInt(r.substring(4,6),16);return"rgb("+Math.max(0,Math.floor(n.nBvlR(o,1-t)))+", "+Math.max(0,Math.floor(i*n.aMbfK(1,t)))+", "+Math.max(0,Math.floor(n.nBvlR(s,1-t)))+")"}if(e.startsWith("rgb")){const r=e.match(/\d+/g);if(r&&r.length>=3){const e=n.VSfol(parseInt,r[0]),o=n.VSfol(parseInt,r[1]),i=parseInt(r[2]);return"rgb("+Math.max(0,Math.floor(e*(1-t)))+", "+Math.max(0,Math.floor(o*(1-t)))+", "+Math.max(0,Math.floor(n.nBvlR(i,n.sZhYz(1,t))))+")"}}return"rgba(0, 0, 0, 0.1)"},y=e=>{a.textContent=e||"Select an option",i.setAttribute(n.FZYLl,"false"),c.style.display="none",l=!1,u=-1,p.value=n.iWarS(e,"")},b=()=>{l=!0,i.setAttribute("aria-expanded",n.rbosE),c.style.display=n.wUYZJ,u=-1},x=()=>{l=!1,i.setAttribute(n.FZYLl,"false"),c.style.display=n.EQHLl,u=-1},v="ep-select-scrollbar-"+e.dataKey;if(!document.getElementById(v)){const t=document.createElement("style");t.id=v;const r=n.ieJmY(g,e.border.color,.2);t.textContent="\n #epi-select-list-"+e.dataKey+"::-webkit-scrollbar {\n width: 8px;\n }\n #epi-select-list-"+e.dataKey+"::-webkit-scrollbar-track {\n background: transparent;\n }\n #epi-select-list-"+e.dataKey+"::-webkit-scrollbar-thumb {\n background: "+e.border.color+";\n border-radius: 4px;\n }\n #epi-select-list-"+e.dataKey+"::-webkit-scrollbar-thumb:hover {\n background: "+r+";\n }\n #epi-select-list-"+e.dataKey+"::-webkit-scrollbar-button {\n display: none;\n }\n #epi-select-list-"+e.dataKey+" {\n scrollbar-width: thin;\n scrollbar-color: "+e.border.color+" transparent;\n }\n ",document.head.appendChild(t)}e.options&&e.options.length>0&&e.options.forEach((t,r)=>{const o="background-color",a="important",p=function(e,t){return e===t},h=document.createElement("div");h.setAttribute("role","option"),h.setAttribute(n.qWPxo,(e.placeholder===t).toString()),h.tabIndex=-1,h.textContent=t,h.style.padding=(e.padding??0)+"px",h.style.cursor=n.rQeUI,h.style.color=e.color,h.style.fontSize=e.size+"px",h.style.fontFamily=e.fontFamily,h.style.backgroundColor=e.placeholder===t?s:"transparent",h.style.transition="background-color 0.15s ease",r{e.stopPropagation(),y(t),i.dispatchEvent(new Event("change",{bubbles:!0}))}),h.addEventListener(n.MyYvy,()=>{if(n.bBCNa(!l,d))return;u=r;Array.from(c.children).forEach((t,n)=>{const i=e.placeholder===t.textContent;n===r?t.style.setProperty(o,m(),a):i?t.style.setProperty(o,s,"important"):t.style.setProperty("background-color","transparent","important")})}),h.addEventListener("mouseleave",()=>{if(!l||d)return;Array.from(c.children).forEach((t,n)=>{const r=p(e.placeholder,t.textContent);p(n,u)?t.style.setProperty("background-color",m(),a):r?t.style.setProperty("background-color",s,"important"):t.style.setProperty(o,"transparent","important")})}),c.appendChild(h)}),i.addEventListener("click",e=>{e.stopPropagation(),l?x():b()}),i.addEventListener("keydown",t=>{const r={ZQkue:function(e,t){return e===t},ahySK:function(e){return n.AzGPV(e)},KqlKj:n.sbqyQ,PJDac:"important"};if(!l&&(n.NndQU(t.key,"Enter")||n.iDeYg(t.key," ")||t.key===n.KACJi||n.iDeYg(t.key,"ArrowUp")))return t.preventDefault(),void n.bhPpm(b);if(l){const o=Array.from(c.children);if("ArrowDown"===t.key||n.VPFSP(t.key,"ArrowUp")){t.preventDefault(),d=!0,setTimeout(()=>{d=!1},100);const i=u;t.key===n.KACJi?u=-1===u?0:u0?u-=1:u=n.nmwEP(o.length,1),o.forEach((t,n)=>{const o=r.ZQkue(e.placeholder,t.textContent);n===u?t.style.setProperty("background-color",r.ahySK(m),"important"):r.ZQkue(n,i)&&i>=0?o?t.style.setProperty("background-color",s,"important"):t.style.setProperty(r.KqlKj,"transparent","important"):o?t.style.setProperty("background-color",s,r.PJDac):t.style.setProperty(r.KqlKj,"transparent","important")})}else if(n.LXnLJ(t.key,"Enter")&&u>=0&&u{l&&!t.contains(e.target)&&n.AzGPV(x)};document.addEventListener(n.nhOBk,C),i.addEventListener("change",()=>{p.value=a.textContent||""}),t.appendChild(i),t.appendChild(c),t.appendChild(p),e.required&&this.createAsterisk(e,t),r.appendChild(t)}else{const t=document.createElement("div");t.style.position="relative",t.style.width=e.width||"100%";const o=document.createElement("input");o.type=e.type===n.cXuQe?"text":e.type,o.placeholder="",o.required=e.required,o.id="epi-"+e.dataKey,o.style.setProperty("--ep-input-color",e.color),Object.assign(o.style,w().inputElement(e)),o.style.width="100%",e.required&&(o.style.paddingRight=this.getRequiredPaddingRight(e)+"px"),t.appendChild(o),this.addCustomPlaceholder(o,t,e),e.required&&this.createAsterisk(e,t),r.appendChild(t)}return t&&(r.style.width="100%"),r}createMediaElement(e,t){const n="img",r="100%",o=document.createElement(n);o.src=e.src,o.alt=e.alt,Object.assign(o.style,w().mediaElement(e));const i=this.createWrapperElement(e);return t&&(i.style.width=r),i.appendChild(o),i}createCountdownElement(e,t){const n=function(e,t){return e===t},r=function(e,t){return e===t},o="NumberRotate",i="00:00:00:00",s=function(e,t){return e*t},a=function(e,t){return e*t},c=function(e,t){return e*t},l=function(e,t){return e/t},u=function(e,t){return e/t},d=function(e,t){return e%t},p=function(e,t){return e*t},h=function(e,t){return e===t},f="CardsFlip",m="div",g=function(e,t){return e*t},y=function(e,t){return e/t},b="transparent",x="column",v=document.createElement(m),C=new Date(e.targetDate),E=new Date,k=C.getTime()-E.getTime();if(k<=0)"Cards"===e.format?this.renderCountdownCards(v,{days:0,hours:0,minutes:0,seconds:0},e):"CardsFlip"===e.format?this.renderCountdownCardsFlip(v,{days:0,hours:0,minutes:0,seconds:0},e):"NumberRotate"===e.format?this.renderCountdownCardsRotate(v,{days:0,hours:0,minutes:0,seconds:0},e):(v.textContent=n(e.format,"Units")?"0d 0h 0m 0s":i,Object.assign(v.style,w().countdownElement(e)));else{const t={days:Math.floor(k/864e5),hours:Math.floor(k%s(36e5,24)/(60*g(1e3,60))),minutes:Math.floor(y(d(k,36e5),6e4)),seconds:Math.floor(l(k%6e4,1e3))};r(e.format,"Cards")?this.renderCountdownCards(v,t,e):e.format===f?this.renderCountdownCardsFlip(v,t,e):e.format===o?this.renderCountdownCardsRotate(v,t,e):this.renderCountdownText(v,t,e)}const S=setInterval(()=>{const t=new Date,m=C.getTime()-t.getTime();if(m<=0)return void(n(e.format,"Cards")?(v.innerHTML="",this.renderCountdownCards(v,{days:0,hours:0,minutes:0,seconds:0},e)):r(e.format,"CardsFlip")?this.updateCountdownCardsFlip(v,{days:0,hours:0,minutes:0,seconds:0},e):n(e.format,o)?this.updateCountdownCardsRotate(v,{days:0,hours:0,minutes:0,seconds:0},e):v.textContent="Units"===e.format?"0d 0h 0m 0s":i);const g={days:Math.floor(m/s(a(c(1e3,60),60),24)),hours:Math.floor(l(m%864e5,36e5)),minutes:Math.floor(m%36e5/s(1e3,60)),seconds:Math.floor(u(d(m,p(1e3,60)),1e3))};h(e.format,"Cards")?(v.innerHTML="",this.renderCountdownCards(v,g,e)):n(e.format,f)?this.updateCountdownCardsFlip(v,g,e):h(e.format,"NumberRotate")?this.updateCountdownCardsRotate(v,g,e):this.renderCountdownText(v,g,e)},1e3);this.activeIntervals.add(S);const I={textParts:[{type:"text",content:""}],size:e.size,color:e.color,border:e.border,align:e.align,style:e.style,fontFamily:e.fontFamily,textWrap:!1,backgroundColor:b,padding:0,justify:e.align},A=this.createWrapperElement(I);return A.style.flexDirection=x,A.style.minWidth="0",t&&(A.style.width="100%"),A.appendChild(v),A}renderCountdownText(e,t,n){const r="Colon",o=function(e,t){return e===t},i="Units",{days:s,hours:a,minutes:c,seconds:l}=t;let u="";if(n.format===r){const e=[];n.units.days&&e.push(s.toString().padStart(2,"0")),n.units.hours&&e.push(a.toString().padStart(2,"0")),n.units.minutes&&e.push(c.toString().padStart(2,"0")),n.units.seconds&&e.push(l.toString().padStart(2,"0")),u=e.join(":")}else if(o(n.format,i)){const e=[];n.units.days&&e.push(s+"d"),n.units.hours&&e.push(a+"h"),n.units.minutes&&e.push(c+"m"),n.units.seconds&&e.push(l+"s"),u=e.join(" ")}else{const e=[];n.units.days&&e.push(s.toString().padStart(2,"0")),n.units.hours&&e.push(a.toString().padStart(2,"0")),n.units.minutes&&e.push(c.toString().padStart(2,"0")),n.units.seconds&&e.push(l.toString().padStart(2,"0")),u=e.join(":")}e.textContent=u,Object.assign(e.style,w().countdownElement(n))}renderCountdownCards(e,t,n){const r="div",o=function(e){return e()},i=function(e){return e()},s="Minutes",{days:a,hours:c,minutes:l,seconds:u}=t,d=n.units,p=n.showLabels,h=document.createElement(r);if(Object.assign(h.style,w().countdownCardsContainer(n)),d.days){const e=document.createElement("div");Object.assign(e.style,o(w).countdownCardWrapper());const t=document.createElement(r);if(t.textContent=this.formatCountdownValue(a),Object.assign(t.style,w().countdownCard(n,p)),e.appendChild(t),p){const t=document.createElement(r);t.textContent="Days",Object.assign(t.style,w().countdownCardLabel(n)),e.appendChild(t)}h.appendChild(e)}if(d.hours){const e=document.createElement("div");Object.assign(e.style,o(w).countdownCardWrapper());const t=document.createElement("div");if(t.textContent=this.formatCountdownValue(c+(d.days?0:24*a)),Object.assign(t.style,w().countdownCard(n,p)),e.appendChild(t),p){const t=document.createElement("div");t.textContent="Hours",Object.assign(t.style,w().countdownCardLabel(n)),e.appendChild(t)}h.appendChild(e)}if(d.minutes){const e=document.createElement("div");Object.assign(e.style,i(w).countdownCardWrapper());const t=document.createElement("div");if(t.textContent=this.formatCountdownValue(l),Object.assign(t.style,w().countdownCard(n,p)),e.appendChild(t),p){const t=document.createElement("div");t.textContent=s,Object.assign(t.style,w().countdownCardLabel(n)),e.appendChild(t)}h.appendChild(e)}if(d.seconds){const e=document.createElement(r);Object.assign(e.style,w().countdownCardWrapper());const t=document.createElement(r);if(t.textContent=this.formatCountdownValue(u),Object.assign(t.style,w().countdownCard(n,p)),e.appendChild(t),p){const t=document.createElement(r);t.textContent="Seconds",Object.assign(t.style,o(w).countdownCardLabel(n)),e.appendChild(t)}h.appendChild(e)}e.appendChild(h)}renderCountdownCardsFlip(e,t,n){const r="div",o=function(e){return e()},i="data-flip-container",s="true",a=function(e){return e()},c="data-front",l=function(e){return e()},u=function(e,t,n){return e(t,n)},d=function(e,t){return e*t},p="Minutes",h="Seconds",{days:f,hours:m,minutes:g,seconds:y}=t,b=n.units,x=n.showLabels,v=document.createElement("div");Object.assign(v.style,w().countdownCardsContainer(n));const C=(e,t)=>{const u=document.createElement(r);Object.assign(u.style,w().countdownCardWrapper());const d=document.createElement("div");Object.assign(d.style,o(w).countdownCardFlip(n,x)),d.setAttribute(i,"true");const p=document.createElement("div");Object.assign(p.style,w().countdownCardFlipInner()),p.setAttribute("data-flip-inner",s),p.setAttribute("data-rotation","0");const h=document.createElement("div");Object.assign(h.style,a(w).countdownCardFlipFace(n)),h.textContent=this.formatCountdownValue(e),h.setAttribute(c,s);const f=document.createElement(r);if(Object.assign(f.style,{...l(w).countdownCardFlipFace(n),...l(w).countdownCardFlipBack()}),f.textContent=this.formatCountdownValue(e),f.setAttribute("data-back","true"),p.appendChild(h),p.appendChild(f),d.appendChild(p),u.appendChild(d),x){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,o(w).countdownCardLabel(n)),u.appendChild(e)}return u};b.days&&v.appendChild(u(C,f,"Days")),b.hours&&v.appendChild(C(m+(b.days?0:d(f,24)),"Hours")),b.minutes&&v.appendChild(C(g,p)),b.seconds&&v.appendChild(C(y,h)),e.appendChild(v)}updateCountdownCardsFlip(e,t,n){const r=function(e,t){return e{const n=e;if(r(t,x.length)){const e=this.formatCountdownValue(x[t]),r=n.querySelector(o),d=n.querySelector(i),p=n.querySelector(s);if(r&&d&&p&&d.textContent!==e){const t=a(parseInt,r.getAttribute(c)||"0",10),n=l(t,180),o=u(setTimeout,()=>{d.textContent=e,p.textContent=e,this.activeTimeouts.delete(o)},250);this.activeTimeouts.add(o),r.style.transform="rotateX("+n+"deg)",r.setAttribute("data-rotation",n.toString())}}})}renderCountdownCardsRotate(e,t,n){const r="div",o="true",i=function(e){return e()},s="data-slide-container",a="data-translate-y",c=function(e){return e()},l=function(e,t,n){return e(t,n)},u=function(e,t){return e+t},d=function(e,t,n){return e(t,n)},p="Seconds",{days:h,hours:f,minutes:m,seconds:g}=t,y=n.units,b=n.showLabels,x=document.createElement("div");Object.assign(x.style,c(w).countdownCardsContainer(n));const v=(e,t)=>{const c=document.createElement(r);Object.assign(c.style,w().countdownCardWrapper());const l=document.createElement(r);Object.assign(l.style,w().countdownCardRotate(n,b)),l.setAttribute("data-rotate-container",o);const u=document.createElement(r);Object.assign(u.style,w().countdownCardRotateInner()),u.setAttribute("data-rotate-inner",o);const d=document.createElement(r);Object.assign(d.style,i(w).countdownCardRotateContainer()),d.setAttribute(s,"true"),d.setAttribute(a,"0");const p=document.createElement(r);Object.assign(p.style,{...i(w).countdownCardRotateNumber(n),top:"0%"}),p.textContent=this.formatCountdownValue(e),p.setAttribute("data-current","true");const h=document.createElement("div");if(Object.assign(h.style,{...i(w).countdownCardRotateNumber(n),top:"50%"}),h.textContent=this.formatCountdownValue(e),h.setAttribute("data-next",o),d.appendChild(p),d.appendChild(h),u.appendChild(d),l.appendChild(u),c.appendChild(l),b){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,w().countdownCardLabel(n)),c.appendChild(e)}return c};y.days&&x.appendChild(v(h,"Days")),y.hours&&x.appendChild(l(v,u(f,y.days?0:24*h),"Hours")),y.minutes&&x.appendChild(d(v,m,"Minutes")),y.seconds&&x.appendChild(d(v,g,p)),e.appendChild(x)}updateCountdownCardsRotate(e,t,n){const r="none",o=function(e,t){return e{const n=e;if(o(t,f.length)){const e=this.formatCountdownValue(f[t]),o=n.querySelector('[data-slide-container="true"]'),a=n.querySelector('[data-current="true"]'),c=n.querySelector('[data-next="true"]');if(o&&a&&c&&a.textContent!==e){c.textContent=e,o.style.transition="transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1)",o.style.transform=i,o.setAttribute(s,"-50");const t=setTimeout(()=>{const n="2|1|0|4|3".split("|");let i=0;for(;;){switch(n[i++]){case"0":o.style.transform="translateY(0%)";continue;case"1":o.style.transition=r;continue;case"2":a.textContent=e;continue;case"3":this.activeTimeouts.delete(t);continue;case"4":o.setAttribute("data-translate-y","0");continue}break}},600);this.activeTimeouts.add(t)}}})}createContainerElement(e,t,n,r){const o="div",i=function(e,t){return e===t},s=document.createElement(o);s.style.display="flex",s.style.alignItems="center",s.style.minWidth="0";const a=document.createElement("div");return Object.assign(a.style,w().containerElement(e,i(n.selectedType,"banner"))),e.elements.forEach(e=>{if(e){const r=this.createElement(e,t,n);r&&a.appendChild(r)}else{const e=document.createElement(o);e.style.minHeight="0",a.appendChild(e)}}),s.appendChild(a),s}createVerticalContainerElement(e,t,n){const r="div",o=function(e,t){return e===t},i="right",s=function(e,t){return e===t},a="80px",c="url",l="cover",u=function(e,t,n){return e(t,n)},d="column",p=document.createElement(r);p.style.display="flex",p.style.width="100%",o(e.justify,"center")?p.style.justifyContent="center":e.justify===i?p.style.justifyContent="flex-end":p.style.justifyContent="flex-start";const f=document.createElement(r);f.style.width=e.width||"100%",f.style.padding=e.padding+"px";const g=e.border??{color:"#000000",width:0,radius:0,style:"all",lineStyle:"solid"};f.style.borderRadius=g.radius+"px",m(f.style,g);s(e.elements.length,0)&&(f.style.minHeight=a);const y=e.backgroundColor.trim();y.startsWith(c)?(f.style.backgroundImage=e.backgroundColor,f.style.backgroundSize=l,f.style.backgroundRepeat="no-repeat",f.style.backgroundPosition="center"):"transparent"!==y&&(f.style.backgroundColor=u(h,e.backgroundColor,e.backgroundOpacity)||e.backgroundColor);const b=document.createElement(r);b.style.display="flex",b.style.flexDirection=d,b.style.gap="8px",b.style.width="100%";return[...e.elements].sort((e,t)=>(e?.order||0)-(t?.order||0)).forEach(e=>{if(e){const r=this.createElement(e,t,n);r&&(r.style.width="100%",b.appendChild(r))}}),f.appendChild(b),p.appendChild(f),p}createSpacerElement(e,t){const n="banner",r="stretch",o=document.createElement("div");return t.selectedType===n?(o.style.flexGrow="1",o.style.flexBasis="0",o.style.alignSelf=r):(o.style.height=e.size+"px",o.style.width="1px",o.style.flexShrink="0"),o}}function C(e){const t={KDaif:"rgba(31, 41, 55, 0.9)",pDxQW:function(e,t){return e(t)},vrKMt:"error",GHeEK:"0|1|2|3|4",dbZgV:"top: 20px; left: 20px;",MhApL:"bottom: 20px; left: 20px;",Eihjc:"top: 20px; left: 50%; transform: translateX(-50%);",lsABR:"100%",cbCwS:"mouseenter",HsycB:function(e,t){return e(t)},CIRLM:function(e,t){return e>t},fGhDc:function(e,t,n){return e(t,n)}},{message:n,type:r=t.vrKMt,duration:o=5e3,position:i="top-right"}=e;let s=document.getElementById("easepop-toast-container");if(!s){const e=t.GHeEK.split("|");let n=0;for(;;){switch(e[n++]){case"0":s=document.createElement("div");continue;case"1":s.id="easepop-toast-container";continue;case"2":s.className="easepop-toast-container";continue;case"3":s.style.cssText="\n position: fixed;\n z-index: 999999;\n pointer-events: none;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n ";continue;case"4":document.body.appendChild(s);continue}break}}const a={"top-right":"top: 20px; right: 20px;","top-left":t.dbZgV,"bottom-right":"bottom: 20px; right: 20px;","bottom-left":t.MhApL,"top-center":t.Eihjc,"bottom-center":"bottom: 20px; left: 50%; transform: translateX(-50%);"};s.style.cssText+=a[i];const c=document.createElement("div");c.className="easepop-toast easepop-toast--"+r,c.style.cssText="\n background: rgba(255, 255, 255, 0.95);\n color: #1f2937;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 8px;\n max-width: 320px;\n word-wrap: break-word;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);\n border-left: 4px solid "+function(e){const t={error:"#ef4444",warning:"#f59e0b",info:"#3b82f6",success:"#10b981"};return t[e]||t.error}(r)+";\n border: 1px solid rgba(0, 0, 0, 0.1);\n opacity: 0;\n transform: translateX("+(i.includes("right")?t.lsABR:"-100%")+");\n transition: all 0.3s ease;\n pointer-events: auto;\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n ";const l=function(e){const t={error:"❗",warning:"⚠️",info:"ℹ️",success:"✅"};return t[e]||t.error}(r);c.innerHTML='\n \n '+l+'\n '+n+"\n
\n ";const u=document.createElement("button");u.className="easepop-toast__close",u.innerHTML="×",u.style.cssText="\n background: none;\n border: none;\n color: rgba(31, 41, 55, 0.6);\n font-size: 18px;\n cursor: pointer;\n padding: 0;\n margin-left: 8px;\n line-height: 1;\n flex-shrink: 0;\n transition: color 0.2s ease;\n ",u.addEventListener(t.cbCwS,()=>{u.style.color=t.KDaif}),u.addEventListener("mouseleave",()=>{u.style.color="rgba(31, 41, 55, 0.6)"}),u.onclick=()=>E(c);const d=c.querySelector("div");let p;d&&d.appendChild(u),s.appendChild(c),t.HsycB(requestAnimationFrame,()=>{c.style.opacity="1",c.style.transform="translateX(0)"}),t.CIRLM(o,0)&&t.fGhDc(setTimeout,()=>E(c),o),c.addEventListener("mouseenter",()=>{t.pDxQW(clearTimeout,p)}),c.addEventListener("mouseleave",()=>{p=setTimeout(()=>E(c),1e3)})}function E(e){const t="center",n="translateX(-100%)",r="left",o=function(e,t,n){return e(t,n)},i=e.style.transform.includes("translateX(-50%)")?t:e.style.transform.includes(n)?r:"right";e.style.opacity="0",e.style.transform="translateX("+(i===r?"-100%":"right"===i?"100%":"0")+") scale(0.9)",o(setTimeout,()=>{e.parentNode&&e.parentNode.removeChild(e)},300)}async function k(e,t,n){const o="POST",i="application/json",s="Your data has been recorded successfully.",a="Error submitting popup form:",c="Your data might not have been recorded successfully. Please try again.",l="Unknown error occurred",u=function(){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);return/iPad|Android(?!.*Mobile)/i.test(e)?"tablet":t?"mobile":"desktop"}(),d=navigator.userAgent,p=window.location.hostname,h={popupId:e.popupId,userId:t,data:n,domain:p,userAgent:d,device:u};try{const e=await fetch(r+"/submission/submit?id="+t,{method:o,headers:{"Content-Type":i},body:JSON.stringify(h)}),n=await e.json();if(!e.ok)throw new Error(n.message||"Failed to submit form");return C({message:s,type:"success",duration:m}),n}catch(e){return console.error(a,e),C({message:c,type:"error",duration:f}),{success:!1,message:e instanceof Error?e.message:l}}var f,m}class S{currentFrame=null;showQueue=[];scriptId;currentPageShownPopups=new Set;sessionId;currentUrl=window.location.href;registeredPopups=[];popupTriggers=[];viewingDisabled=!1;popupRenderer;activePopup=null;currentPopupFormData={};isNewVisitor=!1;autoCloseTimer=null;hasUserInteracted=!1;constructor(e){this.scriptId=e,this.sessionId=this.generateSessionId(),this.setupNavigationListeners(),this.popupRenderer=new v(this)}registerPopup(e){this.registeredPopups.push(e),this.setupTrigger(e)}preview(e){if(e.config.frames.length===0)return!0;if(this.activePopup)return!1;const t={...e,isPreview:!0};return this.registeredPopups.push(t),this.activePopup=this.popupRenderer.renderFrame(e.config.frames[0],t),this.currentFrame=e.config.frames[0],this.setupInteractionTracking(),this.setupAutoCloseTimer(t),!0}hasPopupBeenShownOnCurrentPage(e){return this.currentPageShownPopups.has(e)}hasPopupBeenShownInCurrentSession(e){const t="popup_shown_"+this.scriptId+"_"+this.sessionId;return JSON.parse(sessionStorage.getItem(t)||"[]").includes(e)}isViewingDisabled(){return this.viewingDisabled}getIsNewVisitor(){return this.isNewVisitor}initializeVisitorStatusUsingLocalStorage(){const e=function(e,t){return e===t},t="true";try{const n="popup_visitor_"+this.scriptId+"_seen",r="popup_session_"+this.scriptId+"_isNewVisitor";if(localStorage.getItem(n)){const t=sessionStorage.getItem(r);this.isNewVisitor=e(t,"true")}else this.isNewVisitor=!0,localStorage.setItem(n,t),sessionStorage.setItem(r,t)}catch{this.isNewVisitor=!1}}triggerPopup(e){if(this.activePopup==null){const t="6|4|2|1|3|0|5".split("|");let n=0;for(;;){switch(t[n++]){case"0":this.setupInteractionTracking();continue;case"1":this.trackPopupView(e);continue;case"2":this.markPopupAsShown(e);continue;case"3":this.currentPopupFormData={};continue;case"4":this.currentFrame=e.config.frames[0];continue;case"5":this.setupAutoCloseTimer(e);continue;case"6":this.activePopup=this.popupRenderer.renderFrame(e.config.frames[0],e);continue}break}}else this.showQueue.push(e)}showPopup(e){const t=this.registeredPopups.find(t=>t.popupId===e);return!!t&&(this.triggerPopup(t),!0)}hidePopup(e){this.activePopup&&(this.clearAutoCloseTimer(),this.currentFrame&&this.clearValidationHighlights(this.currentFrame),this.popupRenderer.applyExitAnimation(()=>{e.isPreview&&this.exitPreview(e),this.currentPopupFormData={},this.activePopup=null,this.processNextInQueue()},this.currentFrame,this.activePopup))}handleButtonPress(e,t,n){const r="copy-to-clipboard",o="popup",i="submit-and-popup",s="submit",a="fixed",c="-999999px";let l,u;if(Array.isArray(e.action)){const r=this.evaluateConditionalActions(e.action,n,t);if(!r)return;l=r.action,u=r.param||""}else l=e.action,u=e.param;switch(l){case"close":this.hidePopup(t);break;case"url":this.trackConversion(t,"url",{url:u}),window.open(u);break;case"url-and-close":this.trackConversion(t,"url",{url:u}),window.open(u),this.hidePopup(t);break;case"submit":this.handleFormSubmission(t,n)&&this.trackConversion(t,l);break;case o:this.validateAndSaveCurrentFrame(t,n)&&this.navigateToFrame(u,t);break;case"submit-and-close":this.handleFormSubmission(t,n)&&(this.trackConversion(t,"submit"),this.hidePopup(t));break;case i:this.handleFormSubmission(t,n)&&(this.trackConversion(t,s),this.navigateToFrame(u,t));break;case r:if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(u).then(()=>{this.trackConversion(t,r,{text:u})}).catch(e=>{console.error("Failed to copy to clipboard:",e)});else{const e=document.createElement("textarea");e.value=u,e.style.position=a,e.style.left="-999999px",e.style.top=c,document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")&&this.trackConversion(t,"copy-to-clipboard",{text:u})}catch(e){console.error("Failed to copy to clipboard:",e)}document.body.removeChild(e)}}}evaluateConditionalActions(e,t,n){let r=null;for(const o of e)if(o.condition){if(this.evaluateCondition(o.condition,t,n))return o}else r=o;return r}evaluateCondition(e,t,n){const r="not-equals",o="greater-than",i="less-than",s="less-than-or-equal",a=function(e,t){return e(t)},c=function(e,t){return e(t)},l=function(e,t){return e===t},u=function(e,t){return e!==t};if(!e)return!1;const d=this.getInputFieldValue(e.inputFieldName,t),p=e.value,h=this.getInputElementType(e.inputFieldName,n);switch(e.operation){case"equals":return this.compareValues(d,p,"equals",h);case"not-equals":return this.compareValues(d,p,r,h);case o:return this.compareValues(d,p,o,h);case"less-than":return this.compareValues(d,p,i,h);case"greater-than-or-equal":return this.compareValues(d,p,"greater-than-or-equal",h);case"less-than-or-equal":return this.compareValues(d,p,s,h);case"contains":return String(d).toLowerCase().includes(String(p).toLowerCase());case"not-contains":return!a(String,d).toLowerCase().includes(c(String,p).toLowerCase());case"starts-with":return String(d).toLowerCase().startsWith(String(p).toLowerCase());case"ends-with":return String(d).toLowerCase().endsWith(String(p).toLowerCase());case"is-empty":return null===d||l(d,void 0)||""===String(d).trim();case"is-not-empty":return null!==d&&u(d,void 0)&&u(a(String,d).trim(),"");default:return!1}}getInputElementType(e,t){const n="input",r=function(e,t){return e(t)},o=t=>{for(const r of t)if(r&&r.type===n){const t=r.config;if(t.dataKey===e)return t}else if(r&&"container"===r.type&&r.config.elements&&Array.isArray(r.config.elements)){const e=o(r.config.elements);if(e)return e}else if(r&&"vertical-container"===r.type&&r.config.elements&&Array.isArray(r.config.elements)){const e=o(r.config.elements);if(e)return e}};for(const e of t.config.frames){const t=r(o,e.elements);if(t)return t.type}}getInputElement(e){return document.querySelector("#epi-"+e)}getHiddenInput(e){return document.querySelector("#epi-hidden-"+e)}getSelectButton(e){return document.querySelector("#epi-"+e)}getInputFieldValue(e,t){const n="checkbox",r="hidden",o=function(e,t){return e!==t},i=function(e,t){return e(t)},s=function(e,t){return e!==t},a=function(e,t){return e===t},c="string",l=this.getHiddenInput(e);if(l)return l.value;const u=this.getInputElement(e);if(u){if(u instanceof HTMLInputElement&&u.type===n)return u.checked;if(u instanceof HTMLInputElement&&u.type===r){const e=u.value,t=Number(e);return!Number.isNaN(t)&&o(e.trim(),"")?t:e}if(u instanceof HTMLInputElement&&"number"===u.type){const e=u.value,t=i(Number,e);return Number.isNaN(t)||""===e.trim()?e:t}return u.value}const d=this.currentPopupFormData[e];return void 0!==d&&s(d,null)?a(typeof d,c)||"number"==typeof d||"boolean"==typeof d?d:String(d):null}compareValues(e,t,n,r){const o=function(e,t){return e(t)},i="time",s="not-equals",a=function(e,t){return e!==t},c=function(e,t){return e===t},l="equals",u=function(e,t){return e===t},d=function(e,t){return e(t)},p=function(e,t){return e!==t},h=function(e,t){return ey;case"less-than":return h(g,y);case"greater-than-or-equal":return g>=y;case"less-than-or-equal":return g<=y;default:return!1}}compareDateValues(e,t,n,r){const o=function(e,t){return e(t)},i=function(e,t){return e===t},s=function(e,t){return e===t},a="date",c="T00:00:00",l=function(e,t){return e+t},u="datetime-local",d="equals",p=function(e,t){return e!==t},h=function(e,t){return e>t},f=function(e,t){return e=b.getTime();case"less-than-or-equal":return y.getTime()<=b.getTime();default:return!1}}handleFormSubmission(e,t){const n=this.validateRequiredFields(t);if(!n.isValid)return this.clearValidationHighlights(t),this.highlightInvalidFields(n.invalidFields),!1;if(this.clearValidationHighlights(t),this.saveCurrentFrameData(e.popupId,t),e.isPreview)return this.currentPopupFormData={},!0;const r=this.currentPopupFormData,o=(i=k,s=e,a=this.scriptId,i(s,a,r));var i,s,a;return e.config.customEventName&&""!==e.config.customEventName.trim()&&this.dispatchCustomEvent(e.config.customEventName,r,e,o),this.currentPopupFormData={},!0}validateRequiredFields(e){const t="input",n="select",r=function(e,t){return e===t},o="rating",i=function(e,t){return e instanceof t},s=function(e,t){return e===t},a="email",c=function(e,t){return e===t},l="url",u=function(e,t){return e&&t},d=function(e,t){return e>=t},p=function(e,t){return e===t},h="container",f=function(e,t){return e(t)},m=function(e,t){return e===t},g=[],y=e=>{for(const b of e){if(b&&b.type===t&&b.config.required)if(b.config.type===n){const e=this.getHiddenInput(b.config.dataKey),t=b.config.placeholder||"Select an option";(!e||!e.value.trim()||e.value.trim()===t)&&g.push(b.config.dataKey)}else{const e=this.getInputElement(b.config.dataKey);e&&("checkbox"===b.config.type&&e instanceof HTMLInputElement?!e.checked&&g.push(b.config.dataKey):r(b.config.type,o)&&i(e,HTMLInputElement)?(!e.value||""===e.value.trim())&&g.push(b.config.dataKey):!e.value.trim()&&g.push(b.config.dataKey))}if(b&&b.type===t){const e=this.getInputElement(b.config.dataKey);if(e){const t=e.value.trim();if(""!==t)if("number"===b.config.type&&e instanceof HTMLInputElement){const e=Number(t);Number.isNaN(e)&&!g.includes(b.config.dataKey)&&g.push(b.config.dataKey)}else if(s(b.config.type,a)&&e instanceof HTMLInputElement){!/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/.test(t)&&!g.includes(b.config.dataKey)&&g.push(b.config.dataKey)}else if(c(b.config.type,l)&&e instanceof HTMLInputElement){let e=!1,n=null;try{let r=t;!t.startsWith("http://")&&!t.startsWith("https://")&&(r="https://"+t),n=new URL(r),e=!0}catch{}if(u(e,n)){const e=n.hostname.split(".");!(d(e.length,2)&&e[e.length-1].length>=2)&&!g.includes(b.config.dataKey)&&g.push(b.config.dataKey)}else!g.includes(b.config.dataKey)&&g.push(b.config.dataKey)}}}b&&p(b.type,h)&&b.config.elements&&Array.isArray(b.config.elements)&&f(y,b.config.elements),b&&m(b.type,"vertical-container")&&b.config.elements&&Array.isArray(b.config.elements)&&f(y,b.config.elements)}};return y(e.elements),{isValid:p(g.length,0),invalidFields:g}}addValidationHighlight(e,t,n={}){const r=".popup-validation-icon",o=function(e,t){return e??t},i="popup-validation-shake 0.5s ease-in-out",s="static",a=function(e,t){return e===t},c=function(e,t){return e&&t},l=function(e,t){return e===t},u="flex-end",d=function(e,t){return e===t},p="right",h=function(e,t){return e===t},f="div",m="absolute",g=function(e,t){return e||t},y="auto",b="-32px",x="none",w="translateY(-50%)",v="input",{isCheckbox:C=!1,isPhone:E=!1,isRating:k=!1,iconHost:S,isDigitInput:I=!1}=n,A=o(S,e);e.style.animation=i,setTimeout(()=>{e.style.animation=""},500);window.getComputedStyle(e).position===s&&(e.style.position="relative");const T=A.querySelector(".popup-validation-icon");T&&T.remove();let P=!1;if(C||k)if(k){P="flex-end"===window.getComputedStyle(e).justifyContent}else if(C){const t=e.parentElement,n=t?.parentElement;if(n){P=a(window.getComputedStyle(n).alignItems,"flex-end")}}let L=!1;if(c(!C,!k))if(I&&S){const e=window.getComputedStyle(S),t=e.justifyContent?.toLowerCase();(l(t,u)||"end"===t||d(t,p))&&(L=!0)}else{const e=window.getComputedStyle(t),n=e.textAlign?.toLowerCase();(h(n,"right")||"end"===n)&&(L=!0)}const F=document.createElement(f);F.className="popup-validation-icon",F.innerHTML='\n \n ',F.style.position=m,F.style.top=g(C,k)?"0px":"50%",g(C,k)?P?(F.style.left="-32px",F.style.right=y):(F.style.right=b,F.style.left=y):L?(F.style.left="6px",F.style.right=y):(F.style.right="18px",F.style.left=y),F.style.transform=C||k?x:w,F.style.pointerEvents=x,F.style.zIndex="1001",F.style.opacity="0.8",A.appendChild(F);const R=()=>{const n=A.querySelector(r);n&&n.remove(),t.removeEventListener("input",R),t.removeEventListener("change",R),k&&e.removeEventListener("click",R)};t.addEventListener(v,R),t.addEventListener("change",R),k&&e.addEventListener("click",R)}highlightInvalidFields(e){const t=function(e,t){return e===t},n="hidden",r=function(e,t){return e(t)},o='[data-digit-input-wrapper="true"]';if(e.forEach(e=>{if(this.getHiddenInput(e)){const t=this.getSelectButton(e);if(t){const e=t.parentElement;e&&this.addValidationHighlight(e,t)}return}const i=this.getInputElement(e);if(i){const e=i instanceof HTMLInputElement&&"checkbox"===i.type,s=i instanceof HTMLInputElement&&"hidden"===i.type&&!i.dataset.digitInput,a=i instanceof HTMLInputElement&&t(i.type,n)&&Boolean(i.dataset.digitInput),c=r(Boolean,i instanceof HTMLInputElement&&t(i.type,"number")&&i.parentElement?.parentElement&&Array.from(i.parentElement.parentElement.children).some(e=>"SPAN"===e.tagName&&"+"===e.textContent?.trim()));let l,u;if(l=c&&i.parentElement?.parentElement?i.parentElement.parentElement:(e||s)&&i.parentElement||i.parentElement?i.parentElement:i,a){const e=l.querySelector(o);e&&(u=e)}else c&&i.parentElement&&(u=i.parentElement);this.addValidationHighlight(l,i,{isCheckbox:e,isPhone:c,isRating:s,iconHost:u,isDigitInput:a})}}),!document.querySelector("#popup-validation-styles")){const e=document.createElement("style");e.id="popup-validation-styles",e.textContent="\n @keyframes popup-validation-shake {\n 0%, 100% { transform: translateX(0); }\n 25% { transform: translateX(-5px); }\n 75% { transform: translateX(5px); }\n }\n ",document.head.appendChild(e)}}clearValidationHighlights(e){const t=function(e,t){return e===t},n="input",r=function(e,t){return e===t},o="vertical-container",i=e=>{for(const s of e)if(s&&t(s.type,n))if(t(s.config.type,"select")){const e=this.getSelectButton(s.config.dataKey);e&&(e.style.animation="")}else{const e=this.getInputElement(s.config.dataKey);if(e){e.style.animation="";const t=e.parentElement;if(t){t.style.animation="";const e=t.querySelector(".popup-validation-icon");e&&e.remove()}}}else(s&&r(s.type,"container")&&s.config.elements&&Array.isArray(s.config.elements)||s&&s.type===o&&s.config.elements&&Array.isArray(s.config.elements))&&i(s.config.elements)};(function(e,t){e(t)})(i,e.elements)}validateAndSaveCurrentFrame(e,t){const n=this.validateRequiredFields(t);return n.isValid?(this.clearValidationHighlights(t),this.saveCurrentFrameData(e.popupId,t),!0):(this.clearValidationHighlights(t),this.highlightInvalidFields(n.invalidFields),!1)}saveCurrentFrameData(e,t){const n=function(e,t){return e===t},r="select",o="vertical-container",i=function(e,t){return e(t)},s={},a=e=>{for(const t of e)if(t&&"input"===t.type)if(n(t.config.type,r)){const e=this.getHiddenInput(t.config.dataKey);e&&(s[t.config.dataKey]=e.value)}else{const e=this.getInputElement(t.config.dataKey);e&&("checkbox"===t.config.type&&e instanceof HTMLInputElement?s[t.config.dataKey]=e.checked:s[t.config.dataKey]=e.value)}else t&&"container"===t.type&&t.config.elements&&Array.isArray(t.config.elements)?a(t.config.elements):t&&t.type===o&&t.config.elements&&Array.isArray(t.config.elements)&&i(a,t.config.elements)};a(t.elements);const c={...this.currentPopupFormData,...s};this.currentPopupFormData=c}loadFormData(e){const t=function(e,t){return e(t)},n="change",r=function(e,t){return e===t},o=this.currentPopupFormData;o&&0!==Object.keys(o).length&&setTimeout(()=>{for(const[e,i]of Object.entries(o)){const o=this.getHiddenInput(e);if(o){o.value=t(String,i);const r=this.getSelectButton(e);if(r){const e=r.querySelector("span:first-child");e&&(e.textContent=String(i)||"Select an option"),r.dispatchEvent(new Event(n,{bubbles:!0}))}}else{const t=this.getInputElement(e);t&&(t instanceof HTMLInputElement&&r(t.type,"checkbox")?t.checked=Boolean(i):t.value=String(i),t.dispatchEvent(new Event(n,{bubbles:!0})))}}},0)}setupNavigationListeners(){const e="popstate",t="hashchange";window.addEventListener(e,()=>this.handleLocationChange()),window.addEventListener(t,()=>this.handleLocationChange()),window.addEventListener("beforeunload",()=>this.popupRenderer.clearActiveIntervals());const n=history.pushState,r=history.replaceState;history.pushState=(...e)=>{n.apply(history,e),this.handleLocationChange()},history.replaceState=(...e)=>{r.apply(history,e),this.handleLocationChange()}}handleLocationChange(){const e=window.location.href;e!==this.currentUrl&&(this.viewingDisabled=!0,this.currentUrl=e,this.cleanupAllTriggers(),this.reregisterAllTriggers(),this.viewingDisabled=!1,this.currentPageShownPopups.clear())}reregisterAllTriggers(){this.popupTriggers.forEach(e=>{e.addTrigger()})}generateSessionId(){const e="popup_session_"+this.scriptId;let t=sessionStorage.getItem(e);return!t&&(t="session_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),sessionStorage.setItem(e,t)),t}markPopupAsShown(e){if(e.isPreview)return;this.currentPageShownPopups.add(e.popupId);const t="popup_shown_"+this.scriptId+"_"+this.sessionId,n=JSON.parse(sessionStorage.getItem(t)||"[]");!n.includes(e.popupId)&&(n.push(e.popupId),sessionStorage.setItem(t,JSON.stringify(n)))}exitPreview(e){const t=this.registeredPopups.indexOf(e);t>-1&&this.registeredPopups.splice(t,1)}processNextInQueue(){if(this.showQueue.length>0&&!this.activePopup){const e=this.showQueue.shift();e&&(this.activePopup=this.popupRenderer.renderFrame(e.config.frames[0],e),this.currentFrame=e.config.frames[0],this.markPopupAsShown(e),this.trackPopupView(e),this.currentPopupFormData={},this.setupInteractionTracking(),this.setupAutoCloseTimer(e))}}setupTrigger(e){const t="page-load",n="element-click";let r=null;switch(e.config.trigger.type){case t:r=new a(e,this);break;case"scroll-percentage":r=new c(e,this);break;case"exit-intent":r=new u(e,this);break;case n:r=new l(e,this)}r&&(e.trigger=r,this.popupTriggers.push(r),r.addTrigger())}cleanupAllTriggers(){for(const e of this.popupTriggers)e.removeTrigger();this.popupRenderer.clearActiveIntervals(),this.clearAutoCloseTimer()}trackPopupView(e){if(e.isPreview)return;!async function(e,t){try{(await fetch(o+"/stats/view?id="+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok}catch(e){}}(i(e.popupId,this.scriptId),this.scriptId)}trackConversion(e,t,n){if(e.isPreview)return;var r,s,a;!async function(e,t){const n=function(e,t,n){return e(t,n)};try{(await n(fetch,o+"/stats/conversion?id="+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok}catch(e){}}({...(r=i,s=e.popupId,a=this.scriptId,r(s,a)),conversionType:t,...n},this.scriptId)}navigateToFrame(e,t){const n=this.registeredPopups.find(e=>e.config.frames.some(e=>e===this.currentFrame));if(!n)return;const r=n.config.frames.find(t=>t.id===e);r&&this.popupRenderer.applyTransitionAnimation(()=>{this.activePopup=this.popupRenderer.renderFrame(r,t),this.currentFrame=r,this.setupInteractionTracking(),this.loadFormData(t.popupId)},this.currentFrame,this.activePopup)}async dispatchCustomEvent(e,t,n,r){const{submissionId:o,visible:i}=await r;try{const r=new CustomEvent(e,{detail:{popupId:n.popupId,formData:i?t:{},timestamp:(new Date).toISOString(),domain:window.location.hostname,url:window.location.href,id:o},bubbles:!0,cancelable:!0});window.dispatchEvent(r)}catch(e){}}setupAutoCloseTimer(e){var t,n,r;this.clearAutoCloseTimer(),this.hasUserInteracted=!1,e.config.trigger.autoClose?.delay>0&&(this.autoCloseTimer=(t=setTimeout,n=()=>{!this.hasUserInteracted&&this.hidePopup(e)},r=1e3*e.config.trigger.autoClose.delay,t(n,r)))}clearAutoCloseTimer(){var e,t;this.autoCloseTimer&&(e=clearTimeout,t=this.autoCloseTimer,e(t),this.autoCloseTimer=null)}markUserInteraction(){this.hasUserInteracted=!0}setupInteractionTracking(){const e="focus",t="change",n="input, textarea, select",r='button[role="combobox"]';if(!this.activePopup)return;this.activePopup.querySelectorAll(n).forEach(t=>{t.addEventListener(e,()=>this.markUserInteraction()),t.addEventListener("input",()=>this.markUserInteraction()),t.addEventListener("change",()=>this.markUserInteraction())});this.activePopup.querySelectorAll(r).forEach(e=>{e.addEventListener("click",()=>this.markUserInteraction()),e.addEventListener(t,()=>this.markUserInteraction())});this.activePopup.querySelectorAll('button, [role="button"]').forEach(e=>{e.addEventListener("click",()=>this.markUserInteraction()),e.addEventListener("mousedown",()=>this.markUserInteraction())});this.activePopup.querySelectorAll("a, [onclick], [data-action]").forEach(e=>{e.addEventListener("click",()=>this.markUserInteraction())})}}const I={loadedFonts:new Set,loadingFonts:new Set};async function A(e){const t=function(e,t){return e===t},n="Some fonts failed to load:",r=function(e){const t=function(e,t){return e!==t},n="Inter",r=function(e,t){return e!==t},o=new Set;return e.config&&e.config.frames&&e.config.frames.forEach(e=>{e.elements&&e.elements.forEach(e=>{if(e.config&&e.config.fontFamily){const i=e.config.fontFamily.split(",")[0].trim().replace(/['"]/g,"");i&&t(i,n)&&r(i,"sans-serif")&&o.add(i)}})}),Array.from(o)}(e);if(!t(r.length,0))try{await Promise.all(r.map(e=>function(e){const t=function(e){return e()},n="stylesheet";return new Promise((r,o)=>{const i=e.toLowerCase().replace(/['"]/g,"").replace(/\s+/g,"-");if(I.loadedFonts.has(i))return void r();if(I.loadingFonts.has(i)){const e=()=>{I.loadedFonts.has(i)?r():setTimeout(e,50)};return void t(e)}I.loadingFonts.add(i);const s="https://fonts.bunny.net/css2?family="+e.replace(/['"]/g,"").replace(/\s+/g,"+")+":400,700&display=swap",a=document.createElement("link");a.rel=n,a.href=s,a.onload=()=>{I.loadedFonts.add(i),I.loadingFonts.delete(i),t(r)},a.onerror=()=>{I.loadingFonts.delete(i),o(new Error("Failed to load font: "+e))},document.head.appendChild(a)})}(e)))}catch(e){console.warn(n,e)}}const T={loadedMedia:new Set,loadingMedia:new Set};async function P(e){const t=function(e){const t="media",n=new Set;return e.config&&e.config.frames&&e.config.frames.forEach(e=>{if(e.backgroundColor){const t=e.backgroundColor.trim();if(t.startsWith("url(")){const e=t.match(/^url\((['"]?)(.*?)\1\)$/);e&&e[2]&&n.add(e[2])}}e.elements&&e.elements.forEach(e=>{if(e.type===t&&e.config&&e.config.src&&n.add(e.config.src),e.config&&e.config.backgroundColor){const t=e.config.backgroundColor.trim();if(t.startsWith("url(")){const e=t.match(/^url\((['"]?)(.*?)\1\)$/);e&&e[2]&&n.add(e[2])}}})}),Array.from(n)}(e);if(t.length!==0)try{await Promise.all(t.map(e=>{return t=e,new Promise((e,n)=>{const r=function(e,t){return e(t)};if(T.loadedMedia.has(t))return void e();if(T.loadingMedia.has(t)){const n=()=>{T.loadedMedia.has(t)?e():setTimeout(n,50)};return void n()}T.loadingMedia.add(t);const o=new Image;o.onload=()=>{T.loadedMedia.add(t),T.loadingMedia.delete(t),e()},o.onerror=()=>{T.loadingMedia.delete(t),r(n,new Error("Failed to load media: "+t))},o.src=t});var t}))}catch(e){console.warn("Some media failed to load:",e)}}const L=document.currentScript?.getAttribute("data-id");let F=!1,R=!1,M=null,N=[];async function D(){const e=function(e,t){return e(t)};if(F)return;if(F=!0,!R||!L)return;M=new S(L),window.easepop=M,N=await async function(){const e={gYdoW:function(e,t){return e||t},fTEor:function(e,t){return e(t)}};if(e.gYdoW(!R,!F)||!L)return[];try{const t=await e.fTEor(fetch,r+"/popup/getAvailable?id="+L+"&url="+encodeURIComponent(window.location.href));if(!t.ok)return[];return await t.json()}catch(e){return[]}}();if(N.some(e=>e.config?.targeting?.visitorType&&"all"!==e.config.targeting.visitorType))try{M.initializeVisitorStatusUsingLocalStorage()}catch{}for(const t of N){try{A(t)}catch(e){}try{e(P,t)}catch(e){}}N.forEach(e=>{M.registerPopup(e)})}async function O(){const o=function(e,t){return e===t};if(!L)return console.error("Script ID not found. Please ensure the script is loaded correctly."),void(R=!1);let i,s=0;for(;s<=3;)try{if(i=await t(L,r),i===e.SUCCESS)return R=!0,void D();if(i===e.UNAUTHORIZED||o(i,e.INVALID_ENVIRONMENT))return void(R=!1);if(i===e.TRANSMISSION_RETRY){if(s<3){s++,await n(1e3);continue}return void(R=!1)}return void(R=!1)}catch(e){return void(R=!1)}}let j=window.location.pathname;document.addEventListener("DOMContentLoaded",O),setInterval(function(){const e=function(e,t){return e!==t},t=function(e){return e()},n=window.location.pathname;e(n,j)&&(j=n,t(O))},500)}();