import{b as l,a as S}from"./constant-CWUMdlVX.js";import{__tla as A}from"./config-DRcPrVwf.js";import{__tla as I}from"./build-CgNAQheS.js";import{__tla as O}from"./oxide_parser_wasm-B0b9k-jb.min.js";import{g as P,l as W}from"./intellisense-BK8U5f4A.js";import{l as q}from"./logger-BTW-zIW3.js";import{c as z}from"./index.browser-CJrp5d7n.min.js";import{__tla as T}from"./monaco-editor-BsKw__A9.min.js";Promise.all([(()=>{try{return A}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return T}catch{}})()]).then(async()=>{const m=()=>z("1234567890abcdefghijklmnopqrstuvwxyz",6)();function $(){let r=m();for(;r.match(/^\d/);)r=m();return`windpress${r}`}async function v(){l.$_state.globalVariables=l.$_state.globalVariables.filter(n=>n.category!=="windpress"),l.$_state.globalVariablesCategories.find(n=>n.id==="windpress")||l.$_state.globalVariablesCategories.push({id:"windpress",name:"WindPress"});const r=await S.contentWindow.wp.hooks.applyFilters("windpress.module.design_system.main_css");(await P(await W(r))).forEach(n=>{l.$_state.globalVariables.push({id:$(),name:n.key.substring(2),value:n.value,category:"windpress"})})}new BroadcastChannel("windpress").addEventListener("message",async r=>{const n=r.data;n.source==="windpress/autocomplete"&&n.task==="windpress.main_css.saved.done"&&setTimeout(()=>{v()},1e3)}),v();function C(){var g,E,k,L;if(l.$_state.activePanel!=="element"||!((E=(g=l.$_state)==null?void 0:g.activeElement)!=null&&E.id)||!((k=S)!=null&&k.contentWindow))return;const r=document.querySelector(".expand .options-wrapper"),n=r==null?void 0:r.querySelector(".searchable"),c=r==null?void 0:r.querySelector(".dropdown"),p=c==null?void 0:c.querySelectorAll(".variable-picker-item:not(.title)"),a=(L=document.querySelector(".variable-picker-button.open"))==null?void 0:L.previousElementSibling;if(!a||!(p!=null&&p.length)||!r||!c||!n)return;const x=e=>{var t;const o=((t=e.querySelector("span:first-of-type"))==null?void 0:t.textContent)??"";!a||!o||y(h(o))},j=e=>{var s;const o=((s=e.querySelector("span:first-of-type"))==null?void 0:s.textContent)??"";if(!a||!o)return;const t=h(o);a.value=t,a.click()},M=(e,o)=>{e.forEach(t=>{t.isIntersecting&&!t.target.classList.contains("open")&&t.target.click()})},f=()=>{y(V);const e=a.nextElementSibling;_.observe(e),r.removeEventListener("mouseleave",f)},w=(e,o)=>{e.forEach(t=>{const[s,d]=Object.entries(t)[0]||[];o.insertAdjacentHTML("beforeend",`