Files

2 lines
2.0 KiB
JavaScript

import{ad as _,aa as k,u as v,_ as d,k as L,y as P}from"./index.9_UWDUyH.js";const U=t=>(t||document.location.search).replace(/(^\?)/,"").split("&").map((function(e){return e=e.split("="),this[e[0]]=e[1],this}).bind({}))[0];let l=!1,n=null,y;const w=t=>{y(t,n,w)},W=(t,e,o,s,i,a,r,f,c)=>{let u=50,p=50;{const m=window.outerHeight;u=(window.innerWidth-o)/2,p=(m-50-s)/2}let h=`location=0,status=0,width=${o},height=${s},left=${u},top=${p}`;(e==="_blank"||e==="_self")&&(h=""),(!n||n.closed)&&(n=window.open(t,e,h)),n&&n.focus(),l=window.setInterval(()=>I(a,r,f,c),500)},I=(t,e,o,s=!1)=>{if(s){if(!n){window.removeEventListener("message",w,!1),window.clearInterval(l),o();return}n.closed&&(n=null,window.removeEventListener("message",w,!1),window.clearInterval(l),o());return}let i={};try{i=U(n.location.search)}catch{}const a=[];if(t.forEach(r=>{if(i[r]!==void 0&&i[r]){a.push(!0);return}a.push(!1)}),a.every(r=>r))return window.clearInterval(l),e(i).then(()=>{n.close(),n=null,o(!0)});if(!n){window.clearInterval(l),o();return}n.closed&&(n=null,window.clearInterval(l),o())},g="aioseo-broken-link-checker",O=()=>{const t=_(),e=k(),o=v(),s={toUnlock:d("To unlock a higher quota, consider",g),upgradingToPro:d("upgrading to Pro",g),upgradingToHigherPlan:d("upgrading to a higher plan",g)},i=c=>{if(t.showUpgradePopup=!1,c.success)return t.activateLicense(e.internalOptions.internal.license.licenseKey)},a=()=>{t.showUpgradePopup=!1},r=(c="broken-links-report",u="external-link")=>{if(t.showUpgradePopup.licenseUpgrade)return;t.showUpgradePopup=!0;const p=P.utmUrl(c,u,"blc-pricing-upgrade?license="+e.internalOptions.internal.license.licenseKey)+"&url="+btoa(o.aioseoBrokenLinkChecker.urls.connect);W(p,d("Upgrade Your Broken Link Checker License",g),650,800,!0,["success"],i,a)},f=L(()=>e.internalOptions.internal.license.level&&e.internalOptions.internal.license.level.toLowerCase()==="free"?s.upgradingToPro:s.upgradingToHigherPlan);return{openLicenseUpgradePopup:r,strings:s,upgradeAnchor:f,completedLicenseUpgrade:i,closedLicenseUpgrade:a}};export{W as p,O as u};