import{proxyCustomElement as e,HTMLElement as t,h as s,Host as o,transformTag as n}from"@stencil/core/internal/client";import{b as i}from"./index.esm.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return s(o,{key:"365df6908301371b8b964671382ad936971b6624",hidden:!this.shouldRender},s("slot",{key:"ca7c2a9febf0189dfae882a2ae894d1d0262a213"}))}get ruleRegistry(){return this.platform.get(i.RuleRegistry)}compileAndEvaluate(){var e;if(this.rule)try{const t=this.ruleRegistry.compile(this.rule),s=null!==(e=this.scope)&&void 0!==e?e:this.ruleRegistry.scope({host:this.host});this.shouldRender=t(s)}catch(e){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:e}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host{display:contents}:host([hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),l=r,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(n(e))||customElements.define(n(e),r))}))};export{l as LimebbRuleGate,h as defineCustomElement}