text: import{g as e}from"./p-87f0c668.js";import{d as t,e as n,a as s,b as i}from"./p-c06cc5e4.js";import{c as o}from"./p-5120ebde.js";function c(c){return function(r,l){const{connectedCallback:f,componentWillLoad:a,componentDidLoad:d,render:u}=r;let b="psk-send-events",p=s,m=t,h="definedEvents";r.componentWillLoad=function(){let s=e(this);if(!s.hasAttribute(t)&&!s.hasAttribute(n))return a&&a.call(this)},r.componentDidLoad=function(){let s=e(this);if(!s.hasAttribute(t)&&!s.hasAttribute(n))return d&&d.call(this)},r.connectedCallback=function(){let t=this,s=e(t);if(c.controllerInteraction&&(m=n,h="definedControllers",p=i,b="psk-send-controllers"),s.hasAttribute(m)){if(!t.componentDefinitions)return t.componentDefinitions={},t.componentDefinitions[h]=[Object.assign(Object.assign({},c),{eventName:String(l)})],f&&f.call(t);let e=t.componentDefinitions;const n=Object.assign(Object.assign({},c),{eventName:String(l)});if(e&&e.hasOwnProperty(p)){let t=[...e[p]];t.push(n),e[p]=[...t]}else e[p]=[n];t.componentDefinitions=Object.assign({},e)}return f&&f.call(t)},r.render=function(){if(!this.componentDefinitions||!this.componentDefinitions||!this.componentDefinitions[p])return u&&u.call(this);let e=this.componentDefinitions[p];e&&(e=e.reverse()),o(b,{composed:!0,bubbles:!0,cancelable:!0,detail:e},!0)}}}export{c as T}