import{aa as E,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as t,s as m}from"./machine.-tangy-colts-beg-869.js";import{e as i,h as s,b as d,c as h,d as C}from"./machineh-tangy-colts-beg-816.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const p=E(({helpers:n})=>({states:{components:[h(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:a("Select the channel where the message is located."),id:"channel-id",label:a("Select Channel"),onChange:"SELECT_CHANNEL",onRefetch:"REFETCH_CHANNELS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,helperText:a("Enter the ID of the message to react to."),id:"message-id",label:a("Message ID"),onChange:"SET_MESSAGE_ID",path:"message_id",render:"IF_CHANNEL_SELECTED",required:!0,value:[]},{componentName:n.componentName.mixInput,helperText:a("Enter the emoji to react with (e.g., 👍 or custom:emoji_name:emoji_id)."),id:"emoji",label:a("Emoji"),onChange:"SET_EMOJI",path:"emoji",render:"IF_CHANNEL_SELECTED",required:!0,value:[]}]},actions:{SET_CONNECTION:async({$:e,e:o})=>{t("connectionId")({$:e,e:o}),await i(e),C(e,n)},CONNECTION_ADD_CHANGE:d,HANDLE_BOT_TOKEN:s,SELECT_CHANNEL:t("channelId"),REFETCH_CHANNELS:({$:e})=>i(e),SET_EMOJI:t("emoji"),SET_MESSAGE_ID:t("messageId"),IF_CHANNEL_SELECTED:({$:e})=>{var o;return c((o=e.getComponent("channel-id"))==null?void 0:o.value)},IF_CONNECTION_SELECTED:({$:e})=>{var o;return c((o=e.getComponent("connection-id"))==null?void 0:o.value)},ON_MACHINE_LOAD:({$:e})=>{m(e,[{db:"connectionId",id:"connection-id"},{db:"channelId",id:"channel-id"},{db:"messageId",id:"message-id"},{db:"emoji",id:"emoji"}]),i(e)}}}));export{p as default};
