OwlCyberSecurity - MANAGER
Edit File: postSlug.XW1wPUFy.js
var yt=Object.defineProperty;var St=(t,e,n)=>e in t?yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var y=(t,e,n)=>St(t,typeof e!="symbol"?e+"":e,n);import{m as V,R as Z,b as p,C as E,E as P,z as w,d as g,H as $,T as q,U as M,G as L,F as _,u as X,V as Et,a as F,W as K,s as ht}from"./links.cMjoa9mX.js";import{a1 as G}from"./vue.esm-bundler.CWQFYt9y.js";import{d as J}from"./Caret.iRBf3wcH.js";import{s as Pt}from"./metabox.B54N9lJ3.js";import{c as I}from"./cleanForSlug.o2RefBn0.js";import{g as S}from"./get.BT85ybc8.js";import{b as vt}from"./_baseSet.DALGekmy.js";import{B as Tt}from"./helpers.D2xRWOvn.js";function kt(t,e,n){return t==null?t:vt(t,e,n)}const xt=t=>{var n;if(typeof(window==null?void 0:window.acf)!="object"||typeof((n=window.acf)==null?void 0:n.getField)!="function")return null;const e=window.acf.getField(t)||{};return typeof(e==null?void 0:e.val)!="function"?null:e.val()||{}},bt=()=>{const t=window.elementor.documents.getCurrent(),e=[];return t.$element?(t.$element.find(".elementor-widget-container").each((n,r)=>{const o=r.innerHTML.trim().replaceAll(/<p.*>(<img.*>)<\/p>/g,"$1");V(o)===""&&Z(o).length===0||e.push(o)}),e.join(" ")):""},N=()=>{var n;const{settings:t,config:e}=window.elementor;return{content:bt(),title:t.page.model.get("post_title"),excerpt:t.page.model.get("post_excerpt")||"",slug:I(t.page.model.get("post_title")),permalink:e.document.urls.permalink||"",featuredImage:((n=t.page.model.get("post_featured_image"))==null?void 0:n.url)||""}},Ct=()=>{const t=S(ET_Builder,"Frames.app.frameElement",document.querySelector("iframe#et-fb-app-frame"));if(!t)return document.createElement("div");let e=t.contentWindow.document.querySelectorAll("#et-fb-app");return 1<e.length&&(e=[...e].filter(n=>n.classList.contains("et-fb-root-ancestor"))),e[0]||document.createElement("div")},At=()=>{const t=[],e=Ct().querySelectorAll(".et_pb_section"),n=new RegExp(["<style.*?</style>","\\[object Object\\]"].join("|"),"gi");for(const r of e){const o=r.innerHTML.replace(n,"").replaceAll(/<p.*>(<img.*>)<\/p>/g,"$1");V(o)===""&&Z(o).length===0||t.push(o)}return t.join(" ")},_t=()=>{const t=new URL(S(ETBuilderBackendDynamic,"currentPage.permalink",""));return t.searchParams.delete("PageSpeed"),t.href},It=async()=>{const{wp:t}=window,e=S(ETBuilderBackendDynamic,"currentPage.thumbnailId",0);if(!t||e===0)return"";const n=t.media.attachment(e);let r="";return await n.fetch().then(()=>{r=n.get("url"),kt(ETBuilderBackendDynamic,"currentPage.thumbnailUrl",r)}),r},B=()=>({content:At(),title:S(ETBuilderBackendDynamic,"postTitle",""),excerpt:S(ETBuilderBackendDynamic,"postMeta.post_excerpt",""),slug:S(ETBuilderBackendDynamic,"postMeta.post_name",""),permalink:_t(),featuredImage:It()}),$t=t=>{let e;switch(t.type){case"header":e=document.createElement(t.settings.tag),e.innerHTML=t.settings.headerTxt.trim();break;case"image":const n=document.createElement("img");t.settings.altTxt&&n.setAttribute("alt",t.settings.altTxt),t.settings.src&&n.setAttribute("src",t.settings.src),t.settings.noFollow&&n.setAttribute("rel","nofollow"),e=n,t.settings.link&&(e=document.createElement("a"),e.setAttribute("href",t.settings.link),e.innerHTML=n.outerHTML,t.settings.noFollow&&e.setAttribute("rel","nofollow"),t.settings.openNewWindow&&e.setAttribute("target","_blank"));break;case"video":t.settings.type==="youtube"?(e=document.createElement("iframe"),e.setAttribute("src",t.settings.youtubeUrl)):(e=document.createElement("div"),e.innerHTML=t.settings.code);break;case"text":e=document.createElement("div"),e.innerHTML=t.settings.txt.trim();break;case"button":e=document.createElement("a"),e.appendChild(document.createTextNode(t.settings.btnTxt+" "+t.settings.btnSubTxt)),t.settings.link&&e.setAttribute("href",t.settings.link),t.settings.altTxt&&e.setAttribute("alt",t.settings.altTxt),t.settings.src&&e.setAttribute("src",t.settings.src),t.settings.noFollow&&e.setAttribute("rel","nofollow"),t.settings.openNewWindow&&e.setAttribute("target","_blank");break;case"bullet-list":e=document.createElement("ul"),t.settings.items.forEach(r=>{const o=document.createElement("li");o.innerHTML=r.txt,e.appendChild(o)});break;case"custom-html":e=document.createElement("div"),e.innerHTML=t.settings.code;break}return e},qt=()=>{const t=[];return JSON.parse(JSON.stringify(S(seedprod_data,"settings.document.sections",[]))).forEach(n=>{n.rows.forEach(r=>{r.cols.forEach(o=>{o.blocks.forEach(a=>{const s=$t(a);s&&(V(s)===""&&Z(s).length===0||t.push(s.outerHTML))})})})}),t.join(" ")},Mt=()=>{const t=S(seedprod_data,"home_url",""),e=S(seedprod_data,"settings.post_name","");return`${t}/${e}/`},D=()=>({content:qt(),title:S(seedprod_data,"settings.post_title",""),excerpt:"",slug:S(seedprod_data,"settings.post_name",""),permalink:Mt()}),Lt=()=>p().currentPost.processedContent,Nt=t=>{var e;if(t==="admin_frontend_editor"){const{vc:n}=window;return n.builder.getTitle()}return((e=document.getElementById("#title"))==null?void 0:e.value)||""},Bt=t=>{var e;if(t==="admin_frontend_editor"){const{vc_iframe_src:n}=window,r=new URL(n).pathname.split("/").filter(o=>o);return r[r.length-1]}return((e=document.querySelector("#post_name"))==null?void 0:e.value)||""},Dt=t=>{var e;if(t==="admin_frontend_editor"){const{vc_iframe_src:n}=window;return n.replace(new URL(n).search,"")}return((e=document.querySelector("#sample-permalink a"))==null?void 0:e.href)||""},R=()=>{const{vc_mode:t}=window;return{content:Lt(),title:Nt(t),excerpt:"",slug:Bt(t),permalink:Dt(t),featuredImage:""}},Rt=()=>{var e;return((e=p().currentPost)==null?void 0:e.processedContent)||""},Ut=()=>{var e;const{FusionApp:t}=window;return(t==null?void 0:t.getPost("post_title"))||((e=document.getElementById("#title"))==null?void 0:e.value)||""},Ht=()=>{var e;const{FusionApp:t}=window;return(t==null?void 0:t.getPost("post_name"))||((e=document.querySelector("#post_name"))==null?void 0:e.value)||""},Wt=()=>{var e;const{FusionApp:t}=window;return(t==null?void 0:t.getPost("post_permalink").replace("?fb-edit=1",""))||((e=document.querySelector("#sample-permalink a"))==null?void 0:e.href)||""},Ot=async()=>{const{wp:t,FusionApp:e}=window;if(!t||!e||!e.getDynamicPost("post_meta")._thumbnail_id)return"";const n=t.media.attachment(e.getDynamicPost("post_meta")._thumbnail_id);let r="";return await n.fetch().then(()=>{r=n.get("url")}),r},U=()=>({content:Rt(),title:Ut(),excerpt:"",slug:Ht(),permalink:Wt(),featuredImage:Ot()}),tt=()=>{let t="";switch(!0){case _():t=N().permalink;break;case L():t=B().permalink;break;case M():t=D().permalink;break;case q():t=R().permalink;break;case $():t=U().permalink;break}return t},zt=()=>{const t=g();if(t.liveTags.permalink)return t.liveTags.permalink;let e;if(E()||P){const n=document.querySelector("#edit-slug-box a");n&&n.href&&(e=n.href)}return w()&&(e=window.wp.data.select("core/editor").getPermalink()),e||(e=tt()),e&&t.updatePermalink(e),e},x=()=>{let t;if(E()||P){const e=document.querySelector("#edit-slug-box a");e&&e.href&&(t=e.href)}return w()&&(t=window.wp.data.select("core/editor").getPermalink()),t||(t=tt()),t},Vt=async(t=!0)=>{let e=zt();const n=x();if(e!==n&&(e=n,e)){const r=p();if(g().updatePermalink(e),!t)return;new v().runAnalysis({postId:r.currentPost.id,postData:{...r.currentPost},content:k(),slug:x()})}},et=()=>{let t="";switch(!0){case _():t=N().title;break;case L():t=B().title;break;case M():t=D().title;break;case q():t=R().title;break;case $():t=U().title;break}return t},jt=()=>{const t=g();if(t.liveTags.post_title)return t.liveTags.post_title;let e;if(E()||P()){const n=document.querySelector("#post input#title");e=n?n.value:""}return w()&&(e=window.wp.data.select("core/editor").getCurrentPost().title),e||(e=et()),e&&t.updatePostTitle(e),e},nt=()=>{let t;if(E()||P()){const e=document.querySelector("#post input#title");t=e?e.value:""}return w()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("title")),t||(t=et()),t},Gt=async(t=!0)=>{let e=jt();const n=nt();if(e!==n){e=n;const r=p();if(g().updatePostTitle(e),!t)return;new v().runAnalysis({postId:r.currentPost.id,postData:{...r.currentPost},content:k(),slug:x()})}},rt=t=>t?(t=t.replaceAll(/\n\n/g," "),t=V(t,!1,"innerText"),t=t.replace(/\[.*?]/g,""),t.trim()):"",ot=()=>{let t="";switch(!0){case _():t=N().excerpt;break;case L():t=B().excerpt;break;case M():t=D().excerpt;break;case q():t=R().excerpt;break;case $():t=U().excerpt;break}return t},Jt=()=>{const t=g();if(t.liveTags.post_excerpt)return t.liveTags.post_excerpt;let e;return(E()||P())&&(e=st()),w()&&(e=window.wp.data.select("core/editor").getCurrentPost().excerpt),e||(e=ot()),e||(e=rt(mt())),e&&t.updatePostExcerpt(e),e},Zt=()=>{let t;return(E()||P())&&(t=st()),w()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("excerpt")),t||(t=ot()),t||(t=rt(k())),t},Xt=async(t=!0)=>{let e=Jt();const n=Zt();if(e!==n){e=n;const r=p();if(g().updatePostExcerpt(e),!t)return;new v().runAnalysis({postId:r.currentPost.id,postData:{...r.currentPost},content:k(),slug:x()})}},st=()=>{let t="";const e=document.querySelector("#postexcerpt textarea#excerpt");if(t=e?e.value:"",document.querySelector("#wp-excerpt-wrap.tmce-active")){const n=window.tinyMCE?window.tinyMCE.get("excerpt"):"";n&&(t=n.getContent({format:"raw"}))}return t};let f="",T="";const Ft=(t=!0)=>{var r;const e=g();if(E()||P()){const o=document.querySelectorAll('#post input[name="post_category[]"]:checked');o.length?(f!==o[0].parentNode.innerText&&(f=o[0].parentNode.innerText,e.updateTaxonomyTitle(f)),T=Array.from(o).map(a=>a.parentNode.innerText).join(", "),e.updateCategories(T)):f!==""&&(f=T="",e.updateTaxonomyTitle(f),e.updateCategories(T))}if(w()){let o=[],a=[];if((r=X().aioseo.user.data.allcaps)!=null&&r.manageCategories&&(o=window.wp.data.select("core").getEntityRecords("taxonomy","category"),a=window.wp.data.select("core/editor").getEditedPostAttribute("categories")),a&&a.length&&o){const l=o.find(i=>i.id===a[0]);l&&f!==l.name&&(f=l.name,e.updateTaxonomyTitle(f)),T=o.filter(i=>a.includes(i.id)).map(i=>i.name).join(", "),e.updateCategories(T)}else f!==""&&(f=T="",e.updateTaxonomyTitle(f),e.updateCategories(T))}const n=p();t&&new v().runAnalysis({postId:n.currentPost.id})},Qt=(t=!1)=>{const e=p();if(e.currentPost.context!=="term")return;const n=g(),r=document.querySelector("#edittag input#name");r&&(n.updateTaxonomyTitle(r.value),r.addEventListener("input",()=>{n.updateTaxonomyTitle(r.value)}));const o=document.querySelector("#edittag textarea#description");o&&(n.updateTaxonomyDescription(o.value),o.addEventListener("input",()=>{n.updateTaxonomyDescription(o.value)}));const a=document.querySelector("#edittag input#slug");if(a){const s=I(a.value);n.updatePermalinkSlug(s),n.updatePermalink(e.currentPost.permalink.replace(`/${n.permalinkSlug}`,`/${s.replace(/ /gi,"-").replace(/[^a-z0-9-]/gi,"").toLowerCase()}`)),a.addEventListener("input",()=>{n.updatePermalinkSlug(s),n.updatePermalink(e.currentPost.permalink.replace(`/${n.permalinkSlug}`,`/${s.replace(/ /gi,"-").replace(/[^a-z0-9-]/gi,"").toLowerCase()}`))})}e.savePostState(),t&&v.runAnalysis({postId:e.currentPost.id})},Yt=(t=!1)=>{const e=p();if(e.currentPost.postType!=="attachment")return;const n=g(),r=document.querySelector("textarea#attachment_caption");r&&(n.updateAttachmentCaption(r.value),r.addEventListener("input",i=>{n.updateAttachmentCaption(i.target.value)}));const o=document.querySelector("textarea#attachment-details-caption");o&&(n.updateAttachmentCaption(o.value),o.addEventListener("input",i=>{n.updateAttachmentCaption(i.target.value)}));const a=document.querySelector("textarea#attachment_content");a&&(n.updateAttachmentDescription(a.value),a.addEventListener("input",i=>{n.updateAttachmentDescription(i.target.value)}));const s=document.querySelector("input#attachment_alt");s&&(n.updateAltTag(s.value),s.addEventListener("input",i=>{n.updateAltTag(i.target.value)}));const l=document.querySelector("input#attachment-details-alt-text");l&&(n.updateAltTag(s.value),l.addEventListener("input",i=>{n.updateAltTag(i.target.value)})),t&&new v().runAnalysis({postId:e.currentPost.id})},at=()=>{var e,n;const t=p();return(e=t==null?void 0:t.currentPost)!=null&&e.id&&!!((n=t.currentPost)!=null&&n.isPageAnalysisEligible)||!1},ge=()=>{var r,o;const t=X();if(!((r=t.aioseo.screen)!=null&&r.postType))return!1;const e=p();return!!((o=F().options.advanced)!=null&&o.truSeo&&Pt(t.aioseo.screen.postType)&&!e.currentPost.isStaticPostsPage)},A=async(t=900,e=!0)=>{J(async()=>{const n=Et(),r=p();await Gt(!1),await te(!1),await Xt(!1),await oe(!1),await Vt(!1),Ft(!1),Qt(!1),Yt(!1),J(n.updateSchemaOutput,Math.max(t*2,1800)),e&&new v().runAnalysis({postId:r.currentPost.id})},t)},fe=t=>{const e=t.getRangeAt(0),n=e.cloneRange();return n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.startContainer,e.startOffset),t},we=t=>{const e=new RegExp(" ","g");return t.replace(/ /g," ").replace(e," ")},ye=({element:t,property:e,value:n})=>{if(!t)return document.documentElement;let r=t.parentElement;for(;r;){if(r.isEqualNode(document.documentElement)||n===document.defaultView.getComputedStyle(r).getPropertyValue(e))return r;r=r.parentElement}},Se=()=>{const t=document.createElement("div");return t.classList.add("tru-seo-highlight-popover-wrapper"),t.style.position="absolute",t.style.zIndex="999",t.style.display="flex",t.setAttribute("tabindex",-1),t},it=()=>{const e=p().currentPost.postType;if(!e)return"";const r=F().dynamicOptions.searchAppearance.postTypes[e].customFields;if(!r||!at)return"";const o=()=>{A(500)},a=r.replace(/\n/g,",").split(","),s=[],l=["INPUT","TEXTAREA","IMG"],i=u=>{try{document.createDocumentFragment().querySelector(u)}catch{return!1}return!0};a.forEach(u=>{u=u.trim();const m=i(`#${u}`)?document.querySelector(`#${u}`):!1,b=document.querySelectorAll("#the-list > tr"),H=document.querySelectorAll(".acf-field");l.includes(m==null?void 0:m.tagName)&&!(m!=null&&m.closest(".acf-field"))?s.push(m):b.forEach(d=>{const c=d.querySelector(`#${d.id}-key`),C=d.querySelector(`#${d.id}-value`);l.includes(C==null?void 0:C.tagName)&&a.includes(c==null?void 0:c.value)&&s.push(C)}),H.forEach(d=>{if(u!==d.dataset.name)return"";let c=d.querySelector(`[id^="acf"][name$="[${d.dataset.key}]"]`);if(d.dataset.type==="image"&&(c=d.querySelector(".has-value img")),d.dataset.type==="gallery"&&(c=d.querySelector(".acf-gallery-attachment img")),d.dataset.type==="link"&&(c=xt(d.dataset.key)||d.querySelector(`[name$="[${d.dataset.key}][url]"]`)||{},c={tagName:"INPUT",type:"url",value:(c==null?void 0:c.url)??(c==null?void 0:c.value)??""}),!c||c.type&&c.type==="hidden")return"";if(d.dataset.type==="wysiwyg"){const C=window.setInterval(()=>{var W,O;(O=(W=window.tinyMCE)==null?void 0:W.activeEditor)!=null&&O.acf&&(window.clearInterval(C),window.tinyMCE.activeEditor.on("keyup",function(){A(500)}),window.tinyMCE.activeEditor.on("PostProcess",function(){J(()=>{A(500)},10)}))},50),ft=function(W){W.forEach(O=>{var Y;if(O.attributeName==="class"&&d.querySelector(".wp-editor-wrap.tmce-active")&&((Y=window.tinyMCE)!=null&&Y.activeEditor)){window.tinyMCE.activeEditor.on("keyup",function(){A(500)});const j=d.querySelector(`[name="acf[${d.dataset.key}]"]`);j&&(j.addEventListener("keyup",()=>{A(500)}),j.addEventListener("paste",()=>{A(500)}))}})},wt=new MutationObserver(ft),Q=d.querySelector(".wp-editor-wrap");Q&&wt.observe(Q,{attributes:!0})}l.includes(c.tagName)&&s.push(c)})});let h="";return s.forEach(u=>{let m="";if(l.includes(u.tagName)&&typeof(u==null?void 0:u.addEventListener)=="function"&&u.addEventListener("keyup",o),u.value&&(m=u.value),u.tagName==="IMG"&&u.src){const b=u.alt?`alt="${u.alt}"`:"";m=`<img src="${u.src}" ${b}>`}u.value&&u.type&&u.type==="url"&&(m=`<a href="${m}">${m}</a>`),m&&(h+=`${m} `)}),h},Ee=(t,e=["INPUT","TEXTAREA","IMG"])=>{if(!t)return"";const n=document.querySelector(`#${t}`),r=document.querySelectorAll("#the-list > tr"),o=document.querySelectorAll(".acf-field");let a="";return n&&e.indexOf(n.tagName)!==-1&&(n.closest(".acf-field")||(a=n.tagName==="IMG"?n.getAttribute("src"):n.value)),r.length&&r.forEach(s=>{const l=s.querySelector(`#${s.id}-key`),i=s.querySelector(`#${s.id}-value`);i&&e.indexOf(i.tagName)!==-1&&l.value===t&&(a=i.tagName==="IMG"?i.getAttribute("src"):i.value)}),o.length&&o.forEach(s=>{if(t!==s.dataset.name)return;let l;e.forEach(i=>{const h=i.toLowerCase();l=s.querySelector(`[data-key="${s.dataset.key}"] ${h}`)||l}),l&&(a=l.tagName==="IMG"?l.getAttribute("src"):l.value)}),a},Kt=t=>{const e=t.getBody();return 1<e.childNodes.length?!1:e.childNodes.length===0?!0:1<e.childNodes[0].childNodes.length?!1:/^\n?$/.test(e.innerText||e.textContent)},ct=/base64,(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)/g,lt=["acf","aioseo"],ut=()=>{let t="";switch(!0){case _():t=N().content;break;case L():t=B().content;break;case M():t=D().content;break;case q():t=R().content;break;case $():t=U().content;break}return t},dt=t=>{var r;if(!t.includes('<!-- wp:block {"ref":'))return t;const e=(r=window.wp.blocks)==null?void 0:r.rawHandler({HTML:t});return Tt(e).forEach(o=>{var a,s,l;if(o.name==="core/block"){const i=window.wp.data.select("core").getEntityRecord("postType","wp_block",(a=o.attributes)==null?void 0:a.ref);(s=i==null?void 0:i.content)!=null&&s.raw&&(t=t.replace(`<!-- wp:block {"ref":${(l=o.attributes)==null?void 0:l.ref}} /-->`,i.content.raw))}}),t},pt=(t,e)=>(window.wp.data.select("core/block-editor").getBlocks().forEach(r=>{if(e.includes(r.name.split("/")[0])){const o=document.getElementById("block-"+r.clientId);if(o&&o.innerText){const a=`(<!-- wp:${r.name}.*?/wp:${r.name} -->)|(<!-- wp:${r.name}.*?/-->)`;t=t.replace(new RegExp(a,"s"),o.innerText)}}}),t),mt=()=>{const t=g();if(t.liveTags.post_content)return t.liveTags.post_content;let e="";if(E()&&!K())if(window.tinyMCE||document.querySelector("#wp-content-wrap.html-active"))e=z();else{const r=window.setInterval(()=>{window.tinyMCE&&(window.clearInterval(r),e=z())},50)}return w()&&(e=window.wp.data.select("core/editor").getCurrentPost().content||"",e=dt(e),e=pt(e,lt)),e||(e=ut()),p().currentPost.descriptionIncludeCustomFields&&(e=e+it()),e=e.replace(ct,""),e&&t.updatePostContent(e),e},k=()=>{let t="";if(E()&&!K())if(window.tinyMCE||document.querySelector("#wp-content-wrap.html-active"))t=z();else{const n=window.setInterval(()=>{window.tinyMCE&&(window.clearInterval(n),t=z())},50)}return w()&&(t=window.wp.data.select("core/editor").getEditedPostContent(),t=dt(t),t=pt(t,lt)),t||(t=ut()),p().currentPost.descriptionIncludeCustomFields&&(t=t+it()),t=t.replace(ct,""),t},te=async(t=!0)=>{let e=mt();const n=k();if(e!==n){e=n;const r=p();if(g().updatePostContent(e),!t)return;new v().runAnalysis({postId:r.currentPost.id,postData:{...r.currentPost},content:k(),slug:x()})}},z=()=>{let t;const e=window.tinyMCE?window.tinyMCE.get("content"):"";if(document.querySelector("#wp-content-wrap.tmce-active")&&e)t=e.getContent({format:Kt(e)?"html":"raw"});else{const n=document.querySelector("textarea#content");t=n?n.value:""}return t};function ee(t){return new Worker(""+window.__aioseoDynamicImportPreload__("main-B1WsVr1Z.js"),{name:t==null?void 0:t.name})}class v{constructor(){y(this,"postId",null);y(this,"postTitle",null);y(this,"postParsedTitle",null);y(this,"postParsedDescription",null);y(this,"postDescription",null);y(this,"keyphrases",null);y(this,"postContent",null);y(this,"postSlug",null);y(this,"isAnalyzing",!1);y(this,"worker",null)}async runAnalysis({postId:e,postData:n,content:r=k(),slug:o=x()}){var d;const a=p(),s=F();if(n=n||{...a.currentPost},!((d=s.options.advanced)!=null&&d.truSeo)||!a.currentPost.page_analysis||this.isAnalyzing)return;this.worker&&this.worker.terminate();const l={separator:ht(s.options.searchAppearance.global.separator)},i=X(),h=g(),u=h.tags.map(c=>h.liveTags[c.id]!==void 0&&c.value!==h.liveTags[c.id]?{...c,value:h.liveTags[c.id]}:c),m={...G(i.aioseo),tags:G(u),currentPost:G(a.currentPost)},b=JSON.parse(JSON.stringify({postId:e,postData:n,content:r,aioseo:m,slug:o,postEditedTitle:nt(),aioseoGlobals:l}));let H=[];this.worker=new ee,this.worker.addEventListener("message",c=>{c.data.event==="tru-seo-analysis-complete"&&(H=c.data.analysis,this.dispatchActions(H,b),this.worker.terminate())}),this.worker.postMessage({event:"tru-seo-analysis",analysisData:b})}setSidebarButtonScore(e){const n=document.getElementById("aioseo-post-settings-sidebar-button"),r=document.getElementById("aioseo-post-score");!n||!r||(n.className=80<e?"score-green":50<e?"score-orange":"score-red",w()||(n.classList.add("aioseo-score-button","classic-editor"),e=`${e}/100`),r.textContent=e)}dispatchActions(e,n){const r=p();e.forEach(o=>{o.action==="updateState"&&n.postEditedTitle&&at()&&this.setSidebarButtonScore(o.data.seo_score),r[o.action](o.data)})}}const gt=()=>{let t="";switch(!0){case _():t=N().slug;break;case L():t=B().slug;break;case M():t=D().slug;break;case q():t=R().slug;break;case $():t=U().slug;break}return t},ne=()=>{const t=g();if(t.permalinkSlug)return t.permalinkSlug;let e="";if(E()||P()){const n=document.querySelector("#post_name");n&&(e=I(n.value))}return w()&&(e=window.wp.data.select("core/editor").getCurrentPost().slug),e||(e=gt()),e&&t.updatePermalinkSlug(e),e},re=()=>{let t="";if(E()||P()){const e=document.querySelector("#post_name");e&&(t=I(e.value))}if(w()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("slug")),_()){const e=window.elementor.settings.page.model.get("post_title");e&&(t=I(e))}return t||(t=gt()),t},oe=async(t=!0)=>{let e=ne();const n=re();if(e!==n){e=n;const r=p();if(g().updatePermalinkSlug(e),!t)return;new v().runAnalysis({postId:r.currentPost.id,postData:{...r.currentPost},content:k(),slug:x()})}};export{v as T,B as a,U as b,Ee as c,k as d,Ft as e,Qt as f,N as g,Yt as h,R as i,ge as j,re as k,Se as l,A as m,we as n,ye as o,fe as r,kt as s,at as t};