(()=>{function e(e,c,o){e.preventDefault();const n=e.currentTarget;t(c,o),n.onclick=()=>!0,n.click()}window.addEventListener("load",(function(){void 0!==window.pchppProVars&&(window.pchppProVars.isLoggedIn||window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype&&window.fetch&&(window.pochippBtnCtDelay=10,o(".pochipp-box[data-cvkey]",".pochipp-box__btnwrap"),o(".pochipp-inline__btnwrap[data-cvkey]",":scope")))}));const c=[],o=(o,n)=>{const i=document.querySelectorAll(o);if(0===i.length)return;const r=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const c=e.target,o=c.getAttribute("data-cvkey"),n=window.pochippBtnCtDelay||10;window.pochippBtnCtDelay+=100,setTimeout((()=>{window.pochippBtnCtDelay-=100}),100),setTimeout((()=>{t(o,"imp")}),n),r.unobserve(c)}}))}));i.forEach((o=>{const t=o.getAttribute("data-cvkey");c.push(t),r.observe(o);const i=o.querySelector(".pochipp-box__image a"),p=o.querySelector(".pochipp-box__title a"),a=o.querySelector(".pochipp-box__review a"),l=o.querySelector(`${n}.-amazon a`),d=o.querySelector(`${n}.-rakuten a`),s=o.querySelector(`${n}.-yahoo a`),u=o.querySelector(`${n}.-mercari a`),h=o.querySelector(`${n}.-custom a`),w=o.querySelector(`${n}.-custom_2 a`);i&&(i.onclick=function(c){e(c,t,"clickedOther")}),p&&(p.onclick=function(c){e(c,t,"clickedOther")}),a&&(a.onclick=function(c){e(c,t,"clickedOther")}),l&&(l.onclick=function(c){e(c,t,"clickedAmazon")}),d&&(d.onclick=function(c){e(c,t,"clickedRakuten")}),s&&(s.onclick=function(c){e(c,t,"clickedYahoo")}),u&&(u.onclick=function(c){e(c,t,"clickedMercari")}),h&&(h.onclick=function(c){e(c,t,"clickedCustom")}),w&&(w.onclick=function(c){e(c,t,"clickedCustom2")})})),c.length>0&&(window.pochippBtnCtDelay+=500,setTimeout((()=>{window.pochippBtnCtDelay-=500}),500),t(c.join(","),"pv"))},t=(e,c)=>{const o=window.pchppProVars.postID;if(!o)return;const t=new URLSearchParams;t.append("action","pochipp_pro_ct_cv"),t.append("postid",o),t.append("cvkey",e),t.append("target",c),n(t)},n=async e=>{const c=window.pchppProVars.ajaxUrl;if(void 0===c)return;const o=window.pchppProVars.ajaxNonce;void 0!==o&&(e.append("nonce",o),await fetch(c,{method:"POST",cache:"no-cache",body:e}).then((e=>{if(e.ok)return e.json();throw new TypeError("Failed ajax!")})))}})();
//# sourceMappingURL=script.js.map