import{u as _,b as v,_ as d,d as k}from"./index.DshNLnwE.js";import{u as L}from"./LicenseStore.DW4V507O.js";import{z as P}from"./runtime-dom.esm-bundler.B6m80oiY.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 l=!1,n=null,y;const w=o=>{y(o,n,w)},W=(o,e,r,s,i,a,t,f,c)=>{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(),l=window.setInterval(()=>I(a,t,f,c),500)},I=(o,e,r,s=!1)=>{if(s){if(!n){window.removeEventListener("message",w,!1),window.clearInterval(l),r();return}n.closed&&(n=null,window.removeEventListener("message",w,!1),window.clearInterval(l),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(l),e(i).then(()=>{n.close(),n=null,r(!0)});if(!n){window.clearInterval(l),r();return}n.closed&&(n=null,window.clearInterval(l),r())},g="aioseo-broken-link-checker",T=()=>{const o=L(),e=_(),r=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(o.showUpgradePopup=!1,c.success)return o.activateLicense(e.internalOptions.internal.license.licenseKey)},a=()=>{o.showUpgradePopup=!1},t=(c="broken-links-report",u="external-link")=>{if(o.showUpgradePopup.licenseUpgrade)return;o.showUpgradePopup=!0;const p=k.utmUrl(c,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=P(()=>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};
