import{u as i,i as c,o as a,p as l}from"./index.317ad629.js";import{i as u}from"./isEmpty.15767c6b.js";import{i as p}from"./isEqual.59768dc1.js";const y=n=>{const e=document.getElementById(n);return e?e!=null&&e.contentWindow?e.contentWindow.document:e.contentDocument:null},_=()=>{let n=null;return async({editorData:e})=>{try{(n===null||!p(n,e))&&await l(),n=JSON.parse(JSON.stringify(e))}catch(t){console.error(t)}}},h=(n=null)=>{const e=i();if(u(e.currentPost))return;const t=()=>{e.isDirty=!1,e.saveCurrentPost(e.currentPost).then(()=>{const r=c(),o=a();r.isUnlicensed||o.fetch()})};n==="elementor"?window.elementor.config.document.id===window.elementor.config.document.revisions.current_id&&t():t()},S=(n,e)=>{const t=window.parent.document,r=t.getElementById(e);r&&r.remove();try{new URL(n);const o=t.createElement("link");o.id=e,o.href=n,o.rel="stylesheet",t.head.appendChild(o)}catch{const s=t.createElement("style");s.id=e,s.textContent=n,t.head.appendChild(s)}};export{y as a,_ as c,h,S as i};
