芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/blog.ycreate.jp/wp-content/themes/swell/build/js/front/count_CTR.min.js
!function(){"use strict";const t=async(t,e,n=undefined,o=undefined)=>{const r=new URLSearchParams;Object.keys(e).forEach((t=>{r.append(t,e[t])})),(async(t,e,n,o)=>{var r,d;const i=null===(r=window)||void 0===r||null===(d=r.swellVars)||void 0===d?void 0:d.restUrl;void 0!==i&&fetch(i+t,e).then((t=>{if(t.ok)return t.json();throw new TypeError(`Failed callRestApi: ${t.status}`)})).then((t=>{n&&n(t)})).catch((n=>{console.error(n),console.error("route:"+t,e),o&&o()}))})(t,{method:"POST",body:r},n,o)},e=e=>{const n={adid:e.adID,ct_name:e.ctName};e.target&&(n.target=e.target),t("swell-ct-ad-data",n)},n=(t,n)=>{if("mousedown"===t.type&&1!==t.button)return;const o=document.querySelector(`.p-adBox[data-id="${n.adID}"]`);null!==o&&(o.getAttribute("data-clicked")||(o.setAttribute("data-clicked","1"),e(n)))},o=(e,n)=>{var o,r;const d=null===(o=window)||void 0===o||null===(r=o.swellVars)||void 0===r?void 0:r.postID;d&&t("swell-ct-btn-data",{postid:d,btnid:e,ct_name:n})},r=(t,e)=>{if("mousedown"===t.type&&1!==t.button)return;const n=t.currentTarget;n.getAttribute("data-clicked")||(n.setAttribute("data-clicked","1"),o(e,"click"))};function d(){var t,d;if(!window.IntersectionObserver||!("isIntersecting"in IntersectionObserverEntry.prototype))return void console.error("IntersectionObserver is not supported.");if(!window.fetch)return void console.error("fetch() is not supported.");if(void 0===(null===(t=window)||void 0===t||null===(d=t.swellVars)||void 0===d?void 0:d.restUrl))return void console.error("restUrl not found.");const i={root:null,rootMargin:"0px 0px 10% 0px",threshold:0};(t=>{const o=document.querySelectorAll(".p-adBox");if(0===o.length)return;const r=[];window.swlAdCtDelay=10;const d=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const n=t.target,o=n.getAttribute("data-id"),r=window.swlAdCtDelay||10;window.swlAdCtDelay+=100,setTimeout((()=>{window.swlAdCtDelay-=100}),100),setTimeout((()=>{e({adID:o,ctName:"imp"})}),r),d.unobserve(n)}}))}),t);o.forEach((t=>{const e=t.getAttribute("data-id"),o=t.getAttribute("data-ad");if(r.push(e),d.observe(t),"text"===o){const o=t.querySelector("a");if(o){const t={adID:e,ctName:"click",target:"tag"};o.addEventListener("click",(e=>n(e,t))),o.addEventListener("mousedown",(e=>n(e,t)))}}else{const o=t.querySelector(".p-adBox__img a");if(o){const t={adID:e,ctName:"click",target:"tag"};o.addEventListener("click",(e=>n(e,t))),o.addEventListener("mousedown",(e=>n(e,t)))}const r=t.querySelector(".-btn1");if(r){const t={adID:e,ctName:"click",target:"btn1"};r.addEventListener("click",(e=>n(e,t))),r.addEventListener("mousedown",(e=>n(e,t)))}const d=t.querySelector(".-btn2");if(d){const t={adID:e,ctName:"click",target:"btn2"};d.addEventListener("click",(e=>n(e,t))),d.addEventListener("mousedown",(e=>n(e,t)))}}})),r.length>0&&(window.swlAdCtDelay+=500,setTimeout((()=>{window.swlAdCtDelay-=500}),500),e({adID:r.join(","),ctName:"pv"}))})(i),(t=>{const e=document.querySelectorAll(".swell-block-button[data-id]");if(0===e.length)return;window.swellVars.postID=(()=>{const t=document.querySelector("#content[data-postid], #lp-content[data-postid]");return null===t?(console.error("content[data-postid] not found."),0):t.getAttribute("data-postid")||(console.log("data-postid not found."),0)})();const n=[];window.swlBtnCtDelay=10;const d=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const e=t.target,n=e.getAttribute("data-id"),r=window.swlBtnCtDelay||10;window.swlBtnCtDelay+=100,setTimeout((()=>{window.swlBtnCtDelay-=100}),100),setTimeout((()=>{o(n,"imp")}),r),d.unobserve(e)}}))}),t);e.forEach((t=>{const e=t.getAttribute("data-id");n.push(e),d.observe(t);const o=t.querySelector("a");o&&(o.addEventListener("click",(t=>r(t,e))),o.addEventListener("mousedown",(t=>r(t,e))))})),n.length>0&&(window.swlBtnCtDelay+=500,setTimeout((()=>{window.swlBtnCtDelay-=500}),500),o(n,"pv"))})(i)}window.isSwlAdCtConnecting=!1,window.addEventListener("load",(function(){window.swellVars.isLoggedIn||d()})),window.SWELLHOOK&&window.SWELLHOOK.barbaAfter.add(d)}();