@maincode-ai/matilda-code 0.21.10 → 0.21.11-nightly.20261019.07ef6f6a1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/bundled/mainy/docs/configuration/settings.md +10 -1
  2. package/bundled/mainy/docs/matilda-serve.md +6 -6
  3. package/chunks/agent-PXBLXFNY.js +3 -0
  4. package/chunks/agent-headless-YWSSHHJ2.js +3 -0
  5. package/chunks/{anthropicContentGenerator-SFJGSZHT.js → anthropicContentGenerator-IYZILRDW.js} +1 -1
  6. package/chunks/{askUserQuestion-MJ4FTAOQ.js → askUserQuestion-XWHJY3DM.js} +1 -1
  7. package/chunks/{ca-H4HPSGTI.js → ca-EUJBUYX5.js} +1 -1
  8. package/chunks/{chunk-B3NVKOSU.js → chunk-25NCTG5H.js} +63 -54
  9. package/chunks/{chunk-INAZKGGR.js → chunk-2HQMJ2IU.js} +1 -1
  10. package/chunks/chunk-46MIUE6Z.js +113 -0
  11. package/chunks/{todoWrite-7BZMVNBC.js → chunk-4CSSDBOS.js} +2 -2
  12. package/chunks/{chunk-5PMMY47S.js → chunk-4FVBPNTZ.js} +1 -1
  13. package/chunks/{chunk-LSDMWVW6.js → chunk-5427BPR2.js} +2 -2
  14. package/chunks/{chunk-GC2F575A.js → chunk-6GBNB5Z2.js} +1 -1
  15. package/chunks/chunk-6OM7PU5M.js +2627 -0
  16. package/chunks/{chunk-EXIO3QHE.js → chunk-7Y4YWLWT.js} +9 -9
  17. package/chunks/{chunk-32PTAACU.js → chunk-ELH4YHJR.js} +1 -1
  18. package/chunks/{chunk-3HUM74NZ.js → chunk-EQGA7LH7.js} +2 -2
  19. package/chunks/{chunk-FWIVFCKF.js → chunk-FFFZ2QMG.js} +1 -1
  20. package/chunks/chunk-GHBKFIHC.js +35 -0
  21. package/chunks/{chunk-EQEQPZLQ.js → chunk-GO2GA2GY.js} +1 -1
  22. package/chunks/{chunk-QHA3ZBRO.js → chunk-GUFIMKF5.js} +1 -1
  23. package/chunks/{chunk-DJSOHDUB.js → chunk-H44J3WCU.js} +1 -1
  24. package/chunks/{chunk-RJX7DK4Y.js → chunk-HWOQNYAO.js} +1 -1
  25. package/chunks/{chunk-K3ELACN2.js → chunk-HXXKWC4R.js} +17 -17
  26. package/chunks/chunk-HYVP4472.js +8 -0
  27. package/chunks/chunk-I2UAZHXP.js +39 -0
  28. package/chunks/{chunk-VWWEEU4V.js → chunk-JXUDKX6D.js} +1 -1
  29. package/chunks/chunk-M53RP3YP.js +31 -0
  30. package/chunks/{chunk-VLYRNOD3.js → chunk-MH2P4YXC.js} +10 -10
  31. package/chunks/{chunk-VYTYYCBR.js → chunk-NYEWHSBL.js} +1 -1
  32. package/chunks/{chunk-C62LTEOV.js → chunk-O3X6OM5U.js} +2 -2
  33. package/chunks/{chunk-LIWYWWOK.js → chunk-ODZOYHIC.js} +1 -1
  34. package/chunks/{chunk-Q2I3ARPJ.js → chunk-QH7736R5.js} +1 -1
  35. package/chunks/chunk-QN6WSWMM.js +9 -0
  36. package/chunks/chunk-SNLH42QJ.js +10 -0
  37. package/chunks/chunk-SPW5DXX4.js +35 -0
  38. package/chunks/{chunk-S7G6QPEP.js → chunk-SUH3UUWZ.js} +1 -1
  39. package/chunks/chunk-T2T2UEPY.js +4 -0
  40. package/chunks/{chunk-6B5BDE7S.js → chunk-T4P4KEDW.js} +8 -8
  41. package/chunks/chunk-VI74YQQO.js +8 -0
  42. package/chunks/{chunk-DCQKJTAX.js → chunk-W5CGKUM4.js} +8 -3
  43. package/chunks/{chunk-32T6RWWT.js → chunk-WHG6N5X2.js} +1 -1
  44. package/chunks/{chunk-XCJYORZX.js → chunk-XCFLI3OC.js} +1 -1
  45. package/chunks/{chunk-3ZAMYREW.js → chunk-YMIF2DMT.js} +1 -1
  46. package/chunks/{computer-use-DJV6HTND.js → computer-use-6HSNUCLB.js} +7 -7
  47. package/chunks/contextCommand-BZEFZB7M.js +3 -0
  48. package/chunks/{cron-create-BTTPO3JC.js → cron-create-2UI4AT4Q.js} +1 -1
  49. package/chunks/{cron-delete-U55RHRID.js → cron-delete-ZB6BOTFF.js} +1 -1
  50. package/chunks/{cron-list-J4HRR46K.js → cron-list-YYAXNHB6.js} +1 -1
  51. package/chunks/{de-S7F37S4F.js → de-DNEPG7S7.js} +1 -1
  52. package/chunks/{dist-SVKXQXJX.js → dist-ME6647DQ.js} +1 -1
  53. package/chunks/{dist-SCXU6QWY.js → dist-P6SLWL5V.js} +1 -1
  54. package/chunks/{dist-PVENOVGI.js → dist-VG3ZDJ2A.js} +1 -1
  55. package/chunks/{dist-N66KF4KX.js → dist-YTCHM57U.js} +1 -1
  56. package/chunks/{edit-7XEZHXE4.js → edit-QHKHGKM2.js} +1 -1
  57. package/chunks/{en-S6DMCJQZ.js → en-NOD6KQNM.js} +1 -1
  58. package/chunks/{enter-worktree-MR64QLS4.js → enter-worktree-PTUIG373.js} +1 -1
  59. package/chunks/{enterPlanMode-UNWCEVYY.js → enterPlanMode-2A37Q5OW.js} +1 -1
  60. package/chunks/{exit-worktree-D4BMN6LH.js → exit-worktree-LV2XJ634.js} +1 -1
  61. package/chunks/{exitPlanMode-AKLFFYT2.js → exitPlanMode-AU7EQHXM.js} +1 -1
  62. package/chunks/{fr-RFJP3KVL.js → fr-2OE5WLJ4.js} +1 -1
  63. package/chunks/{geminiContentGenerator-JBASUS2T.js → geminiContentGenerator-QXWIMCG7.js} +1 -1
  64. package/chunks/glob-XFSH2QKT.js +22 -0
  65. package/chunks/goal-tools-6QTC3UI7.js +12 -0
  66. package/chunks/grep-HYFLZADN.js +22 -0
  67. package/chunks/{ja-UTJHPL3M.js → ja-3B6V5KS7.js} +1 -1
  68. package/chunks/{keychain-token-storage-HAFQQIXL.js → keychain-token-storage-54BNK6VH.js} +1 -1
  69. package/chunks/{ls-CLDNF3YS.js → ls-YWZU3FYL.js} +1 -1
  70. package/chunks/{lsp-7SKRKR5Q.js → lsp-4CJDKEEC.js} +1 -1
  71. package/chunks/{matildaAgentContentGenerator-GMDJPWES.js → matildaAgentContentGenerator-VOOMYECL.js} +1 -1
  72. package/chunks/matildaContentGenerator-4NSKMBCF.js +8 -0
  73. package/chunks/{matildaOAuth2-W2DQO2NK.js → matildaOAuth2-WOY7ZS43.js} +1 -1
  74. package/chunks/monitor-F3MMAOV2.js +32 -0
  75. package/chunks/notebook-edit-3N72EDYF.js +17 -0
  76. package/chunks/{openaiContentGenerator-XDOQRO4G.js → openaiContentGenerator-TIRPXHM2.js} +1 -1
  77. package/chunks/{pt-KXMOTADP.js → pt-KP2JCPUY.js} +1 -1
  78. package/chunks/read-file-6EAPS2KG.js +3 -0
  79. package/chunks/ripGrep-7L45WKPK.js +3 -0
  80. package/chunks/{ru-EWGWZPQH.js → ru-K7IQQKHC.js} +1 -1
  81. package/chunks/scheduler-SZNVJELW.js +8 -0
  82. package/chunks/{send-message-XXRROIL7.js → send-message-OO2HAKCC.js} +1 -1
  83. package/chunks/{serve-4MDSDWP7.js → serve-2KBVIHAA.js} +31 -31
  84. package/chunks/shell-JNI7BDC3.js +3 -0
  85. package/chunks/{skill-JIISRKQN.js → skill-LOWNP4W4.js} +1 -1
  86. package/chunks/src-O5Z62OHH.js +3 -0
  87. package/chunks/{symbol-search-3MVTK4KV.js → symbol-search-ALYOX5JN.js} +1 -1
  88. package/chunks/{syntheticOutput-QEUQIVQJ.js → syntheticOutput-UASKABJH.js} +1 -1
  89. package/chunks/task-create-EBJD55TB.js +3 -0
  90. package/chunks/task-detach-I67ZE5MX.js +9 -0
  91. package/chunks/{task-list-ZEJTNZ2O.js → task-list-5BGX4G5N.js} +1 -1
  92. package/chunks/{task-stop-JO3CXG2K.js → task-stop-ERI5X4AO.js} +1 -1
  93. package/chunks/{task-update-3YY37VFN.js → task-update-CD3W556L.js} +1 -1
  94. package/chunks/{team-create-GMI5DIH7.js → team-create-IGCB4YJX.js} +1 -1
  95. package/chunks/{team-delete-4YYLUV23.js → team-delete-5U3GBFKJ.js} +1 -1
  96. package/chunks/todoWrite-YGG6AZ3A.js +3 -0
  97. package/chunks/{tool-search-OWJC3UTX.js → tool-search-JFCD5W5M.js} +1 -1
  98. package/chunks/{web-fetch-K575OWZ7.js → web-fetch-REWGIRWQ.js} +1 -1
  99. package/chunks/{web-search-F6JRBXFV.js → web-search-OX2DPEVN.js} +1 -1
  100. package/chunks/{workflow-H5DWTI5W.js → workflow-6N3FGOUE.js} +2 -2
  101. package/chunks/write-file-WJUMYRVH.js +15 -0
  102. package/cli.js +480 -475
  103. package/locales/ca.js +8 -2
  104. package/locales/de.js +9 -2
  105. package/locales/en.js +15 -8
  106. package/locales/fr.js +9 -2
  107. package/locales/ja.js +8 -2
  108. package/locales/pt.js +8 -2
  109. package/locales/ru.js +9 -2
  110. package/package.json +2 -2
  111. package/sandbox-macos-restrictive-closed.sb +4 -0
  112. package/sandbox-macos-restrictive-open.sb +4 -0
  113. package/sandbox-macos-restrictive-proxied.sb +4 -0
  114. package/chunks/agent-2ZM5WMHY.js +0 -3
  115. package/chunks/agent-headless-PX4INULZ.js +0 -3
  116. package/chunks/chunk-2UDXLDSZ.js +0 -34
  117. package/chunks/chunk-34DXSYJZ.js +0 -34
  118. package/chunks/chunk-ESSYHTAZ.js +0 -8
  119. package/chunks/chunk-FRL6KOLY.js +0 -35
  120. package/chunks/chunk-I7TAYS6D.js +0 -108
  121. package/chunks/chunk-JSFA3NEP.js +0 -5
  122. package/chunks/chunk-ROETRE5J.js +0 -9
  123. package/chunks/chunk-RYLWDCCN.js +0 -2594
  124. package/chunks/chunk-TZIDSCTF.js +0 -31
  125. package/chunks/contextCommand-TAFFF6V7.js +0 -3
  126. package/chunks/glob-3QKPKP7Z.js +0 -22
  127. package/chunks/grep-6CL6HJ5Y.js +0 -22
  128. package/chunks/matildaContentGenerator-EFK4QDRS.js +0 -8
  129. package/chunks/monitor-6W2R25LH.js +0 -32
  130. package/chunks/notebook-edit-WL6MZ6AW.js +0 -17
  131. package/chunks/read-file-J5UBJYDO.js +0 -3
  132. package/chunks/ripGrep-2AMYRBCZ.js +0 -3
  133. package/chunks/scheduler-LFSCKDU6.js +0 -8
  134. package/chunks/shell-SMTFAOAE.js +0 -3
  135. package/chunks/src-OF7NIVIL.js +0 -3
  136. package/chunks/task-create-AEJQ73GE.js +0 -3
  137. package/chunks/update-goal-CF6G57J7.js +0 -16
  138. package/chunks/write-file-RUHYPLKF.js +0 -15
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as rt,b as Ms}from"./chunk-QN6Y6NPA.js";import{f as ot}from"./chunk-3HUM74NZ.js";import"./chunk-JSFA3NEP.js";import"./chunk-TZIDSCTF.js";import{a as Cs}from"./chunk-OOEH6ZSV.js";import{a as ws}from"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import{b as h}from"./chunk-GZPNIYVZ.js";import{a as K,d as y,f as nt}from"./chunk-OWGSC52X.js";var re=y(Y=>{"use strict";h();Object.defineProperty(Y,"__esModule",{value:!0});Y.matchFilter=Is;Y.parse=ft;Y.preprocess=_t;var at=new Map;function Is(n){var e;let t=Array.isArray(n)?n:[n],s=t.join(","),i=(e=at.get(s))!==null&&e!==void 0?e:(()=>{let r=ft(t),o=Ss(r);return at.set(s,o),o})();return r=>i(r)}function ft(n){return Array.isArray(n)?n.map(e=>e.split(":")):[n.split(":")]}function Ss(n){let e=n.flatMap(i=>ks(i,_t(i))),t=Ts(e),s=Ps(t);return i=>!!s(i.update,i)}function _t(n){let e=ne,t=[n].flatMap(s=>{let[i,r,o]=s;if(!(i in mt))return[s];if(!i&&!r&&!o)return[s];let d=mt[i].map(c=>[c,r,o]);return r===void 0||r in Ae&&(r||o)?d:d.filter(([c])=>{var l;return!!(!((l=e[c])===null||l===void 0)&&l[r])})}).flatMap(s=>{let[i,r,o]=s;if(!(r in Ae))return[s];if(!r&&!o)return[s];let d=Ae[r].map(c=>[i,c,o]);return o===void 0?d:d.filter(([,c])=>{var l,p;return!!(!((p=(l=e[i])===null||l===void 0?void 0:l[c])===null||p===void 0)&&p[o])})});if(t.length===0)throw new Error(`Shortcuts in '${n.join(":")}' do not expand to any valid filter query`);return t}function ks(n,e){if(e.length===0)throw new Error("Empty filter query given");let t=e.map(As).filter(s=>s!==!0);if(t.length===0)return e;throw t.length===1?new Error(t[0]):new Error(`Invalid filter query '${n.join(":")}'. There are ${t.length} errors after expanding the contained shortcuts: ${t.join("; ")}`)}function As(n){let[e,t,s,...i]=n;if(e===void 0)return"Empty filter query given";if(!(e in ne)){let a=Object.keys(ne);return`Invalid L1 filter '${e}' given in '${n.join(":")}'. Permitted values are: ${a.map(d=>`'${d}'`).join(", ")}.`}if(t===void 0)return!0;let r=ne[e];if(!(t in r)){let a=Object.keys(r);return`Invalid L2 filter '${t}' given in '${n.join(":")}'. Permitted values are: ${a.map(d=>`'${d}'`).join(", ")}.`}if(s===void 0)return!0;let o=r[t];if(!(s in o)){let a=Object.keys(o);return`Invalid L3 filter '${s}' given in '${n.join(":")}'. ${a.length===0?`No further filtering is possible after '${e}:${t}'.`:`Permitted values are: ${a.map(d=>`'${d}'`).join(", ")}.`}`}return i.length===0?!0:`Cannot filter further than three levels, ':${i.join(":")}' is invalid!`}function Ts(n){var e,t;let s={};for(let[i,r,o]of n){let a=(e=s[i])!==null&&e!==void 0?e:s[i]={};if(r!==void 0){let d=(t=a[r])!==null&&t!==void 0?t:a[r]=new Set;o!==void 0&&d.add(o)}}return s}function ke(n,e){return(t,s)=>n(t,s)||e(t,s)}function ut(n,e){return(t,s)=>{let i=n(t,s);return i&&e(i,s)}}function dt(n){return(e,t)=>n(e,t)!=null}function Ps(n){let e=Object.entries(n).map(([t,s])=>{let i=o=>o[t],r=Object.entries(s).map(([o,a])=>{let d=l=>l[o],c=Array.from(a).map(l=>l==="me"?(m,_)=>{let g=_.me.id;return ct(m,w=>w.id===g)}:m=>ct(m,_=>_[l]||_.type===l));return c.length===0?dt(d):ut(d,c.reduce(ke))});return r.length===0?dt(i):ut(i,r.reduce(ke))});if(e.length===0)throw new Error("Cannot create filter function for empty query");return e.reduce(ke)}function ct(n,e){let t=s=>s!=null&&e(s);return Array.isArray(n)?n.some(t):t(n)}var lt={mention:{},hashtag:{},cashtag:{},bot_command:{},url:{},email:{},phone_number:{},bold:{},italic:{},underline:{},strikethrough:{},spoiler:{},blockquote:{},expandable_blockquote:{},code:{},pre:{},text_link:{},text_mention:{},custom_emoji:{}},Te={me:{},is_bot:{},is_premium:{},added_to_attachment_menu:{}},Es={user:{},hidden_user:{},chat:{},channel:{}},js={is_video:{},is_animated:{},premium_animation:{}},Pe={emoji:{},custom_emoji:{},paid:{}},ht={can_be_upgraded:{},is_upgrade_separate:{},is_private:{}},yt={forward_origin:Es,is_topic_message:{},is_automatic_forward:{},business_connection_id:{},text:{},animation:{},audio:{},document:{},paid_media:{},photo:{},sticker:js,story:{},video:{},video_note:{},voice:{},contact:{},dice:{},game:{},poll:{},venue:{},location:{},entities:lt,caption_entities:lt,caption:{},link_preview_options:{url:{},prefer_small_media:{},prefer_large_media:{},show_above_text:{}},effect_id:{},paid_star_count:{},has_media_spoiler:{},new_chat_title:{},new_chat_photo:{},delete_chat_photo:{},message_auto_delete_timer_changed:{},pinned_message:{},invoice:{},proximity_alert_triggered:{},chat_background_set:{},giveaway_created:{},giveaway:{only_new_members:{},has_public_winners:{}},giveaway_winners:{only_new_members:{},was_refunded:{}},giveaway_completed:{},gift:ht,gift_upgrade_sent:ht,unique_gift:{transfer_star_count:{}},paid_message_price_changed:{},video_chat_scheduled:{},video_chat_started:{},video_chat_ended:{},video_chat_participants_invited:{},web_app_data:{}},ie={...yt,direct_messages_topic:{},chat_owner_left:{new_owner:{}},chat_owner_changd:{},new_chat_members:Te,left_chat_member:Te,group_chat_created:{},supergroup_chat_created:{},migrate_to_chat_id:{},migrate_from_chat_id:{},successful_payment:{},refunded_payment:{},users_shared:{},chat_shared:{},connected_website:{},write_access_allowed:{},passport_data:{},boost_added:{},forum_topic_created:{is_name_implicit:{}},forum_topic_edited:{name:{},icon_custom_emoji_id:{}},forum_topic_closed:{},forum_topic_reopened:{},general_forum_topic_hidden:{},general_forum_topic_unhidden:{},checklist:{others_can_add_tasks:{},others_can_mark_tasks_as_done:{}},checklist_tasks_done:{},checklist_tasks_added:{},suggested_post_info:{},suggested_post_approved:{},suggested_post_approval_failed:{},suggested_post_declined:{},suggested_post_paid:{},suggested_post_refunded:{},sender_boost_count:{}},pt={...yt,channel_chat_created:{},direct_message_price_changed:{},is_paid_post:{}},Rs={can_reply:{},is_enabled:{}},Bs={old_reaction:Pe,new_reaction:Pe},Fs={reactions:Pe},$s={data:{},game_short_name:{}},gt={from:Te},ne={message:ie,edited_message:ie,channel_post:pt,edited_channel_post:pt,business_connection:Rs,business_message:ie,edited_business_message:ie,deleted_business_messages:{},inline_query:{},chosen_inline_result:{},callback_query:$s,shipping_query:{},pre_checkout_query:{},poll:{},poll_answer:{},my_chat_member:gt,chat_member:gt,chat_join_request:{},message_reaction:Bs,message_reaction_count:Fs,chat_boost:{},removed_chat_boost:{},purchased_paid_media:{}},mt={"":["message","channel_post"],msg:["message","channel_post"],edit:["edited_message","edited_channel_post"]},Ae={"":["entities","caption_entities"],media:["photo","video"],file:["photo","animation","audio","document","video","video_note","voice","sticker"]}});var de=y(ue=>{"use strict";h();Object.defineProperty(ue,"__esModule",{value:!0});ue.Context=void 0;var Ls=re(),S={filterQuery(n){let e=(0,Ls.matchFilter)(n);return t=>e(t)},text(n){let e=S.filterQuery([":text",":caption"]),t=$(n);return s=>{var i,r;if(!e(s))return!1;let o=(i=s.message)!==null&&i!==void 0?i:s.channelPost,a=(r=o.text)!==null&&r!==void 0?r:o.caption;return L(s,a,t)}},command(n){let e=S.filterQuery(":entities:bot_command"),t=new Set,s=new Set;return ae(n).forEach(i=>{if(i.startsWith("/"))throw new Error(`Do not include '/' when registering command handlers (use '${i.substring(1)}' not '${i}')`);(i.includes("@")?t:s).add(i)}),i=>{var r,o;if(!e(i))return!1;let a=(r=i.message)!==null&&r!==void 0?r:i.channelPost,d=(o=a.text)!==null&&o!==void 0?o:a.caption;return a.entities.some(c=>{if(c.type!=="bot_command"||c.offset!==0)return!1;let l=d.substring(1,c.length);if(s.has(l)||t.has(l))return i.match=d.substring(l.length+1).trimStart(),!0;let p=l.indexOf("@");if(p===-1)return!1;let m=l.substring(p+1).toLowerCase(),_=i.me.username.toLowerCase();if(m!==_)return!1;let g=l.substring(0,p);return s.has(g)?(i.match=d.substring(l.length+1).trimStart(),!0):!1})}},reaction(n){let e=S.filterQuery("message_reaction"),t=typeof n=="string"?[{type:"emoji",emoji:n}]:(Array.isArray(n)?n:[n]).map(o=>typeof o=="string"?{type:"emoji",emoji:o}:o),s=new Set(t.filter(o=>o.type==="emoji").map(o=>o.emoji)),i=new Set(t.filter(o=>o.type==="custom_emoji").map(o=>o.custom_emoji_id)),r=t.some(o=>o.type==="paid");return o=>{if(!e(o))return!1;let{old_reaction:a,new_reaction:d}=o.messageReaction;for(let c of d){let l=!1;if(c.type==="emoji"){for(let p of a)if(p.type==="emoji"&&p.emoji===c.emoji){l=!0;break}}else if(c.type==="custom_emoji"){for(let p of a)if(p.type==="custom_emoji"&&p.custom_emoji_id===c.custom_emoji_id){l=!0;break}}else if(c.type==="paid"){for(let p of a)if(p.type==="paid"){l=!0;break}}if(!l)if(c.type==="emoji"){if(s.has(c.emoji))return!0}else if(c.type==="custom_emoji"){if(i.has(c.custom_emoji_id))return!0}else if(c.type==="paid"){if(r)return!0}else return!0}return!1}},chatType(n){let e=new Set(ae(n));return t=>{var s;return((s=t.chat)===null||s===void 0?void 0:s.type)!==void 0&&e.has(t.chat.type)}},callbackQuery(n){let e=S.filterQuery("callback_query:data"),t=$(n);return s=>e(s)&&L(s,s.callbackQuery.data,t)},gameQuery(n){let e=S.filterQuery("callback_query:game_short_name"),t=$(n);return s=>e(s)&&L(s,s.callbackQuery.game_short_name,t)},inlineQuery(n){let e=S.filterQuery("inline_query"),t=$(n);return s=>e(s)&&L(s,s.inlineQuery.query,t)},chosenInlineResult(n){let e=S.filterQuery("chosen_inline_result"),t=$(n);return s=>e(s)&&L(s,s.chosenInlineResult.result_id,t)},preCheckoutQuery(n){let e=S.filterQuery("pre_checkout_query"),t=$(n);return s=>e(s)&&L(s,s.preCheckoutQuery.invoice_payload,t)},shippingQuery(n){let e=S.filterQuery("shipping_query"),t=$(n);return s=>e(s)&&L(s,s.shippingQuery.invoice_payload,t)}},oe=class n{constructor(e,t,s){this.update=e,this.api=t,this.me=s}get message(){return this.update.message}get editedMessage(){return this.update.edited_message}get channelPost(){return this.update.channel_post}get editedChannelPost(){return this.update.edited_channel_post}get businessConnection(){return this.update.business_connection}get businessMessage(){return this.update.business_message}get editedBusinessMessage(){return this.update.edited_business_message}get deletedBusinessMessages(){return this.update.deleted_business_messages}get messageReaction(){return this.update.message_reaction}get messageReactionCount(){return this.update.message_reaction_count}get inlineQuery(){return this.update.inline_query}get chosenInlineResult(){return this.update.chosen_inline_result}get callbackQuery(){return this.update.callback_query}get shippingQuery(){return this.update.shipping_query}get preCheckoutQuery(){return this.update.pre_checkout_query}get poll(){return this.update.poll}get pollAnswer(){return this.update.poll_answer}get myChatMember(){return this.update.my_chat_member}get chatMember(){return this.update.chat_member}get chatJoinRequest(){return this.update.chat_join_request}get chatBoost(){return this.update.chat_boost}get removedChatBoost(){return this.update.removed_chat_boost}get purchasedPaidMedia(){return this.update.purchased_paid_media}get msg(){var e,t,s,i,r,o,a;return(o=(r=(i=(s=(t=(e=this.message)!==null&&e!==void 0?e:this.editedMessage)!==null&&t!==void 0?t:this.channelPost)!==null&&s!==void 0?s:this.editedChannelPost)!==null&&i!==void 0?i:this.businessMessage)!==null&&r!==void 0?r:this.editedBusinessMessage)!==null&&o!==void 0?o:(a=this.callbackQuery)===null||a===void 0?void 0:a.message}get chat(){var e,t,s,i,r,o,a,d,c;return(c=(d=(a=(o=(r=(i=(s=(t=(e=this.msg)!==null&&e!==void 0?e:this.deletedBusinessMessages)!==null&&t!==void 0?t:this.messageReaction)!==null&&s!==void 0?s:this.messageReactionCount)!==null&&i!==void 0?i:this.myChatMember)!==null&&r!==void 0?r:this.chatMember)!==null&&o!==void 0?o:this.chatJoinRequest)!==null&&a!==void 0?a:this.chatBoost)!==null&&d!==void 0?d:this.removedChatBoost)===null||c===void 0?void 0:c.chat}get senderChat(){var e;return(e=this.msg)===null||e===void 0?void 0:e.sender_chat}get from(){var e,t,s,i,r,o,a,d,c,l,p,m,_,g,w,M,v;return(a=(o=(t=(e=this.businessConnection)!==null&&e!==void 0?e:this.messageReaction)!==null&&t!==void 0?t:(r=(i=(s=this.chatBoost)===null||s===void 0?void 0:s.boost)!==null&&i!==void 0?i:this.removedChatBoost)===null||r===void 0?void 0:r.source)===null||o===void 0?void 0:o.user)!==null&&a!==void 0?a:(v=(M=(w=(g=(_=(m=(p=(l=(c=(d=this.callbackQuery)!==null&&d!==void 0?d:this.msg)!==null&&c!==void 0?c:this.inlineQuery)!==null&&l!==void 0?l:this.chosenInlineResult)!==null&&p!==void 0?p:this.shippingQuery)!==null&&m!==void 0?m:this.preCheckoutQuery)!==null&&_!==void 0?_:this.myChatMember)!==null&&g!==void 0?g:this.chatMember)!==null&&w!==void 0?w:this.chatJoinRequest)!==null&&M!==void 0?M:this.purchasedPaidMedia)===null||v===void 0?void 0:v.from}get msgId(){var e,t,s,i,r;return(i=(t=(e=this.msg)===null||e===void 0?void 0:e.message_id)!==null&&t!==void 0?t:(s=this.messageReaction)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReactionCount)===null||r===void 0?void 0:r.message_id}get chatId(){var e,t,s;return(t=(e=this.chat)===null||e===void 0?void 0:e.id)!==null&&t!==void 0?t:(s=this.businessConnection)===null||s===void 0?void 0:s.user_chat_id}get inlineMessageId(){var e,t,s;return(t=(e=this.callbackQuery)===null||e===void 0?void 0:e.inline_message_id)!==null&&t!==void 0?t:(s=this.chosenInlineResult)===null||s===void 0?void 0:s.inline_message_id}get businessConnectionId(){var e,t,s,i,r;return(i=(t=(e=this.msg)===null||e===void 0?void 0:e.business_connection_id)!==null&&t!==void 0?t:(s=this.businessConnection)===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:(r=this.deletedBusinessMessages)===null||r===void 0?void 0:r.business_connection_id}entities(e){var t,s;let i=this.msg;if(i===void 0)return[];let r=(t=i.text)!==null&&t!==void 0?t:i.caption;if(r===void 0)return[];let o=(s=i.entities)!==null&&s!==void 0?s:i.caption_entities;if(o===void 0)return[];if(e!==void 0){let a=new Set(ae(e));o=o.filter(d=>a.has(d.type))}return o.map(a=>({...a,text:r.substring(a.offset,a.offset+a.length)}))}reactions(){let e=[],t=[],s=[],i=[],r=[],o=[],a=[],d=[],c=!1,l=!1,p=this.messageReaction;if(p!==void 0){let{old_reaction:m,new_reaction:_}=p;for(let g of _)g.type==="emoji"?e.push(g.emoji):g.type==="custom_emoji"?r.push(g.custom_emoji_id):g.type==="paid"&&(c=l=!0);for(let g of m)g.type==="emoji"?i.push(g.emoji):g.type==="custom_emoji"?d.push(g.custom_emoji_id):g.type==="paid"&&(l=!1);t.push(...e),o.push(...r);for(let g=0;g<i.length;g++){let w=t.length;if(w===0)break;let M=i[g];for(let v=0;v<w;v++)if(M===t[v]){s.push(M),i.splice(g,1),t.splice(v,1),g--;break}}for(let g=0;g<d.length;g++){let w=o.length;if(w===0)break;let M=d[g];for(let v=0;v<w;v++)if(M===o[v]){a.push(M),d.splice(g,1),o.splice(v,1),g--;break}}}return{emoji:e,emojiAdded:t,emojiKept:s,emojiRemoved:i,customEmoji:r,customEmojiAdded:o,customEmojiKept:a,customEmojiRemoved:d,paid:c,paidAdded:l}}has(e){return n.has.filterQuery(e)(this)}hasText(e){return n.has.text(e)(this)}hasCommand(e){return n.has.command(e)(this)}hasReaction(e){return n.has.reaction(e)(this)}hasChatType(e){return n.has.chatType(e)(this)}hasCallbackQuery(e){return n.has.callbackQuery(e)(this)}hasGameQuery(e){return n.has.gameQuery(e)(this)}hasInlineQuery(e){return n.has.inlineQuery(e)(this)}hasChosenInlineResult(e){return n.has.chosenInlineResult(e)(this)}hasPreCheckoutQuery(e){return n.has.preCheckoutQuery(e)(this)}hasShippingQuery(e){return n.has.shippingQuery(e)(this)}reply(e,t,s){var i;let r=this.msg;return this.api.sendMessage(u(this.chatId,"sendMessage"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithDraft(e,t,s){let i=this.msg;return this.api.sendMessageDraft(u(this.chatId,"sendMessageDraft"),this.update.update_id,e,{...i?.is_topic_message?{message_thread_id:i?.message_thread_id}:{},...t},s)}forwardMessage(e,t,s){var i;let r=this.msg;return this.api.forwardMessage(e,u(this.chatId,"forwardMessage"),u(this.msgId,"forwardMessage"),{direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}forwardMessages(e,t,s,i){var r;let o=this.msg;return this.api.forwardMessages(e,u(this.chatId,"forwardMessages"),t,{direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}copyMessage(e,t,s){var i;let r=this.msg;return this.api.copyMessage(e,u(this.chatId,"copyMessage"),u(this.msgId,"copyMessage"),{direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}copyMessages(e,t,s,i){var r;let o=this.msg;return this.api.copyMessages(e,u(this.chatId,"copyMessages"),t,{direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}replyWithPhoto(e,t,s){var i;let r=this.msg;return this.api.sendPhoto(u(this.chatId,"sendPhoto"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithAudio(e,t,s){var i;let r=this.msg;return this.api.sendAudio(u(this.chatId,"sendAudio"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithDocument(e,t,s){var i;let r=this.msg;return this.api.sendDocument(u(this.chatId,"sendDocument"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithVideo(e,t,s){var i;let r=this.msg;return this.api.sendVideo(u(this.chatId,"sendVideo"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithAnimation(e,t,s){var i;let r=this.msg;return this.api.sendAnimation(u(this.chatId,"sendAnimation"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithVoice(e,t,s){var i;let r=this.msg;return this.api.sendVoice(u(this.chatId,"sendVoice"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithVideoNote(e,t,s){var i;let r=this.msg;return this.api.sendVideoNote(u(this.chatId,"sendVideoNote"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithMediaGroup(e,t,s){var i;let r=this.msg;return this.api.sendMediaGroup(u(this.chatId,"sendMediaGroup"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithLocation(e,t,s,i){var r;let o=this.msg;return this.api.sendLocation(u(this.chatId,"sendLocation"),e,t,{business_connection_id:this.businessConnectionId,...o?.is_topic_message?{message_thread_id:o.message_thread_id}:{},direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}editMessageLiveLocation(e,t,s,i){let r=this.inlineMessageId;return r!==void 0?this.api.editMessageLiveLocationInline(r,e,t,{business_connection_id:this.businessConnectionId,...s},i):this.api.editMessageLiveLocation(u(this.chatId,"editMessageLiveLocation"),u(this.msgId,"editMessageLiveLocation"),e,t,{business_connection_id:this.businessConnectionId,...s},i)}stopMessageLiveLocation(e,t){let s=this.inlineMessageId;return s!==void 0?this.api.stopMessageLiveLocationInline(s,{business_connection_id:this.businessConnectionId,...e},t):this.api.stopMessageLiveLocation(u(this.chatId,"stopMessageLiveLocation"),u(this.msgId,"stopMessageLiveLocation"),{business_connection_id:this.businessConnectionId,...e},t)}sendPaidMedia(e,t,s,i){var r,o;let a=this.msg;return this.api.sendPaidMedia(u(this.chatId,"sendPaidMedia"),e,t,{business_connection_id:this.businessConnectionId,...a?.is_topic_message?{message_thread_id:a.message_thread_id}:{},direct_messages_topic_id:(o=(r=this.msg)===null||r===void 0?void 0:r.direct_messages_topic)===null||o===void 0?void 0:o.topic_id,...s},i)}replyWithVenue(e,t,s,i,r,o){var a;let d=this.msg;return this.api.sendVenue(u(this.chatId,"sendVenue"),e,t,s,i,{business_connection_id:this.businessConnectionId,...d?.is_topic_message?{message_thread_id:d.message_thread_id}:{},direct_messages_topic_id:(a=d?.direct_messages_topic)===null||a===void 0?void 0:a.topic_id,...r},o)}replyWithContact(e,t,s,i){var r;let o=this.msg;return this.api.sendContact(u(this.chatId,"sendContact"),e,t,{business_connection_id:this.businessConnectionId,...o?.is_topic_message?{message_thread_id:o.message_thread_id}:{},direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}replyWithPoll(e,t,s,i){let r=this.msg;return this.api.sendPoll(u(this.chatId,"sendPoll"),e,t,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},...s},i)}replyWithChecklist(e,t,s){return this.api.sendChecklist(u(this.businessConnectionId,"sendChecklist"),u(this.chatId,"sendChecklist"),e,t,s)}editMessageChecklist(e,t,s){var i,r,o,a;let d=u(this.msg,"editMessageChecklist"),c=(a=(r=(i=d.checklist_tasks_done)===null||i===void 0?void 0:i.checklist_message)!==null&&r!==void 0?r:(o=d.checklist_tasks_added)===null||o===void 0?void 0:o.checklist_message)!==null&&a!==void 0?a:d;return this.api.editMessageChecklist(u(this.businessConnectionId,"editMessageChecklist"),u(c.chat.id,"editMessageChecklist"),u(c.message_id,"editMessageChecklist"),e,t,s)}replyWithDice(e,t,s){var i;let r=this.msg;return this.api.sendDice(u(this.chatId,"sendDice"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithChatAction(e,t,s){let i=this.msg;return this.api.sendChatAction(u(this.chatId,"sendChatAction"),e,{business_connection_id:this.businessConnectionId,message_thread_id:i?.message_thread_id,...t},s)}react(e,t,s){return this.api.setMessageReaction(u(this.chatId,"setMessageReaction"),u(this.msgId,"setMessageReaction"),typeof e=="string"?[{type:"emoji",emoji:e}]:(Array.isArray(e)?e:[e]).map(i=>typeof i=="string"?{type:"emoji",emoji:i}:i),t,s)}getUserProfilePhotos(e,t){return this.api.getUserProfilePhotos(u(this.from,"getUserProfilePhotos").id,e,t)}getUserProfileAudios(e,t){return this.api.getUserProfileAudios(u(this.from,"getUserProfileAudios").id,e,t)}setUserEmojiStatus(e,t){return this.api.setUserEmojiStatus(u(this.from,"setUserEmojiStatus").id,e,t)}getUserChatBoosts(e,t){return this.api.getUserChatBoosts(e??u(this.chatId,"getUserChatBoosts"),u(this.from,"getUserChatBoosts").id,t)}getUserGifts(e,t){return this.api.getUserGifts(u(this.from,"getUserGifts").id,e,t)}getChatGifts(e,t){return this.api.getChatGifts(u(this.chatId,"getChatGifts"),e,t)}getBusinessConnection(e){return this.api.getBusinessConnection(u(this.businessConnectionId,"getBusinessConnection"),e)}getFile(e){var t,s,i,r,o,a;let d=u(this.msg,"getFile"),c=d.photo!==void 0?d.photo[d.photo.length-1]:(a=(o=(r=(i=(s=(t=d.animation)!==null&&t!==void 0?t:d.audio)!==null&&s!==void 0?s:d.document)!==null&&i!==void 0?i:d.video)!==null&&r!==void 0?r:d.video_note)!==null&&o!==void 0?o:d.voice)!==null&&a!==void 0?a:d.sticker;return this.api.getFile(u(c,"getFile").file_id,e)}kickAuthor(...e){return this.banAuthor(...e)}banAuthor(e,t){return this.api.banChatMember(u(this.chatId,"banAuthor"),u(this.from,"banAuthor").id,e,t)}kickChatMember(...e){return this.banChatMember(...e)}banChatMember(e,t,s){return this.api.banChatMember(u(this.chatId,"banChatMember"),e,t,s)}unbanChatMember(e,t,s){return this.api.unbanChatMember(u(this.chatId,"unbanChatMember"),e,t,s)}restrictAuthor(e,t,s){return this.api.restrictChatMember(u(this.chatId,"restrictAuthor"),u(this.from,"restrictAuthor").id,e,t,s)}restrictChatMember(e,t,s,i){return this.api.restrictChatMember(u(this.chatId,"restrictChatMember"),e,t,s,i)}promoteAuthor(e,t){return this.api.promoteChatMember(u(this.chatId,"promoteAuthor"),u(this.from,"promoteAuthor").id,e,t)}promoteChatMember(e,t,s){return this.api.promoteChatMember(u(this.chatId,"promoteChatMember"),e,t,s)}setChatAdministratorAuthorCustomTitle(e,t){return this.api.setChatAdministratorCustomTitle(u(this.chatId,"setChatAdministratorAuthorCustomTitle"),u(this.from,"setChatAdministratorAuthorCustomTitle").id,e,t)}setChatAdministratorCustomTitle(e,t,s){return this.api.setChatAdministratorCustomTitle(u(this.chatId,"setChatAdministratorCustomTitle"),e,t,s)}setAuthorTag(e,t){return this.api.setChatMemberTag(u(this.chatId,"setChatMemberTag"),u(this.from,"setChatMemberTag").id,e,t)}setChatMemberTag(e,t,s){return this.api.setChatMemberTag(u(this.chatId,"setChatMemberTag"),e,t,s)}banChatSenderChat(e,t){return this.api.banChatSenderChat(u(this.chatId,"banChatSenderChat"),e,t)}unbanChatSenderChat(e,t){return this.api.unbanChatSenderChat(u(this.chatId,"unbanChatSenderChat"),e,t)}setChatPermissions(e,t,s){return this.api.setChatPermissions(u(this.chatId,"setChatPermissions"),e,t,s)}exportChatInviteLink(e){return this.api.exportChatInviteLink(u(this.chatId,"exportChatInviteLink"),e)}createChatInviteLink(e,t){return this.api.createChatInviteLink(u(this.chatId,"createChatInviteLink"),e,t)}editChatInviteLink(e,t,s){return this.api.editChatInviteLink(u(this.chatId,"editChatInviteLink"),e,t,s)}createChatSubscriptionInviteLink(e,t,s,i){return this.api.createChatSubscriptionInviteLink(u(this.chatId,"createChatSubscriptionInviteLink"),e,t,s,i)}editChatSubscriptionInviteLink(e,t,s){return this.api.editChatSubscriptionInviteLink(u(this.chatId,"editChatSubscriptionInviteLink"),e,t,s)}revokeChatInviteLink(e,t){return this.api.revokeChatInviteLink(u(this.chatId,"editChatInviteLink"),e,t)}approveChatJoinRequest(e,t){return this.api.approveChatJoinRequest(u(this.chatId,"approveChatJoinRequest"),e,t)}declineChatJoinRequest(e,t){return this.api.declineChatJoinRequest(u(this.chatId,"declineChatJoinRequest"),e,t)}approveSuggestedPost(e,t){return this.api.approveSuggestedPost(u(this.chatId,"approveSuggestedPost"),u(this.msgId,"approveSuggestedPost"),e,t)}declineSuggestedPost(e,t){return this.api.declineSuggestedPost(u(this.chatId,"declineSuggestedPost"),u(this.msgId,"declineSuggestedPost"),e,t)}setChatPhoto(e,t){return this.api.setChatPhoto(u(this.chatId,"setChatPhoto"),e,t)}deleteChatPhoto(e){return this.api.deleteChatPhoto(u(this.chatId,"deleteChatPhoto"),e)}setChatTitle(e,t){return this.api.setChatTitle(u(this.chatId,"setChatTitle"),e,t)}setChatDescription(e,t){return this.api.setChatDescription(u(this.chatId,"setChatDescription"),e,t)}pinChatMessage(e,t,s){return this.api.pinChatMessage(u(this.chatId,"pinChatMessage"),e,{business_connection_id:this.businessConnectionId,...t},s)}unpinChatMessage(e,t,s){return this.api.unpinChatMessage(u(this.chatId,"unpinChatMessage"),e,{business_connection_id:this.businessConnectionId,...t},s)}unpinAllChatMessages(e){return this.api.unpinAllChatMessages(u(this.chatId,"unpinAllChatMessages"),e)}leaveChat(e){return this.api.leaveChat(u(this.chatId,"leaveChat"),e)}getChat(e){return this.api.getChat(u(this.chatId,"getChat"),e)}getChatAdministrators(e){return this.api.getChatAdministrators(u(this.chatId,"getChatAdministrators"),e)}getChatMembersCount(...e){return this.getChatMemberCount(...e)}getChatMemberCount(e){return this.api.getChatMemberCount(u(this.chatId,"getChatMemberCount"),e)}getAuthor(e){return this.api.getChatMember(u(this.chatId,"getAuthor"),u(this.from,"getAuthor").id,e)}getChatMember(e,t){return this.api.getChatMember(u(this.chatId,"getChatMember"),e,t)}setChatStickerSet(e,t){return this.api.setChatStickerSet(u(this.chatId,"setChatStickerSet"),e,t)}deleteChatStickerSet(e){return this.api.deleteChatStickerSet(u(this.chatId,"deleteChatStickerSet"),e)}createForumTopic(e,t,s){return this.api.createForumTopic(u(this.chatId,"createForumTopic"),e,t,s)}editForumTopic(e,t){let s=u(this.msg,"editForumTopic"),i=u(s.message_thread_id,"editForumTopic");return this.api.editForumTopic(s.chat.id,i,e,t)}closeForumTopic(e){let t=u(this.msg,"closeForumTopic"),s=u(t.message_thread_id,"closeForumTopic");return this.api.closeForumTopic(t.chat.id,s,e)}reopenForumTopic(e){let t=u(this.msg,"reopenForumTopic"),s=u(t.message_thread_id,"reopenForumTopic");return this.api.reopenForumTopic(t.chat.id,s,e)}deleteForumTopic(e){let t=u(this.msg,"deleteForumTopic"),s=u(t.message_thread_id,"deleteForumTopic");return this.api.deleteForumTopic(t.chat.id,s,e)}unpinAllForumTopicMessages(e){let t=u(this.msg,"unpinAllForumTopicMessages"),s=u(t.message_thread_id,"unpinAllForumTopicMessages");return this.api.unpinAllForumTopicMessages(t.chat.id,s,e)}editGeneralForumTopic(e,t){return this.api.editGeneralForumTopic(u(this.chatId,"editGeneralForumTopic"),e,t)}closeGeneralForumTopic(e){return this.api.closeGeneralForumTopic(u(this.chatId,"closeGeneralForumTopic"),e)}reopenGeneralForumTopic(e){return this.api.reopenGeneralForumTopic(u(this.chatId,"reopenGeneralForumTopic"),e)}hideGeneralForumTopic(e){return this.api.hideGeneralForumTopic(u(this.chatId,"hideGeneralForumTopic"),e)}unhideGeneralForumTopic(e){return this.api.unhideGeneralForumTopic(u(this.chatId,"unhideGeneralForumTopic"),e)}unpinAllGeneralForumTopicMessages(e){return this.api.unpinAllGeneralForumTopicMessages(u(this.chatId,"unpinAllGeneralForumTopicMessages"),e)}answerCallbackQuery(e,t){return this.api.answerCallbackQuery(u(this.callbackQuery,"answerCallbackQuery").id,typeof e=="string"?{text:e}:e,t)}setChatMenuButton(e,t){return this.api.setChatMenuButton(e,t)}getChatMenuButton(e,t){return this.api.getChatMenuButton(e,t)}setMyDefaultAdministratorRights(e,t){return this.api.setMyDefaultAdministratorRights(e,t)}getMyDefaultAdministratorRights(e,t){return this.api.getMyDefaultAdministratorRights(e,t)}editMessageText(e,t,s){var i,r,o,a,d;let c=this.inlineMessageId;return c!==void 0?this.api.editMessageTextInline(c,e,{business_connection_id:this.businessConnectionId,...t},s):this.api.editMessageText(u(this.chatId,"editMessageText"),u((a=(r=(i=this.msg)===null||i===void 0?void 0:i.message_id)!==null&&r!==void 0?r:(o=this.messageReaction)===null||o===void 0?void 0:o.message_id)!==null&&a!==void 0?a:(d=this.messageReactionCount)===null||d===void 0?void 0:d.message_id,"editMessageText"),e,{business_connection_id:this.businessConnectionId,...t},s)}editMessageCaption(e,t){var s,i,r,o,a;let d=this.inlineMessageId;return d!==void 0?this.api.editMessageCaptionInline(d,{business_connection_id:this.businessConnectionId,...e},t):this.api.editMessageCaption(u(this.chatId,"editMessageCaption"),u((o=(i=(s=this.msg)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReaction)===null||r===void 0?void 0:r.message_id)!==null&&o!==void 0?o:(a=this.messageReactionCount)===null||a===void 0?void 0:a.message_id,"editMessageCaption"),{business_connection_id:this.businessConnectionId,...e},t)}editMessageMedia(e,t,s){var i,r,o,a,d;let c=this.inlineMessageId;return c!==void 0?this.api.editMessageMediaInline(c,e,{business_connection_id:this.businessConnectionId,...t},s):this.api.editMessageMedia(u(this.chatId,"editMessageMedia"),u((a=(r=(i=this.msg)===null||i===void 0?void 0:i.message_id)!==null&&r!==void 0?r:(o=this.messageReaction)===null||o===void 0?void 0:o.message_id)!==null&&a!==void 0?a:(d=this.messageReactionCount)===null||d===void 0?void 0:d.message_id,"editMessageMedia"),e,{business_connection_id:this.businessConnectionId,...t},s)}editMessageReplyMarkup(e,t){var s,i,r,o,a;let d=this.inlineMessageId;return d!==void 0?this.api.editMessageReplyMarkupInline(d,{business_connection_id:this.businessConnectionId,...e},t):this.api.editMessageReplyMarkup(u(this.chatId,"editMessageReplyMarkup"),u((o=(i=(s=this.msg)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReaction)===null||r===void 0?void 0:r.message_id)!==null&&o!==void 0?o:(a=this.messageReactionCount)===null||a===void 0?void 0:a.message_id,"editMessageReplyMarkup"),{business_connection_id:this.businessConnectionId,...e},t)}stopPoll(e,t){var s,i,r,o,a;return this.api.stopPoll(u(this.chatId,"stopPoll"),u((o=(i=(s=this.msg)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReaction)===null||r===void 0?void 0:r.message_id)!==null&&o!==void 0?o:(a=this.messageReactionCount)===null||a===void 0?void 0:a.message_id,"stopPoll"),{business_connection_id:this.businessConnectionId,...e},t)}deleteMessage(e){var t,s,i,r,o;return this.api.deleteMessage(u(this.chatId,"deleteMessage"),u((r=(s=(t=this.msg)===null||t===void 0?void 0:t.message_id)!==null&&s!==void 0?s:(i=this.messageReaction)===null||i===void 0?void 0:i.message_id)!==null&&r!==void 0?r:(o=this.messageReactionCount)===null||o===void 0?void 0:o.message_id,"deleteMessage"),e)}deleteMessages(e,t){return this.api.deleteMessages(u(this.chatId,"deleteMessages"),e,t)}deleteBusinessMessages(e,t){return this.api.deleteBusinessMessages(u(this.businessConnectionId,"deleteBusinessMessages"),e,t)}setBusinessAccountName(e,t,s){return this.api.setBusinessAccountName(u(this.businessConnectionId,"setBusinessAccountName"),e,t,s)}setBusinessAccountUsername(e,t){return this.api.setBusinessAccountUsername(u(this.businessConnectionId,"setBusinessAccountUsername"),e,t)}setBusinessAccountBio(e,t){return this.api.setBusinessAccountBio(u(this.businessConnectionId,"setBusinessAccountBio"),e,t)}setBusinessAccountProfilePhoto(e,t,s){return this.api.setBusinessAccountProfilePhoto(u(this.businessConnectionId,"setBusinessAccountProfilePhoto"),e,t,s)}removeBusinessAccountProfilePhoto(e,t){return this.api.removeBusinessAccountProfilePhoto(u(this.businessConnectionId,"removeBusinessAccountProfilePhoto"),e,t)}setBusinessAccountGiftSettings(e,t,s){return this.api.setBusinessAccountGiftSettings(u(this.businessConnectionId,"setBusinessAccountGiftSettings"),e,t,s)}getBusinessAccountStarBalance(e){return this.api.getBusinessAccountStarBalance(u(this.businessConnectionId,"getBusinessAccountStarBalance"),e)}transferBusinessAccountStars(e,t){return this.api.transferBusinessAccountStars(u(this.businessConnectionId,"transferBusinessAccountStars"),e,t)}getBusinessAccountGifts(e,t){return this.api.getBusinessAccountGifts(u(this.businessConnectionId,"getBusinessAccountGifts"),e,t)}convertGiftToStars(e,t){return this.api.convertGiftToStars(u(this.businessConnectionId,"convertGiftToStars"),e,t)}upgradeGift(e,t,s){return this.api.upgradeGift(u(this.businessConnectionId,"upgradeGift"),e,t,s)}transferGift(e,t,s,i){return this.api.transferGift(u(this.businessConnectionId,"transferGift"),e,t,s,i)}postStory(e,t,s,i){return this.api.postStory(u(this.businessConnectionId,"postStory"),e,t,s,i)}repostStory(e,t,s){var i;let r=u((i=this.msg)===null||i===void 0?void 0:i.story,"repostStory");return this.api.repostStory(u(this.businessConnectionId,"repostStory"),r.chat.id,r.id,e,t,s)}editStory(e,t,s,i){return this.api.editStory(u(this.businessConnectionId,"editStory"),e,t,s,i)}deleteStory(e,t){return this.api.deleteStory(u(this.businessConnectionId,"deleteStory"),e,t)}replyWithSticker(e,t,s){var i;let r=this.msg;return this.api.sendSticker(u(this.chatId,"sendSticker"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}getCustomEmojiStickers(e){var t,s;return this.api.getCustomEmojiStickers(((s=(t=this.msg)===null||t===void 0?void 0:t.entities)!==null&&s!==void 0?s:[]).filter(i=>i.type==="custom_emoji").map(i=>i.custom_emoji_id),e)}replyWithGift(e,t,s){return this.api.sendGift(u(this.from,"sendGift").id,e,t,s)}giftPremiumSubscription(e,t,s,i){return this.api.giftPremiumSubscription(u(this.from,"giftPremiumSubscription").id,e,t,s,i)}replyWithGiftToChannel(e,t,s){return this.api.sendGiftToChannel(u(this.chat,"sendGift").id,e,t,s)}answerInlineQuery(e,t,s){return this.api.answerInlineQuery(u(this.inlineQuery,"answerInlineQuery").id,e,t,s)}savePreparedInlineMessage(e,t,s){return this.api.savePreparedInlineMessage(u(this.from,"savePreparedInlineMessage").id,e,t,s)}replyWithInvoice(e,t,s,i,r,o,a){var d;let c=this.msg;return this.api.sendInvoice(u(this.chatId,"sendInvoice"),e,t,s,i,r,{...c?.is_topic_message?{message_thread_id:c.message_thread_id}:{},direct_messages_topic_id:(d=c?.direct_messages_topic)===null||d===void 0?void 0:d.topic_id,...o},a)}answerShippingQuery(e,t,s){return this.api.answerShippingQuery(u(this.shippingQuery,"answerShippingQuery").id,e,t,s)}answerPreCheckoutQuery(e,t,s){return this.api.answerPreCheckoutQuery(u(this.preCheckoutQuery,"answerPreCheckoutQuery").id,e,typeof t=="string"?{error_message:t}:t,s)}refundStarPayment(e){var t;return this.api.refundStarPayment(u(this.from,"refundStarPayment").id,u((t=this.msg)===null||t===void 0?void 0:t.successful_payment,"refundStarPayment").telegram_payment_charge_id,e)}editUserStarSubscription(e,t,s){return this.api.editUserStarSubscription(u(this.from,"editUserStarSubscription").id,e,t,s)}verifyUser(e,t){return this.api.verifyUser(u(this.from,"verifyUser").id,e,t)}verifyChat(e,t){return this.api.verifyChat(u(this.chatId,"verifyChat"),e,t)}removeUserVerification(e){return this.api.removeUserVerification(u(this.from,"removeUserVerification").id,e)}removeChatVerification(e){return this.api.removeChatVerification(u(this.chatId,"removeChatVerification"),e)}readBusinessMessage(e){return this.api.readBusinessMessage(u(this.businessConnectionId,"readBusinessMessage"),u(this.chatId,"readBusinessMessage"),u(this.msgId,"readBusinessMessage"),e)}setPassportDataErrors(e,t){return this.api.setPassportDataErrors(u(this.from,"setPassportDataErrors").id,e,t)}replyWithGame(e,t,s){let i=this.msg;return this.api.sendGame(u(this.chatId,"sendGame"),e,{business_connection_id:this.businessConnectionId,...i?.is_topic_message?{message_thread_id:i.message_thread_id}:{},...t},s)}};ue.Context=oe;oe.has=S;function u(n,e){if(n===void 0)throw new Error(`Missing information for API call to ${e}`);return n}function $(n){return ae(n).map(e=>typeof e=="string"?t=>t===e?e:null:t=>t.match(e))}function L(n,e,t){for(let s of t){let i=s(e);if(i)return n.match=i,!0}return!1}function ae(n){return Array.isArray(n)?n:[n]}});var Re=y(q=>{"use strict";h();Object.defineProperty(q,"__esModule",{value:!0});q.Composer=q.BotError=void 0;q.run=bt;var I=de(),ce=class extends Error{constructor(e,t){super(qs(e)),this.error=e,this.ctx=t,this.name="BotError",e instanceof Error&&(this.stack=e.stack)}};q.BotError=ce;function qs(n){let e;if(n instanceof Error)e=`${n.name} in middleware: ${n.message}`;else{let t=typeof n;switch(e=`Non-error value of type ${t} thrown in middleware`,t){case"bigint":case"boolean":case"number":case"symbol":e+=`: ${n}`;break;case"string":e+=`: ${String(n).substring(0,50)}`;break;default:e+="!";break}}return e}function V(n){return typeof n=="function"?n:(e,t)=>n.middleware()(e,t)}function vt(n,e){return async(t,s)=>{let i=!1;await n(t,async()=>{if(i)throw new Error("`next` already called before!");i=!0,await e(t,s)})}}function Ee(n,e){return e()}var Us=()=>Promise.resolve();async function bt(n,e){await n(e,Us)}var je=class n{constructor(...e){this.handler=e.length===0?Ee:e.map(V).reduce(vt)}middleware(){return this.handler}use(...e){let t=new n(...e);return this.handler=vt(this.handler,V(t)),t}on(e,...t){return this.filter(I.Context.has.filterQuery(e),...t)}hears(e,...t){return this.filter(I.Context.has.text(e),...t)}command(e,...t){return this.filter(I.Context.has.command(e),...t)}reaction(e,...t){return this.filter(I.Context.has.reaction(e),...t)}chatType(e,...t){return this.filter(I.Context.has.chatType(e),...t)}callbackQuery(e,...t){return this.filter(I.Context.has.callbackQuery(e),...t)}gameQuery(e,...t){return this.filter(I.Context.has.gameQuery(e),...t)}inlineQuery(e,...t){return this.filter(I.Context.has.inlineQuery(e),...t)}chosenInlineResult(e,...t){return this.filter(I.Context.has.chosenInlineResult(e),...t)}preCheckoutQuery(e,...t){return this.filter(I.Context.has.preCheckoutQuery(e),...t)}shippingQuery(e,...t){return this.filter(I.Context.has.shippingQuery(e),...t)}filter(e,...t){let s=new n(...t);return this.branch(e,s,Ee),s}drop(e,...t){return this.filter(async s=>!await e(s),...t)}fork(...e){let t=new n(...e),s=V(t);return this.use((i,r)=>Promise.all([r(),bt(s,i)])),t}lazy(e){return this.use(async(t,s)=>{let i=await e(t),r=Array.isArray(i)?i:[i];await V(new n(...r))(t,s)})}route(e,t,s=Ee){return this.lazy(async i=>{var r;let o=await e(i);return(r=o===void 0||!t[o]?s:t[o])!==null&&r!==void 0?r:[]})}branch(e,t,s){return this.lazy(async i=>await e(i)?t:s)}errorBoundary(e,...t){let s=new n(...t),i=V(s);return this.use(async(r,o)=>{let a=!1,d=()=>(a=!0,Promise.resolve());try{await i(r,d)}catch(c){a=!1,await e(new ce(c,r),d)}a&&await o()}),s}};q.Composer=je});var j=y(A=>{"use strict";h();Object.defineProperty(A,"__esModule",{value:!0});A.defaultAdapter=A.itrToStream=A.debug=void 0;A.baseFetchConfig=zs;var Gs=K("http"),Os=K("https"),Ds=K("stream"),Qs=ws();Object.defineProperty(A,"debug",{enumerable:!0,get:function(){return Qs.debug}});var Ns=n=>Ds.Readable.from(n,{objectMode:!1});A.itrToStream=Ns;var xs=new Map,Ws=new Map;function wt(n,e,t){let s=n.get(e);return s===void 0&&(s=t(),n.set(e,s)),s}function zs(n){return n.startsWith("https:")?{compress:!0,agent:wt(Ws,n,()=>new Os.Agent({keepAlive:!0}))}:n.startsWith("http:")?{agent:wt(xs,n,()=>new Gs.Agent({keepAlive:!0}))}:{}}A.defaultAdapter="express"});var pe=y(R=>{"use strict";h();Object.defineProperty(R,"__esModule",{value:!0});R.HttpError=R.GrammyError=void 0;R.toGrammyError=Ks;R.toHttpError=Vs;var Hs=j(),Ct=(0,Hs.debug)("grammy:warn"),le=class extends Error{constructor(e,t,s,i){var r;super(`${e} (${t.error_code}: ${t.description})`),this.method=s,this.payload=i,this.ok=!1,this.name="GrammyError",this.error_code=t.error_code,this.description=t.description,this.parameters=(r=t.parameters)!==null&&r!==void 0?r:{}}};R.GrammyError=le;function Ks(n,e,t){switch(n.error_code){case 401:Ct("Error 401 means that your bot token is wrong, talk to https://t.me/BotFather to check it.");break;case 409:Ct("Error 409 means that you are running your bot several times on long polling. Consider revoking the bot token if you believe that no other instance is running.");break}return new le(`Call to '${e}' failed!`,n,e,t)}var he=class extends Error{constructor(e,t){super(e),this.error=t,this.name="HttpError"}};R.HttpError=he;function Ys(n){return typeof n=="object"&&n!==null&&"status"in n&&"statusText"in n}function Vs(n,e,t){let s=`Network request for '${n}' failed!`;return Ys(t)&&(s+=` (${t.status}: ${t.statusText})`),e&&t instanceof Error&&(s+=` ${t.message}`),new he(s,t)}});var Mt=y(()=>{h()});var kt=y(T=>{"use strict";h();var Js=T&&T.__createBinding||(Object.create?function(n,e,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,s,i)}:function(n,e,t,s){s===void 0&&(s=t),n[s]=e[t]}),Xs=T&&T.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Js(e,n,t)};Object.defineProperty(T,"__esModule",{value:!0});T.InputFile=void 0;var It=K("fs"),Zs=rt(),ge=K("path"),ei=j(),ti=(0,ei.debug)("grammy:warn");Xs(Mt(),T);var Be=class n{constructor(e,t){this.consumed=!1,this.fileData=e,t??(t=this.guessFilename(e)),this.filename=t,typeof e=="string"&&(e.startsWith("http:")||e.startsWith("https:"))&&ti(`InputFile received the local file path '${e}' that looks like a URL. Is this a mistake?`)}guessFilename(e){if(typeof e=="string")return(0,ge.basename)(e);if("url"in e)return(0,ge.basename)(e.url);if(e instanceof URL){if(e.pathname!=="/"){let t=(0,ge.basename)(e.pathname);if(t)return t}return(0,ge.basename)(e.hostname)}}async toRaw(){if(this.consumed)throw new Error("Cannot reuse InputFile data source!");let e=this.fileData;return typeof e=="string"?(0,It.createReadStream)(e):e instanceof URL?e.protocol==="file"?(0,It.createReadStream)(e.pathname):St(e):"url"in e?St(e.url):e instanceof Uint8Array?e:typeof e=="function"?new n(await e()).toRaw():(this.consumed=!0,e)}toJSON(){throw new Error("InputFile instances must be sent via grammY")}};T.InputFile=Be;async function*St(n){let{body:e}=await(0,Zs.default)(n);for await(let t of e){if(typeof t=="string")throw new Error(`Could not transfer file, received string data instead of bytes from '${n}'`);yield t}}});var Fe=y(U=>{"use strict";h();var si=U&&U.__createBinding||(Object.create?function(n,e,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,s,i)}:function(n,e,t,s){s===void 0&&(s=t),n[s]=e[t]}),ii=U&&U.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&si(e,n,t)};Object.defineProperty(U,"__esModule",{value:!0});ii(kt(),U)});var Pt=y(X=>{"use strict";h();Object.defineProperty(X,"__esModule",{value:!0});X.requiresFormDataUpload=$e;X.createJsonPayload=ri;X.createFormDataPayload=ai;var ni=j(),me=Fe();function $e(n){return n instanceof me.InputFile||typeof n=="object"&&n!==null&&Object.values(n).some(e=>Array.isArray(e)?e.some($e):e instanceof me.InputFile||$e(e))}function At(n){return JSON.stringify(n,(e,t)=>t??void 0)}function ri(n){return{method:"POST",headers:{"content-type":"application/json",connection:"keep-alive"},body:At(n)}}async function*oi(n,e){try{yield*n}catch(t){e(t)}}function ai(n,e){let t=ui(),s=di(n,t),i=oi(s,e),r=(0,ni.itrToStream)(i);return{method:"POST",headers:{"content-type":`multipart/form-data; boundary=${t}`,connection:"keep-alive"},body:r}}function ui(){return"----------"+Tt(32)}function Tt(n=16){return Array.from(Array(n)).map(()=>Math.random().toString(36)[2]||0).join("")}var J=new TextEncoder;async function*di(n,e){let t=Le(n);yield J.encode(`--${e}\r
3
+ import{a as rt,b as Ms}from"./chunk-QN6Y6NPA.js";import{f as ot}from"./chunk-EQGA7LH7.js";import"./chunk-T2T2UEPY.js";import"./chunk-M53RP3YP.js";import{a as Cs}from"./chunk-OOEH6ZSV.js";import{a as ws}from"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import{b as h}from"./chunk-GZPNIYVZ.js";import{a as K,d as y,f as nt}from"./chunk-OWGSC52X.js";var re=y(Y=>{"use strict";h();Object.defineProperty(Y,"__esModule",{value:!0});Y.matchFilter=Is;Y.parse=ft;Y.preprocess=_t;var at=new Map;function Is(n){var e;let t=Array.isArray(n)?n:[n],s=t.join(","),i=(e=at.get(s))!==null&&e!==void 0?e:(()=>{let r=ft(t),o=Ss(r);return at.set(s,o),o})();return r=>i(r)}function ft(n){return Array.isArray(n)?n.map(e=>e.split(":")):[n.split(":")]}function Ss(n){let e=n.flatMap(i=>ks(i,_t(i))),t=Ts(e),s=Ps(t);return i=>!!s(i.update,i)}function _t(n){let e=ne,t=[n].flatMap(s=>{let[i,r,o]=s;if(!(i in mt))return[s];if(!i&&!r&&!o)return[s];let d=mt[i].map(c=>[c,r,o]);return r===void 0||r in Ae&&(r||o)?d:d.filter(([c])=>{var l;return!!(!((l=e[c])===null||l===void 0)&&l[r])})}).flatMap(s=>{let[i,r,o]=s;if(!(r in Ae))return[s];if(!r&&!o)return[s];let d=Ae[r].map(c=>[i,c,o]);return o===void 0?d:d.filter(([,c])=>{var l,p;return!!(!((p=(l=e[i])===null||l===void 0?void 0:l[c])===null||p===void 0)&&p[o])})});if(t.length===0)throw new Error(`Shortcuts in '${n.join(":")}' do not expand to any valid filter query`);return t}function ks(n,e){if(e.length===0)throw new Error("Empty filter query given");let t=e.map(As).filter(s=>s!==!0);if(t.length===0)return e;throw t.length===1?new Error(t[0]):new Error(`Invalid filter query '${n.join(":")}'. There are ${t.length} errors after expanding the contained shortcuts: ${t.join("; ")}`)}function As(n){let[e,t,s,...i]=n;if(e===void 0)return"Empty filter query given";if(!(e in ne)){let a=Object.keys(ne);return`Invalid L1 filter '${e}' given in '${n.join(":")}'. Permitted values are: ${a.map(d=>`'${d}'`).join(", ")}.`}if(t===void 0)return!0;let r=ne[e];if(!(t in r)){let a=Object.keys(r);return`Invalid L2 filter '${t}' given in '${n.join(":")}'. Permitted values are: ${a.map(d=>`'${d}'`).join(", ")}.`}if(s===void 0)return!0;let o=r[t];if(!(s in o)){let a=Object.keys(o);return`Invalid L3 filter '${s}' given in '${n.join(":")}'. ${a.length===0?`No further filtering is possible after '${e}:${t}'.`:`Permitted values are: ${a.map(d=>`'${d}'`).join(", ")}.`}`}return i.length===0?!0:`Cannot filter further than three levels, ':${i.join(":")}' is invalid!`}function Ts(n){var e,t;let s={};for(let[i,r,o]of n){let a=(e=s[i])!==null&&e!==void 0?e:s[i]={};if(r!==void 0){let d=(t=a[r])!==null&&t!==void 0?t:a[r]=new Set;o!==void 0&&d.add(o)}}return s}function ke(n,e){return(t,s)=>n(t,s)||e(t,s)}function ut(n,e){return(t,s)=>{let i=n(t,s);return i&&e(i,s)}}function dt(n){return(e,t)=>n(e,t)!=null}function Ps(n){let e=Object.entries(n).map(([t,s])=>{let i=o=>o[t],r=Object.entries(s).map(([o,a])=>{let d=l=>l[o],c=Array.from(a).map(l=>l==="me"?(m,_)=>{let g=_.me.id;return ct(m,w=>w.id===g)}:m=>ct(m,_=>_[l]||_.type===l));return c.length===0?dt(d):ut(d,c.reduce(ke))});return r.length===0?dt(i):ut(i,r.reduce(ke))});if(e.length===0)throw new Error("Cannot create filter function for empty query");return e.reduce(ke)}function ct(n,e){let t=s=>s!=null&&e(s);return Array.isArray(n)?n.some(t):t(n)}var lt={mention:{},hashtag:{},cashtag:{},bot_command:{},url:{},email:{},phone_number:{},bold:{},italic:{},underline:{},strikethrough:{},spoiler:{},blockquote:{},expandable_blockquote:{},code:{},pre:{},text_link:{},text_mention:{},custom_emoji:{}},Te={me:{},is_bot:{},is_premium:{},added_to_attachment_menu:{}},Es={user:{},hidden_user:{},chat:{},channel:{}},js={is_video:{},is_animated:{},premium_animation:{}},Pe={emoji:{},custom_emoji:{},paid:{}},ht={can_be_upgraded:{},is_upgrade_separate:{},is_private:{}},yt={forward_origin:Es,is_topic_message:{},is_automatic_forward:{},business_connection_id:{},text:{},animation:{},audio:{},document:{},paid_media:{},photo:{},sticker:js,story:{},video:{},video_note:{},voice:{},contact:{},dice:{},game:{},poll:{},venue:{},location:{},entities:lt,caption_entities:lt,caption:{},link_preview_options:{url:{},prefer_small_media:{},prefer_large_media:{},show_above_text:{}},effect_id:{},paid_star_count:{},has_media_spoiler:{},new_chat_title:{},new_chat_photo:{},delete_chat_photo:{},message_auto_delete_timer_changed:{},pinned_message:{},invoice:{},proximity_alert_triggered:{},chat_background_set:{},giveaway_created:{},giveaway:{only_new_members:{},has_public_winners:{}},giveaway_winners:{only_new_members:{},was_refunded:{}},giveaway_completed:{},gift:ht,gift_upgrade_sent:ht,unique_gift:{transfer_star_count:{}},paid_message_price_changed:{},video_chat_scheduled:{},video_chat_started:{},video_chat_ended:{},video_chat_participants_invited:{},web_app_data:{}},ie={...yt,direct_messages_topic:{},chat_owner_left:{new_owner:{}},chat_owner_changd:{},new_chat_members:Te,left_chat_member:Te,group_chat_created:{},supergroup_chat_created:{},migrate_to_chat_id:{},migrate_from_chat_id:{},successful_payment:{},refunded_payment:{},users_shared:{},chat_shared:{},connected_website:{},write_access_allowed:{},passport_data:{},boost_added:{},forum_topic_created:{is_name_implicit:{}},forum_topic_edited:{name:{},icon_custom_emoji_id:{}},forum_topic_closed:{},forum_topic_reopened:{},general_forum_topic_hidden:{},general_forum_topic_unhidden:{},checklist:{others_can_add_tasks:{},others_can_mark_tasks_as_done:{}},checklist_tasks_done:{},checklist_tasks_added:{},suggested_post_info:{},suggested_post_approved:{},suggested_post_approval_failed:{},suggested_post_declined:{},suggested_post_paid:{},suggested_post_refunded:{},sender_boost_count:{}},pt={...yt,channel_chat_created:{},direct_message_price_changed:{},is_paid_post:{}},Rs={can_reply:{},is_enabled:{}},Bs={old_reaction:Pe,new_reaction:Pe},Fs={reactions:Pe},$s={data:{},game_short_name:{}},gt={from:Te},ne={message:ie,edited_message:ie,channel_post:pt,edited_channel_post:pt,business_connection:Rs,business_message:ie,edited_business_message:ie,deleted_business_messages:{},inline_query:{},chosen_inline_result:{},callback_query:$s,shipping_query:{},pre_checkout_query:{},poll:{},poll_answer:{},my_chat_member:gt,chat_member:gt,chat_join_request:{},message_reaction:Bs,message_reaction_count:Fs,chat_boost:{},removed_chat_boost:{},purchased_paid_media:{}},mt={"":["message","channel_post"],msg:["message","channel_post"],edit:["edited_message","edited_channel_post"]},Ae={"":["entities","caption_entities"],media:["photo","video"],file:["photo","animation","audio","document","video","video_note","voice","sticker"]}});var de=y(ue=>{"use strict";h();Object.defineProperty(ue,"__esModule",{value:!0});ue.Context=void 0;var Ls=re(),S={filterQuery(n){let e=(0,Ls.matchFilter)(n);return t=>e(t)},text(n){let e=S.filterQuery([":text",":caption"]),t=$(n);return s=>{var i,r;if(!e(s))return!1;let o=(i=s.message)!==null&&i!==void 0?i:s.channelPost,a=(r=o.text)!==null&&r!==void 0?r:o.caption;return L(s,a,t)}},command(n){let e=S.filterQuery(":entities:bot_command"),t=new Set,s=new Set;return ae(n).forEach(i=>{if(i.startsWith("/"))throw new Error(`Do not include '/' when registering command handlers (use '${i.substring(1)}' not '${i}')`);(i.includes("@")?t:s).add(i)}),i=>{var r,o;if(!e(i))return!1;let a=(r=i.message)!==null&&r!==void 0?r:i.channelPost,d=(o=a.text)!==null&&o!==void 0?o:a.caption;return a.entities.some(c=>{if(c.type!=="bot_command"||c.offset!==0)return!1;let l=d.substring(1,c.length);if(s.has(l)||t.has(l))return i.match=d.substring(l.length+1).trimStart(),!0;let p=l.indexOf("@");if(p===-1)return!1;let m=l.substring(p+1).toLowerCase(),_=i.me.username.toLowerCase();if(m!==_)return!1;let g=l.substring(0,p);return s.has(g)?(i.match=d.substring(l.length+1).trimStart(),!0):!1})}},reaction(n){let e=S.filterQuery("message_reaction"),t=typeof n=="string"?[{type:"emoji",emoji:n}]:(Array.isArray(n)?n:[n]).map(o=>typeof o=="string"?{type:"emoji",emoji:o}:o),s=new Set(t.filter(o=>o.type==="emoji").map(o=>o.emoji)),i=new Set(t.filter(o=>o.type==="custom_emoji").map(o=>o.custom_emoji_id)),r=t.some(o=>o.type==="paid");return o=>{if(!e(o))return!1;let{old_reaction:a,new_reaction:d}=o.messageReaction;for(let c of d){let l=!1;if(c.type==="emoji"){for(let p of a)if(p.type==="emoji"&&p.emoji===c.emoji){l=!0;break}}else if(c.type==="custom_emoji"){for(let p of a)if(p.type==="custom_emoji"&&p.custom_emoji_id===c.custom_emoji_id){l=!0;break}}else if(c.type==="paid"){for(let p of a)if(p.type==="paid"){l=!0;break}}if(!l)if(c.type==="emoji"){if(s.has(c.emoji))return!0}else if(c.type==="custom_emoji"){if(i.has(c.custom_emoji_id))return!0}else if(c.type==="paid"){if(r)return!0}else return!0}return!1}},chatType(n){let e=new Set(ae(n));return t=>{var s;return((s=t.chat)===null||s===void 0?void 0:s.type)!==void 0&&e.has(t.chat.type)}},callbackQuery(n){let e=S.filterQuery("callback_query:data"),t=$(n);return s=>e(s)&&L(s,s.callbackQuery.data,t)},gameQuery(n){let e=S.filterQuery("callback_query:game_short_name"),t=$(n);return s=>e(s)&&L(s,s.callbackQuery.game_short_name,t)},inlineQuery(n){let e=S.filterQuery("inline_query"),t=$(n);return s=>e(s)&&L(s,s.inlineQuery.query,t)},chosenInlineResult(n){let e=S.filterQuery("chosen_inline_result"),t=$(n);return s=>e(s)&&L(s,s.chosenInlineResult.result_id,t)},preCheckoutQuery(n){let e=S.filterQuery("pre_checkout_query"),t=$(n);return s=>e(s)&&L(s,s.preCheckoutQuery.invoice_payload,t)},shippingQuery(n){let e=S.filterQuery("shipping_query"),t=$(n);return s=>e(s)&&L(s,s.shippingQuery.invoice_payload,t)}},oe=class n{constructor(e,t,s){this.update=e,this.api=t,this.me=s}get message(){return this.update.message}get editedMessage(){return this.update.edited_message}get channelPost(){return this.update.channel_post}get editedChannelPost(){return this.update.edited_channel_post}get businessConnection(){return this.update.business_connection}get businessMessage(){return this.update.business_message}get editedBusinessMessage(){return this.update.edited_business_message}get deletedBusinessMessages(){return this.update.deleted_business_messages}get messageReaction(){return this.update.message_reaction}get messageReactionCount(){return this.update.message_reaction_count}get inlineQuery(){return this.update.inline_query}get chosenInlineResult(){return this.update.chosen_inline_result}get callbackQuery(){return this.update.callback_query}get shippingQuery(){return this.update.shipping_query}get preCheckoutQuery(){return this.update.pre_checkout_query}get poll(){return this.update.poll}get pollAnswer(){return this.update.poll_answer}get myChatMember(){return this.update.my_chat_member}get chatMember(){return this.update.chat_member}get chatJoinRequest(){return this.update.chat_join_request}get chatBoost(){return this.update.chat_boost}get removedChatBoost(){return this.update.removed_chat_boost}get purchasedPaidMedia(){return this.update.purchased_paid_media}get msg(){var e,t,s,i,r,o,a;return(o=(r=(i=(s=(t=(e=this.message)!==null&&e!==void 0?e:this.editedMessage)!==null&&t!==void 0?t:this.channelPost)!==null&&s!==void 0?s:this.editedChannelPost)!==null&&i!==void 0?i:this.businessMessage)!==null&&r!==void 0?r:this.editedBusinessMessage)!==null&&o!==void 0?o:(a=this.callbackQuery)===null||a===void 0?void 0:a.message}get chat(){var e,t,s,i,r,o,a,d,c;return(c=(d=(a=(o=(r=(i=(s=(t=(e=this.msg)!==null&&e!==void 0?e:this.deletedBusinessMessages)!==null&&t!==void 0?t:this.messageReaction)!==null&&s!==void 0?s:this.messageReactionCount)!==null&&i!==void 0?i:this.myChatMember)!==null&&r!==void 0?r:this.chatMember)!==null&&o!==void 0?o:this.chatJoinRequest)!==null&&a!==void 0?a:this.chatBoost)!==null&&d!==void 0?d:this.removedChatBoost)===null||c===void 0?void 0:c.chat}get senderChat(){var e;return(e=this.msg)===null||e===void 0?void 0:e.sender_chat}get from(){var e,t,s,i,r,o,a,d,c,l,p,m,_,g,w,M,v;return(a=(o=(t=(e=this.businessConnection)!==null&&e!==void 0?e:this.messageReaction)!==null&&t!==void 0?t:(r=(i=(s=this.chatBoost)===null||s===void 0?void 0:s.boost)!==null&&i!==void 0?i:this.removedChatBoost)===null||r===void 0?void 0:r.source)===null||o===void 0?void 0:o.user)!==null&&a!==void 0?a:(v=(M=(w=(g=(_=(m=(p=(l=(c=(d=this.callbackQuery)!==null&&d!==void 0?d:this.msg)!==null&&c!==void 0?c:this.inlineQuery)!==null&&l!==void 0?l:this.chosenInlineResult)!==null&&p!==void 0?p:this.shippingQuery)!==null&&m!==void 0?m:this.preCheckoutQuery)!==null&&_!==void 0?_:this.myChatMember)!==null&&g!==void 0?g:this.chatMember)!==null&&w!==void 0?w:this.chatJoinRequest)!==null&&M!==void 0?M:this.purchasedPaidMedia)===null||v===void 0?void 0:v.from}get msgId(){var e,t,s,i,r;return(i=(t=(e=this.msg)===null||e===void 0?void 0:e.message_id)!==null&&t!==void 0?t:(s=this.messageReaction)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReactionCount)===null||r===void 0?void 0:r.message_id}get chatId(){var e,t,s;return(t=(e=this.chat)===null||e===void 0?void 0:e.id)!==null&&t!==void 0?t:(s=this.businessConnection)===null||s===void 0?void 0:s.user_chat_id}get inlineMessageId(){var e,t,s;return(t=(e=this.callbackQuery)===null||e===void 0?void 0:e.inline_message_id)!==null&&t!==void 0?t:(s=this.chosenInlineResult)===null||s===void 0?void 0:s.inline_message_id}get businessConnectionId(){var e,t,s,i,r;return(i=(t=(e=this.msg)===null||e===void 0?void 0:e.business_connection_id)!==null&&t!==void 0?t:(s=this.businessConnection)===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:(r=this.deletedBusinessMessages)===null||r===void 0?void 0:r.business_connection_id}entities(e){var t,s;let i=this.msg;if(i===void 0)return[];let r=(t=i.text)!==null&&t!==void 0?t:i.caption;if(r===void 0)return[];let o=(s=i.entities)!==null&&s!==void 0?s:i.caption_entities;if(o===void 0)return[];if(e!==void 0){let a=new Set(ae(e));o=o.filter(d=>a.has(d.type))}return o.map(a=>({...a,text:r.substring(a.offset,a.offset+a.length)}))}reactions(){let e=[],t=[],s=[],i=[],r=[],o=[],a=[],d=[],c=!1,l=!1,p=this.messageReaction;if(p!==void 0){let{old_reaction:m,new_reaction:_}=p;for(let g of _)g.type==="emoji"?e.push(g.emoji):g.type==="custom_emoji"?r.push(g.custom_emoji_id):g.type==="paid"&&(c=l=!0);for(let g of m)g.type==="emoji"?i.push(g.emoji):g.type==="custom_emoji"?d.push(g.custom_emoji_id):g.type==="paid"&&(l=!1);t.push(...e),o.push(...r);for(let g=0;g<i.length;g++){let w=t.length;if(w===0)break;let M=i[g];for(let v=0;v<w;v++)if(M===t[v]){s.push(M),i.splice(g,1),t.splice(v,1),g--;break}}for(let g=0;g<d.length;g++){let w=o.length;if(w===0)break;let M=d[g];for(let v=0;v<w;v++)if(M===o[v]){a.push(M),d.splice(g,1),o.splice(v,1),g--;break}}}return{emoji:e,emojiAdded:t,emojiKept:s,emojiRemoved:i,customEmoji:r,customEmojiAdded:o,customEmojiKept:a,customEmojiRemoved:d,paid:c,paidAdded:l}}has(e){return n.has.filterQuery(e)(this)}hasText(e){return n.has.text(e)(this)}hasCommand(e){return n.has.command(e)(this)}hasReaction(e){return n.has.reaction(e)(this)}hasChatType(e){return n.has.chatType(e)(this)}hasCallbackQuery(e){return n.has.callbackQuery(e)(this)}hasGameQuery(e){return n.has.gameQuery(e)(this)}hasInlineQuery(e){return n.has.inlineQuery(e)(this)}hasChosenInlineResult(e){return n.has.chosenInlineResult(e)(this)}hasPreCheckoutQuery(e){return n.has.preCheckoutQuery(e)(this)}hasShippingQuery(e){return n.has.shippingQuery(e)(this)}reply(e,t,s){var i;let r=this.msg;return this.api.sendMessage(u(this.chatId,"sendMessage"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithDraft(e,t,s){let i=this.msg;return this.api.sendMessageDraft(u(this.chatId,"sendMessageDraft"),this.update.update_id,e,{...i?.is_topic_message?{message_thread_id:i?.message_thread_id}:{},...t},s)}forwardMessage(e,t,s){var i;let r=this.msg;return this.api.forwardMessage(e,u(this.chatId,"forwardMessage"),u(this.msgId,"forwardMessage"),{direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}forwardMessages(e,t,s,i){var r;let o=this.msg;return this.api.forwardMessages(e,u(this.chatId,"forwardMessages"),t,{direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}copyMessage(e,t,s){var i;let r=this.msg;return this.api.copyMessage(e,u(this.chatId,"copyMessage"),u(this.msgId,"copyMessage"),{direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}copyMessages(e,t,s,i){var r;let o=this.msg;return this.api.copyMessages(e,u(this.chatId,"copyMessages"),t,{direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}replyWithPhoto(e,t,s){var i;let r=this.msg;return this.api.sendPhoto(u(this.chatId,"sendPhoto"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithAudio(e,t,s){var i;let r=this.msg;return this.api.sendAudio(u(this.chatId,"sendAudio"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithDocument(e,t,s){var i;let r=this.msg;return this.api.sendDocument(u(this.chatId,"sendDocument"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithVideo(e,t,s){var i;let r=this.msg;return this.api.sendVideo(u(this.chatId,"sendVideo"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithAnimation(e,t,s){var i;let r=this.msg;return this.api.sendAnimation(u(this.chatId,"sendAnimation"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithVoice(e,t,s){var i;let r=this.msg;return this.api.sendVoice(u(this.chatId,"sendVoice"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithVideoNote(e,t,s){var i;let r=this.msg;return this.api.sendVideoNote(u(this.chatId,"sendVideoNote"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithMediaGroup(e,t,s){var i;let r=this.msg;return this.api.sendMediaGroup(u(this.chatId,"sendMediaGroup"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithLocation(e,t,s,i){var r;let o=this.msg;return this.api.sendLocation(u(this.chatId,"sendLocation"),e,t,{business_connection_id:this.businessConnectionId,...o?.is_topic_message?{message_thread_id:o.message_thread_id}:{},direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}editMessageLiveLocation(e,t,s,i){let r=this.inlineMessageId;return r!==void 0?this.api.editMessageLiveLocationInline(r,e,t,{business_connection_id:this.businessConnectionId,...s},i):this.api.editMessageLiveLocation(u(this.chatId,"editMessageLiveLocation"),u(this.msgId,"editMessageLiveLocation"),e,t,{business_connection_id:this.businessConnectionId,...s},i)}stopMessageLiveLocation(e,t){let s=this.inlineMessageId;return s!==void 0?this.api.stopMessageLiveLocationInline(s,{business_connection_id:this.businessConnectionId,...e},t):this.api.stopMessageLiveLocation(u(this.chatId,"stopMessageLiveLocation"),u(this.msgId,"stopMessageLiveLocation"),{business_connection_id:this.businessConnectionId,...e},t)}sendPaidMedia(e,t,s,i){var r,o;let a=this.msg;return this.api.sendPaidMedia(u(this.chatId,"sendPaidMedia"),e,t,{business_connection_id:this.businessConnectionId,...a?.is_topic_message?{message_thread_id:a.message_thread_id}:{},direct_messages_topic_id:(o=(r=this.msg)===null||r===void 0?void 0:r.direct_messages_topic)===null||o===void 0?void 0:o.topic_id,...s},i)}replyWithVenue(e,t,s,i,r,o){var a;let d=this.msg;return this.api.sendVenue(u(this.chatId,"sendVenue"),e,t,s,i,{business_connection_id:this.businessConnectionId,...d?.is_topic_message?{message_thread_id:d.message_thread_id}:{},direct_messages_topic_id:(a=d?.direct_messages_topic)===null||a===void 0?void 0:a.topic_id,...r},o)}replyWithContact(e,t,s,i){var r;let o=this.msg;return this.api.sendContact(u(this.chatId,"sendContact"),e,t,{business_connection_id:this.businessConnectionId,...o?.is_topic_message?{message_thread_id:o.message_thread_id}:{},direct_messages_topic_id:(r=o?.direct_messages_topic)===null||r===void 0?void 0:r.topic_id,...s},i)}replyWithPoll(e,t,s,i){let r=this.msg;return this.api.sendPoll(u(this.chatId,"sendPoll"),e,t,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},...s},i)}replyWithChecklist(e,t,s){return this.api.sendChecklist(u(this.businessConnectionId,"sendChecklist"),u(this.chatId,"sendChecklist"),e,t,s)}editMessageChecklist(e,t,s){var i,r,o,a;let d=u(this.msg,"editMessageChecklist"),c=(a=(r=(i=d.checklist_tasks_done)===null||i===void 0?void 0:i.checklist_message)!==null&&r!==void 0?r:(o=d.checklist_tasks_added)===null||o===void 0?void 0:o.checklist_message)!==null&&a!==void 0?a:d;return this.api.editMessageChecklist(u(this.businessConnectionId,"editMessageChecklist"),u(c.chat.id,"editMessageChecklist"),u(c.message_id,"editMessageChecklist"),e,t,s)}replyWithDice(e,t,s){var i;let r=this.msg;return this.api.sendDice(u(this.chatId,"sendDice"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}replyWithChatAction(e,t,s){let i=this.msg;return this.api.sendChatAction(u(this.chatId,"sendChatAction"),e,{business_connection_id:this.businessConnectionId,message_thread_id:i?.message_thread_id,...t},s)}react(e,t,s){return this.api.setMessageReaction(u(this.chatId,"setMessageReaction"),u(this.msgId,"setMessageReaction"),typeof e=="string"?[{type:"emoji",emoji:e}]:(Array.isArray(e)?e:[e]).map(i=>typeof i=="string"?{type:"emoji",emoji:i}:i),t,s)}getUserProfilePhotos(e,t){return this.api.getUserProfilePhotos(u(this.from,"getUserProfilePhotos").id,e,t)}getUserProfileAudios(e,t){return this.api.getUserProfileAudios(u(this.from,"getUserProfileAudios").id,e,t)}setUserEmojiStatus(e,t){return this.api.setUserEmojiStatus(u(this.from,"setUserEmojiStatus").id,e,t)}getUserChatBoosts(e,t){return this.api.getUserChatBoosts(e??u(this.chatId,"getUserChatBoosts"),u(this.from,"getUserChatBoosts").id,t)}getUserGifts(e,t){return this.api.getUserGifts(u(this.from,"getUserGifts").id,e,t)}getChatGifts(e,t){return this.api.getChatGifts(u(this.chatId,"getChatGifts"),e,t)}getBusinessConnection(e){return this.api.getBusinessConnection(u(this.businessConnectionId,"getBusinessConnection"),e)}getFile(e){var t,s,i,r,o,a;let d=u(this.msg,"getFile"),c=d.photo!==void 0?d.photo[d.photo.length-1]:(a=(o=(r=(i=(s=(t=d.animation)!==null&&t!==void 0?t:d.audio)!==null&&s!==void 0?s:d.document)!==null&&i!==void 0?i:d.video)!==null&&r!==void 0?r:d.video_note)!==null&&o!==void 0?o:d.voice)!==null&&a!==void 0?a:d.sticker;return this.api.getFile(u(c,"getFile").file_id,e)}kickAuthor(...e){return this.banAuthor(...e)}banAuthor(e,t){return this.api.banChatMember(u(this.chatId,"banAuthor"),u(this.from,"banAuthor").id,e,t)}kickChatMember(...e){return this.banChatMember(...e)}banChatMember(e,t,s){return this.api.banChatMember(u(this.chatId,"banChatMember"),e,t,s)}unbanChatMember(e,t,s){return this.api.unbanChatMember(u(this.chatId,"unbanChatMember"),e,t,s)}restrictAuthor(e,t,s){return this.api.restrictChatMember(u(this.chatId,"restrictAuthor"),u(this.from,"restrictAuthor").id,e,t,s)}restrictChatMember(e,t,s,i){return this.api.restrictChatMember(u(this.chatId,"restrictChatMember"),e,t,s,i)}promoteAuthor(e,t){return this.api.promoteChatMember(u(this.chatId,"promoteAuthor"),u(this.from,"promoteAuthor").id,e,t)}promoteChatMember(e,t,s){return this.api.promoteChatMember(u(this.chatId,"promoteChatMember"),e,t,s)}setChatAdministratorAuthorCustomTitle(e,t){return this.api.setChatAdministratorCustomTitle(u(this.chatId,"setChatAdministratorAuthorCustomTitle"),u(this.from,"setChatAdministratorAuthorCustomTitle").id,e,t)}setChatAdministratorCustomTitle(e,t,s){return this.api.setChatAdministratorCustomTitle(u(this.chatId,"setChatAdministratorCustomTitle"),e,t,s)}setAuthorTag(e,t){return this.api.setChatMemberTag(u(this.chatId,"setChatMemberTag"),u(this.from,"setChatMemberTag").id,e,t)}setChatMemberTag(e,t,s){return this.api.setChatMemberTag(u(this.chatId,"setChatMemberTag"),e,t,s)}banChatSenderChat(e,t){return this.api.banChatSenderChat(u(this.chatId,"banChatSenderChat"),e,t)}unbanChatSenderChat(e,t){return this.api.unbanChatSenderChat(u(this.chatId,"unbanChatSenderChat"),e,t)}setChatPermissions(e,t,s){return this.api.setChatPermissions(u(this.chatId,"setChatPermissions"),e,t,s)}exportChatInviteLink(e){return this.api.exportChatInviteLink(u(this.chatId,"exportChatInviteLink"),e)}createChatInviteLink(e,t){return this.api.createChatInviteLink(u(this.chatId,"createChatInviteLink"),e,t)}editChatInviteLink(e,t,s){return this.api.editChatInviteLink(u(this.chatId,"editChatInviteLink"),e,t,s)}createChatSubscriptionInviteLink(e,t,s,i){return this.api.createChatSubscriptionInviteLink(u(this.chatId,"createChatSubscriptionInviteLink"),e,t,s,i)}editChatSubscriptionInviteLink(e,t,s){return this.api.editChatSubscriptionInviteLink(u(this.chatId,"editChatSubscriptionInviteLink"),e,t,s)}revokeChatInviteLink(e,t){return this.api.revokeChatInviteLink(u(this.chatId,"editChatInviteLink"),e,t)}approveChatJoinRequest(e,t){return this.api.approveChatJoinRequest(u(this.chatId,"approveChatJoinRequest"),e,t)}declineChatJoinRequest(e,t){return this.api.declineChatJoinRequest(u(this.chatId,"declineChatJoinRequest"),e,t)}approveSuggestedPost(e,t){return this.api.approveSuggestedPost(u(this.chatId,"approveSuggestedPost"),u(this.msgId,"approveSuggestedPost"),e,t)}declineSuggestedPost(e,t){return this.api.declineSuggestedPost(u(this.chatId,"declineSuggestedPost"),u(this.msgId,"declineSuggestedPost"),e,t)}setChatPhoto(e,t){return this.api.setChatPhoto(u(this.chatId,"setChatPhoto"),e,t)}deleteChatPhoto(e){return this.api.deleteChatPhoto(u(this.chatId,"deleteChatPhoto"),e)}setChatTitle(e,t){return this.api.setChatTitle(u(this.chatId,"setChatTitle"),e,t)}setChatDescription(e,t){return this.api.setChatDescription(u(this.chatId,"setChatDescription"),e,t)}pinChatMessage(e,t,s){return this.api.pinChatMessage(u(this.chatId,"pinChatMessage"),e,{business_connection_id:this.businessConnectionId,...t},s)}unpinChatMessage(e,t,s){return this.api.unpinChatMessage(u(this.chatId,"unpinChatMessage"),e,{business_connection_id:this.businessConnectionId,...t},s)}unpinAllChatMessages(e){return this.api.unpinAllChatMessages(u(this.chatId,"unpinAllChatMessages"),e)}leaveChat(e){return this.api.leaveChat(u(this.chatId,"leaveChat"),e)}getChat(e){return this.api.getChat(u(this.chatId,"getChat"),e)}getChatAdministrators(e){return this.api.getChatAdministrators(u(this.chatId,"getChatAdministrators"),e)}getChatMembersCount(...e){return this.getChatMemberCount(...e)}getChatMemberCount(e){return this.api.getChatMemberCount(u(this.chatId,"getChatMemberCount"),e)}getAuthor(e){return this.api.getChatMember(u(this.chatId,"getAuthor"),u(this.from,"getAuthor").id,e)}getChatMember(e,t){return this.api.getChatMember(u(this.chatId,"getChatMember"),e,t)}setChatStickerSet(e,t){return this.api.setChatStickerSet(u(this.chatId,"setChatStickerSet"),e,t)}deleteChatStickerSet(e){return this.api.deleteChatStickerSet(u(this.chatId,"deleteChatStickerSet"),e)}createForumTopic(e,t,s){return this.api.createForumTopic(u(this.chatId,"createForumTopic"),e,t,s)}editForumTopic(e,t){let s=u(this.msg,"editForumTopic"),i=u(s.message_thread_id,"editForumTopic");return this.api.editForumTopic(s.chat.id,i,e,t)}closeForumTopic(e){let t=u(this.msg,"closeForumTopic"),s=u(t.message_thread_id,"closeForumTopic");return this.api.closeForumTopic(t.chat.id,s,e)}reopenForumTopic(e){let t=u(this.msg,"reopenForumTopic"),s=u(t.message_thread_id,"reopenForumTopic");return this.api.reopenForumTopic(t.chat.id,s,e)}deleteForumTopic(e){let t=u(this.msg,"deleteForumTopic"),s=u(t.message_thread_id,"deleteForumTopic");return this.api.deleteForumTopic(t.chat.id,s,e)}unpinAllForumTopicMessages(e){let t=u(this.msg,"unpinAllForumTopicMessages"),s=u(t.message_thread_id,"unpinAllForumTopicMessages");return this.api.unpinAllForumTopicMessages(t.chat.id,s,e)}editGeneralForumTopic(e,t){return this.api.editGeneralForumTopic(u(this.chatId,"editGeneralForumTopic"),e,t)}closeGeneralForumTopic(e){return this.api.closeGeneralForumTopic(u(this.chatId,"closeGeneralForumTopic"),e)}reopenGeneralForumTopic(e){return this.api.reopenGeneralForumTopic(u(this.chatId,"reopenGeneralForumTopic"),e)}hideGeneralForumTopic(e){return this.api.hideGeneralForumTopic(u(this.chatId,"hideGeneralForumTopic"),e)}unhideGeneralForumTopic(e){return this.api.unhideGeneralForumTopic(u(this.chatId,"unhideGeneralForumTopic"),e)}unpinAllGeneralForumTopicMessages(e){return this.api.unpinAllGeneralForumTopicMessages(u(this.chatId,"unpinAllGeneralForumTopicMessages"),e)}answerCallbackQuery(e,t){return this.api.answerCallbackQuery(u(this.callbackQuery,"answerCallbackQuery").id,typeof e=="string"?{text:e}:e,t)}setChatMenuButton(e,t){return this.api.setChatMenuButton(e,t)}getChatMenuButton(e,t){return this.api.getChatMenuButton(e,t)}setMyDefaultAdministratorRights(e,t){return this.api.setMyDefaultAdministratorRights(e,t)}getMyDefaultAdministratorRights(e,t){return this.api.getMyDefaultAdministratorRights(e,t)}editMessageText(e,t,s){var i,r,o,a,d;let c=this.inlineMessageId;return c!==void 0?this.api.editMessageTextInline(c,e,{business_connection_id:this.businessConnectionId,...t},s):this.api.editMessageText(u(this.chatId,"editMessageText"),u((a=(r=(i=this.msg)===null||i===void 0?void 0:i.message_id)!==null&&r!==void 0?r:(o=this.messageReaction)===null||o===void 0?void 0:o.message_id)!==null&&a!==void 0?a:(d=this.messageReactionCount)===null||d===void 0?void 0:d.message_id,"editMessageText"),e,{business_connection_id:this.businessConnectionId,...t},s)}editMessageCaption(e,t){var s,i,r,o,a;let d=this.inlineMessageId;return d!==void 0?this.api.editMessageCaptionInline(d,{business_connection_id:this.businessConnectionId,...e},t):this.api.editMessageCaption(u(this.chatId,"editMessageCaption"),u((o=(i=(s=this.msg)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReaction)===null||r===void 0?void 0:r.message_id)!==null&&o!==void 0?o:(a=this.messageReactionCount)===null||a===void 0?void 0:a.message_id,"editMessageCaption"),{business_connection_id:this.businessConnectionId,...e},t)}editMessageMedia(e,t,s){var i,r,o,a,d;let c=this.inlineMessageId;return c!==void 0?this.api.editMessageMediaInline(c,e,{business_connection_id:this.businessConnectionId,...t},s):this.api.editMessageMedia(u(this.chatId,"editMessageMedia"),u((a=(r=(i=this.msg)===null||i===void 0?void 0:i.message_id)!==null&&r!==void 0?r:(o=this.messageReaction)===null||o===void 0?void 0:o.message_id)!==null&&a!==void 0?a:(d=this.messageReactionCount)===null||d===void 0?void 0:d.message_id,"editMessageMedia"),e,{business_connection_id:this.businessConnectionId,...t},s)}editMessageReplyMarkup(e,t){var s,i,r,o,a;let d=this.inlineMessageId;return d!==void 0?this.api.editMessageReplyMarkupInline(d,{business_connection_id:this.businessConnectionId,...e},t):this.api.editMessageReplyMarkup(u(this.chatId,"editMessageReplyMarkup"),u((o=(i=(s=this.msg)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReaction)===null||r===void 0?void 0:r.message_id)!==null&&o!==void 0?o:(a=this.messageReactionCount)===null||a===void 0?void 0:a.message_id,"editMessageReplyMarkup"),{business_connection_id:this.businessConnectionId,...e},t)}stopPoll(e,t){var s,i,r,o,a;return this.api.stopPoll(u(this.chatId,"stopPoll"),u((o=(i=(s=this.msg)===null||s===void 0?void 0:s.message_id)!==null&&i!==void 0?i:(r=this.messageReaction)===null||r===void 0?void 0:r.message_id)!==null&&o!==void 0?o:(a=this.messageReactionCount)===null||a===void 0?void 0:a.message_id,"stopPoll"),{business_connection_id:this.businessConnectionId,...e},t)}deleteMessage(e){var t,s,i,r,o;return this.api.deleteMessage(u(this.chatId,"deleteMessage"),u((r=(s=(t=this.msg)===null||t===void 0?void 0:t.message_id)!==null&&s!==void 0?s:(i=this.messageReaction)===null||i===void 0?void 0:i.message_id)!==null&&r!==void 0?r:(o=this.messageReactionCount)===null||o===void 0?void 0:o.message_id,"deleteMessage"),e)}deleteMessages(e,t){return this.api.deleteMessages(u(this.chatId,"deleteMessages"),e,t)}deleteBusinessMessages(e,t){return this.api.deleteBusinessMessages(u(this.businessConnectionId,"deleteBusinessMessages"),e,t)}setBusinessAccountName(e,t,s){return this.api.setBusinessAccountName(u(this.businessConnectionId,"setBusinessAccountName"),e,t,s)}setBusinessAccountUsername(e,t){return this.api.setBusinessAccountUsername(u(this.businessConnectionId,"setBusinessAccountUsername"),e,t)}setBusinessAccountBio(e,t){return this.api.setBusinessAccountBio(u(this.businessConnectionId,"setBusinessAccountBio"),e,t)}setBusinessAccountProfilePhoto(e,t,s){return this.api.setBusinessAccountProfilePhoto(u(this.businessConnectionId,"setBusinessAccountProfilePhoto"),e,t,s)}removeBusinessAccountProfilePhoto(e,t){return this.api.removeBusinessAccountProfilePhoto(u(this.businessConnectionId,"removeBusinessAccountProfilePhoto"),e,t)}setBusinessAccountGiftSettings(e,t,s){return this.api.setBusinessAccountGiftSettings(u(this.businessConnectionId,"setBusinessAccountGiftSettings"),e,t,s)}getBusinessAccountStarBalance(e){return this.api.getBusinessAccountStarBalance(u(this.businessConnectionId,"getBusinessAccountStarBalance"),e)}transferBusinessAccountStars(e,t){return this.api.transferBusinessAccountStars(u(this.businessConnectionId,"transferBusinessAccountStars"),e,t)}getBusinessAccountGifts(e,t){return this.api.getBusinessAccountGifts(u(this.businessConnectionId,"getBusinessAccountGifts"),e,t)}convertGiftToStars(e,t){return this.api.convertGiftToStars(u(this.businessConnectionId,"convertGiftToStars"),e,t)}upgradeGift(e,t,s){return this.api.upgradeGift(u(this.businessConnectionId,"upgradeGift"),e,t,s)}transferGift(e,t,s,i){return this.api.transferGift(u(this.businessConnectionId,"transferGift"),e,t,s,i)}postStory(e,t,s,i){return this.api.postStory(u(this.businessConnectionId,"postStory"),e,t,s,i)}repostStory(e,t,s){var i;let r=u((i=this.msg)===null||i===void 0?void 0:i.story,"repostStory");return this.api.repostStory(u(this.businessConnectionId,"repostStory"),r.chat.id,r.id,e,t,s)}editStory(e,t,s,i){return this.api.editStory(u(this.businessConnectionId,"editStory"),e,t,s,i)}deleteStory(e,t){return this.api.deleteStory(u(this.businessConnectionId,"deleteStory"),e,t)}replyWithSticker(e,t,s){var i;let r=this.msg;return this.api.sendSticker(u(this.chatId,"sendSticker"),e,{business_connection_id:this.businessConnectionId,...r?.is_topic_message?{message_thread_id:r.message_thread_id}:{},direct_messages_topic_id:(i=r?.direct_messages_topic)===null||i===void 0?void 0:i.topic_id,...t},s)}getCustomEmojiStickers(e){var t,s;return this.api.getCustomEmojiStickers(((s=(t=this.msg)===null||t===void 0?void 0:t.entities)!==null&&s!==void 0?s:[]).filter(i=>i.type==="custom_emoji").map(i=>i.custom_emoji_id),e)}replyWithGift(e,t,s){return this.api.sendGift(u(this.from,"sendGift").id,e,t,s)}giftPremiumSubscription(e,t,s,i){return this.api.giftPremiumSubscription(u(this.from,"giftPremiumSubscription").id,e,t,s,i)}replyWithGiftToChannel(e,t,s){return this.api.sendGiftToChannel(u(this.chat,"sendGift").id,e,t,s)}answerInlineQuery(e,t,s){return this.api.answerInlineQuery(u(this.inlineQuery,"answerInlineQuery").id,e,t,s)}savePreparedInlineMessage(e,t,s){return this.api.savePreparedInlineMessage(u(this.from,"savePreparedInlineMessage").id,e,t,s)}replyWithInvoice(e,t,s,i,r,o,a){var d;let c=this.msg;return this.api.sendInvoice(u(this.chatId,"sendInvoice"),e,t,s,i,r,{...c?.is_topic_message?{message_thread_id:c.message_thread_id}:{},direct_messages_topic_id:(d=c?.direct_messages_topic)===null||d===void 0?void 0:d.topic_id,...o},a)}answerShippingQuery(e,t,s){return this.api.answerShippingQuery(u(this.shippingQuery,"answerShippingQuery").id,e,t,s)}answerPreCheckoutQuery(e,t,s){return this.api.answerPreCheckoutQuery(u(this.preCheckoutQuery,"answerPreCheckoutQuery").id,e,typeof t=="string"?{error_message:t}:t,s)}refundStarPayment(e){var t;return this.api.refundStarPayment(u(this.from,"refundStarPayment").id,u((t=this.msg)===null||t===void 0?void 0:t.successful_payment,"refundStarPayment").telegram_payment_charge_id,e)}editUserStarSubscription(e,t,s){return this.api.editUserStarSubscription(u(this.from,"editUserStarSubscription").id,e,t,s)}verifyUser(e,t){return this.api.verifyUser(u(this.from,"verifyUser").id,e,t)}verifyChat(e,t){return this.api.verifyChat(u(this.chatId,"verifyChat"),e,t)}removeUserVerification(e){return this.api.removeUserVerification(u(this.from,"removeUserVerification").id,e)}removeChatVerification(e){return this.api.removeChatVerification(u(this.chatId,"removeChatVerification"),e)}readBusinessMessage(e){return this.api.readBusinessMessage(u(this.businessConnectionId,"readBusinessMessage"),u(this.chatId,"readBusinessMessage"),u(this.msgId,"readBusinessMessage"),e)}setPassportDataErrors(e,t){return this.api.setPassportDataErrors(u(this.from,"setPassportDataErrors").id,e,t)}replyWithGame(e,t,s){let i=this.msg;return this.api.sendGame(u(this.chatId,"sendGame"),e,{business_connection_id:this.businessConnectionId,...i?.is_topic_message?{message_thread_id:i.message_thread_id}:{},...t},s)}};ue.Context=oe;oe.has=S;function u(n,e){if(n===void 0)throw new Error(`Missing information for API call to ${e}`);return n}function $(n){return ae(n).map(e=>typeof e=="string"?t=>t===e?e:null:t=>t.match(e))}function L(n,e,t){for(let s of t){let i=s(e);if(i)return n.match=i,!0}return!1}function ae(n){return Array.isArray(n)?n:[n]}});var Re=y(q=>{"use strict";h();Object.defineProperty(q,"__esModule",{value:!0});q.Composer=q.BotError=void 0;q.run=bt;var I=de(),ce=class extends Error{constructor(e,t){super(qs(e)),this.error=e,this.ctx=t,this.name="BotError",e instanceof Error&&(this.stack=e.stack)}};q.BotError=ce;function qs(n){let e;if(n instanceof Error)e=`${n.name} in middleware: ${n.message}`;else{let t=typeof n;switch(e=`Non-error value of type ${t} thrown in middleware`,t){case"bigint":case"boolean":case"number":case"symbol":e+=`: ${n}`;break;case"string":e+=`: ${String(n).substring(0,50)}`;break;default:e+="!";break}}return e}function V(n){return typeof n=="function"?n:(e,t)=>n.middleware()(e,t)}function vt(n,e){return async(t,s)=>{let i=!1;await n(t,async()=>{if(i)throw new Error("`next` already called before!");i=!0,await e(t,s)})}}function Ee(n,e){return e()}var Us=()=>Promise.resolve();async function bt(n,e){await n(e,Us)}var je=class n{constructor(...e){this.handler=e.length===0?Ee:e.map(V).reduce(vt)}middleware(){return this.handler}use(...e){let t=new n(...e);return this.handler=vt(this.handler,V(t)),t}on(e,...t){return this.filter(I.Context.has.filterQuery(e),...t)}hears(e,...t){return this.filter(I.Context.has.text(e),...t)}command(e,...t){return this.filter(I.Context.has.command(e),...t)}reaction(e,...t){return this.filter(I.Context.has.reaction(e),...t)}chatType(e,...t){return this.filter(I.Context.has.chatType(e),...t)}callbackQuery(e,...t){return this.filter(I.Context.has.callbackQuery(e),...t)}gameQuery(e,...t){return this.filter(I.Context.has.gameQuery(e),...t)}inlineQuery(e,...t){return this.filter(I.Context.has.inlineQuery(e),...t)}chosenInlineResult(e,...t){return this.filter(I.Context.has.chosenInlineResult(e),...t)}preCheckoutQuery(e,...t){return this.filter(I.Context.has.preCheckoutQuery(e),...t)}shippingQuery(e,...t){return this.filter(I.Context.has.shippingQuery(e),...t)}filter(e,...t){let s=new n(...t);return this.branch(e,s,Ee),s}drop(e,...t){return this.filter(async s=>!await e(s),...t)}fork(...e){let t=new n(...e),s=V(t);return this.use((i,r)=>Promise.all([r(),bt(s,i)])),t}lazy(e){return this.use(async(t,s)=>{let i=await e(t),r=Array.isArray(i)?i:[i];await V(new n(...r))(t,s)})}route(e,t,s=Ee){return this.lazy(async i=>{var r;let o=await e(i);return(r=o===void 0||!t[o]?s:t[o])!==null&&r!==void 0?r:[]})}branch(e,t,s){return this.lazy(async i=>await e(i)?t:s)}errorBoundary(e,...t){let s=new n(...t),i=V(s);return this.use(async(r,o)=>{let a=!1,d=()=>(a=!0,Promise.resolve());try{await i(r,d)}catch(c){a=!1,await e(new ce(c,r),d)}a&&await o()}),s}};q.Composer=je});var j=y(A=>{"use strict";h();Object.defineProperty(A,"__esModule",{value:!0});A.defaultAdapter=A.itrToStream=A.debug=void 0;A.baseFetchConfig=zs;var Gs=K("http"),Os=K("https"),Ds=K("stream"),Qs=ws();Object.defineProperty(A,"debug",{enumerable:!0,get:function(){return Qs.debug}});var Ns=n=>Ds.Readable.from(n,{objectMode:!1});A.itrToStream=Ns;var xs=new Map,Ws=new Map;function wt(n,e,t){let s=n.get(e);return s===void 0&&(s=t(),n.set(e,s)),s}function zs(n){return n.startsWith("https:")?{compress:!0,agent:wt(Ws,n,()=>new Os.Agent({keepAlive:!0}))}:n.startsWith("http:")?{agent:wt(xs,n,()=>new Gs.Agent({keepAlive:!0}))}:{}}A.defaultAdapter="express"});var pe=y(R=>{"use strict";h();Object.defineProperty(R,"__esModule",{value:!0});R.HttpError=R.GrammyError=void 0;R.toGrammyError=Ks;R.toHttpError=Vs;var Hs=j(),Ct=(0,Hs.debug)("grammy:warn"),le=class extends Error{constructor(e,t,s,i){var r;super(`${e} (${t.error_code}: ${t.description})`),this.method=s,this.payload=i,this.ok=!1,this.name="GrammyError",this.error_code=t.error_code,this.description=t.description,this.parameters=(r=t.parameters)!==null&&r!==void 0?r:{}}};R.GrammyError=le;function Ks(n,e,t){switch(n.error_code){case 401:Ct("Error 401 means that your bot token is wrong, talk to https://t.me/BotFather to check it.");break;case 409:Ct("Error 409 means that you are running your bot several times on long polling. Consider revoking the bot token if you believe that no other instance is running.");break}return new le(`Call to '${e}' failed!`,n,e,t)}var he=class extends Error{constructor(e,t){super(e),this.error=t,this.name="HttpError"}};R.HttpError=he;function Ys(n){return typeof n=="object"&&n!==null&&"status"in n&&"statusText"in n}function Vs(n,e,t){let s=`Network request for '${n}' failed!`;return Ys(t)&&(s+=` (${t.status}: ${t.statusText})`),e&&t instanceof Error&&(s+=` ${t.message}`),new he(s,t)}});var Mt=y(()=>{h()});var kt=y(T=>{"use strict";h();var Js=T&&T.__createBinding||(Object.create?function(n,e,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,s,i)}:function(n,e,t,s){s===void 0&&(s=t),n[s]=e[t]}),Xs=T&&T.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Js(e,n,t)};Object.defineProperty(T,"__esModule",{value:!0});T.InputFile=void 0;var It=K("fs"),Zs=rt(),ge=K("path"),ei=j(),ti=(0,ei.debug)("grammy:warn");Xs(Mt(),T);var Be=class n{constructor(e,t){this.consumed=!1,this.fileData=e,t??(t=this.guessFilename(e)),this.filename=t,typeof e=="string"&&(e.startsWith("http:")||e.startsWith("https:"))&&ti(`InputFile received the local file path '${e}' that looks like a URL. Is this a mistake?`)}guessFilename(e){if(typeof e=="string")return(0,ge.basename)(e);if("url"in e)return(0,ge.basename)(e.url);if(e instanceof URL){if(e.pathname!=="/"){let t=(0,ge.basename)(e.pathname);if(t)return t}return(0,ge.basename)(e.hostname)}}async toRaw(){if(this.consumed)throw new Error("Cannot reuse InputFile data source!");let e=this.fileData;return typeof e=="string"?(0,It.createReadStream)(e):e instanceof URL?e.protocol==="file"?(0,It.createReadStream)(e.pathname):St(e):"url"in e?St(e.url):e instanceof Uint8Array?e:typeof e=="function"?new n(await e()).toRaw():(this.consumed=!0,e)}toJSON(){throw new Error("InputFile instances must be sent via grammY")}};T.InputFile=Be;async function*St(n){let{body:e}=await(0,Zs.default)(n);for await(let t of e){if(typeof t=="string")throw new Error(`Could not transfer file, received string data instead of bytes from '${n}'`);yield t}}});var Fe=y(U=>{"use strict";h();var si=U&&U.__createBinding||(Object.create?function(n,e,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,s,i)}:function(n,e,t,s){s===void 0&&(s=t),n[s]=e[t]}),ii=U&&U.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&si(e,n,t)};Object.defineProperty(U,"__esModule",{value:!0});ii(kt(),U)});var Pt=y(X=>{"use strict";h();Object.defineProperty(X,"__esModule",{value:!0});X.requiresFormDataUpload=$e;X.createJsonPayload=ri;X.createFormDataPayload=ai;var ni=j(),me=Fe();function $e(n){return n instanceof me.InputFile||typeof n=="object"&&n!==null&&Object.values(n).some(e=>Array.isArray(e)?e.some($e):e instanceof me.InputFile||$e(e))}function At(n){return JSON.stringify(n,(e,t)=>t??void 0)}function ri(n){return{method:"POST",headers:{"content-type":"application/json",connection:"keep-alive"},body:At(n)}}async function*oi(n,e){try{yield*n}catch(t){e(t)}}function ai(n,e){let t=ui(),s=di(n,t),i=oi(s,e),r=(0,ni.itrToStream)(i);return{method:"POST",headers:{"content-type":`multipart/form-data; boundary=${t}`,connection:"keep-alive"},body:r}}function ui(){return"----------"+Tt(32)}function Tt(n=16){return Array.from(Array(n)).map(()=>Math.random().toString(36)[2]||0).join("")}var J=new TextEncoder;async function*di(n,e){let t=Le(n);yield J.encode(`--${e}\r
4
4
  `);let s=J.encode(`\r
5
5
  --${e}\r
6
6
  `),i=!0;for(let[r,o]of Object.entries(n))o!=null&&(i||(yield s),yield ci(r,o instanceof me.InputFile?o.toJSON():typeof o=="object"?At(o):o),i=!1);for(let{id:r,origin:o,file:a}of t)i||(yield s),yield*li(r,o,a),i=!1;yield J.encode(`\r
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as Hr,b as vr,c as qr}from"./chunk-WZ75OGYY.js";import"./chunk-XMZIY7XX.js";import{f as Bt}from"./chunk-3HUM74NZ.js";import"./chunk-JSFA3NEP.js";import"./chunk-TZIDSCTF.js";import{c as Pt}from"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-UIRBHC5X.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import{b as l}from"./chunk-GZPNIYVZ.js";import{e as Mr,f as Qe}from"./chunk-OWGSC52X.js";l();l();import{mkdirSync as js,writeFileSync as $s}from"node:fs";import{randomUUID as zs}from"node:crypto";import{basename as Js,join as Fr}from"node:path";import{tmpdir as Ws}from"node:os";l();l();var Ye="/v1.0/im/bot/messages/get";l();l();l();l();l();function Ee(t,e){return function(){return t.apply(e,arguments)}}var{toString:jr}=Object.prototype,{getPrototypeOf:et}=Object,{iterator:Fe,toStringTag:Mt}=Symbol,Me=(t=>e=>{let n=jr.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),W=t=>(t=t.toLowerCase(),e=>Me(e)===t),He=t=>e=>typeof e===t,{isArray:he}=Array,me=He("undefined");function Te(t){return t!==null&&!me(t)&&t.constructor!==null&&!me(t.constructor)&&q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Ht=W("ArrayBuffer");function $r(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ht(t.buffer),e}var zr=He("string"),q=He("function"),vt=He("number"),xe=t=>t!==null&&typeof t=="object",Jr=t=>t===!0||t===!1,Ue=t=>{if(Me(t)!=="object")return!1;let e=et(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Mt in t)&&!(Fe in t)},Wr=t=>{if(!xe(t)||Te(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Vr=W("Date"),Kr=W("File"),Gr=t=>!!(t&&typeof t.uri<"u"),Xr=t=>t&&typeof t.getParts<"u",Qr=W("Blob"),Yr=W("FileList"),Zr=t=>xe(t)&&q(t.pipe);function en(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}var It=en(),Ut=typeof It.FormData<"u"?It.FormData:void 0,tn=t=>{let e;return t&&(Ut&&t instanceof Ut||q(t.append)&&((e=Me(t))==="formdata"||e==="object"&&q(t.toString)&&t.toString()==="[object FormData]"))},rn=W("URLSearchParams"),[nn,sn,on,an]=["ReadableStream","Request","Response","Headers"].map(W),cn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),he(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(Te(t))return;let i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length,c;for(r=0;r<o;r++)c=i[r],e.call(null,t[c],c,t)}}function qt(t,e){if(Te(t))return null;e=e.toLowerCase();let n=Object.keys(t),r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}var ae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:globalThis,jt=t=>!me(t)&&t!==ae;function Ze(){let{caseless:t,skipUndefined:e}=jt(this)&&this||{},n={},r=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;let o=t&&qt(n,i)||i;Ue(n[o])&&Ue(s)?n[o]=Ze(n[o],s):Ue(s)?n[o]=Ze({},s):he(s)?n[o]=s.slice():(!e||!me(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Se(arguments[s],r);return n}var ln=(t,e,n,{allOwnKeys:r}={})=>(Se(e,(s,i)=>{n&&q(s)?Object.defineProperty(t,i,{value:Ee(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),un=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),fn=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},dn=(t,e,n,r)=>{let s,i,o,c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!r||r(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=n!==!1&&et(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},pn=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;let r=t.indexOf(e,n);return r!==-1&&r===n},mn=t=>{if(!t)return null;if(he(t))return t;let e=t.length;if(!vt(e))return null;let n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},hn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&et(Uint8Array)),yn=(t,e)=>{let r=(t&&t[Fe]).call(t),s;for(;(s=r.next())&&!s.done;){let i=s.value;e.call(t,i[0],i[1])}},bn=(t,e)=>{let n,r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},gn=W("HTMLFormElement"),wn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ft=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Rn=W("RegExp"),$t=(t,e)=>{let n=Object.getOwnPropertyDescriptors(t),r={};Se(n,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(r[i]=o||s)}),Object.defineProperties(t,r)},En=t=>{$t(t,(e,n)=>{if(q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let r=t[n];if(q(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Tn=(t,e)=>{let n={},r=s=>{s.forEach(i=>{n[i]=!0})};return he(t)?r(t):r(String(t).split(e)),n},xn=()=>{},Sn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function An(t){return!!(t&&q(t.append)&&t[Mt]==="FormData"&&t[Fe])}var Cn=t=>{let e=new Array(10),n=(r,s)=>{if(xe(r)){if(e.indexOf(r)>=0)return;if(Te(r))return r;if(!("toJSON"in r)){e[s]=r;let i=he(r)?[]:{};return Se(r,(o,c)=>{let d=n(o,s+1);!me(d)&&(i[c]=d)}),e[s]=void 0,i}}return r};return n(t,0)},On=W("AsyncFunction"),_n=t=>t&&(xe(t)||q(t))&&q(t.then)&&q(t.catch),zt=((t,e)=>t?setImmediate:e?((n,r)=>(ae.addEventListener("message",({source:s,data:i})=>{s===ae&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),ae.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",q(ae.postMessage)),kn=typeof queueMicrotask<"u"?queueMicrotask.bind(ae):typeof process<"u"&&process.nextTick||zt,Dn=t=>t!=null&&q(t[Fe]),a={isArray:he,isArrayBuffer:Ht,isBuffer:Te,isFormData:tn,isArrayBufferView:$r,isString:zr,isNumber:vt,isBoolean:Jr,isObject:xe,isPlainObject:Ue,isEmptyObject:Wr,isReadableStream:nn,isRequest:sn,isResponse:on,isHeaders:an,isUndefined:me,isDate:Vr,isFile:Kr,isReactNativeBlob:Gr,isReactNative:Xr,isBlob:Qr,isRegExp:Rn,isFunction:q,isStream:Zr,isURLSearchParams:rn,isTypedArray:hn,isFileList:Yr,forEach:Se,merge:Ze,extend:ln,trim:cn,stripBOM:un,inherits:fn,toFlatObject:dn,kindOf:Me,kindOfTest:W,endsWith:pn,toArray:mn,forEachEntry:yn,matchAll:bn,isHTMLForm:gn,hasOwnProperty:Ft,hasOwnProp:Ft,reduceDescriptors:$t,freezeMethods:En,toObjectSet:Tn,toCamelCase:wn,noop:xn,toFiniteNumber:Sn,findKey:qt,global:ae,isContextDefined:jt,isSpecCompliantForm:An,toJSONObject:Cn,isAsyncFn:On,isThenable:_n,setImmediate:zt,asap:kn,isIterable:Dn};l();l();l();l();l();var F=class t extends Error{static from(e,n,r,s,i,o){let c=new t(e.message,n||e.code,r,s,i);return c.cause=e,c.name=e.name,e.status!=null&&c.status==null&&(c.status=e.status),o&&Object.assign(c,o),c}constructor(e,n,r,s,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}};F.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";F.ERR_BAD_OPTION="ERR_BAD_OPTION";F.ECONNABORTED="ECONNABORTED";F.ETIMEDOUT="ETIMEDOUT";F.ERR_NETWORK="ERR_NETWORK";F.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";F.ERR_DEPRECATED="ERR_DEPRECATED";F.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";F.ERR_BAD_REQUEST="ERR_BAD_REQUEST";F.ERR_CANCELED="ERR_CANCELED";F.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";F.ERR_INVALID_URL="ERR_INVALID_URL";var y=F;l();var Jt=Qe(Hr(),1),ve=Jt.default;function rt(t){return a.isPlainObject(t)||a.isArray(t)}function Wt(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function tt(t,e,n){return t?t.concat(e).map(function(s,i){return s=Wt(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function Nn(t){return a.isArray(t)&&!t.some(rt)}var Ln=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Pn(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(ve||FormData),n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!a.isUndefined(m[g])});let r=n.metaTokens,s=n.visitor||f,i=n.dots,o=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!d&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,g,m){let S=p;if(a.isReactNative(e)&&a.isReactNativeBlob(p))return e.append(tt(m,g,i),u(p)),!1;if(p&&!m&&typeof p=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Nn(p)||(a.isFileList(p)||a.endsWith(g,"[]"))&&(S=a.toArray(p)))return g=Wt(g),S.forEach(function(T,_){!(a.isUndefined(T)||T===null)&&e.append(o===!0?tt([g],_,i):o===null?g:g+"[]",u(T))}),!1}return rt(p)?!0:(e.append(tt(m,g,i),u(p)),!1)}let h=[],b=Object.assign(Ln,{defaultVisitor:f,convertValue:u,isVisitable:rt});function R(p,g){if(!a.isUndefined(p)){if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));h.push(p),a.forEach(p,function(S,C){(!(a.isUndefined(S)||S===null)&&s.call(e,S,a.isString(C)?C.trim():C,g,b))===!0&&R(S,g?g.concat(C):[C])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return R(t),e}var re=Pn;function Vt(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Kt(t,e){this._pairs=[],t&&re(t,this,e)}var Gt=Kt.prototype;Gt.append=function(e,n){this._pairs.push([e,n])};Gt.toString=function(e){let n=e?function(r){return e.call(this,r,Vt)}:Vt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};var Xt=Kt;function Bn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ce(t,e,n){if(!e)return t;let r=n&&n.encode||Bn,s=a.isFunction(n)?{serialize:n}:n,i=s&&s.serialize,o;if(i?o=i(e,s):o=a.isURLSearchParams(e)?e.toString():new Xt(e,s).toString(r),o){let c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}l();var nt=class{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}},st=nt;l();l();l();l();var ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0};l();l();l();import Un from"crypto";l();import In from"url";var Qt=In.URLSearchParams;var ot="abcdefghijklmnopqrstuvwxyz",Yt="0123456789",Zt={DIGIT:Yt,ALPHA:ot,ALPHA_DIGIT:ot+ot.toUpperCase()+Yt},Fn=(t=16,e=Zt.ALPHA_DIGIT)=>{let n="",{length:r}=e,s=new Uint32Array(t);Un.randomFillSync(s);for(let i=0;i<t;i++)n+=e[s[i]%r];return n},er={isNode:!0,classes:{URLSearchParams:Qt,FormData:ve,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:Zt,generateString:Fn,protocols:["http","https","file","data"]};var ct={};Mr(ct,{hasBrowserEnv:()=>at,hasStandardBrowserEnv:()=>Mn,hasStandardBrowserWebWorkerEnv:()=>Hn,navigator:()=>it,origin:()=>vn});l();var at=typeof window<"u"&&typeof document<"u",it=typeof navigator=="object"&&navigator||void 0,Mn=at&&(!it||["ReactNative","NativeScript","NS"].indexOf(it.product)<0),Hn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vn=at&&window.location.href||"http://localhost";var x={...ct,...er};function lt(t,e){return re(t,new x.classes.URLSearchParams,{visitor:function(n,r,s,i){return x.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}l();function qn(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function jn(t){let e={},n=Object.keys(t),r,s=n.length,i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function $n(t){function e(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,d?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),e(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=jn(s[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){let n={};return a.forEachEntry(t,(r,s)=>{e(qn(r),s,n,0)}),n}return null}var qe=$n;function zn(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}var ut={transitional:ne,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){let r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return s?JSON.stringify(qe(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return lt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return re(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),zn(e)):e}],transformResponse:[function(e){let n=this.transitional||ut.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||s)){let o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:x.classes.FormData,Blob:x.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{ut.headers[t]={}});var ye=ut;l();l();var Jn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tr=t=>{let e={},n,r,s;return t&&t.split(`
3
+ import{a as Hr,b as vr,c as qr}from"./chunk-WZ75OGYY.js";import"./chunk-XMZIY7XX.js";import{f as Bt}from"./chunk-EQGA7LH7.js";import"./chunk-T2T2UEPY.js";import"./chunk-M53RP3YP.js";import{c as Pt}from"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-UIRBHC5X.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import{b as l}from"./chunk-GZPNIYVZ.js";import{e as Mr,f as Qe}from"./chunk-OWGSC52X.js";l();l();import{mkdirSync as js,writeFileSync as $s}from"node:fs";import{randomUUID as zs}from"node:crypto";import{basename as Js,join as Fr}from"node:path";import{tmpdir as Ws}from"node:os";l();l();var Ye="/v1.0/im/bot/messages/get";l();l();l();l();l();function Ee(t,e){return function(){return t.apply(e,arguments)}}var{toString:jr}=Object.prototype,{getPrototypeOf:et}=Object,{iterator:Fe,toStringTag:Mt}=Symbol,Me=(t=>e=>{let n=jr.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),W=t=>(t=t.toLowerCase(),e=>Me(e)===t),He=t=>e=>typeof e===t,{isArray:he}=Array,me=He("undefined");function Te(t){return t!==null&&!me(t)&&t.constructor!==null&&!me(t.constructor)&&q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Ht=W("ArrayBuffer");function $r(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ht(t.buffer),e}var zr=He("string"),q=He("function"),vt=He("number"),xe=t=>t!==null&&typeof t=="object",Jr=t=>t===!0||t===!1,Ue=t=>{if(Me(t)!=="object")return!1;let e=et(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Mt in t)&&!(Fe in t)},Wr=t=>{if(!xe(t)||Te(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Vr=W("Date"),Kr=W("File"),Gr=t=>!!(t&&typeof t.uri<"u"),Xr=t=>t&&typeof t.getParts<"u",Qr=W("Blob"),Yr=W("FileList"),Zr=t=>xe(t)&&q(t.pipe);function en(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}var It=en(),Ut=typeof It.FormData<"u"?It.FormData:void 0,tn=t=>{let e;return t&&(Ut&&t instanceof Ut||q(t.append)&&((e=Me(t))==="formdata"||e==="object"&&q(t.toString)&&t.toString()==="[object FormData]"))},rn=W("URLSearchParams"),[nn,sn,on,an]=["ReadableStream","Request","Response","Headers"].map(W),cn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),he(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(Te(t))return;let i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length,c;for(r=0;r<o;r++)c=i[r],e.call(null,t[c],c,t)}}function qt(t,e){if(Te(t))return null;e=e.toLowerCase();let n=Object.keys(t),r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}var ae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:globalThis,jt=t=>!me(t)&&t!==ae;function Ze(){let{caseless:t,skipUndefined:e}=jt(this)&&this||{},n={},r=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;let o=t&&qt(n,i)||i;Ue(n[o])&&Ue(s)?n[o]=Ze(n[o],s):Ue(s)?n[o]=Ze({},s):he(s)?n[o]=s.slice():(!e||!me(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Se(arguments[s],r);return n}var ln=(t,e,n,{allOwnKeys:r}={})=>(Se(e,(s,i)=>{n&&q(s)?Object.defineProperty(t,i,{value:Ee(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),un=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),fn=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},dn=(t,e,n,r)=>{let s,i,o,c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!r||r(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=n!==!1&&et(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},pn=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;let r=t.indexOf(e,n);return r!==-1&&r===n},mn=t=>{if(!t)return null;if(he(t))return t;let e=t.length;if(!vt(e))return null;let n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},hn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&et(Uint8Array)),yn=(t,e)=>{let r=(t&&t[Fe]).call(t),s;for(;(s=r.next())&&!s.done;){let i=s.value;e.call(t,i[0],i[1])}},bn=(t,e)=>{let n,r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},gn=W("HTMLFormElement"),wn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ft=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Rn=W("RegExp"),$t=(t,e)=>{let n=Object.getOwnPropertyDescriptors(t),r={};Se(n,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(r[i]=o||s)}),Object.defineProperties(t,r)},En=t=>{$t(t,(e,n)=>{if(q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let r=t[n];if(q(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Tn=(t,e)=>{let n={},r=s=>{s.forEach(i=>{n[i]=!0})};return he(t)?r(t):r(String(t).split(e)),n},xn=()=>{},Sn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function An(t){return!!(t&&q(t.append)&&t[Mt]==="FormData"&&t[Fe])}var Cn=t=>{let e=new Array(10),n=(r,s)=>{if(xe(r)){if(e.indexOf(r)>=0)return;if(Te(r))return r;if(!("toJSON"in r)){e[s]=r;let i=he(r)?[]:{};return Se(r,(o,c)=>{let d=n(o,s+1);!me(d)&&(i[c]=d)}),e[s]=void 0,i}}return r};return n(t,0)},On=W("AsyncFunction"),_n=t=>t&&(xe(t)||q(t))&&q(t.then)&&q(t.catch),zt=((t,e)=>t?setImmediate:e?((n,r)=>(ae.addEventListener("message",({source:s,data:i})=>{s===ae&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),ae.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",q(ae.postMessage)),kn=typeof queueMicrotask<"u"?queueMicrotask.bind(ae):typeof process<"u"&&process.nextTick||zt,Dn=t=>t!=null&&q(t[Fe]),a={isArray:he,isArrayBuffer:Ht,isBuffer:Te,isFormData:tn,isArrayBufferView:$r,isString:zr,isNumber:vt,isBoolean:Jr,isObject:xe,isPlainObject:Ue,isEmptyObject:Wr,isReadableStream:nn,isRequest:sn,isResponse:on,isHeaders:an,isUndefined:me,isDate:Vr,isFile:Kr,isReactNativeBlob:Gr,isReactNative:Xr,isBlob:Qr,isRegExp:Rn,isFunction:q,isStream:Zr,isURLSearchParams:rn,isTypedArray:hn,isFileList:Yr,forEach:Se,merge:Ze,extend:ln,trim:cn,stripBOM:un,inherits:fn,toFlatObject:dn,kindOf:Me,kindOfTest:W,endsWith:pn,toArray:mn,forEachEntry:yn,matchAll:bn,isHTMLForm:gn,hasOwnProperty:Ft,hasOwnProp:Ft,reduceDescriptors:$t,freezeMethods:En,toObjectSet:Tn,toCamelCase:wn,noop:xn,toFiniteNumber:Sn,findKey:qt,global:ae,isContextDefined:jt,isSpecCompliantForm:An,toJSONObject:Cn,isAsyncFn:On,isThenable:_n,setImmediate:zt,asap:kn,isIterable:Dn};l();l();l();l();l();var F=class t extends Error{static from(e,n,r,s,i,o){let c=new t(e.message,n||e.code,r,s,i);return c.cause=e,c.name=e.name,e.status!=null&&c.status==null&&(c.status=e.status),o&&Object.assign(c,o),c}constructor(e,n,r,s,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}};F.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";F.ERR_BAD_OPTION="ERR_BAD_OPTION";F.ECONNABORTED="ECONNABORTED";F.ETIMEDOUT="ETIMEDOUT";F.ERR_NETWORK="ERR_NETWORK";F.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";F.ERR_DEPRECATED="ERR_DEPRECATED";F.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";F.ERR_BAD_REQUEST="ERR_BAD_REQUEST";F.ERR_CANCELED="ERR_CANCELED";F.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";F.ERR_INVALID_URL="ERR_INVALID_URL";var y=F;l();var Jt=Qe(Hr(),1),ve=Jt.default;function rt(t){return a.isPlainObject(t)||a.isArray(t)}function Wt(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function tt(t,e,n){return t?t.concat(e).map(function(s,i){return s=Wt(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function Nn(t){return a.isArray(t)&&!t.some(rt)}var Ln=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Pn(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(ve||FormData),n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!a.isUndefined(m[g])});let r=n.metaTokens,s=n.visitor||f,i=n.dots,o=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!d&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,g,m){let S=p;if(a.isReactNative(e)&&a.isReactNativeBlob(p))return e.append(tt(m,g,i),u(p)),!1;if(p&&!m&&typeof p=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Nn(p)||(a.isFileList(p)||a.endsWith(g,"[]"))&&(S=a.toArray(p)))return g=Wt(g),S.forEach(function(T,_){!(a.isUndefined(T)||T===null)&&e.append(o===!0?tt([g],_,i):o===null?g:g+"[]",u(T))}),!1}return rt(p)?!0:(e.append(tt(m,g,i),u(p)),!1)}let h=[],b=Object.assign(Ln,{defaultVisitor:f,convertValue:u,isVisitable:rt});function R(p,g){if(!a.isUndefined(p)){if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));h.push(p),a.forEach(p,function(S,C){(!(a.isUndefined(S)||S===null)&&s.call(e,S,a.isString(C)?C.trim():C,g,b))===!0&&R(S,g?g.concat(C):[C])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return R(t),e}var re=Pn;function Vt(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Kt(t,e){this._pairs=[],t&&re(t,this,e)}var Gt=Kt.prototype;Gt.append=function(e,n){this._pairs.push([e,n])};Gt.toString=function(e){let n=e?function(r){return e.call(this,r,Vt)}:Vt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};var Xt=Kt;function Bn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ce(t,e,n){if(!e)return t;let r=n&&n.encode||Bn,s=a.isFunction(n)?{serialize:n}:n,i=s&&s.serialize,o;if(i?o=i(e,s):o=a.isURLSearchParams(e)?e.toString():new Xt(e,s).toString(r),o){let c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}l();var nt=class{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}},st=nt;l();l();l();l();var ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0};l();l();l();import Un from"crypto";l();import In from"url";var Qt=In.URLSearchParams;var ot="abcdefghijklmnopqrstuvwxyz",Yt="0123456789",Zt={DIGIT:Yt,ALPHA:ot,ALPHA_DIGIT:ot+ot.toUpperCase()+Yt},Fn=(t=16,e=Zt.ALPHA_DIGIT)=>{let n="",{length:r}=e,s=new Uint32Array(t);Un.randomFillSync(s);for(let i=0;i<t;i++)n+=e[s[i]%r];return n},er={isNode:!0,classes:{URLSearchParams:Qt,FormData:ve,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:Zt,generateString:Fn,protocols:["http","https","file","data"]};var ct={};Mr(ct,{hasBrowserEnv:()=>at,hasStandardBrowserEnv:()=>Mn,hasStandardBrowserWebWorkerEnv:()=>Hn,navigator:()=>it,origin:()=>vn});l();var at=typeof window<"u"&&typeof document<"u",it=typeof navigator=="object"&&navigator||void 0,Mn=at&&(!it||["ReactNative","NativeScript","NS"].indexOf(it.product)<0),Hn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vn=at&&window.location.href||"http://localhost";var x={...ct,...er};function lt(t,e){return re(t,new x.classes.URLSearchParams,{visitor:function(n,r,s,i){return x.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}l();function qn(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function jn(t){let e={},n=Object.keys(t),r,s=n.length,i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function $n(t){function e(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,d?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),e(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=jn(s[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){let n={};return a.forEachEntry(t,(r,s)=>{e(qn(r),s,n,0)}),n}return null}var qe=$n;function zn(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}var ut={transitional:ne,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){let r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return s?JSON.stringify(qe(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return lt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return re(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),zn(e)):e}],transformResponse:[function(e){let n=this.transitional||ut.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||s)){let o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:x.classes.FormData,Blob:x.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{ut.headers[t]={}});var ye=ut;l();l();var Jn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tr=t=>{let e={},n,r,s;return t&&t.split(`
4
4
  `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||e[n]&&Jn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};var rr=Symbol("internals");function Ae(t){return t&&String(t).trim().toLowerCase()}function je(t){return t===!1||t==null?t:a.isArray(t)?t.map(je):String(t)}function Wn(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}var Vn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ft(t,e,n,r,s){if(a.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function Kn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Gn(t,e){let n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}var be=class{constructor(e){e&&this.set(e)}set(e,n,r){let s=this;function i(c,d,u){let f=Ae(d);if(!f)throw new Error("header name must be a non-empty string");let h=a.findKey(s,f);(!h||s[h]===void 0||u===!0||u===void 0&&s[h]!==!1)&&(s[h||d]=je(c))}let o=(c,d)=>a.forEach(c,(u,f)=>i(u,f,d));if(a.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(a.isString(e)&&(e=e.trim())&&!Vn(e))o(tr(e),n);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,u;for(let f of e){if(!a.isArray(f))throw TypeError("Object iterator must return a key-value pair");c[u=f[0]]=(d=c[u])?a.isArray(d)?[...d,f[1]]:[d,f[1]]:f[1]}o(c,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Ae(e),e){let r=a.findKey(this,e);if(r){let s=this[r];if(!n)return s;if(n===!0)return Wn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ae(e),e){let r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ft(this,this[r],r,n)))}return!1}delete(e,n){let r=this,s=!1;function i(o){if(o=Ae(o),o){let c=a.findKey(r,o);c&&(!n||ft(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(e)?e.forEach(i):i(e),s}clear(e){let n=Object.keys(this),r=n.length,s=!1;for(;r--;){let i=n[r];(!e||ft(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){let n=this,r={};return a.forEach(this,(s,i)=>{let o=a.findKey(r,i);if(o){n[o]=je(s),delete n[i];return}let c=e?Kn(i):String(i).trim();c!==i&&delete n[i],n[c]=je(s),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
5
5
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){let r=(this[rr]=this[rr]={accessors:{}}).accessors,s=this.prototype;function i(o){let c=Ae(o);r[c]||(Gn(s,o),r[c]=!0)}return a.isArray(e)?e.forEach(i):i(e),this}};be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(be.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});a.freezeMethods(be);var O=be;function Ce(t,e){let n=this||ye,r=e||n,s=O.from(r.headers),i=r.data;return a.forEach(t,function(c){i=c.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}l();function Oe(t){return!!(t&&t.__CANCEL__)}l();var dt=class extends y{constructor(e,n,r){super(e??"canceled",y.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}},$=dt;l();l();l();function G(t,e,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}l();l();function pt(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}l();function mt(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function le(t,e,n){let r=!pt(e);return t&&(r||n==!1)?mt(t,e):e}var mr=Qe(vr(),1),br=Qe(qr(),1);import ls from"http";import us from"https";import hr from"http2";import yr from"util";import oe from"zlib";l();var ue="1.13.6";l();l();function _e(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var Xn=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function ht(t,e,n){let r=n&&n.Blob||x.classes.Blob,s=_e(t);if(e===void 0&&r&&(e=!0),s==="data"){t=s.length?t.slice(s.length+1):t;let i=Xn.exec(t);if(!i)throw new y("Invalid URL",y.ERR_INVALID_URL);let o=i[1],c=i[2],d=i[3],u=Buffer.from(decodeURIComponent(d),c?"base64":"utf8");if(e){if(!r)throw new y("Blob is not supported",y.ERR_NOT_SUPPORT);return new r([u],{type:o})}return u}throw new y("Unsupported protocol "+s,y.ERR_NOT_SUPPORT)}import se from"stream";l();import Qn from"stream";var yt=Symbol("internals"),bt=class extends Qn.Transform{constructor(e){e=a.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(r,s)=>!a.isUndefined(s[r])),super({readableHighWaterMark:e.chunkSize});let n=this[yt]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",r=>{r==="progress"&&(n.isCaptured||(n.isCaptured=!0))})}_read(e){let n=this[yt];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,r){let s=this[yt],i=s.maxRate,o=this.readableHighWaterMark,c=s.timeWindow,d=1e3/c,u=i/d,f=s.minChunkSize!==!1?Math.max(s.minChunkSize,u*.01):0,h=(R,p)=>{let g=Buffer.byteLength(R);s.bytesSeen+=g,s.bytes+=g,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(R)?process.nextTick(p):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(p)}},b=(R,p)=>{let g=Buffer.byteLength(R),m=null,S=o,C,T=0;if(i){let _=Date.now();(!s.ts||(T=_-s.ts)>=c)&&(s.ts=_,C=u-s.bytes,s.bytes=C<0?-C:0,T=0),C=u-s.bytes}if(i){if(C<=0)return setTimeout(()=>{p(null,R)},c-T);C<S&&(S=C)}S&&g>S&&g-S>f&&(m=R.subarray(S),R=R.subarray(0,S)),h(R,m?()=>{process.nextTick(p,null,m)}:p)};b(e,function R(p,g){if(p)return r(p);g?b(g,R):r(null)})}},gt=bt;import{EventEmitter as fs}from"events";l();import Zn from"util";import{Readable as es}from"stream";l();var{asyncIterator:nr}=Symbol,Yn=async function*(t){t.stream?yield*t.stream():t.arrayBuffer?yield await t.arrayBuffer():t[nr]?yield*t[nr]():yield t},$e=Yn;var ts=x.ALPHABET.ALPHA_DIGIT+"-_",ke=typeof TextEncoder=="function"?new TextEncoder:new Zn.TextEncoder,fe=`\r
6
6
  `,rs=ke.encode(fe),ns=2,wt=class{constructor(e,n){let{escapeName:r}=this.constructor,s=a.isString(n),i=`Content-Disposition: form-data; name="${r(e)}"${!s&&n.name?`; filename="${r(n.name)}"`:""}${fe}`;s?n=ke.encode(String(n).replace(/\r?\n|\r\n?/g,fe)):i+=`Content-Type: ${n.type||"application/octet-stream"}${fe}`,this.headers=ke.encode(i+fe),this.contentLength=s?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+ns,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;a.isTypedArray(e)?yield e:yield*$e(e),yield rs}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},ss=(t,e,n)=>{let{tag:r="form-data-boundary",size:s=25,boundary:i=r+"-"+x.generateString(s,ts)}=n||{};if(!a.isFormData(t))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let o=ke.encode("--"+i+fe),c=ke.encode("--"+i+"--"+fe),d=c.byteLength,u=Array.from(t.entries()).map(([h,b])=>{let R=new wt(h,b);return d+=R.size,R});d+=o.byteLength*u.length,d=a.toFiniteNumber(d);let f={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(d)&&(f["Content-Length"]=d),e&&e(f),es.from(async function*(){for(let h of u)yield o,yield*h.encode();yield c}())},sr=ss;l();import os from"stream";var Rt=class extends os.Transform{__transform(e,n,r){this.push(e),r()}_transform(e,n,r){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let s=Buffer.alloc(2);s[0]=120,s[1]=156,this.push(s,n)}this.__transform(e,n,r)}},or=Rt;l();var is=(t,e)=>a.isAsyncFn(t)?function(...n){let r=n.pop();t.apply(this,n).then(s=>{try{e?r(null,...e(s)):r(null,s)}catch(i){r(i)}},r)}:t,ir=is;l();l();function as(t,e){t=t||10;let n=new Array(t),r=new Array(t),s=0,i=0,o;return e=e!==void 0?e:1e3,function(d){let u=Date.now(),f=r[i];o||(o=u),n[s]=d,r[s]=u;let h=i,b=0;for(;h!==s;)b+=n[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),u-o<e)return;let R=f&&u-f;return R?Math.round(b*1e3/R):void 0}}var ar=as;l();function cs(t,e){let n=0,r=1e3/e,s,i,o=(u,f=Date.now())=>{n=f,s=null,i&&(clearTimeout(i),i=null),t(...u)};return[(...u)=>{let f=Date.now(),h=f-n;h>=r?o(u,f):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},r-h)))},()=>s&&o(s)]}var cr=cs;var Y=(t,e,n=3)=>{let r=0,s=ar(50,250);return cr(i=>{let o=i.loaded,c=i.lengthComputable?i.total:void 0,d=o-r,u=s(d),f=o<=c;r=o;let h={loaded:o,total:c,progress:c?o/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&f?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(h)},n)},ge=(t,e)=>{let n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},we=t=>(...e)=>a.asap(()=>t(...e));l();function Et(t){if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;let e=t.indexOf(",");if(e<0)return 0;let n=t.slice(5,e),r=t.slice(e+1);if(/;base64/i.test(n)){let i=r.length,o=r.length;for(let b=0;b<o;b++)if(r.charCodeAt(b)===37&&b+2<o){let R=r.charCodeAt(b+1),p=r.charCodeAt(b+2);(R>=48&&R<=57||R>=65&&R<=70||R>=97&&R<=102)&&(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)&&(i-=2,b+=2)}let c=0,d=o-1,u=b=>b>=2&&r.charCodeAt(b-2)===37&&r.charCodeAt(b-1)===51&&(r.charCodeAt(b)===68||r.charCodeAt(b)===100);d>=0&&(r.charCodeAt(d)===61?(c++,d--):u(d)&&(c++,d-=3)),c===1&&d>=0&&(r.charCodeAt(d)===61||u(d))&&c++;let h=Math.floor(i/4)*3-(c||0);return h>0?h:0}return Buffer.byteLength(r,"utf8")}var lr={flush:oe.constants.Z_SYNC_FLUSH,finishFlush:oe.constants.Z_SYNC_FLUSH},ds={flush:oe.constants.BROTLI_OPERATION_FLUSH,finishFlush:oe.constants.BROTLI_OPERATION_FLUSH},ur=a.isFunction(oe.createBrotliDecompress),{http:ps,https:ms}=br.default,hs=/https:?/,fr=x.protocols.map(t=>t+":"),dr=(t,[e,n])=>(t.on("end",n).on("error",n),e),Tt=class{constructor(){this.sessions=Object.create(null)}getSession(e,n){n=Object.assign({sessionTimeout:1e3},n);let r=this.sessions[e];if(r){let f=r.length;for(let h=0;h<f;h++){let[b,R]=r[h];if(!b.destroyed&&!b.closed&&yr.isDeepStrictEqual(R,n))return b}}let s=hr.connect(e,n),i,o=()=>{if(i)return;i=!0;let f=r,h=f.length,b=h;for(;b--;)if(f[b][0]===s){h===1?delete this.sessions[e]:f.splice(b,1);return}},c=s.request,{sessionTimeout:d}=n;if(d!=null){let f,h=0;s.request=function(){let b=c.apply(this,arguments);return h++,f&&(clearTimeout(f),f=null),b.once("close",()=>{--h||(f=setTimeout(()=>{f=null,o()},d))}),b}}s.once("close",o);let u=[s,n];return r?r.push(u):r=this.sessions[e]=[u],s}},ys=new Tt;function bs(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function gr(t,e,n){let r=e;if(!r&&r!==!1){let s=mr.default.getProxyForUrl(n);s&&(r=new URL(s))}if(r){if(r.username&&(r.auth=(r.username||"")+":"+(r.password||"")),r.auth){if(!!(r.auth.username||r.auth.password))r.auth=(r.auth.username||"")+":"+(r.auth.password||"");else if(typeof r.auth=="object")throw new y("Invalid proxy authorization",y.ERR_BAD_OPTION,{proxy:r});let o=Buffer.from(r.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+o}t.headers.host=t.hostname+(t.port?":"+t.port:"");let s=r.hostname||r.host;t.hostname=s,t.host=s,t.port=r.port,t.path=n,r.protocol&&(t.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`)}t.beforeRedirects.proxy=function(i){gr(i,e,i.href)}}var gs=typeof process<"u"&&a.kindOf(process)==="process",ws=t=>new Promise((e,n)=>{let r,s,i=(d,u)=>{s||(s=!0,r&&r(d,u))},o=d=>{i(d),e(d)},c=d=>{i(d,!0),n(d)};t(o,c,d=>r=d).catch(c)}),Rs=({address:t,family:e})=>{if(!a.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},pr=(t,e)=>Rs(a.isObject(t)?t:{address:t,family:e}),Es={request(t,e){let n=t.protocol+"//"+t.hostname+":"+(t.port||(t.protocol==="https:"?443:80)),{http2Options:r,headers:s}=t,i=ys.getSession(n,r),{HTTP2_HEADER_SCHEME:o,HTTP2_HEADER_METHOD:c,HTTP2_HEADER_PATH:d,HTTP2_HEADER_STATUS:u}=hr.constants,f={[o]:t.protocol.replace(":",""),[c]:t.method,[d]:t.path};a.forEach(s,(b,R)=>{R.charAt(0)!==":"&&(f[R]=b)});let h=i.request(f);return h.once("response",b=>{let R=h;b=Object.assign({},b);let p=b[u];delete b[u],R.headers=b,R.statusCode=+p,e(R)}),h}},wr=gs&&function(e){return ws(async function(r,s,i){let{data:o,lookup:c,family:d,httpVersion:u=1,http2Options:f}=e,{responseType:h,responseEncoding:b}=e,R=e.method.toUpperCase(),p,g=!1,m;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);let S=u===2;if(c){let E=ir(c,w=>a.isArray(w)?w:[w]);c=(w,A,j)=>{E(w,A,(D,J,te)=>{if(D)return j(D);let v=a.isArray(J)?J.map(Ie=>pr(Ie)):[pr(J,te)];A.all?j(D,v):j(D,v[0].address,v[0].family)})}}let C=new fs;function T(E){try{C.emit("abort",!E||E.type?new $(null,e,m):E)}catch(w){console.warn("emit error",w)}}C.once("abort",s);let _=()=>{e.cancelToken&&e.cancelToken.unsubscribe(T),e.signal&&e.signal.removeEventListener("abort",T),C.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(T),e.signal&&(e.signal.aborted?T():e.signal.addEventListener("abort",T))),i((E,w)=>{if(p=!0,w){g=!0,_();return}let{data:A}=E;if(A instanceof se.Readable||A instanceof se.Duplex){let j=se.finished(A,()=>{j(),_()})}else _()});let M=le(e.baseURL,e.url,e.allowAbsoluteUrls),k=new URL(M,x.hasBrowserEnv?x.origin:void 0),L=k.protocol||fr[0];if(L==="data:"){if(e.maxContentLength>-1){let w=String(e.url||M||"");if(Et(w)>e.maxContentLength)return s(new y("maxContentLength size of "+e.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,e))}let E;if(R!=="GET")return G(r,s,{status:405,statusText:"method not allowed",headers:{},config:e});try{E=ht(e.url,h==="blob",{Blob:e.env&&e.env.Blob})}catch(w){throw y.from(w,y.ERR_BAD_REQUEST,e)}return h==="text"?(E=E.toString(b),(!b||b==="utf8")&&(E=a.stripBOM(E))):h==="stream"&&(E=se.Readable.from(E)),G(r,s,{data:E,status:200,statusText:"OK",headers:new O,config:e})}if(fr.indexOf(L)===-1)return s(new y("Unsupported protocol "+L,y.ERR_BAD_REQUEST,e));let P=O.from(e.headers).normalize();P.set("User-Agent","axios/"+ue,!1);let{onUploadProgress:Z,onDownloadProgress:de}=e,ie=e.maxRate,X,K;if(a.isSpecCompliantForm(o)){let E=P.getContentType(/boundary=([-_\w\d]{10,70})/i);o=sr(o,w=>{P.set(w)},{tag:`axios-${ue}-boundary`,boundary:E&&E[1]||void 0})}else if(a.isFormData(o)&&a.isFunction(o.getHeaders)){if(P.set(o.getHeaders()),!P.hasContentLength())try{let E=await yr.promisify(o.getLength).call(o);Number.isFinite(E)&&E>=0&&P.setContentLength(E)}catch{}}else if(a.isBlob(o)||a.isFile(o))o.size&&P.setContentType(o.type||"application/octet-stream"),P.setContentLength(o.size||0),o=se.Readable.from($e(o));else if(o&&!a.isStream(o)){if(!Buffer.isBuffer(o))if(a.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(a.isString(o))o=Buffer.from(o,"utf-8");else return s(new y("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",y.ERR_BAD_REQUEST,e));if(P.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return s(new y("Request body larger than maxBodyLength limit",y.ERR_BAD_REQUEST,e))}let Q=a.toFiniteNumber(P.getContentLength());a.isArray(ie)?(X=ie[0],K=ie[1]):X=K=ie,o&&(Z||X)&&(a.isStream(o)||(o=se.Readable.from(o,{objectMode:!1})),o=se.pipeline([o,new gt({maxRate:a.toFiniteNumber(X)})],a.noop),Z&&o.on("progress",dr(o,ge(Q,Y(we(Z),!1,3)))));let ee;if(e.auth){let E=e.auth.username||"",w=e.auth.password||"";ee=E+":"+w}if(!ee&&k.username){let E=k.username,w=k.password;ee=E+":"+w}ee&&P.delete("authorization");let B;try{B=ce(k.pathname+k.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(E){let w=new Error(E.message);return w.config=e,w.url=e.url,w.exists=!0,s(w)}P.set("Accept-Encoding","gzip, compress, deflate"+(ur?", br":""),!1);let I={path:B,method:R,headers:P.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:ee,protocol:L,family:d,beforeRedirect:bs,beforeRedirects:{},http2Options:f};!a.isUndefined(c)&&(I.lookup=c),e.socketPath?I.socketPath=e.socketPath:(I.hostname=k.hostname.startsWith("[")?k.hostname.slice(1,-1):k.hostname,I.port=k.port,gr(I,e.proxy,L+"//"+k.hostname+(k.port?":"+k.port:"")+I.path));let H,pe=hs.test(I.protocol);if(I.agent=pe?e.httpsAgent:e.httpAgent,S?H=Es:e.transport?H=e.transport:e.maxRedirects===0?H=pe?us:ls:(e.maxRedirects&&(I.maxRedirects=e.maxRedirects),e.beforeRedirect&&(I.beforeRedirects.config=e.beforeRedirect),H=pe?ms:ps),e.maxBodyLength>-1?I.maxBodyLength=e.maxBodyLength:I.maxBodyLength=1/0,e.insecureHTTPParser&&(I.insecureHTTPParser=e.insecureHTTPParser),m=H.request(I,function(w){if(m.destroyed)return;let A=[w],j=a.toFiniteNumber(w.headers["content-length"]);if(de||K){let v=new gt({maxRate:a.toFiniteNumber(K)});de&&v.on("progress",dr(v,ge(j,Y(we(de),!0,3)))),A.push(v)}let D=w,J=w.req||m;if(e.decompress!==!1&&w.headers["content-encoding"])switch((R==="HEAD"||w.statusCode===204)&&delete w.headers["content-encoding"],(w.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":A.push(oe.createUnzip(lr)),delete w.headers["content-encoding"];break;case"deflate":A.push(new or),A.push(oe.createUnzip(lr)),delete w.headers["content-encoding"];break;case"br":ur&&(A.push(oe.createBrotliDecompress(ds)),delete w.headers["content-encoding"])}D=A.length>1?se.pipeline(A,a.noop):A[0];let te={status:w.statusCode,statusText:w.statusMessage,headers:new O(w.headers),config:e,request:J};if(h==="stream")te.data=D,G(r,s,te);else{let v=[],Ie=0;D.on("data",function(U){v.push(U),Ie+=U.length,e.maxContentLength>-1&&Ie>e.maxContentLength&&(g=!0,D.destroy(),T(new y("maxContentLength size of "+e.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,e,J)))}),D.on("aborted",function(){if(g)return;let U=new y("stream has been aborted",y.ERR_BAD_RESPONSE,e,J);D.destroy(U),s(U)}),D.on("error",function(U){m.destroyed||s(y.from(U,null,e,J))}),D.on("end",function(){try{let U=v.length===1?v[0]:Buffer.concat(v);h!=="arraybuffer"&&(U=U.toString(b),(!b||b==="utf8")&&(U=a.stripBOM(U))),te.data=U}catch(U){return s(y.from(U,null,e,te.request,te))}G(r,s,te)})}C.once("abort",v=>{D.destroyed||(D.emit("error",v),D.destroy())})}),C.once("abort",E=>{m.close?m.close():m.destroy(E)}),m.on("error",function(w){s(y.from(w,null,e,m))}),m.on("socket",function(w){w.setKeepAlive(!0,1e3*60)}),e.timeout){let E=parseInt(e.timeout,10);if(Number.isNaN(E)){T(new y("error trying to parse `config.timeout` to int",y.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(E,function(){if(p)return;let A=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",j=e.transitional||ne;e.timeoutErrorMessage&&(A=e.timeoutErrorMessage),T(new y(A,j.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,m))})}else m.setTimeout(0);if(a.isStream(o)){let E=!1,w=!1;o.on("end",()=>{E=!0}),o.once("error",A=>{w=!0,m.destroy(A)}),o.on("close",()=>{!E&&!w&&T(new $("Request stream has been aborted",e,m))}),o.pipe(m)}else o&&m.write(o),m.end()})};l();l();l();var Rr=x.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,x.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(x.origin),x.navigator&&/(msie|trident)/i.test(x.navigator.userAgent)):()=>!0;l();var Er=x.hasStandardBrowserEnv?{write(t,e,n,r,s,i,o){if(typeof document>"u")return;let c=[`${t}=${encodeURIComponent(e)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};l();var Tr=t=>t instanceof O?{...t}:t;function V(t,e){e=e||{};let n={};function r(u,f,h,b){return a.isPlainObject(u)&&a.isPlainObject(f)?a.merge.call({caseless:b},u,f):a.isPlainObject(f)?a.merge({},f):a.isArray(f)?f.slice():f}function s(u,f,h,b){if(a.isUndefined(f)){if(!a.isUndefined(u))return r(void 0,u,h,b)}else return r(u,f,h,b)}function i(u,f){if(!a.isUndefined(f))return r(void 0,f)}function o(u,f){if(a.isUndefined(f)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function c(u,f,h){if(h in e)return r(u,f);if(h in t)return r(void 0,u)}let d={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,f,h)=>s(Tr(u),Tr(f),h,!0)};return a.forEach(Object.keys({...t,...e}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;let h=a.hasOwnProp(d,f)?d[f]:s,b=h(t[f],e[f],f);a.isUndefined(b)&&h!==c||(n[f]=b)}),n}var ze=t=>{let e=V({},t),{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=e;if(e.headers=o=O.from(o),e.url=ce(le(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){let d=n.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([f,h])=>{u.includes(f.toLowerCase())&&o.set(f,h)})}}if(x.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&Rr(e.url))){let d=s&&i&&Er.read(i);d&&o.set(s,d)}return e};var Ts=typeof XMLHttpRequest<"u",xr=Ts&&function(t){return new Promise(function(n,r){let s=ze(t),i=s.data,o=O.from(s.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:u}=s,f,h,b,R,p;function g(){R&&R(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function S(){if(!m)return;let T=O.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),M={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:T,config:t,request:m};G(function(L){n(L),g()},function(L){r(L),g()},M),m=null}"onloadend"in m?m.onloadend=S:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(S)},m.onabort=function(){m&&(r(new y("Request aborted",y.ECONNABORTED,t,m)),m=null)},m.onerror=function(_){let M=_&&_.message?_.message:"Network Error",k=new y(M,y.ERR_NETWORK,t,m);k.event=_||null,r(k),m=null},m.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",M=s.transitional||ne;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new y(_,M.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(_,M){m.setRequestHeader(M,_)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),c&&c!=="json"&&(m.responseType=s.responseType),u&&([b,p]=Y(u,!0),m.addEventListener("progress",b)),d&&m.upload&&([h,R]=Y(d),m.upload.addEventListener("progress",h),m.upload.addEventListener("loadend",R)),(s.cancelToken||s.signal)&&(f=T=>{m&&(r(!T||T.type?new $(null,t,m):T),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));let C=_e(s.url);if(C&&x.protocols.indexOf(C)===-1){r(new y("Unsupported protocol "+C+":",y.ERR_BAD_REQUEST,t));return}m.send(i||null)})};l();l();var xs=(t,e)=>{let{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s,i=function(u){if(!s){s=!0,c();let f=u instanceof Error?u:this.reason;r.abort(f instanceof y?f:new $(f instanceof Error?f.message:f))}},o=e&&setTimeout(()=>{o=null,i(new y(`timeout of ${e}ms exceeded`,y.ETIMEDOUT))},e),c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));let{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},Sr=xs;l();var Ss=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},As=async function*(t,e){for await(let n of Cs(t))yield*Ss(n,e)},Cs=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},xt=(t,e,n,r)=>{let s=As(t,e),i=0,o,c=d=>{o||(o=!0,r&&r(d))};return new ReadableStream({async pull(d){try{let{done:u,value:f}=await s.next();if(u){c(),d.close();return}let h=f.byteLength;if(n){let b=i+=h;n(b)}d.enqueue(new Uint8Array(f))}catch(u){throw c(u),u}},cancel(d){return c(d),s.return()}},{highWaterMark:2})};var Ar=64*1024,{isFunction:Je}=a,Os=(({Request:t,Response:e})=>({Request:t,Response:e}))(a.global),{ReadableStream:Cr,TextEncoder:Or}=a.global,_r=(t,...e)=>{try{return!!t(...e)}catch{return!1}},_s=t=>{t=a.merge.call({skipUndefined:!0},Os,t);let{fetch:e,Request:n,Response:r}=t,s=e?Je(e):typeof fetch=="function",i=Je(n),o=Je(r);if(!s)return!1;let c=s&&Je(Cr),d=s&&(typeof Or=="function"?(p=>g=>p.encode(g))(new Or):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&c&&_r(()=>{let p=!1,g=new n(x.origin,{body:new Cr,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),f=o&&c&&_r(()=>a.isReadableStream(new r("").body)),h={stream:f&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!h[p]&&(h[p]=(g,m)=>{let S=g&&g[p];if(S)return S.call(g);throw new y(`Response type '${p}' is not supported`,y.ERR_NOT_SUPPORT,m)})});let b=async p=>{if(p==null)return 0;if(a.isBlob(p))return p.size;if(a.isSpecCompliantForm(p))return(await new n(x.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(a.isArrayBufferView(p)||a.isArrayBuffer(p))return p.byteLength;if(a.isURLSearchParams(p)&&(p=p+""),a.isString(p))return(await d(p)).byteLength},R=async(p,g)=>{let m=a.toFiniteNumber(p.getContentLength());return m??b(g)};return async p=>{let{url:g,method:m,data:S,signal:C,cancelToken:T,timeout:_,onDownloadProgress:M,onUploadProgress:k,responseType:L,headers:P,withCredentials:Z="same-origin",fetchOptions:de}=ze(p),ie=e||fetch;L=L?(L+"").toLowerCase():"text";let X=Sr([C,T&&T.toAbortSignal()],_),K=null,Q=X&&X.unsubscribe&&(()=>{X.unsubscribe()}),ee;try{if(k&&u&&m!=="get"&&m!=="head"&&(ee=await R(P,S))!==0){let w=new n(g,{method:"POST",body:S,duplex:"half"}),A;if(a.isFormData(S)&&(A=w.headers.get("content-type"))&&P.setContentType(A),w.body){let[j,D]=ge(ee,Y(we(k)));S=xt(w.body,Ar,j,D)}}a.isString(Z)||(Z=Z?"include":"omit");let B=i&&"credentials"in n.prototype,I={...de,signal:X,method:m.toUpperCase(),headers:P.normalize().toJSON(),body:S,duplex:"half",credentials:B?Z:void 0};K=i&&new n(g,I);let H=await(i?ie(K,de):ie(g,I)),pe=f&&(L==="stream"||L==="response");if(f&&(M||pe&&Q)){let w={};["status","statusText","headers"].forEach(J=>{w[J]=H[J]});let A=a.toFiniteNumber(H.headers.get("content-length")),[j,D]=M&&ge(A,Y(we(M),!0))||[];H=new r(xt(H.body,Ar,j,()=>{D&&D(),Q&&Q()}),w)}L=L||"text";let E=await h[a.findKey(h,L)||"text"](H,p);return!pe&&Q&&Q(),await new Promise((w,A)=>{G(w,A,{data:E,headers:O.from(H.headers),status:H.status,statusText:H.statusText,config:p,request:K})})}catch(B){throw Q&&Q(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,p,K,B&&B.response),{cause:B.cause||B}):y.from(B,B&&B.code,p,K,B&&B.response)}}},ks=new Map,St=t=>{let e=t&&t.env||{},{fetch:n,Request:r,Response:s}=e,i=[r,s,n],o=i.length,c=o,d,u,f=ks;for(;c--;)d=i[c],u=f.get(d),u===void 0&&f.set(d,u=c?new Map:_s(e)),f=u;return u},Fc=St();var At={http:wr,xhr:xr,fetch:{get:St}};a.forEach(At,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var kr=t=>`- ${t}`,Ns=t=>a.isFunction(t)||t===null||t===!1;function Ls(t,e){t=a.isArray(t)?t:[t];let{length:n}=t,r,s,i={};for(let o=0;o<n;o++){r=t[o];let c;if(s=r,!Ns(r)&&(s=At[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(e))))break;i[c||"#"+o]=s}if(!s){let o=Object.entries(i).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build")),c=n?o.length>1?`since :
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as M,b as A,c as P,f as _,h as N,i as E,j as W,k as D,l as B,m as L}from"./chunk-GC2F575A.js";import{f as C}from"./chunk-3HUM74NZ.js";import"./chunk-JSFA3NEP.js";import"./chunk-TZIDSCTF.js";import{b as p}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";p();p();import{mkdirSync as Ue,writeFileSync as Ce}from"node:fs";import{randomUUID as Me}from"node:crypto";import{basename as Ae,join as Z}from"node:path";import{tmpdir as Pe}from"node:os";p();p();var h={NONE:0,USER:1,BOT:2},g={NONE:0,TEXT:1,IMAGE:2,VOICE:3,FILE:4,VIDEO:5},T={NEW:0,GENERATING:1,FINISH:2},$={TYPING:1,CANCEL:2};import{existsSync as re,readFileSync as ne,writeFileSync as oe}from"node:fs";import{join as ie}from"node:path";var F=new Map;function k(e){return F.get(e)}function R(){return ie(A(),"cursor.txt")}function se(){let e=R();return re(e)?ne(e,"utf-8").trim():""}function ae(e){oe(R(),e,"utf-8")}async function G(e){let{baseUrl:t,token:o,onMessage:r,abortSignal:i}=e,s=se(),c=0,a=4e4;for(process.stderr.write(`[weixin] Starting message poll loop...
3
+ import{a as M,b as A,c as P,f as _,h as N,i as E,j as W,k as D,l as B,m as L}from"./chunk-6GBNB5Z2.js";import{f as C}from"./chunk-EQGA7LH7.js";import"./chunk-T2T2UEPY.js";import"./chunk-M53RP3YP.js";import{b as p}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";p();p();import{mkdirSync as Ue,writeFileSync as Ce}from"node:fs";import{randomUUID as Me}from"node:crypto";import{basename as Ae,join as Z}from"node:path";import{tmpdir as Pe}from"node:os";p();p();var h={NONE:0,USER:1,BOT:2},g={NONE:0,TEXT:1,IMAGE:2,VOICE:3,FILE:4,VIDEO:5},T={NEW:0,GENERATING:1,FINISH:2},$={TYPING:1,CANCEL:2};import{existsSync as re,readFileSync as ne,writeFileSync as oe}from"node:fs";import{join as ie}from"node:path";var F=new Map;function k(e){return F.get(e)}function R(){return ie(A(),"cursor.txt")}function se(){let e=R();return re(e)?ne(e,"utf-8").trim():""}function ae(e){oe(R(),e,"utf-8")}async function G(e){let{baseUrl:t,token:o,onMessage:r,abortSignal:i}=e,s=se(),c=0,a=4e4;for(process.stderr.write(`[weixin] Starting message poll loop...
4
4
  `);!i.aborted;)try{let n=await N(t,o,s,a,i);if(n.errcode===-14){process.stderr.write(`[weixin] Session expired (errcode -14). Pausing 30s...
5
5
  `),await new Promise(l=>setTimeout(l,3e4));continue}if(n.ret!==0&&n.ret!==void 0)throw new Error(`getUpdates error: ret=${n.ret} errcode=${n.errcode} ${n.errmsg}`);if(c=0,n.longpolling_timeout_ms&&n.longpolling_timeout_ms>0&&(a=n.longpolling_timeout_ms+5e3),n.msgs&&n.msgs.length>0)for(let l of n.msgs)await ce(l,r);n.get_updates_buf&&(s=n.get_updates_buf,ae(s))}catch(n){if(i.aborted)break;c++,process.stderr.write(`[weixin] Poll error (${c}): ${n instanceof Error?n.message:n}
6
6
  `),c>=3?(process.stderr.write(`[weixin] Too many consecutive errors, backing off 30s...
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as y}from"./chunk-5PMMY47S.js";import{De as K,Re as R,Se as x,Ye as X,Ze as V,af as Q,df as Y,ka as I,ve as A,we as G,xc as q}from"./chunk-RYLWDCCN.js";import"./chunk-TZIDSCTF.js";import"./chunk-ROETRE5J.js";import"./chunk-INAZKGGR.js";import"./chunk-DCQKJTAX.js";import"./chunk-LSDMWVW6.js";import"./chunk-MTMU7JYZ.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-VYTYYCBR.js";import"./chunk-TISQNFB5.js";import"./chunk-34DXSYJZ.js";import"./chunk-47XR7IMP.js";import"./chunk-FWIVFCKF.js";import"./chunk-QKYGQLWC.js";import"./chunk-FRL6KOLY.js";import"./chunk-VWWEEU4V.js";import"./chunk-RNKDFE2S.js";import"./chunk-Q2I3ARPJ.js";import"./chunk-EXIO3QHE.js";import"./chunk-QHA3ZBRO.js";import"./chunk-I7TAYS6D.js";import"./chunk-4F4DA5UI.js";import"./chunk-DC7LAFZZ.js";import"./chunk-S7G6QPEP.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import{Lb as z,Oa as j,_c as H,ca as U,ha as N,wc as D}from"./chunk-B3NVKOSU.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{w as B}from"./chunk-32PTAACU.js";import"./chunk-32T6RWWT.js";import{i as k,p as P,q as W}from"./chunk-6B5BDE7S.js";import"./chunk-RJX7DK4Y.js";import"./chunk-XCJYORZX.js";import"./chunk-ESSYHTAZ.js";import"./chunk-3YLXGE6T.js";import"./chunk-EQEQPZLQ.js";import{D as w,E as S,G as M,aa as $,b as C}from"./chunk-VLYRNOD3.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as T}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";T();import*as m from"node:fs";import*as u from"node:path";T();var se={"\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2015":"-","\u2212":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xA0":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2007":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u202F":" ","\u205F":" ","\u3000":" "};function L(n){if(n==="")return n;let t="";for(let i of n)t+=se[i]??i;return t}var ae=[n=>n,n=>n.trimEnd()];function ce(n){return L(n).trimEnd()}function J(n,t,i){if(t.length===0)return 0;if(t.length>n.length)return null;e:for(let e=0;e<=n.length-t.length;e++){for(let r=0;r<t.length;r++)if(i(n[e+r])!==i(t[r]))continue e;return e}return null}function fe(n){let t=n.split(`
3
+ import{a as y}from"./chunk-4FVBPNTZ.js";import{Ae as G,Bc as q,He as K,Xe as R,Ye as x,cf as X,df as V,ga as I,gf as Q,jf as Y,ze as A}from"./chunk-6OM7PU5M.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-NYEWHSBL.js";import"./chunk-QN6WSWMM.js";import"./chunk-2HQMJ2IU.js";import"./chunk-W5CGKUM4.js";import"./chunk-TISQNFB5.js";import"./chunk-MTMU7JYZ.js";import"./chunk-SPW5DXX4.js";import"./chunk-RNKDFE2S.js";import"./chunk-GHBKFIHC.js";import"./chunk-5427BPR2.js";import"./chunk-47XR7IMP.js";import"./chunk-FFFZ2QMG.js";import"./chunk-SNLH42QJ.js";import"./chunk-HYVP4472.js";import"./chunk-QKYGQLWC.js";import"./chunk-QH7736R5.js";import"./chunk-4CSSDBOS.js";import"./chunk-JXUDKX6D.js";import"./chunk-7Y4YWLWT.js";import"./chunk-GUFIMKF5.js";import"./chunk-46MIUE6Z.js";import"./chunk-DC7LAFZZ.js";import"./chunk-4F4DA5UI.js";import"./chunk-SUH3UUWZ.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import{Lb as z,Oa as j,ca as U,cd as H,ha as N,vc as D}from"./chunk-25NCTG5H.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import{w as B}from"./chunk-ELH4YHJR.js";import"./chunk-WHG6N5X2.js";import{i as k,p as P,q as W}from"./chunk-T4P4KEDW.js";import"./chunk-HWOQNYAO.js";import"./chunk-XCFLI3OC.js";import"./chunk-VI74YQQO.js";import"./chunk-3YLXGE6T.js";import"./chunk-GO2GA2GY.js";import{D as w,E as S,G as M,b as C,ba as $}from"./chunk-MH2P4YXC.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as T}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";T();import*as m from"node:fs";import*as u from"node:path";T();var se={"\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2015":"-","\u2212":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xA0":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2007":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u202F":" ","\u205F":" ","\u3000":" "};function L(n){if(n==="")return n;let t="";for(let i of n)t+=se[i]??i;return t}var ae=[n=>n,n=>n.trimEnd()];function ce(n){return L(n).trimEnd()}function J(n,t,i){if(t.length===0)return 0;if(t.length>n.length)return null;e:for(let e=0;e<=n.length-t.length;e++){for(let r=0;r<t.length;r++)if(i(n[e+r])!==i(t[r]))continue e;return e}return null}function fe(n){let t=n.split(`
4
4
  `),i=new Array(t.length+1),e=0;for(let r=0;r<t.length;r++)i[r]=e,e+=t[r].length,r<t.length-1&&(e+=1);return i[t.length]=n.length,{lines:t,offsets:i}}function Z(n,t,i,e,r,o){if(r===0)return o?`
5
5
  `:"";let f=t[e]??0,l=e+r-1,c=(t[l]??0)+(i[l]?.length??0);if(o){let g=t[e+r];g!==void 0?c=g:n.endsWith(`
6
6
  `)&&(c=n.length)}return n.slice(f,c)}function de(n,t){let{lines:i,offsets:e}=fe(n),r=t.split(`