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