import{aa as m,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{s as l}from"./machine.-tangy-colts-beg-869.js";import{h as o,a as h,c as s}from"./telegram-tangy-colts-beg-669.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(i,e){return this.cache.has(i)?this.cache.get(i):(this.cache.set(i,e),e)}};const _=m(({helpers:i})=>({states:{components:[s(i),{componentName:i.componentName.mixInput,helperText:t("Enter the Chat ID with the prefix 100 here. For example, if your channel ID is -155545555, then the chat ID will be -100155545555 or the username of the target channel (in the format @channelusername or @supergroupusername)."),id:"chat-id",label:t("Chat ID"),onChange:"SET_CHAT_ID",path:"chat_id",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:i.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:i.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:i.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:i.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:async({$:e,e:n})=>{e.setThisComponent(a=>{a.value=n}),e.setDb(a=>{a.connection=n})},IF_CONNECTION_SELECTED:({$:e})=>{var n;return r((n=e.getComponent("connection-id"))==null?void 0:n.value)},IF_JOIN_REQUEST_NOT_SET:({$:e})=>{var n,a;if(((n=e.getComponent("join-request-id"))==null?void 0:n.value)==="false"&&r((a=e.getComponent("connection-id"))==null?void 0:a.value))return!0},CONNECTION_ADD_CHANGE:h,SET_CHAT_ID:o("chat"),SET_NAME:o("name"),SET_EXPIRE_DATE:o("expireDate"),SET_LIMITE:o("limite"),SET_REQUEST:({$:e,e:n})=>{e.setThisComponent(a=>{a.value=n}),e.setDb(a=>{a.request=n}),n==="true"&&e.setComponent("limite-id",a=>{a.value=void 0})},ON_MACHINE_LOAD:async({$:e})=>{l(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"}])}}}));export{_ as default};
