| 1 |
import{b as c,a as S}from"./constant-CWUMdlVX.js";import{d as A,__tla as I}from"./module-CxW9sXP5.js";import{__tla as O}from"./build-RGryZhEU.js";import{__tla as P}from"./oxide_parser_wasm-CcZ9_5i4.min.js";import{g as W}from"./intellisense-BID_9cpn.js";import{__tla as z}from"./monaco-editor-CCkURBm_.min.js";import{l as q}from"./logger-BTW-zIW3.js";import{c as T}from"./index.browser-CJrp5d7n.min.js";Promise.all([(()=>{try{return I}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return P}catch{}})(),(()=>{try{return z}catch{}})()]).then(async()=>{const v=()=>T("1234567890abcdefghijklmnopqrstuvwxyz",6)();function x(){let n=v();for(;n.match(/^\d/);)n=v();return`windpress${n}`}async function m(){c.$_state.globalVariables=c.$_state.globalVariables.filter(o=>o.category!=="windpress"),c.$_state.globalVariablesCategories.find(o=>o.id==="windpress")||c.$_state.globalVariablesCategories.push({id:"windpress",name:"WindPress"});const n=S.contentWindow.document.querySelector('script[type="text/tailwindcss"]'),i=A(n.textContent);(await W({volume:i})).forEach(o=>{c.$_state.globalVariables.push({id:x(),name:o.key.substring(2),value:o.value,category:"windpress"})})}new BroadcastChannel("windpress").addEventListener("message",async n=>{const i=n.data;i.source==="windpress/autocomplete"&&i.task==="windpress.code-editor.saved.done"&&setTimeout(()=>{m()},1e3)}),m();function C(){var g,E,k,L;if(c.$_state.activePanel!=="element"||!((E=(g=c.$_state)==null?void 0:g.activeElement)!=null&&E.id)||!((k=S)!=null&&k.contentWindow))return;const n=document.querySelector(".expand .options-wrapper"),i=n==null?void 0:n.querySelector(".searchable"),o=n==null?void 0:n.querySelector(".dropdown"),d=o==null?void 0:o.querySelectorAll(".variable-picker-item:not(.title)"),r=(L=document.querySelector(".variable-picker-button.open"))==null?void 0:L.previousElementSibling;if(!r||!(d!=null&&d.length)||!n||!o||!i)return;const $=e=>{var t;const a=((t=e.querySelector("span:first-of-type"))==null?void 0:t.textContent)??"";!r||!a||h(w(a))},j=e=>{var s;const a=((s=e.querySelector("span:first-of-type"))==null?void 0:s.textContent)??"";if(!r||!a)return;const t=w(a);r.value=t,r.click()},M=(e,a)=>{e.forEach(t=>{t.isIntersecting&&!t.target.classList.contains("open")&&t.target.click()})},f=()=>{h(V);const e=r.nextElementSibling;_.observe(e),n.removeEventListener("mouseleave",f)},y=(e,a)=>{e.forEach(t=>{const[s,u]=Object.entries(t)[0]||[];a.insertAdjacentHTML("beforeend",` |
| 2 |
<li class="variable-picker-item"> |
| 3 |
<span>${s}</span> |
| 4 |
<span class="option-value">${u}</span> |
| 5 |
</li> |
| 6 |
`)}),l.querySelectorAll(".variable-picker-item").forEach(t=>{t.addEventListener("mouseenter",()=>$(t)),t.addEventListener("click",()=>j(t))})},h=e=>{r.value=e,r.dispatchEvent(new Event("input")),r.focus()},w=e=>`var(--${e})`,p=[];o.remove(),d.forEach(e=>{var s,u;const a=((s=e.querySelector("span:first-of-type"))==null?void 0:s.textContent)??"",t=((u=e.querySelector("span.option-value"))==null?void 0:u.textContent)??"";p.push({[a]:t})});const l=document.createElement("ul");l.classList.add("custom-dropdown"),l.setAttribute("style",` |
| 7 |
max-height: calc(32px * 10); |
| 8 |
overflow: hidden; |
| 9 |
overflow-y: auto; |
| 10 |
position: relative; |
| 11 |
scrollbar-color: rgba(0, 0, 0, .4) rgba(0, 0, 0, .2); |
| 12 |
scrollbar-width: thin; |
| 13 |
`),y(p,l),n.appendChild(l),i.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()}),i.addEventListener("input",e=>{const a=p.filter(t=>{var s;return(((s=Object.keys(t)[0])==null?void 0:s.toLowerCase())??"").includes(i.value.toLowerCase())});l.innerHTML="",y(a,l)});let V=(r==null?void 0:r.value)??" ";const _=new IntersectionObserver(M,{root:r.parentElement});n.addEventListener("mouseleave",f),_.disconnect()}const b=document.querySelector("#bricks-panel-inner:not(div.bricks-control-popup *)");if(!b)throw q("Inner panel not found, can't initialize preview of variables on hover",{module:"variables",type:"error"}),new Error("Inner panel not found, can't initialize preview of variables on hover");new MutationObserver(C).observe(b,{subtree:!0,childList:!0,attributes:!0}),q("Module loaded!",{module:"variables"})}); |
| 14 |
|