import{b as l,i as r}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s}from"./machine.-BRuqPpdF.js";import{h as E,f as m,a as o,c}from"./telegram-Cgmg4C_6.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const u=l(({helpers:a})=>({states:{components:[c(a),{componentName:a.componentName.select,helperText:t("Select the target chat fetched from your bot, or map a Chat ID. Use the prefix 100 for channels (e.g. channel ID -155545555 becomes -100155545555) or a username like @channelusername."),id:"chat-id",isMappable:!0,label:t("Select Chat"),onChange:"SET_CHAT_ID",onRefetch:"REFETCH_CHATS",options:[],path:"chat_id",placeholder:t("Select a chat"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:t("Invite link name. Must be at most 32 characters long."),id:"name-id",label:t("Name"),onChange:"SET_NAME",path:"name",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:t("Provide point in time (Unix timestamp) when the link will expire."),id:"expire-id",label:t("Expire Date"),onChange:"SET_EXPIRE_DATE",path:"Expire Date",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:t("Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"),id:"limite-id",label:t("Member Limit"),onChange:"SET_LIMITE",path:"member_limit",render:"IF_JOIN_REQUEST_NOT_SET",value:[]},{componentName:a.componentName.select,helperText:t("Choose Yes, if users joining the chat via the link need to be approved by chat administrators."),id:"join-request-id",label:t("Creates Join Request"),onChange:"SET_REQUEST",options:[{label:t("Yes"),value:"true"},{label:t("No"),value:"false"}],path:"creates_join_request",placeholder:t("Choose to disable notification"),render:"IF_CONNECTION_SELECTED",value:"false"}]},actions:{SET_CONNECTION:({$:e,e:i})=>{e.setThisComponent(n=>{n.value=i}),e.setDb(n=>{n.connection=i}),m(e)},IF_CONNECTION_SELECTED:({$:e})=>r(e.getComponent("connection-id")?.value),IF_JOIN_REQUEST_NOT_SET:({$:e})=>{if(e.getComponent("join-request-id")?.value==="false"&&r(e.getComponent("connection-id")?.value))return!0},CONNECTION_ADD_CHANGE:E,REFETCH_CHATS:({$:e})=>m(e),SET_CHAT_ID:o("chat"),SET_NAME:o("name"),SET_EXPIRE_DATE:o("expireDate"),SET_LIMITE:o("limite"),SET_REQUEST:({$:e,e:i})=>{e.setThisComponent(n=>{n.value=i}),e.setDb(n=>{n.request=i}),i==="true"&&e.setComponent("limite-id",n=>{n.value=void 0})},ON_MACHINE_LOAD:({$:e})=>{s(e,[{db:"connection",id:"connection-id"},{db:"chat",id:"chat-id"},{db:"name",id:"name-id"},{db:"expireDate",id:"expire-id"},{db:"limite",id:"limite-id"},{db:"joinRequest",id:"join-request-id"}]),m(e)}}}));export{u as default};
