OwlCyberSecurity - MANAGER
Edit File: helpers.7350cd15.js
var Ot=Object.defineProperty;var _t=(t,e,s)=>e in t?Ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var w=(t,e,s)=>_t(t,typeof e!="symbol"?e+"":e,s);import{p as Gt,d as Mt,e as p,b as C,h as I,l as q,k as It,A as y,r as nt,u as tt,s as qt,G as f,y as P,z as k,E as D,U as L,D as B,V as R,W as U,C as J,B as M,X as Q}from"./index.66ecdd60.js";import{d as ot}from"./Caret.a21d4ca8.js";import{s as $t}from"./metabox.ee51de75.js";import{c as $}from"./cleanForSlug.97664b33.js";import{a as Dt,g as E}from"./_baseSet.9f9da1bd.js";import{I as Lt}from"./helpers.53868b98.js";import"./translations.d159963e.js";import{_ as l}from"./default-i18n.20001971.js";import{e as ut}from"./regex.8a6101c0.js";import{n as pt,g as Bt,aT as rt}from"./runtime-dom.esm-bundler.5c3c7d72.js";function Rt(t,e,s){return t==null?t:Dt(t,e,s)}const u="all-in-one-seo-pack",Ut=()=>{const t=[{slug:"article",graphName:"Article",label:l("Article",u)},{slug:"book",graphName:"Book",label:l("Book",u)},{slug:"course",graphName:"Course",label:l("Course",u)},{slug:"dataset",graphName:"Dataset",label:l("Dataset",u)},{slug:"event",graphName:"Event",label:l("Event",u)},{slug:"faq-page",graphName:"FAQPage",label:l("FAQ",u)},{slug:"fact-check",graphName:"FactCheck",label:l("Fact Check",u)},{slug:"how-to",graphName:"HowTo",label:l("How To",u)},{slug:"job-posting",graphName:"JobPosting",label:l("Job Posting",u)},{slug:"movie",graphName:"Movie",label:l("Movie",u)},{slug:"music",graphName:"Music",label:l("Music",u)},{slug:"person",graphName:"Person",label:l("Person",u)},{slug:"product",graphName:"Product",label:l("Product",u)},{slug:"product-review",graphName:"ProductReview",label:l("Product Review",u)},{slug:"car",graphName:"Car",label:l("Car",u)},{slug:"recipe",graphName:"Recipe",label:l("Recipe",u)},{slug:"service",graphName:"Service",label:l("Service",u)},{slug:"software-application",graphName:"SoftwareApplication",label:l("Software",u)},{slug:"video",graphName:"Video",label:l("Video",u)},{slug:"web-page",graphName:"WebPage",label:l("Web Page",u)}],e={Article:[{childGraphName:"BlogPosting",label:l("Blog Post",u)},{childGraphName:"NewsArticle",label:l("News Article",u)}],Music:[{childGraphName:"MusicAlbum",label:l("Music Album",u)},{childGraphName:"MusicGroup",label:l("Music Group",u)}],WebPage:[{childGraphName:"WebPage",label:l("Web Page",u)},{childGraphName:"AboutPage",label:l("About Page",u)},{childGraphName:"CheckoutPage",label:l("Checkout Page",u)},{childGraphName:"CollectionPage",label:l("Collection Page",u)},{childGraphName:"ContactPage",label:l("Contact Page",u)},{childGraphName:"ItemPage",label:l("Item Page",u)},{childGraphName:"MedicalWebPage",label:l("Medical Page",u)},{childGraphName:"ProfilePage",label:l("Profile Page",u)},{childGraphName:"RealEstateListing",label:l("Real Estate Listing",u)},{childGraphName:"SearchResultsPage",label:l("Search Results Page",u)}]};return{childGraphs:e,graphs:t,initSchemaEditor:o=>{const n=dt(),c=JSON.stringify(n.graph);n.graph=Gt(o,n.graph);const i=JSON.stringify(n.graph);JSON.stringify(c)!==JSON.stringify(i)&&(n.isDirty=!0)},getGraphObject:(o,n=!1)=>{var c;return!n&&((c=o==null?void 0:o.properties)==null?void 0:c.type)!==o.graphName&&e[o.graphName]?e[o.graphName].find(i=>i.childGraphName===o.properties.type):t.find(i=>i.slug===o.slug)},getParentGraphName:o=>{let n="";return Object.entries(e).forEach(c=>{const i=c[0];c[1].forEach(d=>{n||o===d.childGraphName&&(n=i)})}),n||o}}},dt=Mt("SchemaStore",{state:()=>({custom:{graphName:"",schema:""},defaultGraphParent:"",graph:null,graphCardsKey:0,isDirty:!1,isEditingCustomGraph:!1,isEditingCustomTemplate:!1,isEditingDefaultGraph:!1,isEditingGraph:!1,isEditingTemplate:!1,modalOpenMetabox:!1,modalOpenSidebar:!1,output:"",outputKey:0,tabs:{generator:"schema-templates",templates:"schema-catalog"},templateName:"",previousOutputRequestData:null}),actions:{getCustomObject(){return{id:"#aioseo-custom-"+new Date().getTime().toString(36),custom:!0,graphName:this.custom.graphName,schema:this.custom.schema}},resetSessionState(){this.custom={graphName:"",schema:""},this.defaultGraphParent="",this.graph=null,this.templateName="",this.isEditingCustomGraph=!1,this.isEditingCustomTemplate=!1,this.isEditingDefaultGraph=!1,this.isEditingGraph=!1,this.isEditingTemplate=!1,this.isDirty=!1},addCustomAsGraph(){const t=p();t.currentPost.schema.customGraphs.push(this.getCustomObject()),t.currentPost.schema.customGraphs=t.currentPost.schema.customGraphs.sort((e,s)=>e.graphName<s.graphName?-1:1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},addCustomAsTemplate(){const t=C(),e={...this.getCustomObject()},s={...JSON.parse(JSON.stringify(e)),label:"Custom Schema - "+e.graphName};t.internalOptions.internal.schema.templates.push(this.getCustomObject()),this.resetSessionState(),this.setTabTemplates("your-templates"),I.post(q.restUrl("schema/templates")).send({template:s}).then(a=>{a.body.success&&a.body.templates&&this.parseAndUpdateTemplates(a.body.templates)})},addCustomTemplateAsGraph(){const t=p();t.currentPost.schema.customGraphs.push(this.graph),t.currentPost.schema.customGraphs=t.currentPost.schema.customGraphs.sort((e,s)=>e.graphName<s.graphName?-1:1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},addDefaultGraph(){const t=p();t.currentPost.schema.default.isEnabled=!0,this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},addGraph(){const t=p();t.currentPost.schema.graphs.push(this.graph),t.currentPost.schema.graphs=t.currentPost.schema.graphs.sort((e,s)=>e.graphName<s.graphName?-1:1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},addGraphAsTemplate(){var a,r,o,n,c;const t=Ut();(r=(a=this.graph)==null?void 0:a.properties)!=null&&r.type&&this.graph.properties.type!==this.graph.graphName?this.graph.label=((o=t.getGraphObject(this.graph,!0))==null?void 0:o.label)+" - "+((n=t.getGraphObject(this.graph))==null?void 0:n.label)+" - "+this.templateName:this.graph.label=((c=t.getGraphObject(this.graph,!0))==null?void 0:c.label)+" - "+this.templateName;const e=JSON.parse(JSON.stringify(this.graph));C().internalOptions.internal.schema.templates.push(this.graph),this.resetSessionState(),this.setTabTemplates("your-templates"),I.post(q.restUrl("schema/templates")).send({template:e}).then(i=>{i.body.success&&i.body.templates&&this.parseAndUpdateTemplates(i.body.templates)})},addTemplateAsGraph(t,e=""){let a=C().internalOptions.internal.schema.templates;if(e){const n=new RegExp(ut(e).replace(/\s/g,"\\s"),"i");a=a.filter(c=>{var i;return(i=c==null?void 0:c.label)==null?void 0:i.match(n)})}t===void 0&&(t=a.findIndex(n=>n.id===this.graph.id));const r=JSON.parse(JSON.stringify(a[t]));r.id=r.id+new Date().getTime().toString(18);const o=p();r.custom?(o.currentPost.schema.customGraphs.push(r),o.currentPost.schema.customGraphs=o.currentPost.schema.customGraphs.sort((n,c)=>n.graphName<c.graphName?-1:1)):(o.currentPost.schema.graphs.push(r),o.currentPost.schema.graphs=o.currentPost.schema.graphs.sort((n,c)=>n.graphName<c.graphName?-1:1)),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},deleteCustomGraph(t){const e=p();t===void 0&&(t=e.currentPost.schema.customGraphs.findIndex(s=>s.id===this.graph.id)),e.currentPost.schema.customGraphs.splice(t,1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},deleteDefaultGraph(){const t=p();t.currentPost.schema.default.isEnabled=!1,this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},deleteGraph(t){const e=p();t===void 0&&(t=e.currentPost.schema.graphs.findIndex(s=>s.id===this.graph.id)),e.currentPost.schema.graphs.splice(t,1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},deleteTemplate(t){const e=this.graph.id,s=C();t===void 0&&(t=s.internalOptions.internal.schema.templates.findIndex(a=>a.id===e)),s.internalOptions.internal.schema.templates.splice(t,1),this.resetSessionState(),this.setTabTemplates("your-templates"),I.delete(q.restUrl("schema/templates")).send({templateId:e}).then(a=>{a.body.success&&a.body.templates&&this.parseAndUpdateTemplates(a.body.templates)})},editCustomGraph({customGraphIndex:t,isSidebar:e}){const s=p(),a=JSON.parse(JSON.stringify(s.currentPost.schema.customGraphs[t]));this.graph=a,this.isEditingCustomGraph=!0,this.tabs.generator="custom-schema",e?this.modalOpenSidebar=!0:this.modalOpenMetabox=!0},editDefaultGraph({isSidebar:t,parentGraphName:e}){this.defaultGraphParent=e;const s=p();s.currentPost.schema.default.data[e]&&(this.graph=s.currentPost.schema.default.data[e]),this.isEditingDefaultGraph=!0,this.tabs.generator="schema-templates",t?this.modalOpenSidebar=!0:this.modalOpenMetabox=!0},async editGraph({graphIndex:t,isSidebar:e}){const s=p(),a=JSON.parse(JSON.stringify(s.currentPost.schema.graphs[t]));this.graph=a,this.isEditingGraph=!0,this.tabs.generator="schema-templates",e?this.modalOpenSidebar=!0:this.modalOpenMetabox=!0,await pt(),this.isDirty=!1},async editTemplate(t,e=""){let a=C().internalOptions.internal.schema.templates;if(e){const o=new RegExp(ut(e).replace(/\s/g,"\\s"),"i");a=a.filter(n=>n.label.match(o))}const r=JSON.parse(JSON.stringify(a[t]));if(this.graph=r,r.custom)this.templateName=this.graphName,this.isEditingCustomTemplate=!0,this.tabs.generator="custom-schema";else{const o=new RegExp(`^${this.graph.graphName} -`,"i"),n=this.graph.label.replace(o,"");this.templateName=n,this.isEditingTemplate=!0}await pt(),this.isDirty=!1},updateCustomGraph(){const t=p(),e=t.currentPost.schema.customGraphs.findIndex(s=>s.id===this.graph.id);e!==-1&&(t.currentPost.schema.customGraphs[e]=this.graph,t.currentPost.schema.customGraphs=t.currentPost.schema.customGraphs.sort((s,a)=>s.graphName<a.graphName?-1:1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1)},updateDefaultGraph(){const t=p();t.currentPost.schema.default.data[this.defaultGraphParent]=this.graph,this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1},updateGraph(){const t=p(),e=t.currentPost.schema.graphs.findIndex(s=>s.id===this.graph.id);e!==-1&&(t.currentPost.schema.graphs[e]=this.graph,t.currentPost.schema.graphs=t.currentPost.schema.graphs.sort((s,a)=>s.graphName<a.graphName?-1:1),this.resetSessionState(),this.graphCardsKey=this.graphCardsKey+1,this.modalOpenMetabox=!1,this.modalOpenSidebar=!1)},updateSchemaOutput(){const t=p();if(It().isUnlicensed)return;let s=t.currentPost.id;if(y()&&(s=window.wp.data.select("core/editor").getCurrentPostId()),!s||t.currentPost.context!=="post")return;const a={postId:s,graphs:t.currentPost.schema.graphs,customGraphs:t.currentPost.schema.customGraphs,default:t.currentPost.schema.default,blockGraphs:t.currentPost.schema.blockGraphs};JSON.stringify(a)!==this.previousOutputRequestData&&(this.previousOutputRequestData=JSON.stringify(a),I.post(q.restUrl("schema/validator/output")).send(a).then(r=>{if(r.body.success&&r.body.output){let o=null;try{o=JSON.parse(r.body.output)}catch{return}if(r.body.output=JSON.stringify(o,null," ").trim(),r.body.output===this.output)return;this.output=r.body.output,this.outputKey=this.outputKey+1}}))},updateTemplate(){this.graph.label=this.graph.graphName+" - "+this.templateName;const t=JSON.parse(JSON.stringify(this.graph)),e=C(),s=e.internalOptions.internal.schema.templates.findIndex(a=>a.id===this.graph.id);s!==-1&&(e.internalOptions.internal.schema.templates[s]=this.graph,this.resetSessionState(),this.setTabTemplates("your-templates"),I.put(q.restUrl("schema/templates")).send({template:t}).then(a=>{a.body.success&&a.body.templates&&this.parseAndUpdateTemplates(a.body.templates)}))},parseAndUpdateTemplates(t){t=t.map(s=>(typeof s!="string"||(s=JSON.parse(s)),s)),t=t.sort((s,a)=>{const r=s.custom?0:1;return s.graphName<a.graphName?-1:r});const e=C();e.internalOptions.internal.schema.templates=t},setModalOpen({isOpen:t,initialTab:e,isSidebar:s}){t||(this.resetSessionState(),this.setTabTemplates("schema-catalog")),s?this.modalOpenSidebar=t:this.modalOpenMetabox=t,e&&(this.tabs.generator=e)},setTabTemplates(t){this.tabs.generator="schema-templates",this.tabs.templates=t}}}),et=(t,e="div")=>{const s=document.createElement(e);return s.innerHTML=qt(t.trim()),s},st=(t,e=!0,s="textContent")=>(typeof t=="string"&&(e&&(t=t.replace(/[\t|\n]/gm,"")),t=et(t)),t[s]||t.textContent||t.innerText||""),Ue=t=>(typeof t=="string"&&(t=et(t)),(t==null?void 0:t.outerText)??""),it=t=>(typeof t=="string"&&(t=et(t)),t.querySelectorAll("img")),Je=(t,e=200,s="…")=>t&&(e<t.length&&(t=t.substring(0,e).trim()+nt(s)),t),Ke=(t,e)=>{try{const s=JSON.parse(e);return s?s["@type"]&&(t===s["@type"]||Array.isArray(s["@type"])&&s["@type"].includes(t))?s:Array.isArray(s["@graph"])&&s["@graph"].find(r=>Array.isArray(r["@type"])?r["@type"].includes(t):r["@type"]===t)||!1:!1}catch{return!1}},je=()=>{var t;return{url:window.location.href,title:document.title||"",description:((t=document.querySelector('meta[name="description"]'))==null?void 0:t.content)||""}},We=()=>{var e,s,a,r;const t={description:((e=document.querySelector('meta[property="og:description"]'))==null?void 0:e.content)||"",image:((s=document.querySelector('meta[property="og:image"]'))==null?void 0:s.content)||"",title:((a=document.querySelector('meta[property="og:title"]'))==null?void 0:a.content)||"",type:((r=document.querySelector('meta[property="og:type"]'))==null?void 0:r.content)||""};if(!t.title&&(t.title=document.title||"",!t.title)){const o=tt();t.title=o.aioseo.urls.domain}return t},He=()=>{var t,e,s,a;return{card:((t=document.querySelector('meta[name="twitter:card"]'))==null?void 0:t.content)||"",description:((e=document.querySelector('meta[name="twitter:description"]'))==null?void 0:e.content)||"",image:((s=document.querySelector('meta[name="twitter:image"]'))==null?void 0:s.content)||"",title:((a=document.querySelector('meta[name="twitter:title"]'))==null?void 0:a.content)||""}},Jt=t=>{var s;if(typeof(window==null?void 0:window.acf)!="object"||typeof((s=window.acf)==null?void 0:s.getField)!="function")return null;const e=window.acf.getField(t)||{};return typeof(e==null?void 0:e.val)!="function"?null:e.val()||{}},mt=()=>{const e=p().currentPost.postType;if(!e)return"";const a=C().dynamicOptions.searchAppearance.postTypes[e].customFields;if(!a||!vt)return"";const r=()=>{G(500)},o=a.replace(/\n/g,",").split(","),n=[],c=["INPUT","TEXTAREA","IMG"];o.forEach(d=>{d=d.trim();const h=document.getElementById(`${d}`)||{},N=document.querySelectorAll("#the-list > tr"),_=document.querySelectorAll(".acf-field");c.includes(h==null?void 0:h.tagName)&&!(h!=null&&h.closest(".acf-field"))?n.push(h):N.forEach(m=>{const g=m.querySelector(`#${m.id}-key`),T=m.querySelector(`#${m.id}-value`);c.includes(T==null?void 0:T.tagName)&&o.includes(g==null?void 0:g.value)&&n.push(T)}),_.forEach(m=>{var T;if(d!==m.dataset.name||m.dataset.type==="repeater"||(T=m.parentNode)!=null&&T.closest(".acf-repeater"))return"";let g=m.querySelector(`[id^="acf"][name$="[${m.dataset.key}]"]`);if(m.dataset.type==="image"&&(g=m.querySelector(".has-value img")),m.dataset.type==="gallery"&&(g=m.querySelector(".acf-gallery-attachment img")),m.dataset.type==="link"&&(g=Jt(m.dataset.key)||m.querySelector(`[name$="[${m.dataset.key}][url]"]`)||{},g={tagName:"INPUT",type:"url",value:(g==null?void 0:g.url)??(g==null?void 0:g.value)??""}),!g||g.type&&g.type==="hidden")return"";if(m.dataset.type==="wysiwyg"){const b=window.setInterval(()=>{var F,X;(X=(F=window.tinyMCE)==null?void 0:F.activeEditor)!=null&&X.acf&&(window.clearInterval(b),window.tinyMCE.activeEditor.on("keyup",function(){G(500)}),window.tinyMCE.activeEditor.on("PostProcess",function(){ot(()=>{G(500)},10)}))},50),xt=function(F){F.forEach(X=>{var lt;if(X.attributeName==="class"&&m.querySelector(".wp-editor-wrap.tmce-active")&&((lt=window.tinyMCE)!=null&<.activeEditor)){window.tinyMCE.activeEditor.on("keyup",function(){G(500)});const at=m.querySelector(`[name="acf[${m.dataset.key}]"]`);at&&(at.addEventListener("keyup",()=>{G(500)}),at.addEventListener("paste",()=>{G(500)}))}})},At=new MutationObserver(xt),ct=m.querySelector(".wp-editor-wrap");ct&&At.observe(ct,{attributes:!0})}c.includes(g.tagName)&&n.push(g)})});let i="";return n.forEach(d=>{let h="";if(c.includes(d.tagName)&&typeof(d==null?void 0:d.addEventListener)=="function"&&d.addEventListener("keyup",r),d.value&&(h=d.value),d.tagName==="IMG"&&d.src){const N=d.alt?`alt="${d.alt}"`:"";h=`<img src="${d.src}" ${N}>`}d.value&&d.type&&d.type==="url"&&(h=`<a href="${h}">${h}</a>`),h&&(i+=`${h} `)}),i},Kt=(t,e=["INPUT","TEXTAREA","IMG"])=>{if(!t)return"";const s=document.getElementById(`${t}`),a=document.querySelectorAll("#the-list > tr"),r=document.querySelectorAll(".acf-field");let o="";if(s&&e.indexOf(s.tagName)!==-1&&(s.closest(".acf-field")||(o=s.tagName==="IMG"?s.getAttribute("src"):s.value)),a.length&&a.forEach(n=>{const c=n.querySelector(`#${n.id}-key`),i=n.querySelector(`#${n.id}-value`);i&&e.indexOf(i.tagName)!==-1&&c.value===t&&(o=i.tagName==="IMG"?i.getAttribute("src"):i.value)}),r.length){const n=[];r.forEach(c=>{var d;if(t!==c.dataset.name||c.dataset.type==="repeater"||(d=c.parentNode)!=null&&d.closest(".acf-repeater"))return;let i;e.forEach(h=>{const N=h.toLowerCase();i=c.querySelector(`[data-key="${c.dataset.key}"] ${N}`)||i}),i&&n.push(i.tagName==="IMG"?i.getAttribute("src"):i.value)}),o=n.join(" ")}return o},jt=({separator:t})=>{const e=Bt(t);return{parseTags:a=>{const r=f();return!a||!r.tags?a:(r.tags.forEach(o=>{if(o.id==="custom_field"){const d=new RegExp(`#${o.id}-([a-zA-Z0-9_-]+)`,"g"),h=a.match(d);h&&h.forEach(N=>{const _=new RegExp(`#${o.id}-([a-zA-Z0-9_-]+)`),m=N.match(_);m&&m[1]&&(a=a.replace(_,Kt(m[1])))});return}if(o.id==="tax_name"){const d=new RegExp(`#${o.id}-([a-zA-Z0-9_-]+)`,"g");a=a.replace(d,`[${o.name} - $1]`);return}const n=new RegExp(`#${o.id}(?![a-zA-Z0-9_])`,"g");o.id==="separator_sa"&&e.value!==void 0&&(a=a.replace(n,e.value));const c=a.match(n),i=r.liveTags[o.id]||o.value;c&&(a=a.replace(n,"%|%"+i))}),a=a.replace(/%\|%/g,""),nt(a))},separator:e}},Wt=()=>{const t=window.elementor.documents.getCurrent(),e=[];return t.$element?(t.$element.find(".elementor-widget-container").each((s,a)=>{const r=a.innerHTML.trim().replaceAll(/<p.*>(<img.*>)<\/p>/g,"$1");st(r)===""&&it(r).length===0||e.push(r)}),e.join(" ")):""},K=()=>{var s;const{settings:t,config:e}=window.elementor;return{content:Wt(),title:t.page.model.get("post_title"),excerpt:t.page.model.get("post_excerpt")||"",slug:$(t.page.model.get("post_title")),permalink:e.document.urls.permalink||"",featuredImage:((s=t.page.model.get("post_featured_image"))==null?void 0:s.url)||""}},Ht=()=>{const t=E(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(s=>s.classList.contains("et-fb-root-ancestor"))),e[0]||document.createElement("div")},zt=()=>{const t=[],e=Ht().querySelectorAll(".et_pb_section"),s=new RegExp(["<style.*?</style>","\\[object Object\\]"].join("|"),"gi");for(const a of e){const r=a.innerHTML.replace(s,"").replaceAll(/<p.*>(<img.*>)<\/p>/g,"$1");st(r)===""&&it(r).length===0||t.push(r)}return t.join(" ")},Vt=()=>{const t=new URL(E(ETBuilderBackendDynamic,"currentPage.permalink",""));return t.searchParams.delete("PageSpeed"),t.href},Zt=async()=>{const{wp:t}=window,e=E(ETBuilderBackendDynamic,"currentPage.thumbnailId",0);if(!t||e===0)return"";const s=t.media.attachment(e);let a="";return await s.fetch().then(()=>{a=s.get("url"),Rt(ETBuilderBackendDynamic,"currentPage.thumbnailUrl",a)}),a},j=()=>({content:zt(),title:E(ETBuilderBackendDynamic,"postTitle",""),excerpt:E(ETBuilderBackendDynamic,"postMeta.post_excerpt",""),slug:E(ETBuilderBackendDynamic,"postMeta.post_name",""),permalink:Vt(),featuredImage:Zt()}),Ft=t=>{let e;switch(t.type){case"header":e=document.createElement(t.settings.tag),e.innerHTML=t.settings.headerTxt.trim();break;case"image":const s=document.createElement("img");t.settings.altTxt&&s.setAttribute("alt",t.settings.altTxt),t.settings.src&&s.setAttribute("src",t.settings.src),t.settings.noFollow&&s.setAttribute("rel","nofollow"),e=s,t.settings.link&&(e=document.createElement("a"),e.setAttribute("href",t.settings.link),e.innerHTML=s.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(a=>{const r=document.createElement("li");r.innerHTML=a.txt,e.appendChild(r)});break;case"custom-html":e=document.createElement("div"),e.innerHTML=t.settings.code;break}return e},Xt=()=>{const t=[];return JSON.parse(JSON.stringify(E(seedprod_data,"settings.document.sections",[]))).forEach(s=>{s.rows.forEach(a=>{a.cols.forEach(r=>{r.blocks.forEach(o=>{const n=Ft(o);n&&(st(n)===""&&it(n).length===0||t.push(n.outerHTML))})})})}),t.join(" ")},Qt=()=>{const t=E(seedprod_data,"home_url",""),e=E(seedprod_data,"settings.post_name","");return`${t}/${e}/`},W=()=>({content:Xt(),title:E(seedprod_data,"settings.post_title",""),excerpt:"",slug:E(seedprod_data,"settings.post_name",""),permalink:Qt()}),Yt=()=>p().currentPost.processedContent,te=t=>{var e;if(t==="admin_frontend_editor"){const{vc:s}=window;return s.builder.getTitle()}return((e=document.getElementById("#title"))==null?void 0:e.value)||""},ee=t=>{var e;if(t==="admin_frontend_editor"){const{vc_iframe_src:s}=window,a=new URL(s).pathname.split("/").filter(r=>r);return a[a.length-1]}return((e=document.querySelector("#post_name"))==null?void 0:e.value)||""},se=t=>{var e;if(t==="admin_frontend_editor"){const{vc_iframe_src:s}=window;return s.replace(new URL(s).search,"")}return((e=document.querySelector("#sample-permalink a"))==null?void 0:e.href)||""},H=()=>{const{vc_mode:t}=window;return{content:Yt(),title:te(t),excerpt:"",slug:ee(t),permalink:se(t),featuredImage:""}},ae=()=>{var e;return((e=p().currentPost)==null?void 0:e.processedContent)||""},re=()=>{var e;const{FusionApp:t}=window;return(t==null?void 0:t.getPost("post_title"))||((e=document.getElementById("#title"))==null?void 0:e.value)||""},oe=()=>{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)||""},ne=()=>{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)||""},ie=async()=>{const{wp:t,FusionApp:e}=window;if(!t||!e||!e.getDynamicPost("post_meta")._thumbnail_id)return"";const s=t.media.attachment(e.getDynamicPost("post_meta")._thumbnail_id);let a="";return await s.fetch().then(()=>{a=s.get("url")}),a},z=()=>({content:ae(),title:re(),excerpt:"",slug:oe(),permalink:ne(),featuredImage:ie()}),ce=()=>{let t="";const e=["p","a","img","caption","br","video","iframe","blockquote","cite","em","strong","i","b","q","h1","h2","h3","h4","h5","h6","ul","ol","li","table","tr","th","td"],s=function(r){var n;const o=et(r);if(o.querySelectorAll(".so-panel").length===0)return r;for(const c of o.querySelectorAll("iframe, script, style, link"))c.remove();return o.querySelectorAll("*").forEach(c=>{if(!e.includes(c.tagName.toLowerCase())){const i=Array.from(c.childNodes);c.replaceWith(...i)}}),((n=o.innerHTML)==null?void 0:n.replace(/[\t|\n]/gm," "))||""},{soPanelsBuilderView:a}=window;return a&&(Array.isArray(a)?a.forEach(function(r){t+=s(r.contentPreview)}):t=s(a.contentPreview)),t},V=()=>({content:ce(),title:"",excerpt:"",slug:"",permalink:"",featuredImage:""}),le=()=>{var t,e;return((e=(t=TVE==null?void 0:TVE.Editor_Page)==null?void 0:t.content_manager)==null?void 0:e.get_clean_content())||""},ue=()=>{var t,e;return((e=(t=TVE==null?void 0:TVE.CONST)==null?void 0:t.post)==null?void 0:e.post_title)||""},pe=()=>{var t,e;return((e=(t=TVE==null?void 0:TVE.CONST)==null?void 0:t.post)==null?void 0:e.post_name)||""},de=()=>{var t;return((t=TVE==null?void 0:TVE.CONST)==null?void 0:t.post_url)||""},me=()=>{var e,s,a,r,o;const t=((a=(s=(e=TVE==null?void 0:TVE.CONST)==null?void 0:e.theme)==null?void 0:s.post_featured_image)==null?void 0:a.src)||((o=(r=TVE==null?void 0:TVE.CONST)==null?void 0:r.post_image)==null?void 0:o.featured)||"";return t.includes("inc/assets/images/featured_image.png")?"":t},Z=()=>({content:le(),title:ue(),excerpt:"",slug:pe(),permalink:de(),featuredImage:me()}),ht=()=>{let t="";switch(!0){case M():t=K().permalink;break;case J():t=j().permalink;break;case U():t=W().permalink;break;case R():t=H().permalink;break;case B():t=z().permalink;break;case L():t=V().permalink;break;case D():t=Z().permalink;break}return t},he=()=>{const t=f();if(t.liveTags.permalink)return t.liveTags.permalink;let e;if(P()||k){const s=document.querySelector("#edit-slug-box a");s&&s.href&&(e=s.href)}return y()&&(e=window.wp.data.select("core/editor").getPermalink()),e||(e=ht()),e&&t.updatePermalink(e),e},O=()=>{let t;if(P()||k){const e=document.querySelector("#edit-slug-box a");e&&e.href&&(t=e.href)}return y()&&(t=window.wp.data.select("core/editor").getPermalink()),t||(t=ht()),t},ge=async(t=!0)=>{let e=he();const s=O();if(e!==s&&(e=s,e)){const a=p();if(f().updatePermalink(e),!t)return;new v().runAnalysis({postId:a.currentPost.id,postData:{...a.currentPost},content:A(),slug:O()})}},fe=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)},gt=/base64,(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)/g,ft=["acf","aioseo","core"],yt=()=>{let t="";switch(!0){case M():t=K().content;break;case J():t=j().content;break;case U():t=W().content;break;case R():t=H().content;break;case B():t=z().content;break;case L():t=V().content;break;case D():t=Z().content;break}return t},St=t=>{var a;if(!t.includes('<!-- wp:block {"ref":'))return t;const e=(a=window.wp.blocks)==null?void 0:a.rawHandler({HTML:t});return Lt(e).forEach(r=>{var o,n,c;if(r.name==="core/block"){const i=window.wp.data.select("core").getEntityRecord("postType","wp_block",(o=r.attributes)==null?void 0:o.ref);(n=i==null?void 0:i.content)!=null&&n.raw&&(t=t.replace(`<!-- wp:block {"ref":${(c=r.attributes)==null?void 0:c.ref}} /-->`,i.content.raw))}}),t},bt=(t,e)=>(window.wp.data.select("core/block-editor").getBlocks().forEach(a=>{const[r,o]=a.name.split("/");if(e.includes(r)){if(r==="core"&&o!=="table")return;const n=document.getElementById("block-"+a.clientId);if(n&&n.innerText){const c=r==="core"?o:a.name,i=`<!-- wp:${c}.*?/wp:${c} -->|<!-- wp:${c}.*?/-->`;t=t.replace(new RegExp(i,"s"),n.innerText)}}}),t),wt=()=>{const t=f();if(t.liveTags.post_content)return t.liveTags.post_content;let e="";if(P()&&!Q())if(window.tinyMCE||document.querySelector("#wp-content-wrap.html-active"))e=Y();else{const a=window.setInterval(()=>{window.tinyMCE&&(window.clearInterval(a),e=Y())},50)}return y()&&(e=window.wp.data.select("core/editor").getCurrentPost().content||"",e=St(e),e=bt(e,ft)),Q()&&(e=yt()),p().currentPost.descriptionIncludeCustomFields&&(e=e+mt()),e=e.replace(gt,""),e&&t.updatePostContent(e),e},A=(t=!1)=>{let e="";if(P()&&!Q())if(window.tinyMCE||document.querySelector("#wp-content-wrap.html-active"))e=Y();else{const a=window.setInterval(()=>{window.tinyMCE&&(window.clearInterval(a),e=Y())},50)}y()&&(e=window.wp.data.select("core/editor").getEditedPostContent(),e=St(e),e=bt(e,ft)),Q()&&(e=yt());const s=p();return!t&&s.currentPost.descriptionIncludeCustomFields&&(e=e+mt()),e=e.replace(gt,""),e},ye=async(t=!0)=>{let e=wt();const s=A();if(e!==s){e=s;const a=p();if(f().updatePostContent(e),!t)return;new v().runAnalysis({postId:a.currentPost.id,postData:{...a.currentPost},content:A(),slug:O()})}},Y=()=>{let t;const e=window.tinyMCE?window.tinyMCE.get("content"):"";if(document.querySelector("#wp-content-wrap.tmce-active")&&e)t=e.getContent({format:fe(e)?"html":"raw"});else{const s=document.querySelector("textarea#content");t=s?s.value:""}return t};function Se(t){return new Worker(""+window.__aioseoDynamicImportPreload__("main-DPlEio9K.js"),{name:t==null?void 0:t.name})}class v{constructor(){w(this,"postId",null);w(this,"postTitle",null);w(this,"postParsedTitle",null);w(this,"postParsedDescription",null);w(this,"postDescription",null);w(this,"keyphrases",null);w(this,"postContent",null);w(this,"postSlug",null);w(this,"isAnalyzing",!1);w(this,"worker",null)}async runAnalysis({postId:e,postData:s,content:a=A(),slug:r=O()}){var T;const o=p(),n=C();if(s=s||{...o.currentPost},!((T=n.options.advanced)!=null&&T.truSeo)||!o.currentPost.page_analysis||this.isAnalyzing)return;this.worker&&this.worker.terminate();const c={separator:nt(n.options.searchAppearance.global.separator)},{parseTags:i}=jt({separator:c.separator}),d=tt(),h=f(),N=h.tags.map(b=>h.liveTags[b.id]!==void 0&&b.value!==h.liveTags[b.id]?{...b,value:h.liveTags[b.id]}:b),_={...rt(d.aioseo),tags:rt(N),currentPost:rt(o.currentPost)},m=JSON.parse(JSON.stringify({postId:e,postData:s,content:a,aioseo:_,slug:r,aioseoGlobals:c,postEditedTitle:Pt(),postTitle:s.title||s.metaDefaults.title||"#post_title",postParsedTitle:i(s.title||s.metaDefaults.title||"#post_title"),postDescription:s.description||s.metaDefaults.description,postParsedDescription:i(s.description||s.metaDefaults.description)}));let g=[];this.worker=new Se,this.worker.addEventListener("message",b=>{b.data.event==="tru-seo-analysis-complete"&&(g=b.data.analysis,this.dispatchActions(g,m),this.worker.terminate())}),this.worker.postMessage({event:"tru-seo-analysis",analysisData:m})}setSidebarButtonScore(e){const s=document.getElementById("aioseo-post-settings-sidebar-button"),a=document.getElementById("aioseo-post-score");!s||!a||(s.className=80<e?"score-green":50<e?"score-orange":"score-red",y()||(s.classList.add("aioseo-score-button","classic-editor"),e=`${e}/100`),a.textContent=e)}dispatchActions(e,s){const a=p();e.forEach(r=>{r.action==="updateState"&&s.postEditedTitle&&vt()&&this.setSidebarButtonScore(r.data.seo_score),a[r.action](r.data)})}}const Et=()=>{let t="";switch(!0){case M():t=K().title;break;case J():t=j().title;break;case U():t=W().title;break;case R():t=H().title;break;case B():t=z().title;break;case L():t=V().title;break;case D():t=Z().title;break}return t},be=()=>{const t=f();if(t.liveTags.post_title)return t.liveTags.post_title;let e;if(P()||k()){const s=document.querySelector("#post input#title");e=s?s.value:""}return y()&&(e=window.wp.data.select("core/editor").getCurrentPost().title),e||(e=Et()),e&&t.updatePostTitle(e),e},Pt=()=>{let t;if(P()||k()){const e=document.querySelector("#post input#title");t=e?e.value:""}return y()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("title")),t||(t=Et()),t},we=async(t=!0)=>{let e=be();const s=Pt();if(e!==s){e=s;const a=p();if(f().updatePostTitle(e),!t)return;new v().runAnalysis({postId:a.currentPost.id,postData:{...a.currentPost},content:A(),slug:O()})}},Tt=t=>t?(t=t.replaceAll(/\n\n/g," "),t=st(t,!1,"innerText"),t=t.replace(/\[.*?]/g,""),t.trim()):"",Ct=()=>{let t="";switch(!0){case M():t=K().excerpt;break;case J():t=j().excerpt;break;case U():t=W().excerpt;break;case R():t=H().excerpt;break;case B():t=z().excerpt;break;case L():t=V().excerpt;break;case D():t=Z().excerpt;break}return t},Ee=()=>{const t=f();if(t.liveTags.post_excerpt)return t.liveTags.post_excerpt;let e;return(P()||k())&&(e=Nt()),y()&&(e=window.wp.data.select("core/editor").getCurrentPost().excerpt),e||(e=Ct()),e||(e=Tt(wt())),e&&t.updatePostExcerpt(e),e},Pe=()=>{let t;return(P()||k())&&(t=Nt()),y()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("excerpt")),t||(t=Ct()),t||(t=Tt(A())),t},Te=async(t=!0)=>{let e=Ee();const s=Pe();if(e!==s){e=s;const a=p();if(f().updatePostExcerpt(e),!t)return;new v().runAnalysis({postId:a.currentPost.id,postData:{...a.currentPost},content:A(),slug:O()})}},Nt=()=>{let t="";const e=document.querySelector("#postexcerpt textarea#excerpt");if(t=e?e.value:"",document.querySelector("#wp-excerpt-wrap.tmce-active")){const s=window.tinyMCE?window.tinyMCE.get("excerpt"):"";s&&(t=s.getContent({format:"raw"}))}return t},kt=()=>{let t="";switch(!0){case M():t=K().slug;break;case J():t=j().slug;break;case U():t=W().slug;break;case R():t=H().slug;break;case B():t=z().slug;break;case L():t=V().slug;break;case D():t=Z().slug;break}return t},Ce=()=>{const t=f();if(t.permalinkSlug)return t.permalinkSlug;let e="";if(P()||k()){const s=document.querySelector("#post_name");s&&(e=$(s.value))}return y()&&(e=window.wp.data.select("core/editor").getCurrentPost().slug),e||(e=kt()),e&&t.updatePermalinkSlug(e),e},Ne=()=>{let t="";if(P()||k()){const e=document.querySelector("#post_name");e&&(t=$(e.value))}if(y()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("slug")),M()){const e=window.elementor.settings.page.model.get("post_title");e&&(t=$(e))}return t||(t=kt()),t},ke=async(t=!0)=>{let e=Ce();const s=Ne();if(e!==s){e=s;const a=p();if(f().updatePermalinkSlug(e),!t)return;new v().runAnalysis({postId:a.currentPost.id,postData:{...a.currentPost},content:A(),slug:O()})}};let S="",x="";const ve=(t=!0)=>{var a;const e=f();if(P()||k()){const r=document.querySelectorAll('#post input[name="post_category[]"]:checked');r.length?(S!==r[0].parentNode.innerText&&(S=r[0].parentNode.innerText,e.updateTaxonomyTitle(S)),x=Array.from(r).map(o=>o.parentNode.innerText).join(", "),e.updateCategories(x)):S!==""&&(S=x="",e.updateTaxonomyTitle(S),e.updateCategories(x))}if(y()){let r=[],o=[];if((a=tt().aioseo.user.data.allcaps)!=null&&a.manageCategories&&(r=window.wp.data.select("core").getEntityRecords("taxonomy","category"),o=window.wp.data.select("core/editor").getEditedPostAttribute("categories")),o&&o.length&&r){const c=r.find(i=>i.id===o[0]);c&&S!==c.name&&(S=c.name,e.updateTaxonomyTitle(S)),x=r.filter(i=>o.includes(i.id)).map(i=>i.name).join(", "),e.updateCategories(x)}else S!==""&&(S=x="",e.updateTaxonomyTitle(S),e.updateCategories(x))}const s=p();t&&new v().runAnalysis({postId:s.currentPost.id})},xe=(t=!1)=>{const e=p();if(e.currentPost.context!=="term")return;const s=f(),a=document.querySelector("#edittag input#name");a&&(s.updateTaxonomyTitle(a.value),a.addEventListener("input",()=>{s.updateTaxonomyTitle(a.value)}));const r=document.querySelector("#edittag textarea#description");r&&(s.updateTaxonomyDescription(r.value),r.addEventListener("input",()=>{s.updateTaxonomyDescription(r.value)}));const o=document.querySelector("#edittag input#slug");if(o){const n=$(o.value);s.updatePermalinkSlug(n),s.updatePermalink(e.currentPost.permalink.replace(`/${s.permalinkSlug}`,`/${n.replace(/ /gi,"-").replace(/[^a-z0-9-]/gi,"").toLowerCase()}`)),o.addEventListener("input",()=>{s.updatePermalinkSlug(n),s.updatePermalink(e.currentPost.permalink.replace(`/${s.permalinkSlug}`,`/${n.replace(/ /gi,"-").replace(/[^a-z0-9-]/gi,"").toLowerCase()}`))})}e.savePostState(),t&&v.runAnalysis({postId:e.currentPost.id})},Ae=(t=!1)=>{const e=p();if(e.currentPost.postType!=="attachment")return;const s=f(),a=document.querySelector("textarea#attachment_caption");a&&(s.updateAttachmentCaption(a.value),a.addEventListener("input",i=>{s.updateAttachmentCaption(i.target.value)}));const r=document.querySelector("textarea#attachment-details-caption");r&&(s.updateAttachmentCaption(r.value),r.addEventListener("input",i=>{s.updateAttachmentCaption(i.target.value)}));const o=document.querySelector("textarea#attachment_content");o&&(s.updateAttachmentDescription(o.value),o.addEventListener("input",i=>{s.updateAttachmentDescription(i.target.value)}));const n=document.querySelector("input#attachment_alt");n&&(s.updateAltTag(n.value),n.addEventListener("input",i=>{s.updateAltTag(i.target.value)}));const c=document.querySelector("input#attachment-details-alt-text");c&&(s.updateAltTag(n.value),c.addEventListener("input",i=>{s.updateAltTag(i.target.value)})),t&&new v().runAnalysis({postId:e.currentPost.id})},vt=()=>{var e,s;const t=p();return(e=t==null?void 0:t.currentPost)!=null&&e.id&&!!((s=t.currentPost)!=null&&s.isTruSeoEligible)||!1},ze=()=>{var a,r,o;const t=tt();if(!((a=t.aioseo.screen)!=null&&a.postType)||((r=t.aioseo.screen)==null?void 0:r.postType)==="web-story")return!1;const e=p();return!!((o=C().options.advanced)!=null&&o.truSeo&&$t(t.aioseo.screen.postType)&&!e.currentPost.isStaticPostsPage)},G=async(t=900,e=!0)=>{ot(async()=>{const s=dt(),a=p();await we(!1),await ye(!1),await Te(!1),await ke(!1),await ge(!1),ve(!1),xe(!1),Ae(!1),ot(s.updateSchemaOutput,Math.max(t*2,1800)),e&&new v().runAnalysis({postId:a.currentPost.id})},t)},Ve=t=>{const e=t.getRangeAt(0),s=e.cloneRange();return s.collapse(!1),t.removeAllRanges(),t.addRange(s),t.extend(e.startContainer,e.startOffset),t},Ze=t=>{const e=new RegExp(" ","g");return t.replace(/ /g," ").replace(e," ")},Fe=({element:t,property:e,value:s})=>{if(!t)return document.documentElement;let a=t.parentElement;for(;a;){if(a.isEqualNode(document.documentElement)||s===document.defaultView.getComputedStyle(a).getPropertyValue(e))return a;a=a.parentElement}},Xe=()=>{const t=document.createElement("div");return t.classList.add("aioseo-app"),t.style.position="absolute",t.style.zIndex="999",t.style.display="flex",t.setAttribute("tabindex",-1),t};export{Ze as A,Ue as B,Fe as C,Ve as D,Xe as E,Ut as F,v as T,jt as a,K as b,j as c,z as d,Z as e,Kt as f,st as g,A as h,ve as i,vt as j,xe as k,Ae as l,G as m,Pt as n,Ee as o,Ke as p,H as q,ze as r,Rt as s,Je as t,dt as u,V as v,We as w,je as x,He as y,Ne as z};