(function(){const nowDate=new Date();const isABTestVariantA=nowDate.getSeconds()%2===0;const scheduledImages=JSON.parse('[{"start_timestamp": 1750993950258, "end_timestamp": null, "name": "biyosyoku_popup_250626_1.jpg", "image_name_a": null, "image_name_b": null, "another_url_flag": false, "another_url_flag_a": null, "another_url_flag_b": null, "another_url_scheme": null, "another_url_scheme_a": null, "another_url_scheme_b": null, "url_scheme": "https://lin.ee/9URjsEF", "url_scheme_a": null, "url_scheme_b": null, "url_scheme_type": "one-link", "url_scheme_type_a": null, "url_scheme_type_b": null}]');function getActiveScheduledImage(scheduledImages=[]){return(scheduledImages.find((img)=>nowDate>=img.start_timestamp&&(img.end_timestamp==null||nowDate<=img.end_timestamp))||null);} function pickProp(img,baseKey,aKey,bKey,defaultValue){if(!img)return defaultValue;if(img.image_name_a!=null&&img.image_name_b!=null){return isABTestVariantA?img[aKey]:img[bKey];} return img[baseKey]!=null?img[baseKey]:defaultValue;} function hasWebbot(scheduledImages){const img=getActiveScheduledImage(scheduledImages);const currentUrl=pickProp(img,"url_scheme","url_scheme_a","url_scheme_b","");const currentAnotherUrl=pickProp(img,"another_url_scheme","another_url_scheme_a","another_url_scheme_b","");function isURL(str){return str!==""&&/^https?:\/\//i.test(str);} return((currentUrl!==""&&!isURL(currentUrl))||(currentAnotherUrl!==""&&!isURL(currentAnotherUrl)));} const webbot_js="false";if(hasWebbot(scheduledImages)||webbot_js==="true"){const webbotScriptSrc="https://cdn.chat-marketing.tech/clients/7cd7f53e-b278-4af9-a268-2235954da522/public/webbots/webbot.js";const webbotScript=document.createElement("script");webbotScript.src=webbotScriptSrc;webbotScript.type="text/javascript";document.head.appendChild(webbotScript);} window.addEventListener("message",(event)=>{if(event.origin!=="https://cdn.chichat.tw"&&event.origin!=="https://cdn.chat-marketing.tech"&&event.origin!=="https://cdn.chichat.tech") return;if(event.data&&event.data.type==="openWebbotIframe"){openWebbotIframe(event.data.value);} if(event.data&&event.data.type==="closePopupIframe"){document.getElementById("pg-modal").remove();}});var ccid="7cd7f53e-b278-4af9-a268-2235954da522";var url=document.location.href;var domain=document.location.host;const popupAgainSec=Number("60")*60;const DOMAIN=getDomain(document.location.host);const BASE_COOKIE_SETTINGS="; path=/; domain="+DOMAIN+"; Secure";var domain_list=domain.split(".");if(domain_list.length==4){domain_list.shift();domain=domain_list.join(".");}else if(domain_list.length==3){if(domain_list[1].length>3){domain_list.shift();domain=domain_list.join(".");}} const backFromLine=getParams().match(/luid=/);if(!backFromLine){document.cookie="script_flag="+ ccid+"; max-age=30000000; path=/; domain="+ domain+"; Secure";document.cookie="url_flag="+ url+"; max-age=30000000; path=/; domain="+ domain+"; Secure";} function checkSameDomain(referrer,currentHostname,flag){var reStr="^https?://"+currentHostname;var re=new RegExp(reStr,"i");if(referrer.length===0){return false;}else if(!flag&&referrer.match(re)){return true;}else{return false;}} var pgRef=document.referrer;var pgHereHost=window.location.hostname;var back_same_domain_flag=JSON.parse("true");var wait_same_domain_flag=JSON.parse("true");var scroll_same_domain_flag=JSON.parse("false");var visibility_same_domain_flag=JSON.parse("false");var backRefFlg=checkSameDomain(pgRef,pgHereHost,back_same_domain_flag);var waitRefFlg=checkSameDomain(pgRef,pgHereHost,wait_same_domain_flag);var scrollRefFlg=checkSameDomain(pgRef,pgHereHost,scroll_same_domain_flag);var visibilityRefFlg=checkSameDomain(pgRef,pgHereHost,visibility_same_domain_flag);let longestExpireTimeForCookie=34560000;var getDevice=(function(){var ua=navigator.userAgent;const windowInnerWidth=window.innerWidth;if((ua.indexOf("iPhone")>0||ua.indexOf("iPod")>0||(ua.indexOf("Android")>0&&ua.indexOf("Mobile")>0))&&windowInnerWidth<768){return"sp";}else if((ua.indexOf("iPad")>0||ua.indexOf("Android")>0)&&windowInnerWidth<1024){return"tab";}else{return"other";}})();let devicePopUpFlag=String("default");if(devicePopUpFlag==="default"&&getDevice==="other"){setCookie("pgmodal2","true",longestExpireTimeForCookie);} if(devicePopUpFlag==="only_pc"&&(getDevice==="sp"||getDevice==="tab")){setCookie("pgmodal2","true",longestExpireTimeForCookie);} function getParams(){let params=location.search;return params;} if(backFromLine){waitRefFlg=true;scrollRefFlg=true;visibilityRefFlg=true;setCookie("pgmodal2","true",popupAgainSec);} function getCookie(name){const cookies=document.cookie.split(";").map((cookie)=>cookie.trim());const targetCookie=cookies.find((cookie)=>cookie.startsWith(`${name}=`));return targetCookie?targetCookie.split("=")[1]:null;} function isPgModalCookie(){return getCookie("pgmodal2")==="true";} function showModalAndSetCookie(actionName){pgModalOpen(actionName);setCookie("pgmodal2","true",popupAgainSec);pgModalClose();showCountPopup=true;clearAllConditions();} let modalTriggered=false;const scrollPercent=Number("2.0");function showModal(){if(!showCountPopup&&!isPgModalCookie()&&!scrollRefFlg){showModalAndSetCookie("scroll");window.removeEventListener("scroll",onScroll);}} function onScroll(e){const totalScrollHeight=document.documentElement.scrollHeight-window.innerHeight;const scrollPosition=totalScrollHeight*scrollPercent;const currentScrollPosition=window.scrollY||document.documentElement.scrollTop;if(currentScrollPosition>=scrollPosition&&!modalTriggered){e.preventDefault();showModal();modalTriggered=true;}} function setupScrollModal(){window.addEventListener("scroll",onScroll,false);} let scrollModal=JSON.parse("false");if(scrollModal){if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",function(){setupScrollModal();});}else{setupScrollModal();}} var visibilityFlag=JSON.parse("false");function visShowModal(){if(!showCountPopup&&!isPgModalCookie()&&!visibilityRefFlg){showModalAndSetCookie("visibility");window.removeEventListener("visibilitychange",onVisibilityChange);}} function onVisibilityChange(){setTimeout(()=>{if(document.hidden&&!modalTriggered){visShowModal();modalTriggered=true;}},0);} if(visibilityFlag){document.addEventListener("visibilitychange",onVisibilityChange,false);} function getDomain(host){let domain_list=host.split(".");if(domain_list.length===4||(domain_list.length===3&&domain_list[1].length>3)){domain_list.shift();} return domain_list.join(".");} function setCookie(name,value,maxAge){document.cookie=`${name}=${value}; max-age=${maxAge}${BASE_COOKIE_SETTINGS}`;} function getCurrentImageName(imgName,scheduledImages){const img=getActiveScheduledImage(scheduledImages);return pickProp(img,"name","image_name_a","image_name_b",imgName);} let imgName="None";function domReady(callback){if(document.readyState==="complete"||document.readyState==="interactive"){setTimeout(callback,0);}else{document.addEventListener("DOMContentLoaded",callback);}} function preloadContent(){const contentUrl=`https://cdn.chichat.tw/clients/7cd7f53e-b278-4af9-a268-2235954da522/public/images/${getCurrentImageName( imgName, scheduledImages )}`;function isVideoFile(filename){const videoExtensions=[".mp4",".webm",".ogg",".mov",".avi",".mkv"];return videoExtensions.some((ext)=>filename.toLowerCase().endsWith(ext));} const isVideo=isVideoFile(contentUrl);if(isVideo){const video=document.createElement("video");video.src=contentUrl;video.preload="auto";video.muted=true;video.autoplay=false;video.style.display="none";document.body.appendChild(video);}else{const img=document.createElement("img");img.src=contentUrl;img.style.display="none";document.body.appendChild(img);}} domReady(preloadContent);var bannerSize="defaultSize";function pgModalOpen(actionName){let inlineStyle;if(bannerSize==="640_480"){inlineStyle=`#pg-modal{z-index:2147483647;position:fixed}.pg-modal{width:100%;height:100%;position:fixed;top:20%;left:0;z-index:9999}.pg-modal__overlay{width:100%;height:100%;position:fixed;top:0;left:0;z-index:10000;background:rgba(102,102,102,.9);transition:all .3s}.pg-modal-body{overflow:visible;width:320px;height:480px;position:absolute;top:50%;left:50%;z-index:10001;text-align:center;transform:translate(-50%,-50%)}@media screen and (max-width:480px){.pg-modal-body{overflow:visible;width:85%;height:0;padding-top:132.8125%;box-sizing:border-box}}#pg-modal__close{width:40px;height:40px;position:absolute;z-index:10003;top:-15px;left:-15px;background:#fff;border-radius:50%;box-shadow:0 0 7px #141414}.pg-modal .icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-block;width:20px;height:20px;stroke-width:0;stroke:black;fill:black}#pg-modal-content{position:relative}.pg-modal__btn--line{width:100%;text-align:center;padding:0!important;margin:20px 0 15px!important}.pg-modal__btn--line a{display:inline-block;font-size:20px!important;line-height:40px!important;color:#fff!important;text-decoration:none!important;background-color:#52b448!important;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 511.99'%3E%3Cpath d='M443.2 233.29c0-84.14-84.35-152.6-188-152.6s-188 68.46-188 152.6c0 75.43 66.9 138.61 157.26 150.55 6.13 1.32 14.46 4 16.57 9.27 1.89 4.76 1.24 12.2.61 17 0 0-2.21 13.26-2.69 16.09-.82 4.75-3.78 18.6 16.29 10.14s108.21-63.76 147.66-109.16c27.25-29.89 40.3-60.18 40.3-93.89zm-254.38 44.92a3.67 3.67 0 01-3.66 3.67h-52.69a3.6 3.6 0 01-2.53-1l-.06-.05v-.05a3.65 3.65 0 01-1-2.53v-81.96a3.66 3.66 0 013.66-3.66h13.19a3.66 3.66 0 013.66 3.66v65.07h35.84a3.66 3.66 0 013.66 3.66zm31.8 0a3.65 3.65 0 01-3.66 3.65h-13.2a3.65 3.65 0 01-3.66-3.65v-81.92a3.66 3.66 0 013.66-3.66H217a3.66 3.66 0 013.66 3.66zm90.78 0a3.65 3.65 0 01-3.66 3.65h-13.19a3.67 3.67 0 01-.94-.12h-.05l-.25-.08h-.11l-.18-.08-.17-.08-.11-.06-.22-.14a3.45 3.45 0 01-.93-.9L254 229.56v48.66a3.66 3.66 0 01-3.67 3.65H237.1a3.65 3.65 0 01-3.66-3.65v-81.93a3.66 3.66 0 013.66-3.66h13.86l.21.05h.13l.21.07h.12a1.31 1.31 0 01.21.08l.12.06.19.11a.41.41 0 01.11.07l.19.13.1.07.19.16.07.07a2.28 2.28 0 01.22.22 3.58 3.58 0 01.28.37L290.89 245v-48.71a3.66 3.66 0 013.66-3.66h13.19a3.66 3.66 0 013.66 3.66zm72.83-68.74a3.66 3.66 0 01-3.65 3.67h-35.84V227h35.84a3.66 3.66 0 013.65 3.67v13.19a3.65 3.65 0 01-3.65 3.66h-35.84v13.85h35.84a3.65 3.65 0 013.65 3.66v13.19a3.66 3.66 0 01-3.65 3.67h-52.7a3.66 3.66 0 01-2.53-1l-.05-.05a.12.12 0 01-.05-.05 3.65 3.65 0 01-1-2.53V196.3a3.6 3.6 0 011-2.52l.06-.07a3.63 3.63 0 012.54-1h52.7a3.66 3.66 0 013.65 3.67z' fill='%23fff' data-name='レイヤー 1'/%3E%3C/svg%3E")!important;-webkit-background-size:50px auto!important;background-size:50px auto!important;background-position:5px 5px!important;border-radius:7px!important;padding:10px 15px 10px 60px!important}a.pg-modal__btn--line:hover{color:#fff}#pg-modal-content{width:320px;height:480px;border:none!important;margin:0!important}@media screen and (max-width:480px){#pg-modal-content{width:100%;height:100%;position:absolute;top:0;left:0}}.pg-modal__banner{line-height:0!important;padding:0!important;margin:0!important}`;}else{inlineStyle=`#pg-modal{z-index:2147483647;position:fixed}.pg-modal{width:100%;height:100%;position:fixed;top:0;left:0;z-index:9999}.pg-modal__overlay{width:100%;height:100%;position:fixed;top:0;left:0;z-index:10000;background:rgba(102,102,102,.9);transition:all .3s}.pg-modal-body{overflow:visible;width:320px;height:480px;position:absolute;top:50%;left:50%;z-index:10001;text-align:center;transform:translate(-50%,-50%)}@media screen and (max-width:480px){.pg-modal-body{overflow:visible;width:85%;height:0;padding-top:132.8125%;box-sizing:border-box}}#pg-modal__close{width:40px;height:40px;position:absolute;z-index:10003;top:-15px;left:-15px;background:#fff;border-radius:50%;box-shadow:0 0 7px #141414}.pg-modal .icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-block;width:20px;height:20px;stroke-width:0;stroke:black;fill:black}#pg-modal-content{position:relative}.pg-modal__btn--line{width:100%;text-align:center;padding:0!important;margin:20px 0 15px!important}.pg-modal__btn--line a{display:inline-block;font-size:20px!important;line-height:40px!important;color:#fff!important;text-decoration:none!important;background-color:#52b448!important;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 511.99'%3E%3Cpath d='M443.2 233.29c0-84.14-84.35-152.6-188-152.6s-188 68.46-188 152.6c0 75.43 66.9 138.61 157.26 150.55 6.13 1.32 14.46 4 16.57 9.27 1.89 4.76 1.24 12.2.61 17 0 0-2.21 13.26-2.69 16.09-.82 4.75-3.78 18.6 16.29 10.14s108.21-63.76 147.66-109.16c27.25-29.89 40.3-60.18 40.3-93.89zm-254.38 44.92a3.67 3.67 0 01-3.66 3.67h-52.69a3.6 3.6 0 01-2.53-1l-.06-.05v-.05a3.65 3.65 0 01-1-2.53v-81.96a3.66 3.66 0 013.66-3.66h13.19a3.66 3.66 0 013.66 3.66v65.07h35.84a3.66 3.66 0 013.66 3.66zm31.8 0a3.65 3.65 0 01-3.66 3.65h-13.2a3.65 3.65 0 01-3.66-3.65v-81.92a3.66 3.66 0 013.66-3.66H217a3.66 3.66 0 013.66 3.66zm90.78 0a3.65 3.65 0 01-3.66 3.65h-13.19a3.67 3.67 0 01-.94-.12h-.05l-.25-.08h-.11l-.18-.08-.17-.08-.11-.06-.22-.14a3.45 3.45 0 01-.93-.9L254 229.56v48.66a3.66 3.66 0 01-3.67 3.65H237.1a3.65 3.65 0 01-3.66-3.65v-81.93a3.66 3.66 0 013.66-3.66h13.86l.21.05h.13l.21.07h.12a1.31 1.31 0 01.21.08l.12.06.19.11a.41.41 0 01.11.07l.19.13.1.07.19.16.07.07a2.28 2.28 0 01.22.22 3.58 3.58 0 01.28.37L290.89 245v-48.71a3.66 3.66 0 013.66-3.66h13.19a3.66 3.66 0 013.66 3.66zm72.83-68.74a3.66 3.66 0 01-3.65 3.67h-35.84V227h35.84a3.66 3.66 0 013.65 3.67v13.19a3.65 3.65 0 01-3.65 3.66h-35.84v13.85h35.84a3.65 3.65 0 013.65 3.66v13.19a3.66 3.66 0 01-3.65 3.67h-52.7a3.66 3.66 0 01-2.53-1l-.05-.05a.12.12 0 01-.05-.05 3.65 3.65 0 01-1-2.53V196.3a3.6 3.6 0 011-2.52l.06-.07a3.63 3.63 0 012.54-1h52.7a3.66 3.66 0 013.65 3.67z' fill='%23fff' data-name='レイヤー 1'/%3E%3C/svg%3E")!important;-webkit-background-size:50px auto!important;background-size:50px auto!important;background-position:5px 5px!important;border-radius:7px!important;padding:10px 15px 10px 60px!important}a.pg-modal__btn--line:hover{color:#fff}#pg-modal-content{width:320px;height:480px;border:none!important;margin:0!important}@media screen and (max-width:480px){#pg-modal-content{width:100%;height:100%;position:absolute;top:0;left:0}}.pg-modal__banner{line-height:0!important;padding:0!important;margin:0!important}`;} if(ccid==="99d185d4-21cb-4cfa-921b-a103ced579a0"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){inlineStyle=`#pg-modal{z-index:2147483647;position:fixed}.pg-modal{width:100%;height:100%;position:fixed;top:0;left:0;z-index:9999}.pg-modal__overlay{width:100%;height:100%;position:fixed;top:0;left:0;z-index:10000;background:rgba(102,102,102,.9);transition:all .3s}.pg-modal-body{overflow:visible;width:640px;height:960px;position:absolute;top:50%;left:50%;z-index:10001;text-align:center;transform:translate(-50%,-50%)}@media screen and (max-width:480px){.pg-modal-body{overflow:visible;width:85%;height:0;padding-top:132.8125%;box-sizing:border-box}}#pg-modal__close{width:40px;height:40px;position:absolute;z-index:10003;top:-15px;left:-15px;background:#fff;border-radius:50%;box-shadow:0 0 7px #141414}.pg-modal .icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-block;width:20px;height:20px;stroke-width:0;stroke:black;fill:black}#pg-modal-content{position:relative}.pg-modal__btn--line{width:100%;text-align:center;padding:0!important;margin:20px 0 15px!important}.pg-modal__btn--line a{display:inline-block;font-size:20px!important;line-height:40px!important;color:#fff!important;text-decoration:none!important;background-color:#52b448!important;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 511.99'%3E%3Cpath d='M443.2 233.29c0-84.14-84.35-152.6-188-152.6s-188 68.46-188 152.6c0 75.43 66.9 138.61 157.26 150.55 6.13 1.32 14.46 4 16.57 9.27 1.89 4.76 1.24 12.2.61 17 0 0-2.21 13.26-2.69 16.09-.82 4.75-3.78 18.6 16.29 10.14s108.21-63.76 147.66-109.16c27.25-29.89 40.3-60.18 40.3-93.89zm-254.38 44.92a3.67 3.67 0 01-3.66 3.67h-52.69a3.6 3.6 0 01-2.53-1l-.06-.05v-.05a3.65 3.65 0 01-1-2.53v-81.96a3.66 3.66 0 013.66-3.66h13.19a3.66 3.66 0 013.66 3.66v65.07h35.84a3.66 3.66 0 013.66 3.66zm31.8 0a3.65 3.65 0 01-3.66 3.65h-13.2a3.65 3.65 0 01-3.66-3.65v-81.92a3.66 3.66 0 013.66-3.66H217a3.66 3.66 0 013.66 3.66zm90.78 0a3.65 3.65 0 01-3.66 3.65h-13.19a3.67 3.67 0 01-.94-.12h-.05l-.25-.08h-.11l-.18-.08-.17-.08-.11-.06-.22-.14a3.45 3.45 0 01-.93-.9L254 229.56v48.66a3.66 3.66 0 01-3.67 3.65H237.1a3.65 3.65 0 01-3.66-3.65v-81.93a3.66 3.66 0 013.66-3.66h13.86l.21.05h.13l.21.07h.12a1.31 1.31 0 01.21.08l.12.06.19.11a.41.41 0 01.11.07l.19.13.1.07.19.16.07.07a2.28 2.28 0 01.22.22 3.58 3.58 0 01.28.37L290.89 245v-48.71a3.66 3.66 0 013.66-3.66h13.19a3.66 3.66 0 013.66 3.66zm72.83-68.74a3.66 3.66 0 01-3.65 3.67h-35.84V227h35.84a3.66 3.66 0 013.65 3.67v13.19a3.65 3.65 0 01-3.65 3.66h-35.84v13.85h35.84a3.65 3.65 0 013.65 3.66v13.19a3.66 3.66 0 01-3.65 3.67h-52.7a3.66 3.66 0 01-2.53-1l-.05-.05a.12.12 0 01-.05-.05 3.65 3.65 0 01-1-2.53V196.3a3.6 3.6 0 011-2.52l.06-.07a3.63 3.63 0 012.54-1h52.7a3.66 3.66 0 013.65 3.67z' fill='%23fff' data-name='レイヤー 1'/%3E%3C/svg%3E")!important;-webkit-background-size:50px auto!important;background-size:50px auto!important;background-position:5px 5px!important;border-radius:7px!important;padding:10px 15px 10px 60px!important}a.pg-modal__btn--line:hover{color:#fff}#pg-modal-content{width:640px;height:960px;border:none!important;margin:0!important}@media screen and (max-width:480px){#pg-modal-content{width:100%;height:100%;position:absolute;top:0;left:0}}.pg-modal__banner{line-height:0!important;padding:0!important;margin:0!important}`;} var insStyleTag=document.createElement("style");insStyleTag.innerHTML=inlineStyle;document.head.insertAdjacentElement("beforeend",insStyleTag);var inlineContainerWrap=` cross
`;var pgModalTag=document.createElement("div");pgModalTag.id="pg-modal";pgModalTag.style.display="none";pgModalTag.innerHTML=inlineContainerWrap;document.getElementsByTagName("body")[0].insertAdjacentElement("beforeend",pgModalTag);let pgModalInnerTag=document.createElement("iframe");pgModalInnerTag.id="pg-modal-content";var abTestFlag=JSON.parse("false");var pgModalInnerTagSrc=`https://cdn.chat-marketing.tech/clients/7cd7f53e-b278-4af9-a268-2235954da522/public/static/banner.html?action=${actionName}&imageName=${getCurrentImageName( imgName, scheduledImages )}&isABTestVariantA=${isABTestVariantA}`;if(abTestFlag){if(isABTestVariantA){pgModalInnerTagSrc=`https://cdn.chat-marketing.tech/clients/7cd7f53e-b278-4af9-a268-2235954da522/public/static/banner_a.html?action=${actionName}&imageName=None&isABTestVariantA=${isABTestVariantA}`;}else{pgModalInnerTagSrc=`https://cdn.chat-marketing.tech/clients/7cd7f53e-b278-4af9-a268-2235954da522/public/static/banner_b.html?action=${actionName}&imageName=cdn.chichat.tw&isABTestVariantA=${isABTestVariantA}`;}} pgModalInnerTag.setAttribute("src",pgModalInnerTagSrc);pgModalInnerTag.setAttribute("allow","clipboard-read; clipboard-write");pgModalInnerTag.setAttribute("scrolling","no");pgModalInnerTag.setAttribute("frameBorder","0");pgModalInnerTag.setAttribute("marginWidth","0");pgModalInnerTag.setAttribute("marginHeight","0");pgModalInnerTag.onload=function(){pgModalTag.style.display="block";};document.getElementById("pg-modal__content").insertAdjacentElement("beforeend",pgModalInnerTag);} function pgModalClose(){var pgCloseEle=document.getElementById("pg-modal__close");pgCloseEle.addEventListener("click",function(){var pgRemEle=document.getElementById("pg-modal");pgRemEle.remove();},false);} var showCountPopup=false;function showWaitPopup(){if(!showCountPopup&&!isPgModalCookie()&&!waitRefFlg){showModalAndSetCookie("wait");clearInterval(waitPopupTimer);}} var popupSecFlag=JSON.parse("true");var popup_millisec=Number("15000");let disableTimer=false;let waitPopupTimer=null;if(popupSecFlag){waitPopupTimer=setInterval(showWaitPopup,popup_millisec);} function clearPopup(){if(popupSecFlag&&!disableTimer){clearInterval(waitPopupTimer);waitPopupTimer=setInterval(showWaitPopup,popup_millisec);}} function setupIntervalCheck(conditionFunc,actionFunc,intervalTime=3000){setInterval(function(){if(conditionFunc()){actionFunc();console.log("condition fulfilled, clear");}},intervalTime);} if(ccid!=="1b4ebbd9-d21a-469f-9568-6be948d3ae85"){var iframes=document.getElementsByTagName("iframe");if(iframes.length>0){setInterval(function(){for(var i=0;i{window.addEventListener(eventType,function(event){clearPopup();},false);});let input=document.querySelector("input");if(input){clearPopup();input.onblur=clearPopup;input.onfocus=clearPopup;} window.addEventListener("popstate",function(event){clearPopup();event.preventDefault();return false;},false);function clearModalOnPageShow(){const pgModal=document.querySelector("#pg-modal");if(pgModal){pgModal.remove();}} window.addEventListener("pageshow",function(event){if(event.persisted){clearModalOnPageShow();}},false);window.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible"){clearModalOnPageShow();}});function loadScript(url,callback){var script=document.createElement("script");script.type="text/javascript";if(script.readyState){script.onreadystatechange=function(){if(script.readyState==="loaded"||script.readyState==="complete"){script.onreadystatechange=null;callback();}};}else{script.onload=function(){callback();};} script.src=url;document.getElementsByTagName("head")[0].appendChild(script);} const chiChatTsSrc="https://cdn.chat-marketing.tech/index.min.js";function clearAllConditions(){disableTimer=true;clearInterval(waitPopupTimer);if(chiChatPopstate)chiChatPopstate.clearPopState();if(scrollModal){window.removeEventListener("scroll",onScroll);} if(visibilityFlag){window.removeEventListener("visibilitychange",onVisibilityChange);}} function restartAllConditions(){disableTimer=false;clearPopup();if(chiChatPopstate)chiChatPopstate.restartPopState();if(scrollModal){window.addEventListener("scroll",onScroll);} if(visibilityFlag){window.addEventListener("visibilitychange",onVisibilityChange);}} window.addEventListener("chichatBotEfoStatusChange",function(event){if(event.detail.status){clearAllConditions();}else{restartAllConditions();}},false);let backSameDomainFlag=JSON.parse("true");let backPopupFlag=JSON.parse("true");let chiChatPopstate=null;const hasExternalService=JSON.parse("false");const botDefaultOpened=JSON.parse("false");const externalServiceProvider="None";let externalServiceSensor=null;loadScript(chiChatTsSrc,()=>{if(!isPgModalCookie()&&backPopupFlag&&!backFromLine) chiChatPopstate=new ChiChatPopState({sameDomainBackBtnPopupFlag:backSameDomainFlag,showPopupCallback:()=>{if(isPgModalCookie())return;showModalAndSetCookie("back");},});if(hasExternalService) externalServiceSensor=new ExternalBotHandler({defaultOpen:botDefaultOpened,botFrom:externalServiceProvider,onBotOpen:clearAllConditions,onBotClose:restartAllConditions,});});})();