@sentio/sdk 2.57.11 → 2.57.12-rc.aaa

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 (245) hide show
  1. package/lib/aptos/ext/token.d.ts.map +1 -1
  2. package/lib/aptos/ext/token.js +4 -6
  3. package/lib/aptos/ext/token.js.map +1 -1
  4. package/lib/chunk-24EEMT46.js +3 -0
  5. package/lib/chunk-24EEMT46.js.map +1 -0
  6. package/lib/chunk-2R7O6UGY.js +3 -0
  7. package/lib/chunk-2R7O6UGY.js.map +1 -0
  8. package/lib/chunk-4JXRK4YH.js +29 -0
  9. package/lib/chunk-4JXRK4YH.js.map +1 -0
  10. package/lib/chunk-7QZC3R57.js +3 -0
  11. package/lib/chunk-7QZC3R57.js.map +1 -0
  12. package/lib/chunk-AK5E6DKD.js +6 -0
  13. package/lib/chunk-AK5E6DKD.js.map +1 -0
  14. package/lib/chunk-ATZBHPQN.js +3 -0
  15. package/lib/chunk-ATZBHPQN.js.map +1 -0
  16. package/lib/chunk-B6U7F4GY.js +29 -0
  17. package/lib/chunk-B6U7F4GY.js.map +1 -0
  18. package/lib/chunk-DGKULIPW.js +3 -0
  19. package/lib/chunk-DGKULIPW.js.map +1 -0
  20. package/lib/chunk-DS2LOABN.js +3 -0
  21. package/lib/chunk-DS2LOABN.js.map +1 -0
  22. package/lib/chunk-FMBGZMT4.js +6 -0
  23. package/lib/chunk-FMBGZMT4.js.map +1 -0
  24. package/lib/chunk-FMZDKD72.js +8 -0
  25. package/lib/chunk-FMZDKD72.js.map +1 -0
  26. package/lib/chunk-G5BIPHMS.js +3 -0
  27. package/lib/chunk-G5BIPHMS.js.map +1 -0
  28. package/lib/chunk-G6XPDWDE.js +3 -0
  29. package/lib/chunk-G6XPDWDE.js.map +1 -0
  30. package/lib/chunk-GJX3DL4J.js +499 -0
  31. package/lib/chunk-GJX3DL4J.js.map +1 -0
  32. package/lib/chunk-GTITFWMU.js +259 -0
  33. package/lib/chunk-GTITFWMU.js.map +1 -0
  34. package/lib/chunk-J7Z2TKQE.js +33 -0
  35. package/lib/chunk-J7Z2TKQE.js.map +1 -0
  36. package/lib/chunk-JQ4LTUIX.js +995 -0
  37. package/lib/chunk-JQ4LTUIX.js.map +1 -0
  38. package/lib/chunk-LG2TF5WR.js +8 -0
  39. package/lib/chunk-LG2TF5WR.js.map +1 -0
  40. package/lib/chunk-LVWOFGF2.js +3 -0
  41. package/lib/chunk-LVWOFGF2.js.map +1 -0
  42. package/lib/chunk-O564J2U6.js +11 -0
  43. package/lib/chunk-O564J2U6.js.map +1 -0
  44. package/lib/chunk-QGIFUSFI.js +84 -0
  45. package/lib/chunk-QGIFUSFI.js.map +1 -0
  46. package/lib/chunk-QGPJOTWP.js +3 -0
  47. package/lib/chunk-QGPJOTWP.js.map +1 -0
  48. package/lib/chunk-RA75ESSD.js +3 -0
  49. package/lib/chunk-RA75ESSD.js.map +1 -0
  50. package/lib/chunk-RVAYZJ7X.js +5 -0
  51. package/lib/chunk-RVAYZJ7X.js.map +1 -0
  52. package/lib/chunk-SPY3PKUB.js +3 -0
  53. package/lib/chunk-SPY3PKUB.js.map +1 -0
  54. package/lib/chunk-SUCYR7EB.js +3 -0
  55. package/lib/chunk-SUCYR7EB.js.map +1 -0
  56. package/lib/chunk-TGIXVAHB.js +7 -0
  57. package/lib/chunk-TGIXVAHB.js.map +1 -0
  58. package/lib/chunk-TSEQGMTN.js +5 -0
  59. package/lib/chunk-TSEQGMTN.js.map +1 -0
  60. package/lib/chunk-ZHI6ULD5.js +3 -0
  61. package/lib/chunk-ZHI6ULD5.js.map +1 -0
  62. package/lib/multipart-parser-J6QPYJHT.js +4 -0
  63. package/lib/multipart-parser-J6QPYJHT.js.map +1 -0
  64. package/package.json +4 -4
  65. package/src/aptos/builtin/0x1.d.ts +6451 -0
  66. package/src/aptos/builtin/0x1.d.ts.map +1 -0
  67. package/src/aptos/builtin/0x1.js +7138 -0
  68. package/src/aptos/builtin/0x1.js.map +1 -0
  69. package/src/aptos/builtin/0x3.d.ts +1122 -0
  70. package/src/aptos/builtin/0x3.d.ts.map +1 -0
  71. package/src/aptos/builtin/0x3.js +937 -0
  72. package/src/aptos/builtin/0x3.js.map +1 -0
  73. package/src/aptos/builtin/0x4.d.ts +551 -0
  74. package/src/aptos/builtin/0x4.d.ts.map +1 -0
  75. package/src/aptos/builtin/0x4.js +529 -0
  76. package/src/aptos/builtin/0x4.js.map +1 -0
  77. package/src/aptos/builtin/index.d.ts +4 -0
  78. package/src/aptos/builtin/index.d.ts.map +1 -0
  79. package/src/aptos/builtin/index.js +7 -0
  80. package/src/aptos/builtin/index.js.map +1 -0
  81. package/src/aptos/ext/token.ts +4 -6
  82. package/src/eth/builtin/eacaggregatorproxy.d.ts +5 -0
  83. package/src/eth/builtin/eacaggregatorproxy.d.ts.map +1 -0
  84. package/src/eth/builtin/eacaggregatorproxy.js +8 -0
  85. package/src/eth/builtin/eacaggregatorproxy.js.map +1 -0
  86. package/src/eth/builtin/erc1155.d.ts +5 -0
  87. package/src/eth/builtin/erc1155.d.ts.map +1 -0
  88. package/src/eth/builtin/erc1155.js +8 -0
  89. package/src/eth/builtin/erc1155.js.map +1 -0
  90. package/src/eth/builtin/erc20.d.ts +5 -0
  91. package/src/eth/builtin/erc20.d.ts.map +1 -0
  92. package/src/eth/builtin/erc20.js +8 -0
  93. package/src/eth/builtin/erc20.js.map +1 -0
  94. package/src/eth/builtin/erc20bytes.d.ts +5 -0
  95. package/src/eth/builtin/erc20bytes.d.ts.map +1 -0
  96. package/src/eth/builtin/erc20bytes.js +8 -0
  97. package/src/eth/builtin/erc20bytes.js.map +1 -0
  98. package/src/eth/builtin/erc721.d.ts +5 -0
  99. package/src/eth/builtin/erc721.d.ts.map +1 -0
  100. package/src/eth/builtin/erc721.js +8 -0
  101. package/src/eth/builtin/erc721.js.map +1 -0
  102. package/src/eth/builtin/index.d.ts +13 -0
  103. package/src/eth/builtin/index.d.ts.map +1 -0
  104. package/src/eth/builtin/index.js +16 -0
  105. package/src/eth/builtin/index.js.map +1 -0
  106. package/src/eth/builtin/internal/EACAggregatorProxy.d.ts +50 -0
  107. package/src/eth/builtin/internal/EACAggregatorProxy.d.ts.map +1 -0
  108. package/src/eth/builtin/internal/EACAggregatorProxy.js +2 -0
  109. package/src/eth/builtin/internal/EACAggregatorProxy.js.map +1 -0
  110. package/src/eth/builtin/internal/ERC1155.d.ts +57 -0
  111. package/src/eth/builtin/internal/ERC1155.d.ts.map +1 -0
  112. package/src/eth/builtin/internal/ERC1155.js +2 -0
  113. package/src/eth/builtin/internal/ERC1155.js.map +1 -0
  114. package/src/eth/builtin/internal/ERC20.d.ts +41 -0
  115. package/src/eth/builtin/internal/ERC20.d.ts.map +1 -0
  116. package/src/eth/builtin/internal/ERC20.js +2 -0
  117. package/src/eth/builtin/internal/ERC20.js.map +1 -0
  118. package/src/eth/builtin/internal/ERC20Bytes.d.ts +32 -0
  119. package/src/eth/builtin/internal/ERC20Bytes.d.ts.map +1 -0
  120. package/src/eth/builtin/internal/ERC20Bytes.js +2 -0
  121. package/src/eth/builtin/internal/ERC20Bytes.js.map +1 -0
  122. package/src/eth/builtin/internal/ERC721.d.ts +43 -0
  123. package/src/eth/builtin/internal/ERC721.d.ts.map +1 -0
  124. package/src/eth/builtin/internal/ERC721.js +2 -0
  125. package/src/eth/builtin/internal/ERC721.js.map +1 -0
  126. package/src/eth/builtin/internal/WETH9.d.ts +47 -0
  127. package/src/eth/builtin/internal/WETH9.d.ts.map +1 -0
  128. package/src/eth/builtin/internal/WETH9.js +2 -0
  129. package/src/eth/builtin/internal/WETH9.js.map +1 -0
  130. package/src/eth/builtin/internal/common.d.ts +3 -0
  131. package/src/eth/builtin/internal/common.d.ts.map +1 -0
  132. package/src/eth/builtin/internal/common.js +8 -0
  133. package/src/eth/builtin/internal/common.js.map +1 -0
  134. package/src/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +373 -0
  135. package/src/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -0
  136. package/src/eth/builtin/internal/eacaggregatorproxy-processor.js +1355 -0
  137. package/src/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -0
  138. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.d.ts +7 -0
  139. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.d.ts.map +1 -0
  140. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.js +55 -0
  141. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.js.map +1 -0
  142. package/src/eth/builtin/internal/erc1155-processor.d.ts +173 -0
  143. package/src/eth/builtin/internal/erc1155-processor.d.ts.map +1 -0
  144. package/src/eth/builtin/internal/erc1155-processor.js +596 -0
  145. package/src/eth/builtin/internal/erc1155-processor.js.map +1 -0
  146. package/src/eth/builtin/internal/erc1155-test-utils.d.ts +7 -0
  147. package/src/eth/builtin/internal/erc1155-test-utils.d.ts.map +1 -0
  148. package/src/eth/builtin/internal/erc1155-test-utils.js +55 -0
  149. package/src/eth/builtin/internal/erc1155-test-utils.js.map +1 -0
  150. package/src/eth/builtin/internal/erc20-processor.d.ts +244 -0
  151. package/src/eth/builtin/internal/erc20-processor.d.ts.map +1 -0
  152. package/src/eth/builtin/internal/erc20-processor.js +1109 -0
  153. package/src/eth/builtin/internal/erc20-processor.js.map +1 -0
  154. package/src/eth/builtin/internal/erc20-test-utils.d.ts +6 -0
  155. package/src/eth/builtin/internal/erc20-test-utils.d.ts.map +1 -0
  156. package/src/eth/builtin/internal/erc20-test-utils.js +44 -0
  157. package/src/eth/builtin/internal/erc20-test-utils.js.map +1 -0
  158. package/src/eth/builtin/internal/erc20bytes-processor.d.ts +144 -0
  159. package/src/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -0
  160. package/src/eth/builtin/internal/erc20bytes-processor.js +594 -0
  161. package/src/eth/builtin/internal/erc20bytes-processor.js.map +1 -0
  162. package/src/eth/builtin/internal/erc20bytes-test-utils.d.ts +5 -0
  163. package/src/eth/builtin/internal/erc20bytes-test-utils.d.ts.map +1 -0
  164. package/src/eth/builtin/internal/erc20bytes-test-utils.js +33 -0
  165. package/src/eth/builtin/internal/erc20bytes-test-utils.js.map +1 -0
  166. package/src/eth/builtin/internal/erc721-processor.d.ts +215 -0
  167. package/src/eth/builtin/internal/erc721-processor.d.ts.map +1 -0
  168. package/src/eth/builtin/internal/erc721-processor.js +895 -0
  169. package/src/eth/builtin/internal/erc721-processor.js.map +1 -0
  170. package/src/eth/builtin/internal/erc721-test-utils.d.ts +6 -0
  171. package/src/eth/builtin/internal/erc721-test-utils.d.ts.map +1 -0
  172. package/src/eth/builtin/internal/erc721-test-utils.js +44 -0
  173. package/src/eth/builtin/internal/erc721-test-utils.js.map +1 -0
  174. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts +400 -0
  175. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts.map +1 -0
  176. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.js +524 -0
  177. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -0
  178. package/src/eth/builtin/internal/factories/ERC1155__factory.d.ts +251 -0
  179. package/src/eth/builtin/internal/factories/ERC1155__factory.d.ts.map +1 -0
  180. package/src/eth/builtin/internal/factories/ERC1155__factory.js +329 -0
  181. package/src/eth/builtin/internal/factories/ERC1155__factory.js.map +1 -0
  182. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts +185 -0
  183. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts.map +1 -0
  184. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.js +251 -0
  185. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -0
  186. package/src/eth/builtin/internal/factories/ERC20__factory.d.ts +303 -0
  187. package/src/eth/builtin/internal/factories/ERC20__factory.d.ts.map +1 -0
  188. package/src/eth/builtin/internal/factories/ERC20__factory.js +401 -0
  189. package/src/eth/builtin/internal/factories/ERC20__factory.js.map +1 -0
  190. package/src/eth/builtin/internal/factories/ERC721__factory.d.ts +273 -0
  191. package/src/eth/builtin/internal/factories/ERC721__factory.d.ts.map +1 -0
  192. package/src/eth/builtin/internal/factories/ERC721__factory.js +361 -0
  193. package/src/eth/builtin/internal/factories/ERC721__factory.js.map +1 -0
  194. package/src/eth/builtin/internal/factories/WETH9__factory.d.ts +220 -0
  195. package/src/eth/builtin/internal/factories/WETH9__factory.d.ts.map +1 -0
  196. package/src/eth/builtin/internal/factories/WETH9__factory.js +294 -0
  197. package/src/eth/builtin/internal/factories/WETH9__factory.js.map +1 -0
  198. package/src/eth/builtin/internal/factories/index.d.ts +7 -0
  199. package/src/eth/builtin/internal/factories/index.d.ts.map +1 -0
  200. package/src/eth/builtin/internal/factories/index.js +10 -0
  201. package/src/eth/builtin/internal/factories/index.js.map +1 -0
  202. package/src/eth/builtin/internal/index.d.ts +14 -0
  203. package/src/eth/builtin/internal/index.d.ts.map +1 -0
  204. package/src/eth/builtin/internal/index.js +8 -0
  205. package/src/eth/builtin/internal/index.js.map +1 -0
  206. package/src/eth/builtin/internal/weth9-processor.d.ts +172 -0
  207. package/src/eth/builtin/internal/weth9-processor.d.ts.map +1 -0
  208. package/src/eth/builtin/internal/weth9-processor.js +729 -0
  209. package/src/eth/builtin/internal/weth9-processor.js.map +1 -0
  210. package/src/eth/builtin/internal/weth9-test-utils.d.ts +7 -0
  211. package/src/eth/builtin/internal/weth9-test-utils.d.ts.map +1 -0
  212. package/src/eth/builtin/internal/weth9-test-utils.js +55 -0
  213. package/src/eth/builtin/internal/weth9-test-utils.js.map +1 -0
  214. package/src/eth/builtin/weth9.d.ts +5 -0
  215. package/src/eth/builtin/weth9.d.ts.map +1 -0
  216. package/src/eth/builtin/weth9.js +8 -0
  217. package/src/eth/builtin/weth9.js.map +1 -0
  218. package/src/solana/builtin/index.d.ts +2 -0
  219. package/src/solana/builtin/index.d.ts.map +1 -0
  220. package/src/solana/builtin/index.js +2 -0
  221. package/src/solana/builtin/index.js.map +1 -0
  222. package/src/solana/builtin/spl-token-processor.d.ts +40 -0
  223. package/src/solana/builtin/spl-token-processor.d.ts.map +1 -0
  224. package/src/solana/builtin/spl-token-processor.js +254 -0
  225. package/src/solana/builtin/spl-token-processor.js.map +1 -0
  226. package/src/solana/builtin/types.d.ts +428 -0
  227. package/src/solana/builtin/types.d.ts.map +1 -0
  228. package/src/solana/builtin/types.js +201 -0
  229. package/src/solana/builtin/types.js.map +1 -0
  230. package/src/sui/builtin/0x1.d.ts +114 -0
  231. package/src/sui/builtin/0x1.d.ts.map +1 -0
  232. package/src/sui/builtin/0x1.js +159 -0
  233. package/src/sui/builtin/0x1.js.map +1 -0
  234. package/src/sui/builtin/0x2.d.ts +1250 -0
  235. package/src/sui/builtin/0x2.d.ts.map +1 -0
  236. package/src/sui/builtin/0x2.js +1511 -0
  237. package/src/sui/builtin/0x2.js.map +1 -0
  238. package/src/sui/builtin/0x3.d.ts +774 -0
  239. package/src/sui/builtin/0x3.d.ts.map +1 -0
  240. package/src/sui/builtin/0x3.js +720 -0
  241. package/src/sui/builtin/0x3.js.map +1 -0
  242. package/src/sui/builtin/index.d.ts +4 -0
  243. package/src/sui/builtin/index.d.ts.map +1 -0
  244. package/src/sui/builtin/index.js +7 -0
  245. package/src/sui/builtin/index.js.map +1 -0
@@ -0,0 +1,84 @@
1
+ import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
+ import{a,b as G,c as Me,d as m,e as Ya,g as vt}from"./chunk-G5BIPHMS.js";var Gu=m(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.Metadata=void 0;On.Metadata=a(function(e){let t=new Map,i={set(n,s){if(n=jr(n),Array.isArray(s))if(s.length===0)t.delete(n);else{for(let o of s)Ka(n,o);t.set(n,n.endsWith("-bin")?s:[s.join(", ")])}else Ka(n,s),t.set(n,[s]);return i},append(n,s){n=jr(n),Ka(n,s);let o=t.get(n);return o==null&&(o=[],t.set(n,o)),o.push(s),n.endsWith("-bin")||t.set(n,[o.join(", ")]),i},delete(n){n=jr(n),t.delete(n)},get(n){var s;return n=jr(n),(s=t.get(n))===null||s===void 0?void 0:s[0]},getAll(n){var s;return n=jr(n),(s=t.get(n))!==null&&s!==void 0?s:[]},has(n){return n=jr(n),t.has(n)},[Symbol.iterator](){return t[Symbol.iterator]()}};if(e!=null){let n=Vm(e)?e:Object.entries(e);for(let[s,o]of n)i.set(s,o)}return i},"Metadata");function jr(r){return r.toLowerCase()}a(jr,"normalizeKey");function Ka(r,e){if(!/^[0-9a-z_.-]+$/.test(r))throw new Error(`Metadata key '${r}' contains illegal characters`);if(r.endsWith("-bin")){if(!(e instanceof Uint8Array))throw new Error(`Metadata key '${r}' ends with '-bin', thus it must have binary value`)}else{if(typeof e!="string")throw new Error(`Metadata key '${r}' doesn't end with '-bin', thus it must have string value`);if(!/^[ -~]*$/.test(e))throw new Error(`Metadata value '${e}' of key '${r}' contains illegal characters`)}}a(Ka,"validate");function Vm(r){return Symbol.iterator in r}a(Vm,"isIterable")});var Mn=m(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.Status=void 0;var Jm;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(Jm=qi.Status||(qi.Status={}))});var $u=m(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0})});var Ju=m(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0})});var Ku=m(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0})});var Xu=m(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.composeClientMiddleware=void 0;function Ym(r,e){return(t,i)=>e(Object.assign(Object.assign({},t),{next:a((n,s)=>r(Object.assign(Object.assign({},t),{request:n}),s),"next")}),i)}a(Ym,"composeClientMiddleware");Pn.composeClientMiddleware=Ym});var Xa={};Ya(Xa,{ExtendableError:()=>Nn,default:()=>Km});var Nn,Km,Qa=Me(()=>{"use strict";Nn=class extends Error{static{a(this,"ExtendableError")}constructor(...e){super(...e);var t=e.length>0&&typeof e[0]=="string"?e[0]:"";(this.name===void 0||this.name==="Error")&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:this.constructor.name,writable:!0}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(this,"stack",{configurable:!0,enumerable:!1,value:"",writable:!0}),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack===""&&(this.stack=new Error(t).stack)}},Km=Nn});var Qu=m(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ClientError=void 0;var Xm=(Qa(),vt(Xa)),Qm=Mn(),Za=class r extends Xm.ExtendableError{static{a(this,"ClientError")}constructor(e,t,i){super(`${e} ${Qm.Status[t]}: ${i}`),this.path=e,this.code=t,this.details=i,this.name="ClientError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ClientError",{value:!0})}static[Symbol.hasInstance](e){return this!==r?this.prototype.isPrototypeOf(e):typeof e=="object"&&e!==null&&(e.constructor===r||e["@@nice-grpc:ClientError"]===!0||e.name==="ClientError"&&e["@@nice-grpc"]===!0)}};kn.ClientError=Za});var ed=m(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0})});var rd=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0})});var id=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.composeServerMiddleware=void 0;function Zm(r,e){return(t,i)=>r(Object.assign(Object.assign({},t),{next:a((n,s)=>e(Object.assign(Object.assign({},t),{request:n}),s),"next")}),i)}a(Zm,"composeServerMiddleware");In.composeServerMiddleware=Zm});var nd=m(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.ServerError=void 0;var ev=(Qa(),vt(Xa)),tv=Mn(),eo=class r extends ev.ExtendableError{static{a(this,"ServerError")}constructor(e,t){super(`${tv.Status[e]}: ${t}`),this.code=e,this.details=t,this.name="ServerError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ServerError",{value:!0})}static[Symbol.hasInstance](e){return this!==r?this.prototype.isPrototypeOf(e):typeof e=="object"&&e!==null&&(e.constructor===r||e["@@nice-grpc:ServerError"]===!0||e.name==="ServerError"&&e["@@nice-grpc"]===!0)}};xn.ServerError=eo});var Ge=m(Ee=>{"use strict";var rv=Ee&&Ee.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),at=Ee&&Ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rv(e,r,t)};Object.defineProperty(Ee,"__esModule",{value:!0});at(Gu(),Ee);at(Mn(),Ee);at($u(),Ee);at(Ju(),Ee);at(Ku(),Ee);at(Xu(),Ee);at(Qu(),Ee);at(ed(),Ee);at(rd(),Ee);at(id(),Ee);at(nd(),Ee)});var U=m(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=We.DEFAULT_MAX_SEND_MESSAGE_LENGTH=We.Propagate=We.LogVerbosity=We.Status=void 0;var sd;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(sd||(We.Status=sd={}));var ad;(function(r){r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.ERROR=2]="ERROR",r[r.NONE=3]="NONE"})(ad||(We.LogVerbosity=ad={}));var od;(function(r){r[r.DEADLINE=1]="DEADLINE",r[r.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",r[r.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",r[r.CANCELLATION=8]="CANCELLATION",r[r.DEFAULTS=65535]="DEFAULTS"})(od||(We.Propagate=od={}));We.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;We.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var to=m((GR,iv)=>{iv.exports={name:"@grpc/grpc-js",version:"1.12.2",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run generate-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"},dependencies:{"@grpc/proto-loader":"^0.7.13","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/*.proto","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var te=m(Pe=>{"use strict";var ro,io,no,so;Object.defineProperty(Pe,"__esModule",{value:!0});Pe.isTracerEnabled=Pe.trace=Pe.log=Pe.setLoggerVerbosity=Pe.setLogger=Pe.getLogger=void 0;var Jt=U(),nv=G("process"),sv=to().version,av={error:a((r,...e)=>{console.error("E "+r,...e)},"error"),info:a((r,...e)=>{console.error("I "+r,...e)},"info"),debug:a((r,...e)=>{console.error("D "+r,...e)},"debug")},Er=av,Gr=Jt.LogVerbosity.ERROR,ov=(io=(ro=process.env.GRPC_NODE_VERBOSITY)!==null&&ro!==void 0?ro:process.env.GRPC_VERBOSITY)!==null&&io!==void 0?io:"";switch(ov.toUpperCase()){case"DEBUG":Gr=Jt.LogVerbosity.DEBUG;break;case"INFO":Gr=Jt.LogVerbosity.INFO;break;case"ERROR":Gr=Jt.LogVerbosity.ERROR;break;case"NONE":Gr=Jt.LogVerbosity.NONE;break;default:}var lv=a(()=>Er,"getLogger");Pe.getLogger=lv;var cv=a(r=>{Er=r},"setLogger");Pe.setLogger=cv;var uv=a(r=>{Gr=r},"setLoggerVerbosity");Pe.setLoggerVerbosity=uv;var dv=a((r,...e)=>{let t;if(r>=Gr){switch(r){case Jt.LogVerbosity.DEBUG:t=Er.debug;break;case Jt.LogVerbosity.INFO:t=Er.info;break;case Jt.LogVerbosity.ERROR:t=Er.error;break}t||(t=Er.error),t&&t.bind(Er)(...e)}},"log");Pe.log=dv;var hv=(so=(no=process.env.GRPC_NODE_TRACE)!==null&&no!==void 0?no:process.env.GRPC_TRACE)!==null&&so!==void 0?so:"",ao=new Set,ld=new Set;for(let r of hv.split(","))r.startsWith("-")?ld.add(r.substring(1)):ao.add(r);var fv=ao.has("all");function pv(r,e,t){cd(e)&&(0,Pe.log)(r,new Date().toISOString()+" | v"+sv+" "+nv.pid+" | "+e+" | "+t)}a(pv,"trace");Pe.trace=pv;function cd(r){return!ld.has(r)&&(fv||ao.has(r))}a(cd,"isTracerEnabled");Pe.isTracerEnabled=cd});var Dn=m(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.getErrorCode=Wr.getErrorMessage=void 0;function gv(r){return r instanceof Error?r.message:String(r)}a(gv,"getErrorMessage");Wr.getErrorMessage=gv;function mv(r){return typeof r=="object"&&r!==null&&"code"in r&&typeof r.code=="number"?r.code:null}a(mv,"getErrorCode");Wr.getErrorCode=mv});var we=m(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.Metadata=void 0;var vv=te(),yv=U(),_v=Dn(),Sv=/^[0-9a-z_.-]+$/,Cv=/^[ -~]*$/;function Ev(r){return Sv.test(r)}a(Ev,"isLegalKey");function bv(r){return Cv.test(r)}a(bv,"isLegalNonBinaryValue");function dd(r){return r.endsWith("-bin")}a(dd,"isBinaryKey");function Tv(r){return!r.startsWith("grpc-")}a(Tv,"isCustomMetadata");function Ln(r){return r.toLowerCase()}a(Ln,"normalizeKey");function ud(r,e){if(!Ev(r))throw new Error('Metadata key "'+r+'" contains illegal characters');if(e!=null)if(dd(r)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!bv(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}a(ud,"validate");var oo=class r{static{a(this,"Metadata")}constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=Ln(e),ud(e,t),this.internalRepr.set(e,[t])}add(e,t){e=Ln(e),ud(e,t);let i=this.internalRepr.get(e);i===void 0?this.internalRepr.set(e,[t]):i.push(t)}remove(e){e=Ln(e),this.internalRepr.delete(e)}get(e){return e=Ln(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,i]of this.internalRepr)if(i.length>0){let n=i[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[i,n]of this.internalRepr){let s=n.map(o=>Buffer.isBuffer(o)?Buffer.from(o):o);t.set(i,s)}return e}merge(e){for(let[t,i]of e.internalRepr){let n=(this.internalRepr.get(t)||[]).concat(i);this.internalRepr.set(t,n)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,i]of this.internalRepr)e[t]=i.map(wv);return e}toJSON(){let e={};for(let[t,i]of this.internalRepr)e[t]=i;return e}static fromHttp2Headers(e){let t=new r;for(let i of Object.keys(e)){if(i.charAt(0)===":")continue;let n=e[i];try{dd(i)?Array.isArray(n)?n.forEach(s=>{t.add(i,Buffer.from(s,"base64"))}):n!==void 0&&(Tv(i)?n.split(",").forEach(s=>{t.add(i,Buffer.from(s.trim(),"base64"))}):t.add(i,Buffer.from(n,"base64"))):Array.isArray(n)?n.forEach(s=>{t.add(i,s)}):n!==void 0&&t.add(i,n)}catch(s){let o=`Failed to add metadata entry ${i}: ${n}. ${(0,_v.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,vv.log)(yv.LogVerbosity.ERROR,o)}}return t}};qn.Metadata=oo;var wv=a(r=>Buffer.isBuffer(r)?r.toString("base64"):r,"bufToString")});var fo=m(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.CallCredentials=void 0;var ho=we();function Rv(r){return"getRequestHeaders"in r&&typeof r.getRequestHeaders=="function"}a(Rv,"isCurrentOauth2Client");var $r=class r{static{a(this,"CallCredentials")}static createFromMetadataGenerator(e){return new co(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,i)=>{let n;Rv(e)?n=e.getRequestHeaders(t.service_url):n=new Promise((s,o)=>{e.getRequestMetadata(t.service_url,(l,c)=>{if(l){o(l);return}if(!c){o(new Error("Headers not set by metadata plugin"));return}s(c)})}),n.then(s=>{let o=new ho.Metadata;for(let l of Object.keys(s))o.add(l,s[l]);i(null,o)},s=>{i(s)})})}static createEmpty(){return new uo}};Fn.CallCredentials=$r;var lo=class r extends $r{static{a(this,"ComposedCallCredentials")}constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new ho.Metadata,i=await Promise.all(this.creds.map(n=>n.generateMetadata(e)));for(let n of i)t.merge(n);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,i)=>t._equals(e.creds[i])):!1}},co=class r extends $r{static{a(this,"SingleCallCredentials")}constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,i)=>{this.metadataGenerator(e,(n,s)=>{s!==void 0?t(s):i(n)})})}compose(e){return new lo([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},uo=class r extends $r{static{a(this,"EmptyCallCredentials")}generateMetadata(e){return Promise.resolve(new ho.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var go=m(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.getDefaultRootsData=Vr.CIPHER_SUITES=void 0;var Av=G("fs");Vr.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var hd=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,po=null;function Ov(){return hd?(po===null&&(po=Av.readFileSync(hd)),po):null}a(Ov,"getDefaultRootsData");Vr.getDefaultRootsData=Ov});var Fi=m(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.createCertificateProviderChannelCredentials=Jr.ChannelCredentials=void 0;var fd=G("tls"),Mv=fo(),vo=go();function mo(r,e){if(r&&!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}a(mo,"verifyIsBufferOrNull");var br=class{static{a(this,"ChannelCredentials")}constructor(e){this.callCredentials=e||Mv.CallCredentials.createEmpty()}_getCallCredentials(){return this.callCredentials}_ref(){}_unref(){}static createSsl(e,t,i,n){var s;if(mo(e,"Root certificate"),mo(t,"Private key"),mo(i,"Certificate chain"),t&&!i)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&i)throw new Error("Certificate chain must be given with accompanying private key");let o=(0,fd.createSecureContext)({ca:(s=e??(0,vo.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:t??void 0,cert:i??void 0,ciphers:vo.CIPHER_SUITES});return new Bn(o,n??{})}static createFromSecureContext(e,t){return new Bn(e,t??{})}static createInsecure(){return new yo}};Jr.ChannelCredentials=br;var yo=class r extends br{static{a(this,"InsecureChannelCredentialsImpl")}constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_getConnectionOptions(){return{}}_isSecure(){return!1}_equals(e){return e instanceof r}},Bn=class r extends br{static{a(this,"SecureChannelCredentialsImpl")}constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t,this.connectionOptions={secureContext:e},t?.checkServerIdentity&&(this.connectionOptions.checkServerIdentity=t.checkServerIdentity),t?.rejectUnauthorized!==void 0&&(this.connectionOptions.rejectUnauthorized=t.rejectUnauthorized)}compose(e){let t=this.callCredentials.compose(e);return new Un(this,t)}_getConnectionOptions(){return Object.assign({},this.connectionOptions)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}},_o=class r extends br{static{a(this,"CertificateProviderChannelCredentialsImpl")}constructor(e,t,i){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=i,this.refcount=0,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}compose(e){let t=this.callCredentials.compose(e);return new Un(this,t)}_getConnectionOptions(){var e,t,i;if(this.latestCaUpdate===null||this.identityCertificateProvider!==null&&this.latestIdentityUpdate===null)return null;let s={secureContext:(0,fd.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:vo.CIPHER_SUITES})};return!((i=this.verifyOptions)===null||i===void 0)&&i.checkServerIdentity&&(s.checkServerIdentity=this.verifyOptions.checkServerIdentity),s}_isSecure(){return!0}_equals(e){var t,i;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((i=e.verifyOptions)===null||i===void 0?void 0:i.checkServerIdentity):!1}_ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}_unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}handleCaCertificateUpdate(e){this.latestCaUpdate=e}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e}};function Pv(r,e,t){return new _o(r,e,t??null)}a(Pv,"createCertificateProviderChannelCredentials");Jr.createCertificateProviderChannelCredentials=Pv;var Un=class r extends br{static{a(this,"ComposedChannelCredentialsImpl")}constructor(e,t){if(super(t),this.channelCredentials=e,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_getConnectionOptions(){return this.channelCredentials._getConnectionOptions()}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}}});var Tr=m(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.selectLbConfigFromList=me.getDefaultConfig=me.parseLoadBalancingConfig=me.isLoadBalancerNameRegistered=me.createLoadBalancer=me.registerDefaultLoadBalancerType=me.registerLoadBalancerType=me.createChildChannelControlHelper=void 0;var Nv=te(),kv=U();function Iv(r,e){var t,i,n,s,o,l,c,u,d,h;return{createSubchannel:(i=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&i!==void 0?i:r.createSubchannel.bind(r),updateState:(s=(n=e.updateState)===null||n===void 0?void 0:n.bind(e))!==null&&s!==void 0?s:r.updateState.bind(r),requestReresolution:(l=(o=e.requestReresolution)===null||o===void 0?void 0:o.bind(e))!==null&&l!==void 0?l:r.requestReresolution.bind(r),addChannelzChild:(u=(c=e.addChannelzChild)===null||c===void 0?void 0:c.bind(e))!==null&&u!==void 0?u:r.addChannelzChild.bind(r),removeChannelzChild:(h=(d=e.removeChannelzChild)===null||d===void 0?void 0:d.bind(e))!==null&&h!==void 0?h:r.removeChannelzChild.bind(r)}}a(Iv,"createChildChannelControlHelper");me.createChildChannelControlHelper=Iv;var Yt={},Bi=null;function xv(r,e,t){Yt[r]={LoadBalancer:e,LoadBalancingConfig:t}}a(xv,"registerLoadBalancerType");me.registerLoadBalancerType=xv;function Dv(r){Bi=r}a(Dv,"registerDefaultLoadBalancerType");me.registerDefaultLoadBalancerType=Dv;function Lv(r,e,t,i){let n=r.getLoadBalancerName();return n in Yt?new Yt[n].LoadBalancer(e,t,i):null}a(Lv,"createLoadBalancer");me.createLoadBalancer=Lv;function qv(r){return r in Yt}a(qv,"isLoadBalancerNameRegistered");me.isLoadBalancerNameRegistered=qv;function pd(r){let e=Object.keys(r);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in Yt)try{return Yt[t].LoadBalancingConfig.createFromJson(r[t])}catch(i){throw new Error(`${t}: ${i.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}a(pd,"parseLoadBalancingConfig");me.parseLoadBalancingConfig=pd;function Fv(){if(!Bi)throw new Error("No default load balancer type registered");return new Yt[Bi].LoadBalancingConfig}a(Fv,"getDefaultConfig");me.getDefaultConfig=Fv;function Bv(r,e=!1){for(let t of r)try{return pd(t)}catch(i){(0,Nv.log)(kv.LogVerbosity.DEBUG,"Config parsing failed with error",i.message);continue}return e&&Bi?new Yt[Bi].LoadBalancingConfig:null}a(Bv,"selectLbConfigFromList");me.selectLbConfigFromList=Bv});var So=m(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.extractAndSelectServiceConfig=Kt.validateServiceConfig=Kt.validateRetryThrottling=void 0;var Uv=G("os"),zn=U(),Hn=/^\d+(\.\d{1,9})?s$/,zv="node";function Hv(r){if("service"in r&&r.service!==""){if(typeof r.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if("method"in r&&r.method!==""){if(typeof r.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if("method"in r&&r.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}a(Hv,"validateName");function jv(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in r)||typeof r.initialBackoff!="string"||!Hn.test(r.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in r)||typeof r.maxBackoff!="string"||!Hn.test(r.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in r)||typeof r.backoffMultiplier!="number"||r.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in r&&Array.isArray(r.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(r.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of r.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(zn.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(zn.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}a(jv,"validateRetryPolicy");function Gv(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in r&&(typeof r.hedgingDelay!="string"||!Hn.test(r.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in r&&Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(zn.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(zn.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&&(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&&(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}a(Gv,"validateHedgingPolicy");function Wv(r){var e;let t={name:[]};if(!("name"in r)||!Array.isArray(r.name))throw new Error("Invalid method config: invalid name array");for(let i of r.name)t.name.push(Hv(i));if("waitForReady"in r){if(typeof r.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=r.waitForReady}if("timeout"in r)if(typeof r.timeout=="object"){if(!("seconds"in r.timeout)||typeof r.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in r.timeout)||typeof r.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=r.timeout}else if(typeof r.timeout=="string"&&Hn.test(r.timeout)){let i=r.timeout.substring(0,r.timeout.length-1).split(".");t.timeout={seconds:i[0]|0,nanos:((e=i[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in r){if(typeof r.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=r.maxRequestBytes}if("maxResponseBytes"in r){if(typeof r.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=r.maxResponseBytes}if("retryPolicy"in r){if("hedgingPolicy"in r)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=jv(r.retryPolicy)}else"hedgingPolicy"in r&&(t.hedgingPolicy=Gv(r.hedgingPolicy));return t}a(Wv,"validateMethodConfig");function gd(r){if(!("maxTokens"in r)||typeof r.maxTokens!="number"||r.maxTokens<=0||r.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in r)||typeof r.tokenRatio!="number"||r.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}a(gd,"validateRetryThrottling");Kt.validateRetryThrottling=gd;function $v(r){if(!(typeof r=="object"&&r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:r[e[0]]}}a($v,"validateLoadBalancingConfig");function md(r){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in r)if(typeof r.loadBalancingPolicy=="string")e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in r)if(Array.isArray(r.loadBalancingConfig))for(let i of r.loadBalancingConfig)e.loadBalancingConfig.push($v(i));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in r&&Array.isArray(r.methodConfig))for(let i of r.methodConfig)e.methodConfig.push(Wv(i));"retryThrottling"in r&&(e.retryThrottling=gd(r.retryThrottling));let t=[];for(let i of e.methodConfig)for(let n of i.name){for(let s of t)if(n.service===s.service&&n.method===s.method)throw new Error(`Invalid service config: duplicate name ${n.service}/${n.method}`);t.push(n)}return e}a(md,"validateServiceConfig");Kt.validateServiceConfig=md;function Vv(r){if(!("serviceConfig"in r))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:md(r.serviceConfig)};if("clientLanguage"in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let i of r.clientLanguage)if(typeof i=="string")e.clientLanguage.push(i);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let i of r.clientHostname)if(typeof i=="string")e.clientHostname.push(i);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in r)if(typeof r.percentage=="number"&&0<=r.percentage&&r.percentage<=100)e.percentage=r.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let i in r)if(!t.includes(i))throw new Error(`Invalid service config choice: unexpected field ${i}`);return e}a(Vv,"validateCanaryConfig");function Jv(r,e){if(!Array.isArray(r))throw new Error("Invalid service config list");for(let t of r){let i=Vv(t);if(!(typeof i.percentage=="number"&&e>i.percentage)){if(Array.isArray(i.clientHostname)){let n=!1;for(let s of i.clientHostname)s===Uv.hostname()&&(n=!0);if(!n)continue}if(Array.isArray(i.clientLanguage)){let n=!1;for(let s of i.clientLanguage)s===zv&&(n=!0);if(!n)continue}return i.serviceConfig}}throw new Error("No matching service config found")}a(Jv,"validateAndSelectCanaryConfig");function Yv(r,e){for(let t of r)if(t.length>0&&t[0].startsWith("grpc_config=")){let i=t.join("").substring(12),n=JSON.parse(i);return Jv(n,e)}return null}a(Yv,"extractAndSelectServiceConfig");Kt.extractAndSelectServiceConfig=Yv});var $e=m(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.ConnectivityState=void 0;var vd;(function(r){r[r.IDLE=0]="IDLE",r[r.CONNECTING=1]="CONNECTING",r[r.READY=2]="READY",r[r.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",r[r.SHUTDOWN=4]="SHUTDOWN"})(vd||(jn.ConnectivityState=vd={}))});var Ue=m(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.uriToString=yt.combineHostPort=yt.splitHostPort=yt.parseUri=void 0;var Kv=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Xv(r){let e=Kv.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}a(Xv,"parseUri");yt.parseUri=Xv;var yd=/^\d+$/;function Qv(r){if(r.startsWith("[")){let e=r.indexOf("]");if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(":")===-1)return null;if(r.length>e+1)if(r[e+1]===":"){let i=r.substring(e+2);return yd.test(i)?{host:t,port:+i}:null}else return null;else return{host:t}}else{let e=r.split(":");return e.length===2?yd.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}a(Qv,"splitHostPort");yt.splitHostPort=Qv;function Zv(r){return r.port===void 0?r.host:r.host.includes(":")?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}a(Zv,"combineHostPort");yt.combineHostPort=Zv;function ey(r){let e="";return r.scheme!==void 0&&(e+=r.scheme+":"),r.authority!==void 0&&(e+="//"+r.authority+"/"),e+=r.path,e}a(ey,"uriToString");yt.uriToString=ey});var _t=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.mapUriDefaultScheme=Ve.getDefaultAuthority=Ve.createResolver=Ve.registerDefaultScheme=Ve.registerResolver=void 0;var Eo=Ue(),Yr={},Co=null;function ty(r,e){Yr[r]=e}a(ty,"registerResolver");Ve.registerResolver=ty;function ry(r){Co=r}a(ry,"registerDefaultScheme");Ve.registerDefaultScheme=ry;function iy(r,e,t){if(r.scheme!==void 0&&r.scheme in Yr)return new Yr[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,Eo.uriToString)(r)}`)}a(iy,"createResolver");Ve.createResolver=iy;function ny(r){if(r.scheme!==void 0&&r.scheme in Yr)return Yr[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,Eo.uriToString)(r)}`)}a(ny,"getDefaultAuthority");Ve.getDefaultAuthority=ny;function sy(r){return r.scheme===void 0||!(r.scheme in Yr)?Co!==null?{scheme:Co,authority:void 0,path:(0,Eo.uriToString)(r)}:null:r}a(sy,"mapUriDefaultScheme");Ve.mapUriDefaultScheme=sy});var Qt=m(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.QueuePicker=Xt.UnavailablePicker=Xt.PickResultType=void 0;var ay=we(),oy=U(),Gn;(function(r){r[r.COMPLETE=0]="COMPLETE",r[r.QUEUE=1]="QUEUE",r[r.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",r[r.DROP=3]="DROP"})(Gn||(Xt.PickResultType=Gn={}));var bo=class{static{a(this,"UnavailablePicker")}constructor(e){this.status=Object.assign({code:oy.Status.UNAVAILABLE,details:"No connection established",metadata:new ay.Metadata},e)}pick(e){return{pickResultType:Gn.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Xt.UnavailablePicker=bo;var To=class{static{a(this,"QueuePicker")}constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:Gn.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Xt.QueuePicker=To});var Ui=m(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.BackoffTimeout=void 0;var ly=1e3,cy=1.6,uy=12e4,dy=.2;function hy(r,e){return Math.random()*(e-r)+r}a(hy,"uniformRandom");var wo=class{static{a(this,"BackoffTimeout")}constructor(e,t){this.callback=e,this.initialDelay=ly,this.multiplier=cy,this.maxDelay=uy,this.jitter=dy,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}runTimer(e){var t,i;this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.callback(),this.running=!1},e),this.hasRef||(i=(t=this.timerId).unref)===null||i===void 0||i.call(t)}runOnce(){this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+hy(-t,t)}stop(){clearTimeout(this.timerId),this.running=!1}reset(){if(this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};Wn.BackoffTimeout=wo});var Vn=m($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.ChildLoadBalancerHandler=void 0;var fy=Tr(),py=$e(),gy="child_load_balancer_helper",Ro=class{static{a(this,"ChildLoadBalancerHandler")}constructor(e,t,i){this.channelControlHelper=e,this.credentials=t,this.options=i,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(n){this.parent=n,this.child=null}createSubchannel(n,s,o){return this.parent.channelControlHelper.createSubchannel(n,s,o)}updateState(n,s){var o;if(this.calledByPendingChild()){if(n===py.ConnectivityState.CONNECTING)return;(o=this.parent.currentChild)===null||o===void 0||o.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(n,s)}requestReresolution(){var n;let s=(n=this.parent.pendingChild)!==null&&n!==void 0?n:this.parent.currentChild;this.child===s&&this.parent.channelControlHelper.requestReresolution()}setChild(n){this.child=n}addChannelzChild(n){this.parent.channelControlHelper.addChannelzChild(n)}removeChannelzChild(n){this.parent.channelControlHelper.removeChannelzChild(n)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,i){let n;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let s=new this.ChildPolicyHelper(this),o=(0,fy.createLoadBalancer)(t,s,this.credentials,this.options);s.setChild(o),this.currentChild===null?(this.currentChild=o,n=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=o,n=this.pendingChild)}else this.pendingChild===null?n=this.currentChild:n=this.pendingChild;this.latestConfig=t,n.updateAddressList(e,t,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return gy}};$n.ChildLoadBalancerHandler=Ro});var Sd=m(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ResolvingLoadBalancer=void 0;var my=Tr(),vy=So(),xe=$e(),yy=_t(),zi=Qt(),_y=Ui(),Ao=U(),Sy=we(),Cy=te(),Ey=U(),by=Ue(),Ty=Vn(),wy="resolving_load_balancer";function _d(r){Cy.trace(Ey.LogVerbosity.DEBUG,wy,r)}a(_d,"trace");var Ry=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Ay(r,e,t,i){for(let n of t.name)switch(i){case"EMPTY":if(!n.service&&!n.method)return!0;break;case"SERVICE":if(n.service===r&&!n.method)return!0;break;case"SERVICE_AND_METHOD":if(n.service===r&&n.method===e)return!0}return!1}a(Ay,"hasMatchingName");function Oy(r,e,t,i){for(let n of t)if(Ay(r,e,n,i))return n;return null}a(Oy,"findMatchingConfig");function My(r){return a(function(t,i){var n,s;let o=t.split("/").filter(u=>u.length>0),l=(n=o[0])!==null&&n!==void 0?n:"",c=(s=o[1])!==null&&s!==void 0?s:"";if(r&&r.methodConfig)for(let u of Ry){let d=Oy(l,c,r.methodConfig,u);if(d)return{methodConfig:d,pickInformation:{},status:Ao.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:Ao.Status.OK,dynamicFilterFactories:[]}},"defaultConfigSelector")}a(My,"getDefaultConfigSelector");var Oo=class{static{a(this,"ResolvingLoadBalancer")}constructor(e,t,i,n,s,o){this.target=e,this.channelControlHelper=t,this.onSuccessfulResolution=s,this.onFailedResolution=o,this.latestChildState=xe.ConnectivityState.IDLE,this.latestChildPicker=new zi.QueuePicker(this),this.currentState=xe.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,n["grpc.service_config"]?this.defaultServiceConfig=(0,vy.validateServiceConfig)(JSON.parse(n["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(xe.ConnectivityState.IDLE,new zi.QueuePicker(this)),this.childLoadBalancer=new Ty.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:a(()=>{this.backoffTimeout.isRunning()?(_d("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},"requestReresolution"),updateState:a((c,u)=>{this.latestChildState=c,this.latestChildPicker=u,this.updateState(c,u)},"updateState"),addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)},i,n),this.innerResolver=(0,yy.createResolver)(e,{onSuccessfulResolution:a((c,u,d,h,p)=>{var g;this.backoffTimeout.stop(),this.backoffTimeout.reset();let y=null;u===null?d===null?(this.previousServiceConfig=null,y=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(d):y=this.previousServiceConfig:(y=u,this.previousServiceConfig=u);let v=(g=y?.loadBalancingConfig)!==null&&g!==void 0?g:[],C=(0,my.selectLbConfigFromList)(v,!0);if(C===null){this.handleResolutionFailure({code:Ao.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new Sy.Metadata});return}this.childLoadBalancer.updateAddressList(c,C,p);let S=y??this.defaultServiceConfig;this.onSuccessfulResolution(S,h??My(S))},"onSuccessfulResolution"),onError:a(c=>{this.handleResolutionFailure(c)},"onError")},n);let l={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new _y.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker)},l),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===xe.ConnectivityState.IDLE&&this.updateState(xe.ConnectivityState.CONNECTING,this.latestChildPicker),this.backoffTimeout.runOnce()}updateState(e,t){_d((0,by.uriToString)(this.target)+" "+xe.ConnectivityState[this.currentState]+" -> "+xe.ConnectivityState[e]),e===xe.ConnectivityState.IDLE&&(t=new zi.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t)}handleResolutionFailure(e){this.latestChildState===xe.ConnectivityState.IDLE&&(this.updateState(xe.ConnectivityState.TRANSIENT_FAILURE,new zi.UnavailablePicker(e)),this.onFailedResolution(e))}exitIdle(){(this.currentState===xe.ConnectivityState.IDLE||this.currentState===xe.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=xe.ConnectivityState.IDLE,this.latestChildPicker=new zi.QueuePicker(this),this.currentState=xe.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Jn.ResolvingLoadBalancer=Oo});var Cd=m(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.channelOptionsEqual=Kr.recognizedOptions=void 0;Kr.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0};function Py(r,e){let t=Object.keys(r).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==i[n]||r[t[n]]!==e[i[n]])return!1;return!0}a(Py,"channelOptionsEqual");Kr.channelOptionsEqual=Py});var Je=m(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.EndpointMap=ve.endpointHasAddress=ve.endpointToString=ve.endpointEqual=ve.stringToSubchannelAddress=ve.subchannelAddressToString=ve.subchannelAddressEqual=ve.isTcpSubchannelAddress=void 0;var Ed=G("net");function ji(r){return"port"in r}a(ji,"isTcpSubchannelAddress");ve.isTcpSubchannelAddress=ji;function Yn(r,e){return!r&&!e?!0:!r||!e?!1:ji(r)?ji(e)&&r.host===e.host&&r.port===e.port:!ji(e)&&r.path===e.path}a(Yn,"subchannelAddressEqual");ve.subchannelAddressEqual=Yn;function bd(r){return ji(r)?(0,Ed.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}a(bd,"subchannelAddressToString");ve.subchannelAddressToString=bd;var Ny=443;function ky(r,e){return(0,Ed.isIP)(r)?{host:r,port:e??Ny}:{path:r}}a(ky,"stringToSubchannelAddress");ve.stringToSubchannelAddress=ky;function Iy(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t<r.addresses.length;t++)if(!Yn(r.addresses[t],e.addresses[t]))return!1;return!0}a(Iy,"endpointEqual");ve.endpointEqual=Iy;function xy(r){return"["+r.addresses.map(bd).join(", ")+"]"}a(xy,"endpointToString");ve.endpointToString=xy;function Td(r,e){for(let t of r.addresses)if(Yn(t,e))return!0;return!1}a(Td,"endpointHasAddress");ve.endpointHasAddress=Td;function Hi(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let i=!1;for(let n of e.addresses)if(Yn(t,n)){i=!0;break}if(!i)return!1}return!0}a(Hi,"endpointEqualUnordered");var Mo=class{static{a(this,"EndpointMap")}constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Td(t.key,e))return t.value}deleteMissing(e){let t=[];for(let i of this.map){let n=!1;for(let s of e)Hi(s,i.key)&&(n=!0);n||(t.push(i.value),this.map.delete(i))}return t}get(e){for(let t of this.map)if(Hi(e,t.key))return t.value}set(e,t){for(let i of this.map)if(Hi(e,i.key)){i.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Hi(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Hi(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};ve.EndpointMap=Mo});var Rd={};Ya(Rd,{OrderedMap:()=>Hy});function Xr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Po(r,e);function t(){this.constructor=r}a(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Dy(r,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},i,n,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function wr(){throw new RangeError("Iterator access denied!")}var Po,wd,Ly,qy,Fy,By,Uy,zy,Lt,Hy,Ad=Me(()=>{"use strict";Po=a(function(r,e){return Po=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},Po(r,e)},"extendStatics");a(Xr,"__extends");a(Dy,"__generator");wd=function(){function r(e,t,i){i===void 0&&(i=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=i}return a(r,"TreeNode"),r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var i=e.h;i.t===e;)e=i,i=e.h;e=i}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,i=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=i,i&&(i.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,i=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=i,i&&(i.h=this),t},r}(),Ly=function(r){Xr(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.O=1,t}return a(e,"TreeNodeEnableIndex"),e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e}(wd),qy=function(){function r(e){e===void 0&&(e=0),this.iteratorType=e}return a(r,"ContainerIterator"),r.prototype.equals=function(e){return this.C===e.C},r}(),Fy=function(){function r(){this._=0}return a(r,"Base"),Object.defineProperty(r.prototype,"length",{get:a(function(){return this._},"get"),enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r}(),By=function(r){Xr(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return a(e,"Container"),e}(Fy);a(wr,"throwIteratorAccessError");Uy=function(r){Xr(e,r);function e(t,i){t===void 0&&(t=a(function(s,o){return s<o?-1:s>o?1:0},"r")),i===void 0&&(i=!1);var n=r.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=i,n.S=i?Ly:wd,n.A=new n.S,n}return a(e,"TreeContainer"),e.prototype.m=function(t,i){for(var n=this.A;t;){var s=this.g(t.u,i);if(s<0)t=t.i;else if(s>0)n=t,t=t.t;else return t}return n},e.prototype.B=function(t,i){for(var n=this.A;t;){var s=this.g(t.u,i);s<=0?t=t.i:(n=t,t=t.t)}return n},e.prototype.j=function(t,i){for(var n=this.A;t;){var s=this.g(t.u,i);if(s<0)n=t,t=t.i;else if(s>0)t=t.t;else return t}return n},e.prototype.k=function(t,i){for(var n=this.A;t;){var s=this.g(t.u,i);s<0?(n=t,t=t.i):t=t.t}return n},e.prototype.R=function(t){for(;;){var i=t.h;if(i===this.A)return;if(t.l===1){t.l=0;return}if(t===i.t){var n=i.i;if(n.l===1)n.l=0,i.l=1,i===this.N?this.N=i.T():i.T();else if(n.i&&n.i.l===1){n.l=i.l,i.l=0,n.i.l=0,i===this.N?this.N=i.T():i.T();return}else n.t&&n.t.l===1?(n.l=1,n.t.l=0,n.I()):(n.l=1,t=i)}else{var n=i.t;if(n.l===1)n.l=0,i.l=1,i===this.N?this.N=i.I():i.I();else if(n.t&&n.t.l===1){n.l=i.l,i.l=0,n.t.l=0,i===this.N?this.N=i.I():i.I();return}else n.i&&n.i.l===1?(n.l=1,n.i.l=0,n.T()):(n.l=1,t=i)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var i=t;i.t||i.i;){if(i.i)for(i=i.i;i.t;)i=i.t;else i=i.t;var n=t.u;t.u=i.u,i.u=n;var s=t.o;t.o=i.o,i.o=s,t=i}this.A.t===i?this.A.t=i.h:this.A.i===i&&(this.A.i=i.h),this.R(i);var o=i.h;if(i===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h},e.prototype.P=function(t){for(var i=typeof t=="number"?t:void 0,n=typeof t=="function"?t:void 0,s=typeof t>"u"?[]:void 0,o=0,l=this.N,c=[];c.length||l;)if(l)c.push(l),l=l.t;else{if(l=c.pop(),o===i)return l;s&&s.push(l),n&&n(l,o,this),o+=1,l=l.i}return s},e.prototype.q=function(t){for(;;){var i=t.h;if(i.l===0)return;var n=i.h;if(i===n.t){var s=n.i;if(s&&s.l===1){if(s.l=i.l=0,n===this.N)return;n.l=1,t=n;continue}else if(t===i.i){if(t.l=0,t.t&&(t.t.h=i),t.i&&(t.i.h=n),i.i=t.t,n.t=t.i,t.t=i,t.i=n,n===this.N)this.N=t,this.A.h=t;else{var o=n.h;o.t===n?o.t=t:o.i=t}t.h=n.h,i.h=t,n.h=t,n.l=1}else{i.l=0,n===this.N?this.N=n.I():n.I(),n.l=1;return}}else{var s=n.t;if(s&&s.l===1){if(s.l=i.l=0,n===this.N)return;n.l=1,t=n;continue}else if(t===i.t){if(t.l=0,t.t&&(t.t.h=n),t.i&&(t.i.h=i),n.i=t.t,i.t=t.i,t.t=n,t.i=i,n===this.N)this.N=t,this.A.h=t;else{var o=n.h;o.t===n?o.t=t:o.i=t}t.h=n.h,i.h=t,n.h=t,n.l=1}else{i.l=0,n===this.N?this.N=n.T():n.T(),n.l=1;return}}this.enableIndex&&(i.M(),n.M(),t.M());return}},e.prototype.D=function(t,i,n){if(this.N===void 0)return this._+=1,this.N=new this.S(t,i,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,o=this.A.t,l=this.g(o.u,t);if(l===0)return o.o=i,this._;if(l>0)o.t=new this.S(t,i),o.t.h=o,s=o.t,this.A.t=s;else{var c=this.A.i,u=this.g(c.u,t);if(u===0)return c.o=i,this._;if(u<0)c.i=new this.S(t,i),c.i.h=c,s=c.i,this.A.i=s;else{if(n!==void 0){var d=n.C;if(d!==this.A){var h=this.g(d.u,t);if(h===0)return d.o=i,this._;if(h>0){var p=d.v(),g=this.g(p.u,t);if(g===0)return p.o=i,this._;g<0&&(s=new this.S(t,i),p.i===void 0?(p.i=s,s.h=p):(d.t=s,s.h=d))}}}if(s===void 0)for(s=this.N;;){var y=this.g(s.u,t);if(y>0){if(s.t===void 0){s.t=new this.S(t,i),s.t.h=s,s=s.t;break}s=s.t}else if(y<0){if(s.i===void 0){s.i=new this.S(t,i),s.i.h=s,s=s.i;break}s=s.i}else return s.o=i,this._}}}if(this.enableIndex)for(var v=s.h;v!==this.A;)v.O+=1,v=v.h;return this.q(s),this._+=1,this._},e.prototype.F=function(t,i){for(;t;){var n=this.g(t.u,i);if(n<0)t=t.i;else if(n>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,i){var n=t.C;if(n===this.A&&wr(),this._===1)return n.u=i,!0;var s=n.p().u;if(n===this.A.t)return this.g(s,i)>0?(n.u=i,!0):!1;var o=n.v().u;return n===this.A.i?this.g(o,i)<0?(n.u=i,!0):!1:this.g(o,i)>=0||this.g(s,i)<=0?!1:(n.u=i,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var i=this.P(t);return this.G(i),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var i=this.F(this.N,t);return i===this.A?!1:(this.G(i),!0)},e.prototype.eraseElementByIterator=function(t){var i=t.C;i===this.A&&wr();var n=i.i===void 0,s=t.iteratorType===0;return s?n&&t.next():(!n||i.t===void 0)&&t.next(),this.G(i),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(i){return i?Math.max(t(i.t),t(i.i))+1:0}return a(t,"traversal"),t(this.N)},e}(By),zy=function(r){Xr(e,r);function e(t,i,n){var s=r.call(this,n)||this;return s.C=t,s.A=i,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&wr(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&wr(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&wr(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&wr(),this.C=this.C.v(),this}),s}return a(e,"TreeIterator"),Object.defineProperty(e.prototype,"index",{get:a(function(){var t=this.C,i=this.A.h;if(t===this.A)return i?i.O-1:0;var n=0;for(t.t&&(n+=t.t.O);t!==i;){var s=t.h;t===s.i&&(n+=1,s.t&&(n+=s.t.O)),t=s}return n},"get"),enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e}(qy),Lt=function(r){Xr(e,r);function e(t,i,n,s){var o=r.call(this,t,i,s)||this;return o.container=n,o}return a(e,"OrderedMapIterator"),Object.defineProperty(e.prototype,"pointer",{get:a(function(){this.C===this.A&&wr();var t=this;return new Proxy([],{get:a(function(i,n){return n==="0"?t.C.u:n==="1"?t.C.o:(i[0]=t.C.u,i[1]=t.C.o,i[n])},"get"),set:a(function(i,n,s){if(n!=="1")throw new TypeError("prop must be 1");return t.C.o=s,!0},"set")})},"get"),enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e}(zy),Hy=function(r){Xr(e,r);function e(t,i,n){t===void 0&&(t=[]);var s=r.call(this,i,n)||this,o=s;return t.forEach(function(l){o.setElement(l[0],l[1])}),s}return a(e,"OrderedMap"),e.prototype.begin=function(){return new Lt(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Lt(this.A,this.A,this)},e.prototype.rBegin=function(){return new Lt(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Lt(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var i=this.m(this.N,t);return new Lt(i,this.A,this)},e.prototype.upperBound=function(t){var i=this.B(this.N,t);return new Lt(i,this.A,this)},e.prototype.reverseLowerBound=function(t){var i=this.j(this.N,t);return new Lt(i,this.A,this)},e.prototype.reverseUpperBound=function(t){var i=this.k(this.N,t);return new Lt(i,this.A,this)},e.prototype.forEach=function(t){this.P(function(i,n,s){t([i.u,i.o],n,s)})},e.prototype.setElement=function(t,i,n){return this.D(t,i,n)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var i=this.P(t);return[i.u,i.o]},e.prototype.find=function(t){var i=this.F(this.N,t);return new Lt(i,this.A,this)},e.prototype.getElementByKey=function(t){var i=this.F(this.N,t);return i.o},e.prototype.union=function(t){var i=this;return t.forEach(function(n){i.setElement(n[0],n[1])}),this._},e.prototype[Symbol.iterator]=function(){var t,i,n,s;return Dy(this,function(o){switch(o.label){case 0:t=this._,i=this.P(),n=0,o.label=1;case 1:return n<t?(s=i[n],[4,[s.u,s.o]]):[3,4];case 2:o.sent(),o.label=3;case 3:return++n,[3,1];case 4:return[2]}})},e}(Uy)});var Kn=m(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.addAdminServicesToServer=Qr.registerAdminService=void 0;var Od=[];function jy(r,e){Od.push({getServiceDefinition:r,getHandlers:e})}a(jy,"registerAdminService");Qr.registerAdminService=jy;function Gy(r){for(let{getServiceDefinition:e,getHandlers:t}of Od)r.addService(e(),t())}a(Gy,"addAdminServicesToServer");Qr.addAdminServicesToServer=Gy});var Md=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ClientDuplexStreamImpl=Ye.ClientWritableStreamImpl=Ye.ClientReadableStreamImpl=Ye.ClientUnaryCallImpl=Ye.callErrorFromStatus=void 0;var Wy=G("events"),Do=G("stream"),Gi=U();function $y(r,e){let t=`${r.code} ${Gi.Status[r.code]}: ${r.details}`,n=`${new Error(t).stack}
3
+ for call at
4
+ ${e}`;return Object.assign(new Error(t),r,{stack:n})}a($y,"callErrorFromStatus");Ye.callErrorFromStatus=$y;var No=class extends Wy.EventEmitter{static{a(this,"ClientUnaryCallImpl")}constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Gi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}};Ye.ClientUnaryCallImpl=No;var ko=class extends Do.Readable{static{a(this,"ClientReadableStreamImpl")}constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Gi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};Ye.ClientReadableStreamImpl=ko;var Io=class extends Do.Writable{static{a(this,"ClientWritableStreamImpl")}constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Gi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_write(e,t,i){var n;let s={callback:i},o=Number(t);Number.isNaN(o)||(s.flags=o),(n=this.call)===null||n===void 0||n.sendMessageWithContext(s,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};Ye.ClientWritableStreamImpl=Io;var xo=class extends Do.Duplex{static{a(this,"ClientDuplexStreamImpl")}constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Gi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,i){var n;let s={callback:i},o=Number(t);Number.isNaN(o)||(s.flags=o),(n=this.call)===null||n===void 0||n.sendMessageWithContext(s,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};Ye.ClientDuplexStreamImpl=xo});var Pd=m(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.InterceptingListenerImpl=Zr.isInterceptingListener=void 0;function Vy(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}a(Vy,"isInterceptingListener");Zr.isInterceptingListener=Vy;var Lo=class{static{a(this,"InterceptingListenerImpl")}constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};Zr.InterceptingListenerImpl=Lo});var jo=m(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getInterceptingCall=Ke.InterceptingCall=Ke.RequesterBuilder=Ke.ListenerBuilder=Ke.InterceptorConfigurationError=void 0;var Jy=we(),Nd=Pd(),kd=U(),Id=Dn(),$i=class r extends Error{static{a(this,"InterceptorConfigurationError")}constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,r)}};Ke.InterceptorConfigurationError=$i;var Fo=class{static{a(this,"ListenerBuilder")}constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};Ke.ListenerBuilder=Fo;var Bo=class{static{a(this,"RequesterBuilder")}constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};Ke.RequesterBuilder=Bo;var qo={onReceiveMetadata:a((r,e)=>{e(r)},"onReceiveMetadata"),onReceiveMessage:a((r,e)=>{e(r)},"onReceiveMessage"),onReceiveStatus:a((r,e)=>{e(r)},"onReceiveStatus")},Wi={start:a((r,e,t)=>{t(r,e)},"start"),sendMessage:a((r,e)=>{e(r)},"sendMessage"),halfClose:a(r=>{r()},"halfClose"),cancel:a(r=>{r()},"cancel")},Uo=class{static{a(this,"InterceptingCall")}constructor(e,t){var i,n,s,o;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(i=t.start)!==null&&i!==void 0?i:Wi.start,sendMessage:(n=t.sendMessage)!==null&&n!==void 0?n:Wi.sendMessage,halfClose:(s=t.halfClose)!==null&&s!==void 0?s:Wi.halfClose,cancel:(o=t.cancel)!==null&&o!==void 0?o:Wi.cancel}:this.requester=Wi}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){var i,n,s,o,l,c;let u={onReceiveMetadata:(n=(i=t?.onReceiveMetadata)===null||i===void 0?void 0:i.bind(t))!==null&&n!==void 0?n:d=>{},onReceiveMessage:(o=(s=t?.onReceiveMessage)===null||s===void 0?void 0:s.bind(t))!==null&&o!==void 0?o:d=>{},onReceiveStatus:(c=(l=t?.onReceiveStatus)===null||l===void 0?void 0:l.bind(t))!==null&&c!==void 0?c:d=>{}};this.processingMetadata=!0,this.requester.start(e,u,(d,h)=>{var p,g,y;this.processingMetadata=!1;let v;if((0,Nd.isInterceptingListener)(h))v=h;else{let C={onReceiveMetadata:(p=h.onReceiveMetadata)!==null&&p!==void 0?p:qo.onReceiveMetadata,onReceiveMessage:(g=h.onReceiveMessage)!==null&&g!==void 0?g:qo.onReceiveMessage,onReceiveStatus:(y=h.onReceiveStatus)!==null&&y!==void 0?y:qo.onReceiveStatus};v=new Nd.InterceptingListenerImpl(C,u)}this.nextCall.start(d,v),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,i=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,i),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}};Ke.InterceptingCall=Uo;function Yy(r,e,t){var i,n;let s=(i=t.deadline)!==null&&i!==void 0?i:1/0,o=t.host,l=(n=t.parent)!==null&&n!==void 0?n:null,c=t.propagate_flags,u=t.credentials,d=r.createCall(e,s,o,l,c);return u&&d.setCredentials(u),d}a(Yy,"getCall");var Xn=class{static{a(this,"BaseInterceptingCall")}constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let i;try{i=this.methodDefinition.requestSerialize(t)}catch(n){this.call.cancelWithStatus(kd.Status.INTERNAL,`Request message serialization failure: ${(0,Id.getErrorMessage)(n)}`);return}this.call.sendMessageWithContext(e,i)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let i=null;this.call.start(e,{onReceiveMetadata:a(n=>{var s;(s=t?.onReceiveMetadata)===null||s===void 0||s.call(t,n)},"onReceiveMetadata"),onReceiveMessage:a(n=>{var s;let o;try{o=this.methodDefinition.responseDeserialize(n)}catch(l){i={code:kd.Status.INTERNAL,details:`Response message parsing error: ${(0,Id.getErrorMessage)(l)}`,metadata:new Jy.Metadata},this.call.cancelWithStatus(i.code,i.details);return}(s=t?.onReceiveMessage)===null||s===void 0||s.call(t,o)},"onReceiveMessage"),onReceiveStatus:a(n=>{var s,o;i?(s=t?.onReceiveStatus)===null||s===void 0||s.call(t,i):(o=t?.onReceiveStatus)===null||o===void 0||o.call(t,n)},"onReceiveStatus")})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},zo=class extends Xn{static{a(this,"BaseUnaryInterceptingCall")}constructor(e,t){super(e,t)}start(e,t){var i,n;let s=!1,o={onReceiveMetadata:(n=(i=t?.onReceiveMetadata)===null||i===void 0?void 0:i.bind(t))!==null&&n!==void 0?n:l=>{},onReceiveMessage:a(l=>{var c;s=!0,(c=t?.onReceiveMessage)===null||c===void 0||c.call(t,l)},"onReceiveMessage"),onReceiveStatus:a(l=>{var c,u;s||(c=t?.onReceiveMessage)===null||c===void 0||c.call(t,null),(u=t?.onReceiveStatus)===null||u===void 0||u.call(t,l)},"onReceiveStatus")};super.start(e,o),this.call.startRead()}},Ho=class extends Xn{static{a(this,"BaseStreamingInterceptingCall")}};function Ky(r,e,t){let i=Yy(r,t.path,e);return t.responseStream?new Ho(i,t):new zo(i,t)}a(Ky,"getBottomInterceptingCall");function Xy(r,e,t,i){if(r.clientInterceptors.length>0&&r.clientInterceptorProviders.length>0)throw new $i("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(r.callInterceptors.length>0&&r.callInterceptorProviders.length>0)throw new $i("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let n=[];r.callInterceptors.length>0||r.callInterceptorProviders.length>0?n=[].concat(r.callInterceptors,r.callInterceptorProviders.map(l=>l(e))).filter(l=>l):n=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(l=>l(e))).filter(l=>l);let s=Object.assign({},t,{method_definition:e});return n.reduceRight((l,c)=>u=>c(u,l),l=>Ky(i,l,e))(s)}a(Xy,"getInterceptingCall");Ke.getInterceptingCall=Xy});var $o=m(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.Client=void 0;var St=Md(),Qy=Vo(),Zy=$e(),Zt=U(),ei=we(),Qn=jo(),ot=Symbol(),ti=Symbol(),ri=Symbol(),qt=Symbol();function Go(r){return typeof r=="function"}a(Go,"isFunction");function ii(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(`
5
+ `).slice(1).join(`
6
+ `))||"no stack trace available"}a(ii,"getErrorStackString");var Wo=class{static{a(this,"Client")}constructor(e,t,i={}){var n,s;if(i=Object.assign({},i),this[ti]=(n=i.interceptors)!==null&&n!==void 0?n:[],delete i.interceptors,this[ri]=(s=i.interceptor_providers)!==null&&s!==void 0?s:[],delete i.interceptor_providers,this[ti].length>0&&this[ri].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[qt]=i.callInvocationTransformer,delete i.callInvocationTransformer,i.channelOverride)this[ot]=i.channelOverride;else if(i.channelFactoryOverride){let o=i.channelFactoryOverride;delete i.channelFactoryOverride,this[ot]=o(e,t,i)}else this[ot]=new Qy.ChannelImplementation(e,t,i)}close(){this[ot].close()}getChannel(){return this[ot]}waitForReady(e,t){let i=a(n=>{if(n){t(new Error("Failed to connect before the deadline"));return}let s;try{s=this[ot].getConnectivityState(!0)}catch{t(new Error("The channel has been closed"));return}if(s===Zy.ConnectivityState.READY)t();else try{this[ot].watchConnectivityState(s,e,i)}catch{t(new Error("The channel has been closed"))}},"checkState");setImmediate(i)}checkOptionalUnaryResponseArguments(e,t,i){if(Go(e))return{metadata:new ei.Metadata,options:{},callback:e};if(Go(t))return e instanceof ei.Metadata?{metadata:e,options:{},callback:t}:{metadata:new ei.Metadata,options:e,callback:t};if(!(e instanceof ei.Metadata&&t instanceof Object&&Go(i)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:i}}makeUnaryRequest(e,t,i,n,s,o,l){var c,u;let d=this.checkOptionalUnaryResponseArguments(s,o,l),h={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:i},p={argument:n,metadata:d.metadata,call:new St.ClientUnaryCallImpl,channel:this[ot],methodDefinition:h,callOptions:d.options,callback:d.callback};this[qt]&&(p=this[qt](p));let g=p.call,y={clientInterceptors:this[ti],clientInterceptorProviders:this[ri],callInterceptors:(c=p.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(u=p.callOptions.interceptor_providers)!==null&&u!==void 0?u:[]},v=(0,Qn.getInterceptingCall)(y,p.methodDefinition,p.callOptions,p.channel);g.call=v;let C=null,S=!1,_=new Error;return v.start(p.metadata,{onReceiveMetadata:a(P=>{g.emit("metadata",P)},"onReceiveMetadata"),onReceiveMessage(P){C!==null&&v.cancelWithStatus(Zt.Status.UNIMPLEMENTED,"Too many responses received"),C=P},onReceiveStatus(P){if(!S){if(S=!0,P.code===Zt.Status.OK)if(C===null){let A=ii(_);p.callback((0,St.callErrorFromStatus)({code:Zt.Status.UNIMPLEMENTED,details:"No message received",metadata:P.metadata},A))}else p.callback(null,C);else{let A=ii(_);p.callback((0,St.callErrorFromStatus)(P,A))}_=null,g.emit("status",P)}}}),v.sendMessage(n),v.halfClose(),g}makeClientStreamRequest(e,t,i,n,s,o){var l,c;let u=this.checkOptionalUnaryResponseArguments(n,s,o),d={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:i},h={metadata:u.metadata,call:new St.ClientWritableStreamImpl(t),channel:this[ot],methodDefinition:d,callOptions:u.options,callback:u.callback};this[qt]&&(h=this[qt](h));let p=h.call,g={clientInterceptors:this[ti],clientInterceptorProviders:this[ri],callInterceptors:(l=h.callOptions.interceptors)!==null&&l!==void 0?l:[],callInterceptorProviders:(c=h.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},y=(0,Qn.getInterceptingCall)(g,h.methodDefinition,h.callOptions,h.channel);p.call=y;let v=null,C=!1,S=new Error;return y.start(h.metadata,{onReceiveMetadata:a(_=>{p.emit("metadata",_)},"onReceiveMetadata"),onReceiveMessage(_){v!==null&&y.cancelWithStatus(Zt.Status.UNIMPLEMENTED,"Too many responses received"),v=_,y.startRead()},onReceiveStatus(_){if(!C){if(C=!0,_.code===Zt.Status.OK)if(v===null){let P=ii(S);h.callback((0,St.callErrorFromStatus)({code:Zt.Status.UNIMPLEMENTED,details:"No message received",metadata:_.metadata},P))}else h.callback(null,v);else{let P=ii(S);h.callback((0,St.callErrorFromStatus)(_,P))}S=null,p.emit("status",_)}}}),p}checkMetadataAndOptions(e,t){let i,n;return e instanceof ei.Metadata?(i=e,t?n=t:n={}):(e?n=e:n={},i=new ei.Metadata),{metadata:i,options:n}}makeServerStreamRequest(e,t,i,n,s,o){var l,c;let u=this.checkMetadataAndOptions(s,o),d={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:i},h={argument:n,metadata:u.metadata,call:new St.ClientReadableStreamImpl(i),channel:this[ot],methodDefinition:d,callOptions:u.options};this[qt]&&(h=this[qt](h));let p=h.call,g={clientInterceptors:this[ti],clientInterceptorProviders:this[ri],callInterceptors:(l=h.callOptions.interceptors)!==null&&l!==void 0?l:[],callInterceptorProviders:(c=h.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},y=(0,Qn.getInterceptingCall)(g,h.methodDefinition,h.callOptions,h.channel);p.call=y;let v=!1,C=new Error;return y.start(h.metadata,{onReceiveMetadata(S){p.emit("metadata",S)},onReceiveMessage(S){p.push(S)},onReceiveStatus(S){if(!v){if(v=!0,p.push(null),S.code!==Zt.Status.OK){let _=ii(C);p.emit("error",(0,St.callErrorFromStatus)(S,_))}C=null,p.emit("status",S)}}}),y.sendMessage(n),y.halfClose(),p}makeBidiStreamRequest(e,t,i,n,s){var o,l;let c=this.checkMetadataAndOptions(n,s),u={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:i},d={metadata:c.metadata,call:new St.ClientDuplexStreamImpl(t,i),channel:this[ot],methodDefinition:u,callOptions:c.options};this[qt]&&(d=this[qt](d));let h=d.call,p={clientInterceptors:this[ti],clientInterceptorProviders:this[ri],callInterceptors:(o=d.callOptions.interceptors)!==null&&o!==void 0?o:[],callInterceptorProviders:(l=d.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},g=(0,Qn.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);h.call=g;let y=!1,v=new Error;return g.start(d.metadata,{onReceiveMetadata(C){h.emit("metadata",C)},onReceiveMessage(C){h.push(C)},onReceiveStatus(C){if(!y){if(y=!0,h.push(null),C.code!==Zt.Status.OK){let S=ii(v);h.emit("error",(0,St.callErrorFromStatus)(C,S))}v=null,h.emit("status",C)}}}),h}};Zn.Client=Wo});var Yo=m(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.loadPackageDefinition=ni.makeClientConstructor=void 0;var Vi=$o(),e_={unary:Vi.Client.prototype.makeUnaryRequest,server_stream:Vi.Client.prototype.makeServerStreamRequest,client_stream:Vi.Client.prototype.makeClientStreamRequest,bidi:Vi.Client.prototype.makeBidiStreamRequest};function Jo(r){return["__proto__","prototype","constructor"].includes(r)}a(Jo,"isPrototypePolluted");function xd(r,e,t){t||(t={});class i extends Vi.Client{static{a(this,"ServiceClientImpl")}}return Object.keys(r).forEach(n=>{if(Jo(n))return;let s=r[n],o;if(typeof n=="string"&&n.charAt(0)==="$")throw new Error("Method names cannot start with $");s.requestStream?s.responseStream?o="bidi":o="client_stream":s.responseStream?o="server_stream":o="unary";let l=s.requestSerialize,c=s.responseDeserialize,u=t_(e_[o],s.path,l,c);i.prototype[n]=u,Object.assign(i.prototype[n],s),s.originalName&&!Jo(s.originalName)&&(i.prototype[s.originalName]=i.prototype[n])}),i.service=r,i.serviceName=e,i}a(xd,"makeClientConstructor");ni.makeClientConstructor=xd;function t_(r,e,t,i){return function(...n){return r.call(this,e,t,i,...n)}}a(t_,"partial");function r_(r){return"format"in r}a(r_,"isProtobufTypeDefinition");function i_(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let i=r[t],n=t.split(".");if(n.some(l=>Jo(l)))continue;let s=n[n.length-1],o=e;for(let l of n.slice(0,-1))o[l]||(o[l]={}),o=o[l];r_(i)?o[s]=i:o[s]=xd(i,s,{})}return e}a(i_,"loadPackageDefinition");ni.loadPackageDefinition=i_});var sh=m((F1,nh)=>{"use strict";var n_=1/0,s_="[object Symbol]",a_=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,o_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ts="\\ud800-\\udfff",Hd="\\u0300-\\u036f\\ufe20-\\ufe23",jd="\\u20d0-\\u20f0",Gd="\\u2700-\\u27bf",Wd="a-z\\xdf-\\xf6\\xf8-\\xff",l_="\\xac\\xb1\\xd7\\xf7",c_="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",u_="\\u2000-\\u206f",d_=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$d="A-Z\\xc0-\\xd6\\xd8-\\xde",Vd="\\ufe0e\\ufe0f",Jd=l_+c_+u_+d_,Xo="['\u2019]",h_="["+ts+"]",Dd="["+Jd+"]",es="["+Hd+jd+"]",Yd="\\d+",f_="["+Gd+"]",Kd="["+Wd+"]",Xd="[^"+ts+Jd+Yd+Gd+Wd+$d+"]",Ko="\\ud83c[\\udffb-\\udfff]",p_="(?:"+es+"|"+Ko+")",Qd="[^"+ts+"]",Qo="(?:\\ud83c[\\udde6-\\uddff]){2}",Zo="[\\ud800-\\udbff][\\udc00-\\udfff]",si="["+$d+"]",Zd="\\u200d",Ld="(?:"+Kd+"|"+Xd+")",g_="(?:"+si+"|"+Xd+")",qd="(?:"+Xo+"(?:d|ll|m|re|s|t|ve))?",Fd="(?:"+Xo+"(?:D|LL|M|RE|S|T|VE))?",eh=p_+"?",th="["+Vd+"]?",m_="(?:"+Zd+"(?:"+[Qd,Qo,Zo].join("|")+")"+th+eh+")*",rh=th+eh+m_,v_="(?:"+[f_,Qo,Zo].join("|")+")"+rh,y_="(?:"+[Qd+es+"?",es,Qo,Zo,h_].join("|")+")",__=RegExp(Xo,"g"),S_=RegExp(es,"g"),C_=RegExp(Ko+"(?="+Ko+")|"+y_+rh,"g"),E_=RegExp([si+"?"+Kd+"+"+qd+"(?="+[Dd,si,"$"].join("|")+")",g_+"+"+Fd+"(?="+[Dd,si+Ld,"$"].join("|")+")",si+"?"+Ld+"+"+qd,si+"+"+Fd,Yd,v_].join("|"),"g"),b_=RegExp("["+Zd+ts+Hd+jd+Vd+"]"),T_=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,w_={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},R_=typeof global=="object"&&global&&global.Object===Object&&global,A_=typeof self=="object"&&self&&self.Object===Object&&self,O_=R_||A_||Function("return this")();function M_(r,e,t,i){var n=-1,s=r?r.length:0;for(i&&s&&(t=r[++n]);++n<s;)t=e(t,r[n],n,r);return t}a(M_,"arrayReduce");function P_(r){return r.split("")}a(P_,"asciiToArray");function N_(r){return r.match(a_)||[]}a(N_,"asciiWords");function k_(r){return function(e){return r?.[e]}}a(k_,"basePropertyOf");var I_=k_(w_);function ih(r){return b_.test(r)}a(ih,"hasUnicode");function x_(r){return T_.test(r)}a(x_,"hasUnicodeWord");function D_(r){return ih(r)?L_(r):P_(r)}a(D_,"stringToArray");function L_(r){return r.match(C_)||[]}a(L_,"unicodeToArray");function q_(r){return r.match(E_)||[]}a(q_,"unicodeWords");var F_=Object.prototype,B_=F_.toString,Bd=O_.Symbol,Ud=Bd?Bd.prototype:void 0,zd=Ud?Ud.toString:void 0;function U_(r,e,t){var i=-1,n=r.length;e<0&&(e=-e>n?0:n+e),t=t>n?n:t,t<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(n);++i<n;)s[i]=r[i+e];return s}a(U_,"baseSlice");function z_(r){if(typeof r=="string")return r;if($_(r))return zd?zd.call(r):"";var e=r+"";return e=="0"&&1/r==-n_?"-0":e}a(z_,"baseToString");function H_(r,e,t){var i=r.length;return t=t===void 0?i:t,!e&&t>=i?r:U_(r,e,t)}a(H_,"castSlice");function j_(r){return function(e){e=rs(e);var t=ih(e)?D_(e):void 0,i=t?t[0]:e.charAt(0),n=t?H_(t,1).join(""):e.slice(1);return i[r]()+n}}a(j_,"createCaseFirst");function G_(r){return function(e){return M_(X_(Y_(e).replace(__,"")),r,"")}}a(G_,"createCompounder");function W_(r){return!!r&&typeof r=="object"}a(W_,"isObjectLike");function $_(r){return typeof r=="symbol"||W_(r)&&B_.call(r)==s_}a($_,"isSymbol");function rs(r){return r==null?"":z_(r)}a(rs,"toString");var V_=G_(function(r,e,t){return e=e.toLowerCase(),r+(t?J_(e):e)});function J_(r){return K_(rs(r).toLowerCase())}a(J_,"capitalize");function Y_(r){return r=rs(r),r&&r.replace(o_,I_).replace(S_,"")}a(Y_,"deburr");var K_=j_("toUpperCase");function X_(r,e,t){return r=rs(r),e=t?void 0:e,e===void 0?x_(r)?q_(r):N_(r):r.match(e)||[]}a(X_,"words");nh.exports=V_});var el=m((U1,ah)=>{"use strict";ah.exports=Q_;function Q_(r,e){for(var t=new Array(arguments.length-1),i=0,n=2,s=!0;n<arguments.length;)t[i++]=arguments[n++];return new Promise(a(function(l,c){t[i]=a(function(d){if(s)if(s=!1,d)c(d);else{for(var h=new Array(arguments.length-1),p=0;p<h.length;)h[p++]=arguments[p];l.apply(null,h)}},"callback");try{r.apply(e||null,t)}catch(u){s&&(s=!1,c(u))}},"executor"))}a(Q_,"asPromise")});var uh=m(ch=>{"use strict";var is=ch;is.length=a(function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&e.charAt(t)==="=";)++i;return Math.ceil(e.length*3)/4-i},"length");var ai=new Array(64),lh=new Array(123);for(lt=0;lt<64;)lh[ai[lt]=lt<26?lt+65:lt<52?lt+71:lt<62?lt-4:lt-59|43]=lt++;var lt;is.encode=a(function(e,t,i){for(var n=null,s=[],o=0,l=0,c;t<i;){var u=e[t++];switch(l){case 0:s[o++]=ai[u>>2],c=(u&3)<<4,l=1;break;case 1:s[o++]=ai[c|u>>4],c=(u&15)<<2,l=2;break;case 2:s[o++]=ai[c|u>>6],s[o++]=ai[u&63],l=0;break}o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0)}return l&&(s[o++]=ai[c],s[o++]=61,l===1&&(s[o++]=61)),n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))},"encode");var oh="invalid encoding";is.decode=a(function(e,t,i){for(var n=i,s=0,o,l=0;l<e.length;){var c=e.charCodeAt(l++);if(c===61&&s>1)break;if((c=lh[c])===void 0)throw Error(oh);switch(s){case 0:o=c,s=1;break;case 1:t[i++]=o<<2|(c&48)>>4,o=c,s=2;break;case 2:t[i++]=(o&15)<<4|(c&60)>>2,o=c,s=3;break;case 3:t[i++]=(o&3)<<6|c,s=0;break}}if(s===1)throw Error(oh);return i-n},"decode");is.test=a(function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},"test")});var hh=m((G1,dh)=>{"use strict";dh.exports=ns;function ns(){this._listeners={}}a(ns,"EventEmitter");ns.prototype.on=a(function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},"on");ns.prototype.off=a(function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var i=this._listeners[e],n=0;n<i.length;)i[n].fn===t?i.splice(n,1):++n;return this},"off");ns.prototype.emit=a(function(e){var t=this._listeners[e];if(t){for(var i=[],n=1;n<arguments.length;)i.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,i)}return this},"emit")});var _h=m(($1,yh)=>{"use strict";yh.exports=fh(fh);function fh(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),i=t[3]===128;function n(c,u,d){e[0]=c,u[d]=t[0],u[d+1]=t[1],u[d+2]=t[2],u[d+3]=t[3]}a(n,"writeFloat_f32_cpy");function s(c,u,d){e[0]=c,u[d]=t[3],u[d+1]=t[2],u[d+2]=t[1],u[d+3]=t[0]}a(s,"writeFloat_f32_rev"),r.writeFloatLE=i?n:s,r.writeFloatBE=i?s:n;function o(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],e[0]}a(o,"readFloat_f32_cpy");function l(c,u){return t[3]=c[u],t[2]=c[u+1],t[1]=c[u+2],t[0]=c[u+3],e[0]}a(l,"readFloat_f32_rev"),r.readFloatLE=i?o:l,r.readFloatBE=i?l:o}():function(){function e(i,n,s,o){var l=n<0?1:0;if(l&&(n=-n),n===0)i(1/n>0?0:2147483648,s,o);else if(isNaN(n))i(2143289344,s,o);else if(n>34028234663852886e22)i((l<<31|2139095040)>>>0,s,o);else if(n<11754943508222875e-54)i((l<<31|Math.round(n/1401298464324817e-60))>>>0,s,o);else{var c=Math.floor(Math.log(n)/Math.LN2),u=Math.round(n*Math.pow(2,-c)*8388608)&8388607;i((l<<31|c+127<<23|u)>>>0,s,o)}}a(e,"writeFloat_ieee754"),r.writeFloatLE=e.bind(null,ph),r.writeFloatBE=e.bind(null,gh);function t(i,n,s){var o=i(n,s),l=(o>>31)*2+1,c=o>>>23&255,u=o&8388607;return c===255?u?NaN:l*(1/0):c===0?l*1401298464324817e-60*u:l*Math.pow(2,c-150)*(u+8388608)}a(t,"readFloat_ieee754"),r.readFloatLE=t.bind(null,mh),r.readFloatBE=t.bind(null,vh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),i=t[7]===128;function n(c,u,d){e[0]=c,u[d]=t[0],u[d+1]=t[1],u[d+2]=t[2],u[d+3]=t[3],u[d+4]=t[4],u[d+5]=t[5],u[d+6]=t[6],u[d+7]=t[7]}a(n,"writeDouble_f64_cpy");function s(c,u,d){e[0]=c,u[d]=t[7],u[d+1]=t[6],u[d+2]=t[5],u[d+3]=t[4],u[d+4]=t[3],u[d+5]=t[2],u[d+6]=t[1],u[d+7]=t[0]}a(s,"writeDouble_f64_rev"),r.writeDoubleLE=i?n:s,r.writeDoubleBE=i?s:n;function o(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],t[4]=c[u+4],t[5]=c[u+5],t[6]=c[u+6],t[7]=c[u+7],e[0]}a(o,"readDouble_f64_cpy");function l(c,u){return t[7]=c[u],t[6]=c[u+1],t[5]=c[u+2],t[4]=c[u+3],t[3]=c[u+4],t[2]=c[u+5],t[1]=c[u+6],t[0]=c[u+7],e[0]}a(l,"readDouble_f64_rev"),r.readDoubleLE=i?o:l,r.readDoubleBE=i?l:o}():function(){function e(i,n,s,o,l,c){var u=o<0?1:0;if(u&&(o=-o),o===0)i(0,l,c+n),i(1/o>0?0:2147483648,l,c+s);else if(isNaN(o))i(0,l,c+n),i(2146959360,l,c+s);else if(o>17976931348623157e292)i(0,l,c+n),i((u<<31|2146435072)>>>0,l,c+s);else{var d;if(o<22250738585072014e-324)d=o/5e-324,i(d>>>0,l,c+n),i((u<<31|d/4294967296)>>>0,l,c+s);else{var h=Math.floor(Math.log(o)/Math.LN2);h===1024&&(h=1023),d=o*Math.pow(2,-h),i(d*4503599627370496>>>0,l,c+n),i((u<<31|h+1023<<20|d*1048576&1048575)>>>0,l,c+s)}}}a(e,"writeDouble_ieee754"),r.writeDoubleLE=e.bind(null,ph,0,4),r.writeDoubleBE=e.bind(null,gh,4,0);function t(i,n,s,o,l){var c=i(o,l+n),u=i(o,l+s),d=(u>>31)*2+1,h=u>>>20&2047,p=4294967296*(u&1048575)+c;return h===2047?p?NaN:d*(1/0):h===0?d*5e-324*p:d*Math.pow(2,h-1075)*(p+4503599627370496)}a(t,"readDouble_ieee754"),r.readDoubleLE=t.bind(null,mh,0,4),r.readDoubleBE=t.bind(null,vh,4,0)}(),r}a(fh,"factory");function ph(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}a(ph,"writeUintLE");function gh(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}a(gh,"writeUintBE");function mh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}a(mh,"readUintLE");function vh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}a(vh,"readUintBE")});var tl=m((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}a(inquire,"inquire")});var Ch=m(Sh=>{"use strict";var rl=Sh;rl.length=a(function(e){for(var t=0,i=0,n=0;n<e.length;++n)i=e.charCodeAt(n),i<128?t+=1:i<2048?t+=2:(i&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t},"utf8_length");rl.read=a(function(e,t,i){var n=i-t;if(n<1)return"";for(var s=null,o=[],l=0,c;t<i;)c=e[t++],c<128?o[l++]=c:c>191&&c<224?o[l++]=(c&31)<<6|e[t++]&63:c>239&&c<365?(c=((c&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[l++]=55296+(c>>10),o[l++]=56320+(c&1023)):o[l++]=(c&15)<<12|(e[t++]&63)<<6|e[t++]&63,l>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),l=0);return s?(l&&s.push(String.fromCharCode.apply(String,o.slice(0,l))),s.join("")):String.fromCharCode.apply(String,o.slice(0,l))},"utf8_read");rl.write=a(function(e,t,i){for(var n=i,s,o,l=0;l<e.length;++l)s=e.charCodeAt(l),s<128?t[i++]=s:s<2048?(t[i++]=s>>6|192,t[i++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(l+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++l,t[i++]=s>>18|240,t[i++]=s>>12&63|128,t[i++]=s>>6&63|128,t[i++]=s&63|128):(t[i++]=s>>12|224,t[i++]=s>>6&63|128,t[i++]=s&63|128);return i-n},"utf8_write")});var bh=m((X1,Eh)=>{"use strict";Eh.exports=Z_;function Z_(r,e,t){var i=t||8192,n=i>>>1,s=null,o=i;return a(function(c){if(c<1||c>n)return r(c);o+c>i&&(s=r(i),o=0);var u=e.call(s,o,o+=c);return o&7&&(o=(o|7)+1),u},"pool_alloc")}a(Z_,"pool")});var wh=m((Z1,Th)=>{"use strict";Th.exports=ye;var Ji=Ct();function ye(r,e){this.lo=r>>>0,this.hi=e>>>0}a(ye,"LongBits");var Rr=ye.zero=new ye(0,0);Rr.toNumber=function(){return 0};Rr.zzEncode=Rr.zzDecode=function(){return this};Rr.length=function(){return 1};var e0=ye.zeroHash="\0\0\0\0\0\0\0\0";ye.fromNumber=a(function(e){if(e===0)return Rr;var t=e<0;t&&(e=-e);var i=e>>>0,n=(e-i)/4294967296>>>0;return t&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new ye(i,n)},"fromNumber");ye.from=a(function(e){if(typeof e=="number")return ye.fromNumber(e);if(Ji.isString(e))if(Ji.Long)e=Ji.Long.fromString(e);else return ye.fromNumber(parseInt(e,10));return e.low||e.high?new ye(e.low>>>0,e.high>>>0):Rr},"from");ye.prototype.toNumber=a(function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+i*4294967296)}return this.lo+this.hi*4294967296},"toNumber");ye.prototype.toLong=a(function(e){return Ji.Long?new Ji.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}},"toLong");var er=String.prototype.charCodeAt;ye.fromHash=a(function(e){return e===e0?Rr:new ye((er.call(e,0)|er.call(e,1)<<8|er.call(e,2)<<16|er.call(e,3)<<24)>>>0,(er.call(e,4)|er.call(e,5)<<8|er.call(e,6)<<16|er.call(e,7)<<24)>>>0)},"fromHash");ye.prototype.toHash=a(function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},"toHash");ye.prototype.zzEncode=a(function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},"zzEncode");ye.prototype.zzDecode=a(function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},"zzDecode");ye.prototype.length=a(function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10},"length")});var Ct=m(il=>{"use strict";var I=il;I.asPromise=el();I.base64=uh();I.EventEmitter=hh();I.float=_h();I.inquire=tl();I.utf8=Ch();I.pool=bh();I.LongBits=wh();I.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);I.global=I.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||il;I.emptyArray=Object.freeze?Object.freeze([]):[];I.emptyObject=Object.freeze?Object.freeze({}):{};I.isInteger=Number.isInteger||a(function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},"isInteger");I.isString=a(function(e){return typeof e=="string"||e instanceof String},"isString");I.isObject=a(function(e){return e&&typeof e=="object"},"isObject");I.isset=I.isSet=a(function(e,t){var i=e[t];return i!=null&&e.hasOwnProperty(t)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1},"isSet");I.Buffer=function(){try{var r=I.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();I._Buffer_from=null;I._Buffer_allocUnsafe=null;I.newBuffer=a(function(e){return typeof e=="number"?I.Buffer?I._Buffer_allocUnsafe(e):new I.Array(e):I.Buffer?I._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)},"newBuffer");I.Array=typeof Uint8Array<"u"?Uint8Array:Array;I.Long=I.global.dcodeIO&&I.global.dcodeIO.Long||I.global.Long||I.inquire("long");I.key2Re=/^true|false|0|1$/;I.key32Re=/^-?(?:0|[1-9][0-9]*)$/;I.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;I.longToHash=a(function(e){return e?I.LongBits.from(e).toHash():I.LongBits.zeroHash},"longToHash");I.longFromHash=a(function(e,t){var i=I.LongBits.fromHash(e);return I.Long?I.Long.fromBits(i.lo,i.hi,t):i.toNumber(!!t)},"longFromHash");function Rh(r,e,t){for(var i=Object.keys(e),n=0;n<i.length;++n)(r[i[n]]===void 0||!t)&&(r[i[n]]=e[i[n]]);return r}a(Rh,"merge");I.merge=Rh;I.lcFirst=a(function(e){return e.charAt(0).toLowerCase()+e.substring(1)},"lcFirst");function Ah(r){function e(t,i){if(!(this instanceof e))return new e(t,i);Object.defineProperty(this,"message",{get:a(function(){return t},"get")}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),i&&Rh(this,i)}return a(e,"CustomError"),e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:a(function(){return r},"get"),set:void 0,enumerable:!1,configurable:!0},toString:{value:a(function(){return this.name+": "+this.message},"value"),writable:!0,enumerable:!1,configurable:!0}}),e}a(Ah,"newError");I.newError=Ah;I.ProtocolError=Ah("ProtocolError");I.oneOfGetter=a(function(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=1;return function(){for(var n=Object.keys(this),s=n.length-1;s>-1;--s)if(t[n[s]]===1&&this[n[s]]!==void 0&&this[n[s]]!==null)return n[s]}},"getOneOf");I.oneOfSetter=a(function(e){return function(t){for(var i=0;i<e.length;++i)e[i]!==t&&delete this[e[i]]}},"setOneOf");I.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};I._configure=function(){var r=I.Buffer;if(!r){I._Buffer_from=I._Buffer_allocUnsafe=null;return}I._Buffer_from=r.from!==Uint8Array.from&&r.from||a(function(t,i){return new r(t,i)},"Buffer_from"),I._Buffer_allocUnsafe=r.allocUnsafe||a(function(t){return new r(t)},"Buffer_allocUnsafe")}});var as=m((iA,Nh)=>{"use strict";Nh.exports=j;var Xe=Ct(),nl,ss=Xe.LongBits,Oh=Xe.base64,Mh=Xe.utf8;function Yi(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}a(Yi,"Op");function al(){}a(al,"noop");function t0(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}a(t0,"State");function j(){this.len=0,this.head=new Yi(al,0,0),this.tail=this.head,this.states=null}a(j,"Writer");var Ph=a(function(){return Xe.Buffer?a(function(){return(j.create=a(function(){return new nl},"create_buffer"))()},"create_buffer_setup"):a(function(){return new j},"create_array")},"create");j.create=Ph();j.alloc=a(function(e){return new Xe.Array(e)},"alloc");Xe.Array!==Array&&(j.alloc=Xe.pool(j.alloc,Xe.Array.prototype.subarray));j.prototype._push=a(function(e,t,i){return this.tail=this.tail.next=new Yi(e,t,i),this.len+=t,this},"push");function ol(r,e,t){e[t]=r&255}a(ol,"writeByte");function r0(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}a(r0,"writeVarint32");function ll(r,e){this.len=r,this.next=void 0,this.val=e}a(ll,"VarintOp");ll.prototype=Object.create(Yi.prototype);ll.prototype.fn=r0;j.prototype.uint32=a(function(e){return this.len+=(this.tail=this.tail.next=new ll((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},"write_uint32");j.prototype.int32=a(function(e){return e<0?this._push(cl,10,ss.fromNumber(e)):this.uint32(e)},"write_int32");j.prototype.sint32=a(function(e){return this.uint32((e<<1^e>>31)>>>0)},"write_sint32");function cl(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}a(cl,"writeVarint64");j.prototype.uint64=a(function(e){var t=ss.from(e);return this._push(cl,t.length(),t)},"write_uint64");j.prototype.int64=j.prototype.uint64;j.prototype.sint64=a(function(e){var t=ss.from(e).zzEncode();return this._push(cl,t.length(),t)},"write_sint64");j.prototype.bool=a(function(e){return this._push(ol,1,e?1:0)},"write_bool");function sl(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}a(sl,"writeFixed32");j.prototype.fixed32=a(function(e){return this._push(sl,4,e>>>0)},"write_fixed32");j.prototype.sfixed32=j.prototype.fixed32;j.prototype.fixed64=a(function(e){var t=ss.from(e);return this._push(sl,4,t.lo)._push(sl,4,t.hi)},"write_fixed64");j.prototype.sfixed64=j.prototype.fixed64;j.prototype.float=a(function(e){return this._push(Xe.float.writeFloatLE,4,e)},"write_float");j.prototype.double=a(function(e){return this._push(Xe.float.writeDoubleLE,8,e)},"write_double");var i0=Xe.Array.prototype.set?a(function(e,t,i){t.set(e,i)},"writeBytes_set"):a(function(e,t,i){for(var n=0;n<e.length;++n)t[i+n]=e[n]},"writeBytes_for");j.prototype.bytes=a(function(e){var t=e.length>>>0;if(!t)return this._push(ol,1,0);if(Xe.isString(e)){var i=j.alloc(t=Oh.length(e));Oh.decode(e,i,0),e=i}return this.uint32(t)._push(i0,t,e)},"write_bytes");j.prototype.string=a(function(e){var t=Mh.length(e);return t?this.uint32(t)._push(Mh.write,t,e):this._push(ol,1,0)},"write_string");j.prototype.fork=a(function(){return this.states=new t0(this),this.head=this.tail=new Yi(al,0,0),this.len=0,this},"fork");j.prototype.reset=a(function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Yi(al,0,0),this.len=0),this},"reset");j.prototype.ldelim=a(function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},"ldelim");j.prototype.finish=a(function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},"finish");j._configure=function(r){nl=r,j.create=Ph(),nl._configure()}});var xh=m((sA,Ih)=>{"use strict";Ih.exports=Et;var kh=as();(Et.prototype=Object.create(kh.prototype)).constructor=Et;var tr=Ct();function Et(){kh.call(this)}a(Et,"BufferWriter");Et._configure=function(){Et.alloc=tr._Buffer_allocUnsafe,Et.writeBytesBuffer=tr.Buffer&&tr.Buffer.prototype instanceof Uint8Array&&tr.Buffer.prototype.set.name==="set"?a(function(e,t,i){t.set(e,i)},"writeBytesBuffer_set"):a(function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var n=0;n<e.length;)t[i++]=e[n++]},"writeBytesBuffer_copy")};Et.prototype.bytes=a(function(e){tr.isString(e)&&(e=tr._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Et.writeBytesBuffer,t,e),this},"write_bytes_buffer");function n0(r,e,t){r.length<40?tr.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}a(n0,"writeStringBuffer");Et.prototype.string=a(function(e){var t=tr.Buffer.byteLength(e);return this.uint32(t),t&&this._push(n0,t,e),this},"write_string_buffer");Et._configure()});var ls=m((oA,Bh)=>{"use strict";Bh.exports=oe;var ct=Ct(),dl,qh=ct.LongBits,s0=ct.utf8;function ut(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}a(ut,"indexOutOfRange");function oe(r){this.buf=r,this.pos=0,this.len=r.length}a(oe,"Reader");var Dh=typeof Uint8Array<"u"?a(function(e){if(e instanceof Uint8Array||Array.isArray(e))return new oe(e);throw Error("illegal buffer")},"create_typed_array"):a(function(e){if(Array.isArray(e))return new oe(e);throw Error("illegal buffer")},"create_array"),Fh=a(function(){return ct.Buffer?a(function(t){return(oe.create=a(function(n){return ct.Buffer.isBuffer(n)?new dl(n):Dh(n)},"create_buffer"))(t)},"create_buffer_setup"):Dh},"create");oe.create=Fh();oe.prototype._slice=ct.Array.prototype.subarray||ct.Array.prototype.slice;oe.prototype.uint32=a(function(){var e=4294967295;return a(function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,ut(this,10);return e},"read_uint32")},"read_uint32_setup")();oe.prototype.int32=a(function(){return this.uint32()|0},"read_int32");oe.prototype.sint32=a(function(){var e=this.uint32();return e>>>1^-(e&1)|0},"read_sint32");function ul(){var r=new qh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw ut(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw ut(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}a(ul,"readLongVarint");oe.prototype.bool=a(function(){return this.uint32()!==0},"read_bool");function os(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}a(os,"readFixed32_end");oe.prototype.fixed32=a(function(){if(this.pos+4>this.len)throw ut(this,4);return os(this.buf,this.pos+=4)},"read_fixed32");oe.prototype.sfixed32=a(function(){if(this.pos+4>this.len)throw ut(this,4);return os(this.buf,this.pos+=4)|0},"read_sfixed32");function Lh(){if(this.pos+8>this.len)throw ut(this,8);return new qh(os(this.buf,this.pos+=4),os(this.buf,this.pos+=4))}a(Lh,"readFixed64");oe.prototype.float=a(function(){if(this.pos+4>this.len)throw ut(this,4);var e=ct.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},"read_float");oe.prototype.double=a(function(){if(this.pos+8>this.len)throw ut(this,4);var e=ct.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},"read_double");oe.prototype.bytes=a(function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw ut(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,i);if(t===i){var n=ct.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,i)},"read_bytes");oe.prototype.string=a(function(){var e=this.bytes();return s0.read(e,0,e.length)},"read_string");oe.prototype.skip=a(function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ut(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ut(this);while(this.buf[this.pos++]&128);return this},"skip");oe.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};oe._configure=function(r){dl=r,oe.create=Fh(),dl._configure();var e=ct.Long?"toLong":"toNumber";ct.merge(oe.prototype,{int64:a(function(){return ul.call(this)[e](!1)},"read_int64"),uint64:a(function(){return ul.call(this)[e](!0)},"read_uint64"),sint64:a(function(){return ul.call(this).zzDecode()[e](!1)},"read_sint64"),fixed64:a(function(){return Lh.call(this)[e](!0)},"read_fixed64"),sfixed64:a(function(){return Lh.call(this)[e](!1)},"read_sfixed64")})}});var jh=m((cA,Hh)=>{"use strict";Hh.exports=Ar;var zh=ls();(Ar.prototype=Object.create(zh.prototype)).constructor=Ar;var Uh=Ct();function Ar(r){zh.call(this,r)}a(Ar,"BufferReader");Ar._configure=function(){Uh.Buffer&&(Ar.prototype._slice=Uh.Buffer.prototype.slice)};Ar.prototype.string=a(function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},"read_string_buffer");Ar._configure()});var Wh=m((dA,Gh)=>{"use strict";Gh.exports=Ki;var hl=Ct();(Ki.prototype=Object.create(hl.EventEmitter.prototype)).constructor=Ki;function Ki(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");hl.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}a(Ki,"Service");Ki.prototype.rpcCall=a(function r(e,t,i,n,s){if(!n)throw TypeError("request must be specified");var o=this;if(!s)return hl.asPromise(r,o,e,t,i,n);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),a(function(c,u){if(c)return o.emit("error",c,e),s(c);if(u===null){o.end(!0);return}if(!(u instanceof i))try{u=i[o.responseDelimited?"decodeDelimited":"decode"](u)}catch(d){return o.emit("error",d,e),s(d)}return o.emit("data",u,e),s(null,u)},"rpcCallback"))}catch(l){o.emit("error",l,e),setTimeout(function(){s(l)},0);return}},"rpcCall");Ki.prototype.end=a(function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},"end")});var fl=m($h=>{"use strict";var a0=$h;a0.Service=Wh()});var pl=m((pA,Vh)=>{"use strict";Vh.exports={}});var Kh=m(Yh=>{"use strict";var De=Yh;De.build="minimal";De.Writer=as();De.BufferWriter=xh();De.Reader=ls();De.BufferReader=jh();De.util=Ct();De.rpc=fl();De.roots=pl();De.configure=Jh;function Jh(){De.util._configure(),De.Writer._configure(De.BufferWriter),De.Reader._configure(De.BufferReader)}a(Jh,"configure");Jh()});var Qh=m((vA,Xh)=>{"use strict";Xh.exports=gl;function gl(r,e){typeof r=="string"&&(e=r,r=void 0);var t=[];function i(s){if(typeof s!="string"){var o=n();if(gl.verbose&&console.log("codegen: "+o),o="return "+o,s){for(var l=Object.keys(s),c=new Array(l.length+1),u=new Array(l.length),d=0;d<l.length;)c[d]=l[d],u[d]=s[l[d++]];return c[d]=o,Function.apply(null,c).apply(null,u)}return Function(o)()}for(var h=new Array(arguments.length-1),p=0;p<h.length;)h[p]=arguments[++p];if(p=0,s=s.replace(/%([%dfijs])/g,a(function(y,v){var C=h[p++];switch(v){case"d":case"f":return String(Number(C));case"i":return String(Math.floor(C));case"j":return JSON.stringify(C);case"s":return String(C)}return"%"},"replace")),p!==h.length)throw Error("parameter count mismatch");return t.push(s),i}a(i,"Codegen");function n(s){return"function "+(s||e||"")+"("+(r&&r.join(",")||"")+`){
7
+ `+t.join(`
8
+ `)+`
9
+ }`}return a(n,"toString"),i.toString=n,i}a(gl,"codegen");gl.verbose=!1});var ef=m((_A,Zh)=>{"use strict";Zh.exports=Xi;var o0=el(),l0=tl(),ml=l0("fs");function Xi(r,e,t){return typeof e=="function"?(t=e,e={}):e||(e={}),t?!e.xhr&&ml&&ml.readFile?ml.readFile(r,a(function(n,s){return n&&typeof XMLHttpRequest<"u"?Xi.xhr(r,e,t):n?t(n):t(null,e.binary?s:s.toString("utf8"))},"fetchReadFileCallback")):Xi.xhr(r,e,t):o0(Xi,this,r,e)}a(Xi,"fetch");Xi.xhr=a(function(e,t,i){var n=new XMLHttpRequest;n.onreadystatechange=a(function(){if(n.readyState===4){if(n.status!==0&&n.status!==200)return i(Error("status "+n.status));if(t.binary){var o=n.response;if(!o){o=[];for(var l=0;l<n.responseText.length;++l)o.push(n.responseText.charCodeAt(l)&255)}return i(null,typeof Uint8Array<"u"?new Uint8Array(o):o)}return i(null,n.responseText)}},"fetchOnReadyStateChange"),t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()},"fetch_xhr")});var nf=m(rf=>{"use strict";var yl=rf,tf=yl.isAbsolute=a(function(e){return/^(?:\/|\w+:)/.test(e)},"isAbsolute"),vl=yl.normalize=a(function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),i=tf(e),n="";i&&(n=t.shift()+"/");for(var s=0;s<t.length;)t[s]===".."?s>0&&t[s-1]!==".."?t.splice(--s,2):i?t.splice(s,1):++s:t[s]==="."?t.splice(s,1):++s;return n+t.join("/")},"normalize");yl.resolve=a(function(e,t,i){return i||(t=vl(t)),tf(t)?t:(i||(e=vl(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?vl(e+"/"+t):t)},"resolve")});var Or=m(sf=>{"use strict";var Qi=sf,c0=_e(),u0=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Zi(r,e){var t=0,i={};for(e|=0;t<r.length;)i[u0[t+e]]=r[t++];return i}a(Zi,"bake");Qi.basic=Zi([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Qi.defaults=Zi([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",c0.emptyArray,null]);Qi.long=Zi([0,0,0,1,1],7);Qi.mapKey=Zi([0,0,0,5,5,0,0,0,1,1,0,2],2);Qi.packed=Zi([1,5,0,0,0,5,5,0,0,0,1,1,0])});var rr=m((wA,lf)=>{"use strict";lf.exports=Qe;var cs=Mr();((Qe.prototype=Object.create(cs.prototype)).constructor=Qe).className="Field";var af=dt(),of=Or(),de=_e(),_l,d0=/^required|optional|repeated$/;Qe.fromJSON=a(function(e,t){return new Qe(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},"fromJSON");function Qe(r,e,t,i,n,s,o){if(de.isObject(i)?(o=n,s=i,i=n=void 0):de.isObject(n)&&(o=s,s=n,n=void 0),cs.call(this,r,s),!de.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!de.isString(t))throw TypeError("type must be a string");if(i!==void 0&&!d0.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(n!==void 0&&!de.isString(n))throw TypeError("extend must be a string");i==="proto3_optional"&&(i="optional"),this.rule=i&&i!=="optional"?i:void 0,this.type=t,this.id=e,this.extend=n||void 0,this.required=i==="required",this.optional=!this.required,this.repeated=i==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=de.Long?of.long[t]!==void 0:!1,this.bytes=t==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=o}a(Qe,"Field");Object.defineProperty(Qe.prototype,"packed",{get:a(function(){return this._packed===null&&(this._packed=this.getOption("packed")!==!1),this._packed},"get")});Qe.prototype.setOption=a(function(e,t,i){return e==="packed"&&(this._packed=null),cs.prototype.setOption.call(this,e,t,i)},"setOption");Qe.prototype.toJSON=a(function(e){var t=e?!!e.keepComments:!1;return de.toObject(["rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},"toJSON");Qe.prototype.resolve=a(function(){if(this.resolved)return this;if((this.typeDefault=of.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof _l?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof af&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&((this.options.packed===!0||this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof af))&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=de.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;de.base64.test(this.typeDefault)?de.base64.decode(this.typeDefault,e=de.newBuffer(de.base64.length(this.typeDefault)),0):de.utf8.write(this.typeDefault,e=de.newBuffer(de.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=de.emptyObject:this.repeated?this.defaultValue=de.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof _l&&(this.parent.ctor.prototype[this.name]=this.defaultValue),cs.prototype.resolve.call(this)},"resolve");Qe.d=a(function(e,t,i,n){return typeof t=="function"?t=de.decorateType(t).name:t&&typeof t=="object"&&(t=de.decorateEnum(t).name),a(function(o,l){de.decorateType(o.constructor).add(new Qe(l,e,t,i,{default:n}))},"fieldDecorator")},"decorateField");Qe._configure=a(function(e){_l=e},"configure")});var oi=m((AA,df)=>{"use strict";df.exports=Ze;var ds=Mr();((Ze.prototype=Object.create(ds.prototype)).constructor=Ze).className="OneOf";var cf=rr(),us=_e();function Ze(r,e,t,i){if(Array.isArray(e)||(t=e,e=void 0),ds.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=i}a(Ze,"OneOf");Ze.fromJSON=a(function(e,t){return new Ze(e,t.oneof,t.options,t.comment)},"fromJSON");Ze.prototype.toJSON=a(function(e){var t=e?!!e.keepComments:!1;return us.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},"toJSON");function uf(r){if(r.parent)for(var e=0;e<r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}a(uf,"addFieldsToParent");Ze.prototype.add=a(function(e){if(!(e instanceof cf))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,uf(this),this},"add");Ze.prototype.remove=a(function(e){if(!(e instanceof cf))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},"remove");Ze.prototype.onAdd=a(function(e){ds.prototype.onAdd.call(this,e);for(var t=this,i=0;i<this.oneof.length;++i){var n=e.get(this.oneof[i]);n&&!n.partOf&&(n.partOf=t,t.fieldsArray.push(n))}uf(this)},"onAdd");Ze.prototype.onRemove=a(function(e){for(var t=0,i;t<this.fieldsArray.length;++t)(i=this.fieldsArray[t]).parent&&i.parent.remove(i);ds.prototype.onRemove.call(this,e)},"onRemove");Ze.d=a(function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return a(function(n,s){us.decorateType(n.constructor).add(new Ze(s,e)),Object.defineProperty(n,s,{get:us.oneOfGetter(e),set:us.oneOfSetter(e)})},"oneOfDecorator")},"decorateOneOf")});var ui=m((MA,gf)=>{"use strict";gf.exports=W;var Sl=Mr();((W.prototype=Object.create(Sl.prototype)).constructor=W).className="Namespace";var hf=rr(),hs=_e(),h0=oi(),li,en,ci;W.fromJSON=a(function(e,t){return new W(e,t.options).addJSON(t.nested)},"fromJSON");function ff(r,e){if(r&&r.length){for(var t={},i=0;i<r.length;++i)t[r[i].name]=r[i].toJSON(e);return t}}a(ff,"arrayToJSON");W.arrayToJSON=ff;W.isReservedId=a(function(e,t){if(e){for(var i=0;i<e.length;++i)if(typeof e[i]!="string"&&e[i][0]<=t&&e[i][1]>t)return!0}return!1},"isReservedId");W.isReservedName=a(function(e,t){if(e){for(var i=0;i<e.length;++i)if(e[i]===t)return!0}return!1},"isReservedName");function W(r,e){Sl.call(this,r,e),this.nested=void 0,this._nestedArray=null}a(W,"Namespace");function pf(r){return r._nestedArray=null,r}a(pf,"clearCache");Object.defineProperty(W.prototype,"nestedArray",{get:a(function(){return this._nestedArray||(this._nestedArray=hs.toArray(this.nested))},"get")});W.prototype.toJSON=a(function(e){return hs.toObject(["options",this.options,"nested",ff(this.nestedArray,e)])},"toJSON");W.prototype.addJSON=a(function(e){var t=this;if(e)for(var i=Object.keys(e),n=0,s;n<i.length;++n)s=e[i[n]],t.add((s.fields!==void 0?li.fromJSON:s.values!==void 0?ci.fromJSON:s.methods!==void 0?en.fromJSON:s.id!==void 0?hf.fromJSON:W.fromJSON)(i[n],s));return this},"addJSON");W.prototype.get=a(function(e){return this.nested&&this.nested[e]||null},"get");W.prototype.getEnum=a(function(e){if(this.nested&&this.nested[e]instanceof ci)return this.nested[e].values;throw Error("no such enum: "+e)},"getEnum");W.prototype.add=a(function(e){if(!(e instanceof hf&&e.extend!==void 0||e instanceof li||e instanceof h0||e instanceof ci||e instanceof en||e instanceof W))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof W&&e instanceof W&&!(t instanceof li||t instanceof en)){for(var i=t.nestedArray,n=0;n<i.length;++n)e.add(i[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}return this.nested[e.name]=e,e.onAdd(this),pf(this)},"add");W.prototype.remove=a(function(e){if(!(e instanceof Sl))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),pf(this)},"remove");W.prototype.define=a(function(e,t){if(hs.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");for(var i=this;e.length>0;){var n=e.shift();if(i.nested&&i.nested[n]){if(i=i.nested[n],!(i instanceof W))throw Error("path conflicts with non-namespace objects")}else i.add(i=new W(n))}return t&&i.addJSON(t),i},"define");W.prototype.resolveAll=a(function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof W?e[t++].resolveAll():e[t++].resolve();return this.resolve()},"resolveAll");W.prototype.lookup=a(function(e,t,i){if(typeof t=="boolean"?(i=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),hs.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;if(e[0]==="")return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(e.length===1){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof W&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var s=0;s<this.nestedArray.length;++s)if(this._nestedArray[s]instanceof W&&(n=this._nestedArray[s].lookup(e,t,!0)))return n;return this.parent===null||i?null:this.parent.lookup(e,t)},"lookup");W.prototype.lookupType=a(function(e){var t=this.lookup(e,[li]);if(!t)throw Error("no such type: "+e);return t},"lookupType");W.prototype.lookupEnum=a(function(e){var t=this.lookup(e,[ci]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},"lookupEnum");W.prototype.lookupTypeOrEnum=a(function(e){var t=this.lookup(e,[li,ci]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},"lookupTypeOrEnum");W.prototype.lookupService=a(function(e){var t=this.lookup(e,[en]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},"lookupService");W._configure=function(r,e,t){li=r,en=e,ci=t}});var fs=m((NA,mf)=>{"use strict";mf.exports=Ft;var Cl=rr();((Ft.prototype=Object.create(Cl.prototype)).constructor=Ft).className="MapField";var f0=Or(),tn=_e();function Ft(r,e,t,i,n,s){if(Cl.call(this,r,e,i,void 0,void 0,n,s),!tn.isString(t))throw TypeError("keyType must be a string");this.keyType=t,this.resolvedKeyType=null,this.map=!0}a(Ft,"MapField");Ft.fromJSON=a(function(e,t){return new Ft(e,t.id,t.keyType,t.type,t.options,t.comment)},"fromJSON");Ft.prototype.toJSON=a(function(e){var t=e?!!e.keepComments:!1;return tn.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},"toJSON");Ft.prototype.resolve=a(function(){if(this.resolved)return this;if(f0.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return Cl.prototype.resolve.call(this)},"resolve");Ft.d=a(function(e,t,i){return typeof i=="function"?i=tn.decorateType(i).name:i&&typeof i=="object"&&(i=tn.decorateEnum(i).name),a(function(s,o){tn.decorateType(s.constructor).add(new Ft(o,e,t,i))},"mapFieldDecorator")},"decorateMapField")});var ps=m((IA,vf)=>{"use strict";vf.exports=Pr;var El=Mr();((Pr.prototype=Object.create(El.prototype)).constructor=Pr).className="Method";var di=_e();function Pr(r,e,t,i,n,s,o,l,c){if(di.isObject(n)?(o=n,n=s=void 0):di.isObject(s)&&(o=s,s=void 0),!(e===void 0||di.isString(e)))throw TypeError("type must be a string");if(!di.isString(t))throw TypeError("requestType must be a string");if(!di.isString(i))throw TypeError("responseType must be a string");El.call(this,r,o),this.type=e||"rpc",this.requestType=t,this.requestStream=n?!0:void 0,this.responseType=i,this.responseStream=s?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=c}a(Pr,"Method");Pr.fromJSON=a(function(e,t){return new Pr(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},"fromJSON");Pr.prototype.toJSON=a(function(e){var t=e?!!e.keepComments:!1;return di.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},"toJSON");Pr.prototype.resolve=a(function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),El.prototype.resolve.call(this))},"resolve")});var gs=m((DA,_f)=>{"use strict";_f.exports=et;var ir=ui();((et.prototype=Object.create(ir.prototype)).constructor=et).className="Service";var bl=ps(),rn=_e(),p0=fl();function et(r,e){ir.call(this,r,e),this.methods={},this._methodsArray=null}a(et,"Service");et.fromJSON=a(function(e,t){var i=new et(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),s=0;s<n.length;++s)i.add(bl.fromJSON(n[s],t.methods[n[s]]));return t.nested&&i.addJSON(t.nested),i.comment=t.comment,i},"fromJSON");et.prototype.toJSON=a(function(e){var t=ir.prototype.toJSON.call(this,e),i=e?!!e.keepComments:!1;return rn.toObject(["options",t&&t.options||void 0,"methods",ir.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",i?this.comment:void 0])},"toJSON");Object.defineProperty(et.prototype,"methodsArray",{get:a(function(){return this._methodsArray||(this._methodsArray=rn.toArray(this.methods))},"get")});function yf(r){return r._methodsArray=null,r}a(yf,"clearCache");et.prototype.get=a(function(e){return this.methods[e]||ir.prototype.get.call(this,e)},"get");et.prototype.resolveAll=a(function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return ir.prototype.resolve.call(this)},"resolveAll");et.prototype.add=a(function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof bl?(this.methods[e.name]=e,e.parent=this,yf(this)):ir.prototype.add.call(this,e)},"add");et.prototype.remove=a(function(e){if(e instanceof bl){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,yf(this)}return ir.prototype.remove.call(this,e)},"remove");et.prototype.create=a(function(e,t,i){for(var n=new p0.Service(e,t,i),s=0,o;s<this.methodsArray.length;++s){var l=rn.lcFirst((o=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");n[l]=rn.codegen(["r","c"],rn.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return n},"create")});var ms=m((qA,Sf)=>{"use strict";Sf.exports=bt;var g0=Ct();function bt(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)this[e[t]]=r[e[t]]}a(bt,"Message");bt.create=a(function(e){return this.$type.create(e)},"create");bt.encode=a(function(e,t){return this.$type.encode(e,t)},"encode");bt.encodeDelimited=a(function(e,t){return this.$type.encodeDelimited(e,t)},"encodeDelimited");bt.decode=a(function(e){return this.$type.decode(e)},"decode");bt.decodeDelimited=a(function(e){return this.$type.decodeDelimited(e)},"decodeDelimited");bt.verify=a(function(e){return this.$type.verify(e)},"verify");bt.fromObject=a(function(e){return this.$type.fromObject(e)},"fromObject");bt.toObject=a(function(e,t){return this.$type.toObject(e,t)},"toObject");bt.prototype.toJSON=a(function(){return this.$type.toObject(this,g0.toJSONOptions)},"toJSON")});var Tl=m((BA,Ef)=>{"use strict";Ef.exports=y0;var m0=dt(),Bt=Or(),Cf=_e();function v0(r){return"missing required '"+r.name+"'"}a(v0,"missing");function y0(r){var e=Cf.codegen(["r","l"],r.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(r.fieldsArray.filter(function(l){return l.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");r.group&&e("if((t&7)===4)")("break"),e("switch(t>>>3){");for(var t=0;t<r.fieldsArray.length;++t){var i=r._fieldsArray[t].resolve(),n=i.resolvedType instanceof m0?"int32":i.type,s="m"+Cf.safeProp(i.name);e("case %i: {",i.id),i.map?(e("if(%s===util.emptyObject)",s)("%s={}",s)("var c2 = r.uint32()+r.pos"),Bt.defaults[i.keyType]!==void 0?e("k=%j",Bt.defaults[i.keyType]):e("k=null"),Bt.defaults[n]!==void 0?e("value=%j",Bt.defaults[n]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",i.keyType)("case 2:"),Bt.basic[n]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",n),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),Bt.long[i.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',s):e("%s[k]=value",s)):i.repeated?(e("if(!(%s&&%s.length))",s,s)("%s=[]",s),Bt.packed[n]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",s,n)("}else"),Bt.basic[n]===void 0?e(i.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",s,t):e("%s.push(r.%s())",s,n)):Bt.basic[n]===void 0?e(i.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",s,t):e("%s=r.%s()",s,n),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<r._fieldsArray.length;++t){var o=r._fieldsArray[t];o.required&&e("if(!m.hasOwnProperty(%j))",o.name)("throw util.ProtocolError(%j,{instance:m})",v0(o))}return e("return m")}a(y0,"decoder")});var Al=m((zA,bf)=>{"use strict";bf.exports=C0;var _0=dt(),wl=_e();function tt(r,e){return r.name+": "+e+(r.repeated&&e!=="array"?"[]":r.map&&e!=="object"?"{k:"+r.keyType+"}":"")+" expected"}a(tt,"invalid");function Rl(r,e,t,i){if(e.resolvedType)if(e.resolvedType instanceof _0){r("switch(%s){",i)("default:")("return%j",tt(e,"enum value"));for(var n=Object.keys(e.resolvedType.values),s=0;s<n.length;++s)r("case %i:",e.resolvedType.values[n[s]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",t,i)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",i)("return%j",tt(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",tt(e,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',i)("return%j",tt(e,"number"));break;case"bool":r('if(typeof %s!=="boolean")',i)("return%j",tt(e,"boolean"));break;case"string":r("if(!util.isString(%s))",i)("return%j",tt(e,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",tt(e,"buffer"));break}return r}a(Rl,"genVerifyValue");function S0(r,e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.key32Re.test(%s))",t)("return%j",tt(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.key64Re.test(%s))",t)("return%j",tt(e,"integer|Long key"));break;case"bool":r("if(!util.key2Re.test(%s))",t)("return%j",tt(e,"boolean key"));break}return r}a(S0,"genVerifyKey");function C0(r){var e=wl.codegen(["m"],r.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),t=r.oneofsArray,i={};t.length&&e("var p={}");for(var n=0;n<r.fieldsArray.length;++n){var s=r._fieldsArray[n].resolve(),o="m"+wl.safeProp(s.name);if(s.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",o,s.name),s.map)e("if(!util.isObject(%s))",o)("return%j",tt(s,"object"))("var k=Object.keys(%s)",o)("for(var i=0;i<k.length;++i){"),S0(e,s,"k[i]"),Rl(e,s,n,o+"[k[i]]")("}");else if(s.repeated)e("if(!Array.isArray(%s))",o)("return%j",tt(s,"array"))("for(var i=0;i<%s.length;++i){",o),Rl(e,s,n,o+"[i]")("}");else{if(s.partOf){var l=wl.safeProp(s.partOf.name);i[s.partOf.name]===1&&e("if(p%s===1)",l)("return%j",s.partOf.name+": multiple values"),i[s.partOf.name]=1,e("p%s=1",l)}Rl(e,s,n,o)}s.optional&&e("}")}return e("return null")}a(C0,"verifier")});var Pl=m(wf=>{"use strict";var Tf=wf,nn=dt(),Tt=_e();function Ol(r,e,t,i){var n=!1;if(e.resolvedType)if(e.resolvedType instanceof nn){r("switch(d%s){",i);for(var s=e.resolvedType.values,o=Object.keys(s),l=0;l<o.length;++l)s[o[l]]===e.typeDefault&&!n&&(r("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',i,i,i),e.repeated||r("break"),n=!0),r("case%j:",o[l])("case %i:",s[o[l]])("m%s=%j",i,s[o[l]])("break");r("}")}else r('if(typeof d%s!=="object")',i)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,t,i);else{var c=!1;switch(e.type){case"double":case"float":r("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":r("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":r("m%s=d%s|0",i,i);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,c)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,c?"true":"");break;case"bytes":r('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length >= 0)",i)("m%s=d%s",i,i);break;case"string":r("m%s=String(d%s)",i,i);break;case"bool":r("m%s=Boolean(d%s)",i,i);break}}return r}a(Ol,"genValuePartial_fromObject");Tf.fromObject=a(function(e){var t=e.fieldsArray,i=Tt.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return i("return new this.ctor");i("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),o=Tt.safeProp(s.name);s.map?(i("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),Ol(i,s,n,o+"[ks[i]]")("}")("}")):s.repeated?(i("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),Ol(i,s,n,o+"[i]")("}")("}")):(s.resolvedType instanceof nn||i("if(d%s!=null){",o),Ol(i,s,n,o),s.resolvedType instanceof nn||i("}"))}return i("return m")},"fromObject");function Ml(r,e,t,i){if(e.resolvedType)e.resolvedType instanceof nn?r("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",i,t,i,i,t,i,i):r("d%s=types[%i].toObject(m%s,o)",i,t,i);else{var n=!1;switch(e.type){case"double":case"float":r("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":n=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,n?"true":"",i);break;case"bytes":r("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:r("d%s=m%s",i,i);break}}return r}a(Ml,"genValuePartial_toObject");Tf.toObject=a(function(e){var t=e.fieldsArray.slice().sort(Tt.compareFieldsById);if(!t.length)return Tt.codegen()("return {}");for(var i=Tt.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],o=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?n:t[l].map?s:o).push(t[l]);if(n.length){for(i("if(o.arrays||o.defaults){"),l=0;l<n.length;++l)i("d%s=[]",Tt.safeProp(n[l].name));i("}")}if(s.length){for(i("if(o.objects||o.defaults){"),l=0;l<s.length;++l)i("d%s={}",Tt.safeProp(s[l].name));i("}")}if(o.length){for(i("if(o.defaults){"),l=0;l<o.length;++l){var c=o[l],u=Tt.safeProp(c.name);if(c.resolvedType instanceof nn)i("d%s=o.enums===String?%j:%j",u,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)i("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",u)("}else")("d%s=o.longs===String?%j:%i",u,c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var d="["+Array.prototype.slice.call(c.typeDefault).join(",")+"]";i("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%s",u,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else i("d%s=%j",u,c.typeDefault)}i("}")}var h=!1;for(l=0;l<t.length;++l){var c=t[l],p=e._fieldsArray.indexOf(c),u=Tt.safeProp(c.name);c.map?(h||(h=!0,i("var ks2")),i("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),Ml(i,c,p,u+"[ks2[j]]")("}")):c.repeated?(i("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),Ml(i,c,p,u+"[j]")("}")):(i("if(m%s!=null&&m.hasOwnProperty(%j)){",u,c.name),Ml(i,c,p,u),c.partOf&&i("if(o.oneofs)")("d%s=%j",Tt.safeProp(c.partOf.name),c.name)),i("}")}return i("return d")},"toObject")});var Nl=m(Rf=>{"use strict";var E0=Rf,b0=ms();E0[".google.protobuf.Any"]={fromObject:a(function(r){if(r&&r["@type"]){var e=r["@type"].substring(r["@type"].lastIndexOf("/")+1),t=this.lookup(e);if(t){var i=r["@type"].charAt(0)==="."?r["@type"].slice(1):r["@type"];return i.indexOf("/")===-1&&(i="/"+i),this.create({type_url:i,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},"fromObject"),toObject:a(function(r,e){var t="type.googleapis.com/",i="",n="";if(e&&e.json&&r.type_url&&r.value){n=r.type_url.substring(r.type_url.lastIndexOf("/")+1),i=r.type_url.substring(0,r.type_url.lastIndexOf("/")+1);var s=this.lookup(n);s&&(r=s.decode(r.value))}if(!(r instanceof this.ctor)&&r instanceof b0){var o=r.$type.toObject(r,e),l=r.$type.fullName[0]==="."?r.$type.fullName.slice(1):r.$type.fullName;return i===""&&(i=t),n=i+l,o["@type"]=n,o}return this.toObject(r,e)},"toObject")}});var _s=m((VA,Of)=>{"use strict";Of.exports=Q;var ht=ui();((Q.prototype=Object.create(ht.prototype)).constructor=Q).className="Type";var T0=dt(),xl=oi(),vs=rr(),w0=fs(),R0=gs(),kl=ms(),Il=ls(),A0=as(),Re=_e(),O0=Dl(),M0=Tl(),P0=Al(),Af=Pl(),N0=Nl();function Q(r,e){ht.call(this,r,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}a(Q,"Type");Object.defineProperties(Q.prototype,{fieldsById:{get:a(function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e<r.length;++e){var t=this.fields[r[e]],i=t.id;if(this._fieldsById[i])throw Error("duplicate id "+i+" in "+this);this._fieldsById[i]=t}return this._fieldsById},"get")},fieldsArray:{get:a(function(){return this._fieldsArray||(this._fieldsArray=Re.toArray(this.fields))},"get")},oneofsArray:{get:a(function(){return this._oneofsArray||(this._oneofsArray=Re.toArray(this.oneofs))},"get")},ctor:{get:a(function(){return this._ctor||(this.ctor=Q.generateConstructor(this)())},"get"),set:a(function(r){var e=r.prototype;e instanceof kl||((r.prototype=new kl).constructor=r,Re.merge(r.prototype,e)),r.$type=r.prototype.$type=this,Re.merge(r,kl,!0),this._ctor=r;for(var t=0;t<this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var i={};for(t=0;t<this.oneofsArray.length;++t)i[this._oneofsArray[t].resolve().name]={get:Re.oneOfGetter(this._oneofsArray[t].oneof),set:Re.oneOfSetter(this._oneofsArray[t].oneof)};t&&Object.defineProperties(r.prototype,i)},"set")}});Q.generateConstructor=a(function(e){for(var t=Re.codegen(["p"],e.name),i=0,n;i<e.fieldsArray.length;++i)(n=e._fieldsArray[i]).map?t("this%s={}",Re.safeProp(n.name)):n.repeated&&t("this%s=[]",Re.safeProp(n.name));return t("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},"generateConstructor");function ys(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}a(ys,"clearCache");Q.fromJSON=a(function(e,t){var i=new Q(e,t.options);i.extensions=t.extensions,i.reserved=t.reserved;for(var n=Object.keys(t.fields),s=0;s<n.length;++s)i.add((typeof t.fields[n[s]].keyType<"u"?w0.fromJSON:vs.fromJSON)(n[s],t.fields[n[s]]));if(t.oneofs)for(n=Object.keys(t.oneofs),s=0;s<n.length;++s)i.add(xl.fromJSON(n[s],t.oneofs[n[s]]));if(t.nested)for(n=Object.keys(t.nested),s=0;s<n.length;++s){var o=t.nested[n[s]];i.add((o.id!==void 0?vs.fromJSON:o.fields!==void 0?Q.fromJSON:o.values!==void 0?T0.fromJSON:o.methods!==void 0?R0.fromJSON:ht.fromJSON)(n[s],o))}return t.extensions&&t.extensions.length&&(i.extensions=t.extensions),t.reserved&&t.reserved.length&&(i.reserved=t.reserved),t.group&&(i.group=!0),t.comment&&(i.comment=t.comment),i},"fromJSON");Q.prototype.toJSON=a(function(e){var t=ht.prototype.toJSON.call(this,e),i=e?!!e.keepComments:!1;return Re.toObject(["options",t&&t.options||void 0,"oneofs",ht.arrayToJSON(this.oneofsArray,e),"fields",ht.arrayToJSON(this.fieldsArray.filter(function(n){return!n.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",i?this.comment:void 0])},"toJSON");Q.prototype.resolveAll=a(function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var i=this.oneofsArray;for(t=0;t<i.length;)i[t++].resolve();return ht.prototype.resolveAll.call(this)},"resolveAll");Q.prototype.get=a(function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},"get");Q.prototype.add=a(function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof vs&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),ys(this)}return e instanceof xl?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),ys(this)):ht.prototype.add.call(this,e)},"add");Q.prototype.remove=a(function(e){if(e instanceof vs&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),ys(this)}if(e instanceof xl){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),ys(this)}return ht.prototype.remove.call(this,e)},"remove");Q.prototype.isReservedId=a(function(e){return ht.isReservedId(this.reserved,e)},"isReservedId");Q.prototype.isReservedName=a(function(e){return ht.isReservedName(this.reserved,e)},"isReservedName");Q.prototype.create=a(function(e){return new this.ctor(e)},"create");Q.prototype.setup=a(function(){for(var e=this.fullName,t=[],i=0;i<this.fieldsArray.length;++i)t.push(this._fieldsArray[i].resolve().resolvedType);this.encode=O0(this)({Writer:A0,types:t,util:Re}),this.decode=M0(this)({Reader:Il,types:t,util:Re}),this.verify=P0(this)({types:t,util:Re}),this.fromObject=Af.fromObject(this)({types:t,util:Re}),this.toObject=Af.toObject(this)({types:t,util:Re});var n=N0[e];if(n){var s=Object.create(this);s.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(s),s.toObject=this.toObject,this.toObject=n.toObject.bind(s)}return this},"setup");Q.prototype.encode=a(function(e,t){return this.setup().encode(e,t)},"encode_setup");Q.prototype.encodeDelimited=a(function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},"encodeDelimited");Q.prototype.decode=a(function(e,t){return this.setup().decode(e,t)},"decode_setup");Q.prototype.decodeDelimited=a(function(e){return e instanceof Il||(e=Il.create(e)),this.decode(e,e.uint32())},"decodeDelimited");Q.prototype.verify=a(function(e){return this.setup().verify(e)},"verify_setup");Q.prototype.fromObject=a(function(e){return this.setup().fromObject(e)},"fromObject");Q.prototype.toObject=a(function(e,t){return this.setup().toObject(e,t)},"toObject");Q.d=a(function(e){return a(function(i){Re.decorateType(i,e)},"typeDecorator")},"decorateType")});var Es=m((YA,If)=>{"use strict";If.exports=ze;var Cs=ui();((ze.prototype=Object.create(Cs.prototype)).constructor=ze).className="Root";var ql=rr(),Pf=dt(),k0=oi(),nr=_e(),Nf,Ll,sn;function ze(r){Cs.call(this,"",r),this.deferred=[],this.files=[]}a(ze,"Root");ze.fromJSON=a(function(e,t){return t||(t=new ze),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},"fromJSON");ze.prototype.resolvePath=nr.path.resolve;ze.prototype.fetch=nr.fetch;function kf(){}a(kf,"SYNC");ze.prototype.load=a(function r(e,t,i){typeof t=="function"&&(i=t,t=void 0);var n=this;if(!i)return nr.asPromise(r,n,e,t);var s=i===kf;function o(g,y){if(i){if(s)throw g;var v=i;i=null,v(g,y)}}a(o,"finish");function l(g){var y=g.lastIndexOf("google/protobuf/");if(y>-1){var v=g.substring(y);if(v in sn)return v}return null}a(l,"getBundledFileName");function c(g,y){try{if(nr.isString(y)&&y.charAt(0)==="{"&&(y=JSON.parse(y)),!nr.isString(y))n.setOptions(y.options).addJSON(y.nested);else{Ll.filename=g;var v=Ll(y,n,t),C,S=0;if(v.imports)for(;S<v.imports.length;++S)(C=l(v.imports[S])||n.resolvePath(g,v.imports[S]))&&u(C);if(v.weakImports)for(S=0;S<v.weakImports.length;++S)(C=l(v.weakImports[S])||n.resolvePath(g,v.weakImports[S]))&&u(C,!0)}}catch(_){o(_)}!s&&!d&&o(null,n)}a(c,"process");function u(g,y){if(g=l(g)||g,!(n.files.indexOf(g)>-1)){if(n.files.push(g),g in sn){s?c(g,sn[g]):(++d,setTimeout(function(){--d,c(g,sn[g])}));return}if(s){var v;try{v=nr.fs.readFileSync(g).toString("utf8")}catch(C){y||o(C);return}c(g,v)}else++d,n.fetch(g,function(C,S){if(--d,!!i){if(C){y?d||o(null,n):o(C);return}c(g,S)}})}}a(u,"fetch");var d=0;nr.isString(e)&&(e=[e]);for(var h=0,p;h<e.length;++h)(p=n.resolvePath("",e[h]))&&u(p);if(s)return n;d||o(null,n)},"load");ze.prototype.loadSync=a(function(e,t){if(!nr.isNode)throw Error("not supported");return this.load(e,t,kf)},"loadSync");ze.prototype.resolveAll=a(function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return Cs.prototype.resolveAll.call(this)},"resolveAll");var Ss=/^[A-Z]/;function Mf(r,e){var t=e.parent.lookup(e.extend);if(t){var i=new ql(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(i.name)||(i.declaringField=e,e.extensionField=i,t.add(i)),!0}return!1}a(Mf,"tryHandleExtension");ze.prototype._handleAdd=a(function(e){if(e instanceof ql)e.extend!==void 0&&!e.extensionField&&(Mf(this,e)||this.deferred.push(e));else if(e instanceof Pf)Ss.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof k0)){if(e instanceof Nf)for(var t=0;t<this.deferred.length;)Mf(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var i=0;i<e.nestedArray.length;++i)this._handleAdd(e._nestedArray[i]);Ss.test(e.name)&&(e.parent[e.name]=e)}},"_handleAdd");ze.prototype._handleRemove=a(function(e){if(e instanceof ql){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof Pf)Ss.test(e.name)&&delete e.parent[e.name];else if(e instanceof Cs){for(var i=0;i<e.nestedArray.length;++i)this._handleRemove(e._nestedArray[i]);Ss.test(e.name)&&delete e.parent[e.name]}},"_handleRemove");ze._configure=function(r,e,t){Nf=r,Ll=e,sn=t}});var _e=m((XA,Df)=>{"use strict";var le=Df.exports=Ct(),xf=pl(),Fl,Bl;le.codegen=Qh();le.fetch=ef();le.path=nf();le.fs=le.inquire("fs");le.toArray=a(function(e){if(e){for(var t=Object.keys(e),i=new Array(t.length),n=0;n<t.length;)i[n]=e[t[n++]];return i}return[]},"toArray");le.toObject=a(function(e){for(var t={},i=0;i<e.length;){var n=e[i++],s=e[i++];s!==void 0&&(t[n]=s)}return t},"toObject");var I0=/\\/g,x0=/"/g;le.isReserved=a(function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},"isReserved");le.safeProp=a(function(e){return!/^[$\w_]+$/.test(e)||le.isReserved(e)?'["'+e.replace(I0,"\\\\").replace(x0,'\\"')+'"]':"."+e},"safeProp");le.ucFirst=a(function(e){return e.charAt(0).toUpperCase()+e.substring(1)},"ucFirst");var D0=/_([a-z])/g;le.camelCase=a(function(e){return e.substring(0,1)+e.substring(1).replace(D0,function(t,i){return i.toUpperCase()})},"camelCase");le.compareFieldsById=a(function(e,t){return e.id-t.id},"compareFieldsById");le.decorateType=a(function(e,t){if(e.$type)return t&&e.$type.name!==t&&(le.decorateRoot.remove(e.$type),e.$type.name=t,le.decorateRoot.add(e.$type)),e.$type;Fl||(Fl=_s());var i=new Fl(t||e.name);return le.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i},"decorateType");var L0=0;le.decorateEnum=a(function(e){if(e.$type)return e.$type;Bl||(Bl=dt());var t=new Bl("Enum"+L0++,e);return le.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},"decorateEnum");le.setProperty=a(function(e,t,i){function n(s,o,l){var c=o.shift();if(c==="__proto__"||c==="prototype")return s;if(o.length>0)s[c]=n(s[c]||{},o,l);else{var u=s[c];u&&(l=[].concat(u).concat(l)),s[c]=l}return s}if(a(n,"setProp"),typeof e!="object")throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return t=t.split("."),n(e,t,i)},"setProperty");Object.defineProperty(le,"decorateRoot",{get:a(function(){return xf.decorated||(xf.decorated=new(Es()))},"get")})});var Mr=m((ZA,Lf)=>{"use strict";Lf.exports=He;He.className="ReflectionObject";var bs=_e(),Ts;function He(r,e){if(!bs.isString(r))throw TypeError("name must be a string");if(e&&!bs.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=r,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}a(He,"ReflectionObject");Object.defineProperties(He.prototype,{root:{get:a(function(){for(var r=this;r.parent!==null;)r=r.parent;return r},"get")},fullName:{get:a(function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(".")},"get")}});He.prototype.toJSON=a(function(){throw Error()},"toJSON");He.prototype.onAdd=a(function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof Ts&&t._handleAdd(this)},"onAdd");He.prototype.onRemove=a(function(e){var t=e.root;t instanceof Ts&&t._handleRemove(this),this.parent=null,this.resolved=!1},"onRemove");He.prototype.resolve=a(function(){return this.resolved?this:(this.root instanceof Ts&&(this.resolved=!0),this)},"resolve");He.prototype.getOption=a(function(e){if(this.options)return this.options[e]},"getOption");He.prototype.setOption=a(function(e,t,i){return(!i||!this.options||this.options[e]===void 0)&&((this.options||(this.options={}))[e]=t),this},"setOption");He.prototype.setParsedOption=a(function(e,t,i){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(i){var s=n.find(function(c){return Object.prototype.hasOwnProperty.call(c,e)});if(s){var o=s[e];bs.setProperty(o,i,t)}else s={},s[e]=bs.setProperty({},i,t),n.push(s)}else{var l={};l[e]=t,n.push(l)}return this},"setParsedOption");He.prototype.setOptions=a(function(e,t){if(e)for(var i=Object.keys(e),n=0;n<i.length;++n)this.setOption(i[n],e[i[n]],t);return this},"setOptions");He.prototype.toString=a(function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},"toString");He._configure=function(r){Ts=r}});var dt=m((tO,Bf)=>{"use strict";Bf.exports=wt;var qf=Mr();((wt.prototype=Object.create(qf.prototype)).constructor=wt).className="Enum";var Ff=ui(),ws=_e();function wt(r,e,t,i,n,s){if(qf.call(this,r,t),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=n||{},this.valuesOptions=s,this.reserved=void 0,e)for(var o=Object.keys(e),l=0;l<o.length;++l)typeof e[o[l]]=="number"&&(this.valuesById[this.values[o[l]]=e[o[l]]]=o[l])}a(wt,"Enum");wt.fromJSON=a(function(e,t){var i=new wt(e,t.values,t.options,t.comment,t.comments);return i.reserved=t.reserved,i},"fromJSON");wt.prototype.toJSON=a(function(e){var t=e?!!e.keepComments:!1;return ws.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},"toJSON");wt.prototype.add=a(function(e,t,i,n){if(!ws.isString(e))throw TypeError("name must be a string");if(!ws.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=i||null,this},"add");wt.prototype.remove=a(function(e){if(!ws.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(t==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},"remove");wt.prototype.isReservedId=a(function(e){return Ff.isReservedId(this.reserved,e)},"isReservedId");wt.prototype.isReservedName=a(function(e){return Ff.isReservedName(this.reserved,e)},"isReservedName")});var Dl=m((iO,zf)=>{"use strict";zf.exports=F0;var q0=dt(),Ul=Or(),zl=_e();function Uf(r,e,t,i){return e.resolvedType.group?r("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,i,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):r("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,i,(e.id<<3|2)>>>0)}a(Uf,"genTypePartial");function F0(r){for(var e=zl.codegen(["m","w"],r.name+"$encode")("if(!w)")("w=Writer.create()"),t,i,n=r.fieldsArray.slice().sort(zl.compareFieldsById),t=0;t<n.length;++t){var s=n[t].resolve(),o=r._fieldsArray.indexOf(s),l=s.resolvedType instanceof q0?"int32":s.type,c=Ul.basic[l];i="m"+zl.safeProp(s.name),s.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",i,s.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(s.id<<3|2)>>>0,8|Ul.mapKey[s.keyType],s.keyType),c===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",o,i):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,l,i),e("}")("}")):s.repeated?(e("if(%s!=null&&%s.length){",i,i),s.packed&&Ul.packed[l]!==void 0?e("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",l,i)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",i),c===void 0?Uf(e,s,o,i+"[i]"):e("w.uint32(%i).%s(%s[i])",(s.id<<3|c)>>>0,l,i)),e("}")):(s.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),c===void 0?Uf(e,s,o,i):e("w.uint32(%i).%s(%s)",(s.id<<3|c)>>>0,l,i))}return e("return w")}a(F0,"encoder")});var jf=m((sO,Hf)=>{"use strict";var z=Hf.exports=Kh();z.build="light";function B0(r,e,t){return typeof e=="function"?(t=e,e=new z.Root):e||(e=new z.Root),e.load(r,t)}a(B0,"load");z.load=B0;function U0(r,e){return e||(e=new z.Root),e.loadSync(r)}a(U0,"loadSync");z.loadSync=U0;z.encoder=Dl();z.decoder=Tl();z.verifier=Al();z.converter=Pl();z.ReflectionObject=Mr();z.Namespace=ui();z.Root=Es();z.Enum=dt();z.Type=_s();z.Field=rr();z.OneOf=oi();z.MapField=fs();z.Service=gs();z.Method=ps();z.Message=ms();z.wrappers=Nl();z.types=Or();z.util=_e();z.ReflectionObject._configure(z.Root);z.Namespace._configure(z.Type,z.Service,z.Enum);z.Root._configure(z.Type);z.Field._configure(z.Type)});var jl=m((oO,$f)=>{"use strict";$f.exports=Wf;var Hl=/[\s{}=;:[\],'"()<>]/g,z0=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,H0=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,j0=/^ *[*/]+ */,G0=/^\s*\*?\/*/,W0=/\n/g,$0=/\s/,V0=/\\(.?)/g,J0={0:"\0",r:"\r",n:`
10
+ `,t:" "};function Gf(r){return r.replace(V0,function(e,t){switch(t){case"\\":case"":return t;default:return J0[t]||""}})}a(Gf,"unescape");Wf.unescape=Gf;function Wf(r,e){r=r.toString();var t=0,i=r.length,n=1,s=0,o={},l=[],c=null;function u(A){return Error("illegal "+A+" (line "+n+")")}a(u,"illegal");function d(){var A=c==="'"?H0:z0;A.lastIndex=t-1;var L=A.exec(r);if(!L)throw u("string");return t=A.lastIndex,C(c),c=null,Gf(L[1])}a(d,"readString");function h(A){return r.charAt(A)}a(h,"charAt");function p(A,L,D){var B={type:r.charAt(A++),lineEmpty:!1,leading:D},Z;e?Z=2:Z=3;var se=A-Z,V;do if(--se<0||(V=r.charAt(se))===`
11
+ `){B.lineEmpty=!0;break}while(V===" "||V===" ");for(var E=r.substring(A,L).split(W0),re=0;re<E.length;++re)E[re]=E[re].replace(e?G0:j0,"").trim();B.text=E.join(`
12
+ `).trim(),o[n]=B,s=n}a(p,"setComment");function g(A){var L=y(A),D=r.substring(A,L),B=/^\s*\/\//.test(D);return B}a(g,"isDoubleSlashCommentLine");function y(A){for(var L=A;L<i&&h(L)!==`
13
+ `;)L++;return L}a(y,"findEndOfLine");function v(){if(l.length>0)return l.shift();if(c)return d();var A,L,D,B,Z,se=t===0;do{if(t===i)return null;for(A=!1;$0.test(D=h(t));)if(D===`
14
+ `&&(se=!0,++n),++t===i)return null;if(h(t)==="/"){if(++t===i)throw u("comment");if(h(t)==="/")if(e){if(B=t,Z=!1,g(t-1)){Z=!0;do if(t=y(t),t===i||(t++,!se))break;while(g(t))}else t=Math.min(i,y(t)+1);Z&&(p(B,t,se),se=!0),n++,A=!0}else{for(Z=h(B=t+1)==="/";h(++t)!==`
15
+ `;)if(t===i)return null;++t,Z&&(p(B,t-1,se),se=!0),++n,A=!0}else if((D=h(t))==="*"){B=t+1,Z=e||h(B)==="*";do{if(D===`
16
+ `&&++n,++t===i)throw u("comment");L=D,D=h(t)}while(L!=="*"||D!=="/");++t,Z&&(p(B,t-2,se),se=!0),A=!0}else return"/"}}while(A);var V=t;Hl.lastIndex=0;var E=Hl.test(h(V++));if(!E)for(;V<i&&!Hl.test(h(V));)++V;var re=r.substring(t,t=V);return(re==='"'||re==="'")&&(c=re),re}a(v,"next");function C(A){l.push(A)}a(C,"push");function S(){if(!l.length){var A=v();if(A===null)return null;C(A)}return l[0]}a(S,"peek");function _(A,L){var D=S(),B=D===A;if(B)return v(),!0;if(!L)throw u("token '"+D+"', '"+A+"' expected");return!1}a(_,"skip");function P(A){var L=null,D;return A===void 0?(D=o[n-1],delete o[n-1],D&&(e||D.type==="*"||D.lineEmpty)&&(L=D.leading?D.text:null)):(s<A&&S(),D=o[A],delete o[A],D&&!D.lineEmpty&&(e||D.type==="/")&&(L=D.leading?null:D.text)),L}return a(P,"cmnt"),Object.defineProperty({next:v,peek:S,push:C,skip:_,cmnt:P},"line",{get:a(function(){return n},"get")})}a(Wf,"tokenize")});var Qf=m((cO,Xf)=>{"use strict";Xf.exports=Ut;Ut.filename=null;Ut.defaults={keepCase:!1};var Y0=jl(),Vf=Es(),Jf=_s(),Yf=rr(),K0=fs(),Kf=oi(),X0=dt(),Q0=gs(),Z0=ps(),Gl=Or(),Wl=_e(),eS=/^[1-9][0-9]*$/,tS=/^-?[1-9][0-9]*$/,rS=/^0[x][0-9a-fA-F]+$/,iS=/^-?0[x][0-9a-fA-F]+$/,nS=/^0[0-7]+$/,sS=/^-?0[0-7]+$/,aS=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Rt=/^[a-zA-Z_][a-zA-Z_0-9]*$/,At=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,oS=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function Ut(r,e,t){e instanceof Vf||(t=e,e=new Vf),t||(t=Ut.defaults);var i=t.preferTrailingComment||!1,n=Y0(r,t.alternateCommentMode||!1),s=n.next,o=n.push,l=n.peek,c=n.skip,u=n.cmnt,d=!0,h,p,g,y,v=!1,C=e,S=t.keepCase?function(T){return T}:Wl.camelCase;function _(T,w,R){var x=Ut.filename;return R||(Ut.filename=null),Error("illegal "+(w||"token")+" '"+T+"' ("+(x?x+", ":"")+"line "+n.line+")")}a(_,"illegal");function P(){var T=[],w;do{if((w=s())!=='"'&&w!=="'")throw _(w);T.push(s()),c(w),w=l()}while(w==='"'||w==="'");return T.join("")}a(P,"readString");function A(T){var w=s();switch(w){case"'":case'"':return o(w),P();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return D(w,!0)}catch{if(T&&At.test(w))return w;throw _(w,"value")}}a(A,"readValue");function L(T,w){var R,x;do w&&((R=l())==='"'||R==="'")?T.push(P()):T.push([x=B(s()),c("to",!0)?B(s()):x]);while(c(",",!0));var k={options:void 0};k.setOption=function(q,ie){this.options===void 0&&(this.options={}),this.options[q]=ie},re(k,a(function(ie){if(ie==="option")X(k,ie),c(";");else throw _(ie)},"parseRange_block"),a(function(){Ce(k)},"parseRange_line"))}a(L,"readRanges");function D(T,w){var R=1;switch(T.charAt(0)==="-"&&(R=-1,T=T.substring(1)),T){case"inf":case"INF":case"Inf":return R*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(eS.test(T))return R*parseInt(T,10);if(rS.test(T))return R*parseInt(T,16);if(nS.test(T))return R*parseInt(T,8);if(aS.test(T))return R*parseFloat(T);throw _(T,"number",w)}a(D,"parseNumber");function B(T,w){switch(T){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!w&&T.charAt(0)==="-")throw _(T,"id");if(tS.test(T))return parseInt(T,10);if(iS.test(T))return parseInt(T,16);if(sS.test(T))return parseInt(T,8);throw _(T,"id")}a(B,"parseId");function Z(){if(h!==void 0)throw _("package");if(h=s(),!At.test(h))throw _(h,"name");C=C.define(h),c(";")}a(Z,"parsePackage");function se(){var T=l(),w;switch(T){case"weak":w=g||(g=[]),s();break;case"public":s();default:w=p||(p=[]);break}T=P(),c(";"),w.push(T)}a(se,"parseImport");function V(){if(c("="),y=P(),v=y==="proto3",!v&&y!=="proto2")throw _(y,"syntax");c(";")}a(V,"parseSyntax");function E(T,w){switch(w){case"option":return X(T,w),c(";"),!0;case"message":return b(T,w),!0;case"enum":return J(T,w),!0;case"service":return ue(T,w),!0;case"extend":return Hr(T,w),!0}return!1}a(E,"parseCommon");function re(T,w,R){var x=n.line;if(T&&(typeof T.comment!="string"&&(T.comment=u()),T.filename=Ut.filename),c("{",!0)){for(var k;(k=s())!=="}";)w(k);c(";",!0)}else R&&R(),c(";"),T&&(typeof T.comment!="string"||i)&&(T.comment=u(x)||T.comment)}a(re,"ifBlock");function b(T,w){if(!Rt.test(w=s()))throw _(w,"type name");var R=new Jf(w);re(R,a(function(k){if(!E(R,k))switch(k){case"map":H(R,k);break;case"required":case"repeated":f(R,k);break;case"optional":v?f(R,"proto3_optional"):f(R,"optional");break;case"oneof":ee(R,k);break;case"extensions":L(R.extensions||(R.extensions=[]));break;case"reserved":L(R.reserved||(R.reserved=[]),!0);break;default:if(!v||!At.test(k))throw _(k);o(k),f(R,"optional");break}},"parseType_block")),T.add(R)}a(b,"parseType");function f(T,w,R){var x=s();if(x==="group"){O(T,w);return}for(;x.endsWith(".")||l().startsWith(".");)x+=s();if(!At.test(x))throw _(x,"type");var k=s();if(!Rt.test(k))throw _(k,"name");k=S(k),c("=");var q=new Yf(k,B(s()),x,w,R);if(re(q,a(function(Be){if(Be==="option")X(q,Be),c(";");else throw _(Be)},"parseField_block"),a(function(){Ce(q)},"parseField_line")),w==="proto3_optional"){var ie=new Kf("_"+k);q.setOption("proto3_optional",!0),ie.add(q),T.add(ie)}else T.add(q);!v&&q.repeated&&(Gl.packed[x]!==void 0||Gl.basic[x]===void 0)&&q.setOption("packed",!1,!0)}a(f,"parseField");function O(T,w){var R=s();if(!Rt.test(R))throw _(R,"name");var x=Wl.lcFirst(R);R===x&&(R=Wl.ucFirst(R)),c("=");var k=B(s()),q=new Jf(R);q.group=!0;var ie=new Yf(x,k,R,w);ie.filename=Ut.filename,re(q,a(function(Be){switch(Be){case"option":X(q,Be),c(";");break;case"required":case"repeated":f(q,Be);break;case"optional":v?f(q,"proto3_optional"):f(q,"optional");break;case"message":b(q,Be);break;case"enum":J(q,Be);break;default:throw _(Be)}},"parseGroup_block")),T.add(q).add(ie)}a(O,"parseGroup");function H(T){c("<");var w=s();if(Gl.mapKey[w]===void 0)throw _(w,"type");c(",");var R=s();if(!At.test(R))throw _(R,"type");c(">");var x=s();if(!Rt.test(x))throw _(x,"name");c("=");var k=new K0(S(x),B(s()),w,R);re(k,a(function(ie){if(ie==="option")X(k,ie),c(";");else throw _(ie)},"parseMapField_block"),a(function(){Ce(k)},"parseMapField_line")),T.add(k)}a(H,"parseMapField");function ee(T,w){if(!Rt.test(w=s()))throw _(w,"name");var R=new Kf(S(w));re(R,a(function(k){k==="option"?(X(R,k),c(";")):(o(k),f(R,"optional"))},"parseOneOf_block")),T.add(R)}a(ee,"parseOneOf");function J(T,w){if(!Rt.test(w=s()))throw _(w,"name");var R=new X0(w);re(R,a(function(k){switch(k){case"option":X(R,k),c(";");break;case"reserved":L(R.reserved||(R.reserved=[]),!0);break;default:ae(R,k)}},"parseEnum_block")),T.add(R)}a(J,"parseEnum");function ae(T,w){if(!Rt.test(w))throw _(w,"name");c("=");var R=B(s(),!0),x={options:void 0};x.setOption=function(k,q){this.options===void 0&&(this.options={}),this.options[k]=q},re(x,a(function(q){if(q==="option")X(x,q),c(";");else throw _(q)},"parseEnumValue_block"),a(function(){Ce(x)},"parseEnumValue_line")),T.add(w,R,x.comment,x.options)}a(ae,"parseEnumValue");function X(T,w){var R=c("(",!0);if(!At.test(w=s()))throw _(w,"name");var x=w,k=x,q;R&&(c(")"),x="("+x+")",k=x,w=l(),oS.test(w)&&(q=w.slice(1),x+=w,s())),c("=");var ie=Ae(T,x);ne(T,k,ie,q)}a(X,"parseOption");function Ae(T,w){if(c("{",!0)){for(var R={};!c("}",!0);){if(!Rt.test(Te=s()))throw _(Te,"name");if(Te===null)throw _(Te,"end of input");var x,k=Te;if(c(":",!0),l()==="{")x=Ae(T,w+"."+Te);else if(l()==="["){x=[];var q;if(c("[",!0)){do q=A(!0),x.push(q);while(c(",",!0));c("]"),typeof q<"u"&&ce(T,w+"."+Te,q)}}else x=A(!0),ce(T,w+"."+Te,x);var ie=R[k];ie&&(x=[].concat(ie).concat(x)),R[k]=x,c(",",!0),c(";",!0)}return R}var Vt=A(!0);return ce(T,w,Vt),Vt}a(Ae,"parseOptionValue");function ce(T,w,R){T.setOption&&T.setOption(w,R)}a(ce,"setOption");function ne(T,w,R,x){T.setParsedOption&&T.setParsedOption(w,R,x)}a(ne,"setParsedOption");function Ce(T){if(c("[",!0)){do X(T,"option");while(c(",",!0));c("]")}return T}a(Ce,"parseInlineOptions");function ue(T,w){if(!Rt.test(w=s()))throw _(w,"service name");var R=new Q0(w);re(R,a(function(k){if(!E(R,k))if(k==="rpc")Oe(R,k);else throw _(k)},"parseService_block")),T.add(R)}a(ue,"parseService");function Oe(T,w){var R=u(),x=w;if(!Rt.test(w=s()))throw _(w,"name");var k=w,q,ie,Vt,Be;if(c("("),c("stream",!0)&&(ie=!0),!At.test(w=s())||(q=w,c(")"),c("returns"),c("("),c("stream",!0)&&(Be=!0),!At.test(w=s())))throw _(w);Vt=w,c(")");var An=new Z0(k,x,q,Vt,ie,Be);An.comment=R,re(An,a(function(Ja){if(Ja==="option")X(An,Ja),c(";");else throw _(Ja)},"parseMethod_block")),T.add(An)}a(Oe,"parseMethod");function Hr(T,w){if(!At.test(w=s()))throw _(w,"reference");var R=w;re(null,a(function(k){switch(k){case"required":case"repeated":f(T,k,R);break;case"optional":v?f(T,"proto3_optional",R):f(T,"optional",R);break;default:if(!v||!At.test(k))throw _(k);o(k),f(T,"optional",R);break}},"parseExtension_block"))}a(Hr,"parseExtension");for(var Te;(Te=s())!==null;)switch(Te){case"package":if(!d)throw _(Te);Z();break;case"import":if(!d)throw _(Te);se();break;case"syntax":if(!d)throw _(Te);V();break;case"option":X(C,Te),c(";");break;default:if(E(C,Te)){d=!1;continue}throw _(Te)}return Ut.filename=null,{package:h,imports:p,weakImports:g,syntax:y,root:e}}a(Ut,"parse")});var tp=m((dO,ep)=>{"use strict";ep.exports=ft;var lS=/\/|\./;function ft(r,e){lS.test(r)||(r="google/protobuf/"+r+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),ft[r]=e}a(ft,"common");ft("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var Zf;ft("duration",{Duration:Zf={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});ft("timestamp",{Timestamp:Zf});ft("empty",{Empty:{fields:{}}});ft("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});ft("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});ft("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});ft.get=a(function(e){return ft[e]||null},"get")});var ip=m((fO,rp)=>{"use strict";var sr=rp.exports=jf();sr.build="full";sr.tokenize=jl();sr.parse=Qf();sr.common=tp();sr.Root._configure(sr.Type,sr.parse,sr.common)});var Rs=m((pO,np)=>{"use strict";np.exports=ip()});var $l=m((gO,cS)=>{cS.exports={nested:{google:{nested:{protobuf:{nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}}}}}}});var cp=m((F,lp)=>{"use strict";var Ne=Rs();lp.exports=F=Ne.descriptor=Ne.Root.fromJSON($l()).lookup(".google.protobuf");var sp=Ne.Namespace,an=Ne.Root,zt=Ne.Enum,ar=Ne.Type,or=Ne.Field,uS=Ne.MapField,As=Ne.OneOf,on=Ne.Service,Os=Ne.Method;an.fromDescriptor=a(function(e){typeof e.length=="number"&&(e=F.FileDescriptorSet.decode(e));var t=new an;if(e.file)for(var i,n,s=0,o;s<e.file.length;++s){if(n=t,(i=e.file[s]).package&&i.package.length&&(n=t.define(i.package)),i.name&&i.name.length&&t.files.push(n.filename=i.name),i.messageType)for(o=0;o<i.messageType.length;++o)n.add(ar.fromDescriptor(i.messageType[o],i.syntax));if(i.enumType)for(o=0;o<i.enumType.length;++o)n.add(zt.fromDescriptor(i.enumType[o]));if(i.extension)for(o=0;o<i.extension.length;++o)n.add(or.fromDescriptor(i.extension[o]));if(i.service)for(o=0;o<i.service.length;++o)n.add(on.fromDescriptor(i.service[o]));var l=hi(i.options,F.FileOptions);if(l){var c=Object.keys(l);for(o=0;o<c.length;++o)n.setOption(c[o],l[c[o]])}}return t},"fromDescriptor");an.prototype.toDescriptor=a(function(e){var t=F.FileDescriptorSet.create();return ap(this,t.file,e),t},"toDescriptor");function ap(r,e,t){var i=F.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});t&&(i.syntax=t),r instanceof an||(i.package=r.fullName.substring(1));for(var n=0,s;n<r.nestedArray.length;++n)(s=r._nestedArray[n])instanceof ar?i.messageType.push(s.toDescriptor(t)):s instanceof zt?i.enumType.push(s.toDescriptor()):s instanceof or?i.extension.push(s.toDescriptor(t)):s instanceof on?i.service.push(s.toDescriptor()):s instanceof sp&&ap(s,e,t);i.options=fi(r.options,F.FileOptions),i.messageType.length+i.enumType.length+i.extension.length+i.service.length&&e.push(i)}a(ap,"Root_toDescriptorRecursive");var dS=0;ar.fromDescriptor=a(function(e,t){typeof e.length=="number"&&(e=F.DescriptorProto.decode(e));var i=new ar(e.name.length?e.name:"Type"+dS++,hi(e.options,F.MessageOptions)),n;if(e.oneofDecl)for(n=0;n<e.oneofDecl.length;++n)i.add(As.fromDescriptor(e.oneofDecl[n]));if(e.field)for(n=0;n<e.field.length;++n){var s=or.fromDescriptor(e.field[n],t);i.add(s),e.field[n].hasOwnProperty("oneofIndex")&&i.oneofsArray[e.field[n].oneofIndex].add(s)}if(e.extension)for(n=0;n<e.extension.length;++n)i.add(or.fromDescriptor(e.extension[n],t));if(e.nestedType)for(n=0;n<e.nestedType.length;++n)i.add(ar.fromDescriptor(e.nestedType[n],t)),e.nestedType[n].options&&e.nestedType[n].options.mapEntry&&i.setOption("map_entry",!0);if(e.enumType)for(n=0;n<e.enumType.length;++n)i.add(zt.fromDescriptor(e.enumType[n]));if(e.extensionRange&&e.extensionRange.length)for(i.extensions=[],n=0;n<e.extensionRange.length;++n)i.extensions.push([e.extensionRange[n].start,e.extensionRange[n].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(i.reserved=[],e.reservedRange)for(n=0;n<e.reservedRange.length;++n)i.reserved.push([e.reservedRange[n].start,e.reservedRange[n].end]);if(e.reservedName)for(n=0;n<e.reservedName.length;++n)i.reserved.push(e.reservedName[n])}return i},"fromDescriptor");ar.prototype.toDescriptor=a(function(e){var t=F.DescriptorProto.create({name:this.name}),i;for(i=0;i<this.fieldsArray.length;++i){var n;if(t.field.push(n=this._fieldsArray[i].toDescriptor(e)),this._fieldsArray[i]instanceof uS){var s=Vl(this._fieldsArray[i].keyType,this._fieldsArray[i].resolvedKeyType),o=Vl(this._fieldsArray[i].type,this._fieldsArray[i].resolvedType),l=o===11||o===14?this._fieldsArray[i].resolvedType&&op(this.parent,this._fieldsArray[i].resolvedType)||this._fieldsArray[i].type:void 0;t.nestedType.push(F.DescriptorProto.create({name:n.typeName,field:[F.FieldDescriptorProto.create({name:"key",number:1,label:1,type:s}),F.FieldDescriptorProto.create({name:"value",number:2,label:1,type:o,typeName:l})],options:F.MessageOptions.create({mapEntry:!0})}))}}for(i=0;i<this.oneofsArray.length;++i)t.oneofDecl.push(this._oneofsArray[i].toDescriptor());for(i=0;i<this.nestedArray.length;++i)this._nestedArray[i]instanceof or?t.field.push(this._nestedArray[i].toDescriptor(e)):this._nestedArray[i]instanceof ar?t.nestedType.push(this._nestedArray[i].toDescriptor(e)):this._nestedArray[i]instanceof zt&&t.enumType.push(this._nestedArray[i].toDescriptor());if(this.extensions)for(i=0;i<this.extensions.length;++i)t.extensionRange.push(F.DescriptorProto.ExtensionRange.create({start:this.extensions[i][0],end:this.extensions[i][1]}));if(this.reserved)for(i=0;i<this.reserved.length;++i)typeof this.reserved[i]=="string"?t.reservedName.push(this.reserved[i]):t.reservedRange.push(F.DescriptorProto.ReservedRange.create({start:this.reserved[i][0],end:this.reserved[i][1]}));return t.options=fi(this.options,F.MessageOptions),t},"toDescriptor");var hS=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;or.fromDescriptor=a(function(e,t){if(typeof e.length=="number"&&(e=F.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i;e.typeName&&e.typeName.length?i=e.typeName:i=vS(e.type);var n;switch(e.label){case 1:n=void 0;break;case 2:n="required";break;case 3:n="repeated";break;default:throw Error("illegal label: "+e.label)}var s=e.extendee;e.extendee!==void 0&&(s=s.length?s:void 0);var o=new or(e.name.length?e.name:"field"+e.number,e.number,i,n,s);if(o.options=hi(e.options,F.FieldOptions),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var c=hS.exec(l);c&&(l=parseInt(l));break}o.setOption("default",l)}return yS(e.type)&&(t==="proto3"?e.options&&!e.options.packed&&o.setOption("packed",!1):e.options&&e.options.packed||o.setOption("packed",!1)),o},"fromDescriptor");or.prototype.toDescriptor=a(function(e){var t=F.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=Ne.util.ucFirst(this.name),t.label=3;else{switch(t.type=Vl(this.type,this.resolve().resolvedType)){case 10:case 11:case 14:t.typeName=this.resolvedType?op(this.parent,this.resolvedType):this.type;break}switch(this.rule){case"repeated":t.label=3;break;case"required":t.label=2;break;default:t.label=1;break}}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(t.options=fi(this.options,F.FieldOptions),this.options.default!=null&&(t.defaultValue=String(this.options.default))),e==="proto3"?this.packed||((t.options||(t.options=F.FieldOptions.create())).packed=!1):this.packed&&((t.options||(t.options=F.FieldOptions.create())).packed=!0),t},"toDescriptor");var fS=0;zt.fromDescriptor=a(function(e){typeof e.length=="number"&&(e=F.EnumDescriptorProto.decode(e));var t={};if(e.value)for(var i=0;i<e.value.length;++i){var n=e.value[i].name,s=e.value[i].number||0;t[n&&n.length?n:"NAME"+s]=s}return new zt(e.name&&e.name.length?e.name:"Enum"+fS++,t,hi(e.options,F.EnumOptions))},"fromDescriptor");zt.prototype.toDescriptor=a(function(){for(var e=[],t=0,i=Object.keys(this.values);t<i.length;++t)e.push(F.EnumValueDescriptorProto.create({name:i[t],number:this.values[i[t]]}));return F.EnumDescriptorProto.create({name:this.name,value:e,options:fi(this.options,F.EnumOptions)})},"toDescriptor");var pS=0;As.fromDescriptor=a(function(e){return typeof e.length=="number"&&(e=F.OneofDescriptorProto.decode(e)),new As(e.name&&e.name.length?e.name:"oneof"+pS++)},"fromDescriptor");As.prototype.toDescriptor=a(function(){return F.OneofDescriptorProto.create({name:this.name})},"toDescriptor");var gS=0;on.fromDescriptor=a(function(e){typeof e.length=="number"&&(e=F.ServiceDescriptorProto.decode(e));var t=new on(e.name&&e.name.length?e.name:"Service"+gS++,hi(e.options,F.ServiceOptions));if(e.method)for(var i=0;i<e.method.length;++i)t.add(Os.fromDescriptor(e.method[i]));return t},"fromDescriptor");on.prototype.toDescriptor=a(function(){for(var e=[],t=0;t<this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return F.ServiceDescriptorProto.create({name:this.name,method:e,options:fi(this.options,F.ServiceOptions)})},"toDescriptor");var mS=0;Os.fromDescriptor=a(function(e){return typeof e.length=="number"&&(e=F.MethodDescriptorProto.decode(e)),new Os(e.name&&e.name.length?e.name:"Method"+mS++,"rpc",e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,hi(e.options,F.MethodOptions))},"fromDescriptor");Os.prototype.toDescriptor=a(function(){return F.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:fi(this.options,F.MethodOptions)})},"toDescriptor");function vS(r){switch(r){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+r)}a(vS,"fromDescriptorType");function yS(r){switch(r){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}a(yS,"packableDescriptorType");function Vl(r,e){switch(r){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof zt)return 14;if(e instanceof ar)return e.group?10:11;throw Error("illegal type: "+r)}a(Vl,"toDescriptorType");function hi(r,e){if(r){for(var t=[],i=0,n,s,o;i<e.fieldsArray.length;++i)(s=(n=e._fieldsArray[i]).name)!=="uninterpretedOption"&&r.hasOwnProperty(s)&&(o=r[s],n.resolvedType instanceof zt&&typeof o=="number"&&n.resolvedType.valuesById[o]!==void 0&&(o=n.resolvedType.valuesById[o]),t.push(_S(s),o));return t.length?Ne.util.toObject(t):void 0}}a(hi,"fromDescriptorOptions");function fi(r,e){if(r){for(var t=[],i=0,n=Object.keys(r),s,o;i<n.length;++i)if(o=r[s=n[i]],s!=="default"){var l=e.fields[s];!l&&!(l=e.fields[s=Ne.util.camelCase(s)])||t.push(s,o)}return t.length?e.fromObject(Ne.util.toObject(t)):void 0}}a(fi,"toDescriptorOptions");function op(r,e){var t=r.fullName.split("."),i=e.fullName.split("."),n=0,s=0,o=i.length-1;if(!(r instanceof an)&&e instanceof sp)for(;n<t.length&&s<o&&t[n]===i[s];){var l=e.lookup(t[n++],!0);if(l!==null&&l!==e)break;++s}else for(;n<t.length&&s<o&&t[n]===i[s];++n,++s);return i.slice(s).join(".")}a(op,"shortname");function _S(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}a(_S,"underScore")});var up=m((vO,SS)=>{SS.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var dp=m((yO,CS)=>{CS.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var hp=m((_O,ES)=>{ES.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var mp=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.addCommonProtos=lr.loadProtosWithOptionsSync=lr.loadProtosWithOptions=void 0;var fp=G("fs"),pp=G("path"),pi=Rs();function gp(r,e){let t=r.resolvePath;r.resolvePath=(i,n)=>{if(pp.isAbsolute(n))return n;for(let s of e){let o=pp.join(s,n);try{return fp.accessSync(o,fp.constants.R_OK),o}catch{continue}}return process.emitWarning(`${n} not found in any of the include paths ${e}`),t(i,n)}}a(gp,"addIncludePathResolver");async function bS(r,e){let t=new pi.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));gp(t,e.includeDirs)}let i=await t.load(r,e);return i.resolveAll(),i}a(bS,"loadProtosWithOptions");lr.loadProtosWithOptions=bS;function TS(r,e){let t=new pi.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");gp(t,e.includeDirs)}let i=t.loadSync(r,e);return i.resolveAll(),i}a(TS,"loadProtosWithOptionsSync");lr.loadProtosWithOptionsSync=TS;function wS(){let r=up(),e=$l(),t=dp(),i=hp();pi.common("api",r.nested.google.nested.protobuf.nested),pi.common("descriptor",e.nested.google.nested.protobuf.nested),pi.common("source_context",t.nested.google.nested.protobuf.nested),pi.common("type",i.nested.google.nested.protobuf.nested)}a(wS,"addCommonProtos");lr.addCommonProtos=wS});var _p=m((yp,Jl)=>{"use strict";var vp=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(b,f,O){this.low=b|0,this.high=f|0,this.unsigned=!!O}a(t,"Long"),t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0});function i(b){return(b&&b.__isLong__)===!0}a(i,"isLong");function n(b){var f=Math.clz32(b&-b);return b?31-f:f}a(n,"ctz32"),t.isLong=i;var s={},o={};function l(b,f){var O,H,ee;return f?(b>>>=0,(ee=0<=b&&b<256)&&(H=o[b],H)?H:(O=u(b,0,!0),ee&&(o[b]=O),O)):(b|=0,(ee=-128<=b&&b<128)&&(H=s[b],H)?H:(O=u(b,b<0?-1:0,!1),ee&&(s[b]=O),O))}a(l,"fromInt"),t.fromInt=l;function c(b,f){if(isNaN(b))return f?A:P;if(f){if(b<0)return A;if(b>=C)return se}else{if(b<=-S)return V;if(b+1>=S)return Z}return b<0?c(-b,f).neg():u(b%v|0,b/v|0,f)}a(c,"fromNumber"),t.fromNumber=c;function u(b,f,O){return new t(b,f,O)}a(u,"fromBits"),t.fromBits=u;var d=Math.pow;function h(b,f,O){if(b.length===0)throw Error("empty string");if(typeof f=="number"?(O=f,f=!1):f=!!f,b==="NaN"||b==="Infinity"||b==="+Infinity"||b==="-Infinity")return f?A:P;if(O=O||10,O<2||36<O)throw RangeError("radix");var H;if((H=b.indexOf("-"))>0)throw Error("interior hyphen");if(H===0)return h(b.substring(1),f,O).neg();for(var ee=c(d(O,8)),J=P,ae=0;ae<b.length;ae+=8){var X=Math.min(8,b.length-ae),Ae=parseInt(b.substring(ae,ae+X),O);if(X<8){var ce=c(d(O,X));J=J.mul(ce).add(c(Ae))}else J=J.mul(ee),J=J.add(c(Ae))}return J.unsigned=f,J}a(h,"fromString"),t.fromString=h;function p(b,f){return typeof b=="number"?c(b,f):typeof b=="string"?h(b,f):u(b.low,b.high,typeof f=="boolean"?f:b.unsigned)}a(p,"fromValue"),t.fromValue=p;var g=65536,y=1<<24,v=g*g,C=v*v,S=C/2,_=l(y),P=l(0);t.ZERO=P;var A=l(0,!0);t.UZERO=A;var L=l(1);t.ONE=L;var D=l(1,!0);t.UONE=D;var B=l(-1);t.NEG_ONE=B;var Z=u(-1,2147483647,!1);t.MAX_VALUE=Z;var se=u(-1,-1,!0);t.MAX_UNSIGNED_VALUE=se;var V=u(0,-2147483648,!1);t.MIN_VALUE=V;var E=t.prototype;E.toInt=a(function(){return this.unsigned?this.low>>>0:this.low},"toInt"),E.toNumber=a(function(){return this.unsigned?(this.high>>>0)*v+(this.low>>>0):this.high*v+(this.low>>>0)},"toNumber"),E.toString=a(function(f){if(f=f||10,f<2||36<f)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(V)){var O=c(f),H=this.div(O),ee=H.mul(O).sub(this);return H.toString(f)+ee.toInt().toString(f)}else return"-"+this.neg().toString(f);for(var J=c(d(f,6),this.unsigned),ae=this,X="";;){var Ae=ae.div(J),ce=ae.sub(Ae.mul(J)).toInt()>>>0,ne=ce.toString(f);if(ae=Ae,ae.isZero())return ne+X;for(;ne.length<6;)ne="0"+ne;X=""+ne+X}},"toString"),E.getHighBits=a(function(){return this.high},"getHighBits"),E.getHighBitsUnsigned=a(function(){return this.high>>>0},"getHighBitsUnsigned"),E.getLowBits=a(function(){return this.low},"getLowBits"),E.getLowBitsUnsigned=a(function(){return this.low>>>0},"getLowBitsUnsigned"),E.getNumBitsAbs=a(function(){if(this.isNegative())return this.eq(V)?64:this.neg().getNumBitsAbs();for(var f=this.high!=0?this.high:this.low,O=31;O>0&&!(f&1<<O);O--);return this.high!=0?O+33:O+1},"getNumBitsAbs"),E.isZero=a(function(){return this.high===0&&this.low===0},"isZero"),E.eqz=E.isZero,E.isNegative=a(function(){return!this.unsigned&&this.high<0},"isNegative"),E.isPositive=a(function(){return this.unsigned||this.high>=0},"isPositive"),E.isOdd=a(function(){return(this.low&1)===1},"isOdd"),E.isEven=a(function(){return(this.low&1)===0},"isEven"),E.equals=a(function(f){return i(f)||(f=p(f)),this.unsigned!==f.unsigned&&this.high>>>31===1&&f.high>>>31===1?!1:this.high===f.high&&this.low===f.low},"equals"),E.eq=E.equals,E.notEquals=a(function(f){return!this.eq(f)},"notEquals"),E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=a(function(f){return this.comp(f)<0},"lessThan"),E.lt=E.lessThan,E.lessThanOrEqual=a(function(f){return this.comp(f)<=0},"lessThanOrEqual"),E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=a(function(f){return this.comp(f)>0},"greaterThan"),E.gt=E.greaterThan,E.greaterThanOrEqual=a(function(f){return this.comp(f)>=0},"greaterThanOrEqual"),E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=a(function(f){if(i(f)||(f=p(f)),this.eq(f))return 0;var O=this.isNegative(),H=f.isNegative();return O&&!H?-1:!O&&H?1:this.unsigned?f.high>>>0>this.high>>>0||f.high===this.high&&f.low>>>0>this.low>>>0?-1:1:this.sub(f).isNegative()?-1:1},"compare"),E.comp=E.compare,E.negate=a(function(){return!this.unsigned&&this.eq(V)?V:this.not().add(L)},"negate"),E.neg=E.negate,E.add=a(function(f){i(f)||(f=p(f));var O=this.high>>>16,H=this.high&65535,ee=this.low>>>16,J=this.low&65535,ae=f.high>>>16,X=f.high&65535,Ae=f.low>>>16,ce=f.low&65535,ne=0,Ce=0,ue=0,Oe=0;return Oe+=J+ce,ue+=Oe>>>16,Oe&=65535,ue+=ee+Ae,Ce+=ue>>>16,ue&=65535,Ce+=H+X,ne+=Ce>>>16,Ce&=65535,ne+=O+ae,ne&=65535,u(ue<<16|Oe,ne<<16|Ce,this.unsigned)},"add"),E.subtract=a(function(f){return i(f)||(f=p(f)),this.add(f.neg())},"subtract"),E.sub=E.subtract,E.multiply=a(function(f){if(this.isZero())return this;if(i(f)||(f=p(f)),e){var O=e.mul(this.low,this.high,f.low,f.high);return u(O,e.get_high(),this.unsigned)}if(f.isZero())return this.unsigned?A:P;if(this.eq(V))return f.isOdd()?V:P;if(f.eq(V))return this.isOdd()?V:P;if(this.isNegative())return f.isNegative()?this.neg().mul(f.neg()):this.neg().mul(f).neg();if(f.isNegative())return this.mul(f.neg()).neg();if(this.lt(_)&&f.lt(_))return c(this.toNumber()*f.toNumber(),this.unsigned);var H=this.high>>>16,ee=this.high&65535,J=this.low>>>16,ae=this.low&65535,X=f.high>>>16,Ae=f.high&65535,ce=f.low>>>16,ne=f.low&65535,Ce=0,ue=0,Oe=0,Hr=0;return Hr+=ae*ne,Oe+=Hr>>>16,Hr&=65535,Oe+=J*ne,ue+=Oe>>>16,Oe&=65535,Oe+=ae*ce,ue+=Oe>>>16,Oe&=65535,ue+=ee*ne,Ce+=ue>>>16,ue&=65535,ue+=J*ce,Ce+=ue>>>16,ue&=65535,ue+=ae*Ae,Ce+=ue>>>16,ue&=65535,Ce+=H*ne+ee*ce+J*Ae+ae*X,Ce&=65535,u(Oe<<16|Hr,Ce<<16|ue,this.unsigned)},"multiply"),E.mul=E.multiply,E.divide=a(function(f){if(i(f)||(f=p(f)),f.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&f.low===-1&&f.high===-1)return this;var O=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,f.low,f.high);return u(O,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?A:P;var H,ee,J;if(this.unsigned){if(f.unsigned||(f=f.toUnsigned()),f.gt(this))return A;if(f.gt(this.shru(1)))return D;J=A}else{if(this.eq(V)){if(f.eq(L)||f.eq(B))return V;if(f.eq(V))return L;var ae=this.shr(1);return H=ae.div(f).shl(1),H.eq(P)?f.isNegative()?L:B:(ee=this.sub(f.mul(H)),J=H.add(ee.div(f)),J)}else if(f.eq(V))return this.unsigned?A:P;if(this.isNegative())return f.isNegative()?this.neg().div(f.neg()):this.neg().div(f).neg();if(f.isNegative())return this.div(f.neg()).neg();J=P}for(ee=this;ee.gte(f);){H=Math.max(1,Math.floor(ee.toNumber()/f.toNumber()));for(var X=Math.ceil(Math.log(H)/Math.LN2),Ae=X<=48?1:d(2,X-48),ce=c(H),ne=ce.mul(f);ne.isNegative()||ne.gt(ee);)H-=Ae,ce=c(H,this.unsigned),ne=ce.mul(f);ce.isZero()&&(ce=L),J=J.add(ce),ee=ee.sub(ne)}return J},"divide"),E.div=E.divide,E.modulo=a(function(f){if(i(f)||(f=p(f)),e){var O=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,f.low,f.high);return u(O,e.get_high(),this.unsigned)}return this.sub(this.div(f).mul(f))},"modulo"),E.mod=E.modulo,E.rem=E.modulo,E.not=a(function(){return u(~this.low,~this.high,this.unsigned)},"not"),E.countLeadingZeros=a(function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},"countLeadingZeros"),E.clz=E.countLeadingZeros,E.countTrailingZeros=a(function(){return this.low?n(this.low):n(this.high)+32},"countTrailingZeros"),E.ctz=E.countTrailingZeros,E.and=a(function(f){return i(f)||(f=p(f)),u(this.low&f.low,this.high&f.high,this.unsigned)},"and"),E.or=a(function(f){return i(f)||(f=p(f)),u(this.low|f.low,this.high|f.high,this.unsigned)},"or"),E.xor=a(function(f){return i(f)||(f=p(f)),u(this.low^f.low,this.high^f.high,this.unsigned)},"xor"),E.shiftLeft=a(function(f){return i(f)&&(f=f.toInt()),(f&=63)===0?this:f<32?u(this.low<<f,this.high<<f|this.low>>>32-f,this.unsigned):u(0,this.low<<f-32,this.unsigned)},"shiftLeft"),E.shl=E.shiftLeft,E.shiftRight=a(function(f){return i(f)&&(f=f.toInt()),(f&=63)===0?this:f<32?u(this.low>>>f|this.high<<32-f,this.high>>f,this.unsigned):u(this.high>>f-32,this.high>=0?0:-1,this.unsigned)},"shiftRight"),E.shr=E.shiftRight,E.shiftRightUnsigned=a(function(f){return i(f)&&(f=f.toInt()),(f&=63)===0?this:f<32?u(this.low>>>f|this.high<<32-f,this.high>>>f,this.unsigned):f===32?u(this.high,0,this.unsigned):u(this.high>>>f-32,0,this.unsigned)},"shiftRightUnsigned"),E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=a(function(f){var O;return i(f)&&(f=f.toInt()),(f&=63)===0?this:f===32?u(this.high,this.low,this.unsigned):f<32?(O=32-f,u(this.low<<f|this.high>>>O,this.high<<f|this.low>>>O,this.unsigned)):(f-=32,O=32-f,u(this.high<<f|this.low>>>O,this.low<<f|this.high>>>O,this.unsigned))},"rotateLeft"),E.rotl=E.rotateLeft,E.rotateRight=a(function(f){var O;return i(f)&&(f=f.toInt()),(f&=63)===0?this:f===32?u(this.high,this.low,this.unsigned):f<32?(O=32-f,u(this.high<<O|this.low>>>f,this.low<<O|this.high>>>f,this.unsigned)):(f-=32,O=32-f,u(this.low<<O|this.high>>>f,this.high<<O|this.low>>>f,this.unsigned))},"rotateRight"),E.rotr=E.rotateRight,E.toSigned=a(function(){return this.unsigned?u(this.low,this.high,!1):this},"toSigned"),E.toUnsigned=a(function(){return this.unsigned?this:u(this.low,this.high,!0)},"toUnsigned"),E.toBytes=a(function(f){return f?this.toBytesLE():this.toBytesBE()},"toBytes"),E.toBytesLE=a(function(){var f=this.high,O=this.low;return[O&255,O>>>8&255,O>>>16&255,O>>>24,f&255,f>>>8&255,f>>>16&255,f>>>24]},"toBytesLE"),E.toBytesBE=a(function(){var f=this.high,O=this.low;return[f>>>24,f>>>16&255,f>>>8&255,f&255,O>>>24,O>>>16&255,O>>>8&255,O&255]},"toBytesBE"),t.fromBytes=a(function(f,O,H){return H?t.fromBytesLE(f,O):t.fromBytesBE(f,O)},"fromBytes"),t.fromBytesLE=a(function(f,O){return new t(f[0]|f[1]<<8|f[2]<<16|f[3]<<24,f[4]|f[5]<<8|f[6]<<16|f[7]<<24,O)},"fromBytesLE"),t.fromBytesBE=a(function(f,O){return new t(f[4]<<24|f[5]<<16|f[6]<<8|f[7],f[0]<<24|f[1]<<16|f[2]<<8|f[3],O)},"fromBytesBE");var re=t;return r.default=re,"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return vp}):typeof Jl=="object"&&typeof yp=="object"&&(Jl.exports=vp)});var Rp=m(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.loadFileDescriptorSetFromObject=he.loadFileDescriptorSetFromBuffer=he.fromJSON=he.loadSync=he.load=he.IdempotencyLevel=he.isAnyExtension=he.Long=void 0;var RS=sh(),Ot=Rs(),Kl=cp(),Xl=mp(),AS=_p();he.Long=AS;function OS(r){return"@type"in r&&typeof r["@type"]=="string"}a(OS,"isAnyExtension");he.isAnyExtension=OS;var Ep;(function(r){r.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",r.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",r.IDEMPOTENT="IDEMPOTENT"})(Ep=he.IdempotencyLevel||(he.IdempotencyLevel={}));var bp={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function MS(r,e){return r===""?e:r+"."+e}a(MS,"joinName");function PS(r){return r instanceof Ot.Service||r instanceof Ot.Type||r instanceof Ot.Enum}a(PS,"isHandledReflectionObject");function NS(r){return r instanceof Ot.Namespace||r instanceof Ot.Root}a(NS,"isNamespaceBase");function Tp(r,e){let t=MS(e,r.name);return PS(r)?[[t,r]]:NS(r)&&typeof r.nested<"u"?Object.keys(r.nested).map(i=>Tp(r.nested[i],t)).reduce((i,n)=>i.concat(n),[]):[]}a(Tp,"getAllHandledReflectionObjects");function Sp(r,e){return a(function(i){return r.toObject(r.decode(i),e)},"deserialize")}a(Sp,"createDeserializer");function Cp(r){return a(function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let i=r.fromObject(t);return r.encode(i).finish()},"serialize")}a(Cp,"createSerializer");function kS(r){return(r||[]).reduce((e,t)=>{for(let[i,n]of Object.entries(t))switch(i){case"uninterpreted_option":e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[i]=n}return e},{deprecated:!1,idempotency_level:Ep.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}a(kS,"mapMethodOptions");function IS(r,e,t,i){let n=r.resolvedRequestType,s=r.resolvedResponseType;return{path:"/"+e+"/"+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:Cp(n),requestDeserialize:Sp(n,t),responseSerialize:Cp(s),responseDeserialize:Sp(s,t),originalName:RS(r.name),requestType:Yl(n,i),responseType:Yl(s,i),options:kS(r.parsedOptions)}}a(IS,"createMethodDefinition");function xS(r,e,t,i){let n={};for(let s of r.methodsArray)n[s.name]=IS(s,e,t,i);return n}a(xS,"createServiceDefinition");function Yl(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:t.$type.toObject(t,bp),fileDescriptorProtos:e}}a(Yl,"createMessageDefinition");function DS(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:t.$type.toObject(t,bp),fileDescriptorProtos:e}}a(DS,"createEnumDefinition");function LS(r,e,t,i){if(r instanceof Ot.Service)return xS(r,e,t,i);if(r instanceof Ot.Type)return Yl(r,i);if(r instanceof Ot.Enum)return DS(r,i);throw new Error("Type mismatch in reflection object handling")}a(LS,"createDefinition");function Ms(r,e){let t={};r.resolveAll();let n=r.toDescriptor("proto3").file.map(s=>Buffer.from(Kl.FileDescriptorProto.encode(s).finish()));for(let[s,o]of Tp(r,""))t[s]=LS(o,s,e,n);return t}a(Ms,"createPackageDefinition");function wp(r,e){e=e||{};let t=Ot.Root.fromDescriptor(r);return t.resolveAll(),Ms(t,e)}a(wp,"createPackageDefinitionFromDescriptorSet");function qS(r,e){return(0,Xl.loadProtosWithOptions)(r,e).then(t=>Ms(t,e))}a(qS,"load");he.load=qS;function FS(r,e){let t=(0,Xl.loadProtosWithOptionsSync)(r,e);return Ms(t,e)}a(FS,"loadSync");he.loadSync=FS;function BS(r,e){e=e||{};let t=Ot.Root.fromJSON(r);return t.resolveAll(),Ms(t,e)}a(BS,"fromJSON");he.fromJSON=BS;function US(r,e){let t=Kl.FileDescriptorSet.decode(r);return wp(t,e)}a(US,"loadFileDescriptorSetFromBuffer");he.loadFileDescriptorSetFromBuffer=US;function zS(r,e){let t=Kl.FileDescriptorSet.fromObject(r);return wp(t,e)}a(zS,"loadFileDescriptorSetFromObject");he.loadFileDescriptorSetFromObject=zS;(0,Xl.addCommonProtos)()});var kr=m($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.setup=$.getChannelzServiceDefinition=$.getChannelzHandlers=$.unregisterChannelzRef=$.registerChannelzSocket=$.registerChannelzServer=$.registerChannelzSubchannel=$.registerChannelzChannel=$.ChannelzCallTrackerStub=$.ChannelzCallTracker=$.ChannelzChildrenTrackerStub=$.ChannelzChildrenTracker=$.ChannelzTrace=$.ChannelzTraceStub=void 0;var Ap=G("net"),Nr=(Ad(),vt(Rd)),ln=$e(),cn=U(),HS=Je(),jS=Kn(),GS=Yo();function Ql(r){return{channel_id:r.id,name:r.name}}a(Ql,"channelRefToMessage");function ic(r){return{subchannel_id:r.id,name:r.name}}a(ic,"subchannelRefToMessage");function WS(r){return{server_id:r.id}}a(WS,"serverRefToMessage");function Is(r){return{socket_id:r.id,name:r.name}}a(Is,"socketRefToMessage");var Op=32,nc=100,Zl=class{static{a(this,"ChannelzTraceStub")}constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Mt(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};$.ChannelzTraceStub=Zl;var ec=class{static{a(this,"ChannelzTrace")}constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,i){let n=new Date;this.events.push({description:t,severity:e,timestamp:n,childChannel:i?.kind==="channel"?i:void 0,childSubchannel:i?.kind==="subchannel"?i:void 0}),this.events.length>=Op*2&&(this.events=this.events.slice(Op)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Mt(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Mt(e.timestamp),channel_ref:e.childChannel?Ql(e.childChannel):null,subchannel_ref:e.childSubchannel?ic(e.childSubchannel):null}))}}};$.ChannelzTrace=ec;var Ns=class{static{a(this,"ChannelzChildrenTracker")}constructor(){this.channelChildren=new Nr.OrderedMap,this.subchannelChildren=new Nr.OrderedMap,this.socketChildren=new Nr.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],i=t.find(e.id);i.equals(t.end())?t.setElement(e.id,{ref:e,count:1},i):i.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],i=t.getElementByKey(e.id);i!==void 0&&(i.count-=1,i.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};$.ChannelzChildrenTracker=Ns;var tc=class extends Ns{static{a(this,"ChannelzChildrenTrackerStub")}refChild(){}unrefChild(){}};$.ChannelzChildrenTrackerStub=tc;var ks=class{static{a(this,"ChannelzCallTracker")}constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};$.ChannelzCallTracker=ks;var rc=class extends ks{static{a(this,"ChannelzCallTrackerStub")}addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};$.ChannelzCallTrackerStub=rc;var Ht={channel:new Nr.OrderedMap,subchannel:new Nr.OrderedMap,server:new Nr.OrderedMap,socket:new Nr.OrderedMap},xs=a(r=>{let e=1;function t(){return e++}a(t,"getNextId");let i=Ht[r];return(n,s,o)=>{let l=t(),c={id:l,name:n,kind:r};return o&&i.setElement(l,{ref:c,getInfo:s}),c}},"generateRegisterFn");$.registerChannelzChannel=xs("channel");$.registerChannelzSubchannel=xs("subchannel");$.registerChannelzServer=xs("server");$.registerChannelzSocket=xs("socket");function $S(r){Ht[r.kind].eraseElementByKey(r.id)}a($S,"unregisterChannelzRef");$.unregisterChannelzRef=$S;function VS(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}a(VS,"parseIPv6Section");function Mp(r){if(r==="")return[];let e=r.split(":").map(i=>VS(i));return[].concat(...e)}a(Mp,"parseIPv6Chunk");function JS(r){if((0,Ap.isIPv4)(r))return Buffer.from(Uint8Array.from(r.split(".").map(e=>Number.parseInt(e))));if((0,Ap.isIPv6)(r)){let e,t,i=r.indexOf("::");i===-1?(e=r,t=""):(e=r.substring(0,i),t=r.substring(i+2));let n=Buffer.from(Mp(e)),s=Buffer.from(Mp(t)),o=Buffer.alloc(16-n.length-s.length,0);return Buffer.concat([n,o,s])}else return null}a(JS,"ipAddressStringToBuffer");function Np(r){switch(r){case ln.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case ln.ConnectivityState.IDLE:return{state:"IDLE"};case ln.ConnectivityState.READY:return{state:"READY"};case ln.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case ln.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}a(Np,"connectivityStateToMessage");function Mt(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}a(Mt,"dateToProtoTimestamp");function kp(r){let e=r.getInfo(),t=[],i=[];return e.children.channels.forEach(n=>{t.push(Ql(n[1].ref))}),e.children.subchannels.forEach(n=>{i.push(ic(n[1].ref))}),{ref:Ql(r.ref),data:{target:e.target,state:Np(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Mt(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:i}}a(kp,"getChannelMessage");function YS(r,e){let t=parseInt(r.request.channel_id,10),i=Ht.channel.getElementByKey(t);if(i===void 0){e({code:cn.Status.NOT_FOUND,details:"No channel data found for id "+t});return}e(null,{channel:kp(i)})}a(YS,"GetChannel");function KS(r,e){let t=parseInt(r.request.max_results,10)||nc,i=[],n=parseInt(r.request.start_channel_id,10),s=Ht.channel,o;for(o=s.lowerBound(n);!o.equals(s.end())&&i.length<t;o=o.next())i.push(kp(o.pointer[1]));e(null,{channel:i,end:o.equals(s.end())})}a(KS,"GetTopChannels");function Ip(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(i=>{t.push(Is(i[1].ref))}),{ref:WS(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Mt(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}a(Ip,"getServerMessage");function XS(r,e){let t=parseInt(r.request.server_id,10),n=Ht.server.getElementByKey(t);if(n===void 0){e({code:cn.Status.NOT_FOUND,details:"No server data found for id "+t});return}e(null,{server:Ip(n)})}a(XS,"GetServer");function QS(r,e){let t=parseInt(r.request.max_results,10)||nc,i=parseInt(r.request.start_server_id,10),n=Ht.server,s=[],o;for(o=n.lowerBound(i);!o.equals(n.end())&&s.length<t;o=o.next())s.push(Ip(o.pointer[1]));e(null,{server:s,end:o.equals(n.end())})}a(QS,"GetServers");function ZS(r,e){let t=parseInt(r.request.subchannel_id,10),i=Ht.subchannel.getElementByKey(t);if(i===void 0){e({code:cn.Status.NOT_FOUND,details:"No subchannel data found for id "+t});return}let n=i.getInfo(),s=[];n.children.sockets.forEach(l=>{s.push(Is(l[1].ref))});let o={ref:ic(i.ref),data:{target:n.target,state:Np(n.state),calls_started:n.callTracker.callsStarted,calls_succeeded:n.callTracker.callsSucceeded,calls_failed:n.callTracker.callsFailed,last_call_started_timestamp:Mt(n.callTracker.lastCallStartedTimestamp),trace:n.trace.getTraceMessage()},socket_ref:s};e(null,{subchannel:o})}a(ZS,"GetSubchannel");function Pp(r){var e;return(0,HS.isTcpSubchannelAddress)(r)?{address:"tcpip_address",tcpip_address:{ip_address:(e=JS(r.host))!==null&&e!==void 0?e:void 0,port:r.port}}:{address:"uds_address",uds_address:{filename:r.path}}}a(Pp,"subchannelAddressToAddressMessage");function eC(r,e){var t,i,n,s,o;let l=parseInt(r.request.socket_id,10),c=Ht.socket.getElementByKey(l);if(c===void 0){e({code:cn.Status.NOT_FOUND,details:"No socket data found for id "+l});return}let u=c.getInfo(),d=u.security?{model:"tls",tls:{cipher_suite:u.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(t=u.security.cipherSuiteStandardName)!==null&&t!==void 0?t:void 0,other_name:(i=u.security.cipherSuiteOtherName)!==null&&i!==void 0?i:void 0,local_certificate:(n=u.security.localCertificate)!==null&&n!==void 0?n:void 0,remote_certificate:(s=u.security.remoteCertificate)!==null&&s!==void 0?s:void 0}}:null,h={ref:Is(c.ref),local:u.localAddress?Pp(u.localAddress):null,remote:u.remoteAddress?Pp(u.remoteAddress):null,remote_name:(o=u.remoteName)!==null&&o!==void 0?o:void 0,security:d,data:{keep_alives_sent:u.keepAlivesSent,streams_started:u.streamsStarted,streams_succeeded:u.streamsSucceeded,streams_failed:u.streamsFailed,last_local_stream_created_timestamp:Mt(u.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Mt(u.lastRemoteStreamCreatedTimestamp),messages_received:u.messagesReceived,messages_sent:u.messagesSent,last_message_received_timestamp:Mt(u.lastMessageReceivedTimestamp),last_message_sent_timestamp:Mt(u.lastMessageSentTimestamp),local_flow_control_window:u.localFlowControlWindow?{value:u.localFlowControlWindow}:null,remote_flow_control_window:u.remoteFlowControlWindow?{value:u.remoteFlowControlWindow}:null}};e(null,{socket:h})}a(eC,"GetSocket");function tC(r,e){let t=parseInt(r.request.server_id,10),i=Ht.server.getElementByKey(t);if(i===void 0){e({code:cn.Status.NOT_FOUND,details:"No server data found for id "+t});return}let n=parseInt(r.request.start_socket_id,10),s=parseInt(r.request.max_results,10)||nc,l=i.getInfo().sessionChildren.sockets,c=[],u;for(u=l.lowerBound(n);!u.equals(l.end())&&c.length<s;u=u.next())c.push(Is(u.pointer[1].ref));e(null,{socket_ref:c,end:u.equals(l.end())})}a(tC,"GetServerSockets");function xp(){return{GetChannel:YS,GetTopChannels:KS,GetServer:XS,GetServers:QS,GetSubchannel:ZS,GetSocket:eC,GetServerSockets:tC}}a(xp,"getChannelzHandlers");$.getChannelzHandlers=xp;var Ps=null;function Dp(){if(Ps)return Ps;let r=Rp().loadSync,e=r("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return Ps=(0,GS.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,Ps}a(Dp,"getChannelzServiceDefinition");$.getChannelzServiceDefinition=Dp;function rC(){(0,jS.registerAdminService)(Dp,xp)}a(rC,"setup");$.setup=rC});var Lp=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Subchannel=void 0;var Y=$e(),iC=Ui(),sc=te(),Ds=U(),nC=Ue(),sC=Je(),Pt=kr(),aC="subchannel",oC=~(1<<31),ac=class{static{a(this,"Subchannel")}constructor(e,t,i,n,s){var o;this.channelTarget=e,this.subchannelAddress=t,this.options=i,this.credentials=n,this.connector=s,this.connectivityState=Y.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let l={initialDelay:i["grpc.initial_reconnect_backoff_ms"],maxDelay:i["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new iC.BackoffTimeout(()=>{this.handleBackoffTimer()},l),this.backoffTimeout.unref(),this.subchannelAddressString=(0,sC.subchannelAddressToString)(t),this.keepaliveTime=(o=i["grpc.keepalive_time_ms"])!==null&&o!==void 0?o:-1,i["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Pt.ChannelzTraceStub,this.callTracker=new Pt.ChannelzCallTrackerStub,this.childrenTracker=new Pt.ChannelzChildrenTrackerStub,this.streamTracker=new Pt.ChannelzCallTrackerStub):(this.channelzTrace=new Pt.ChannelzTrace,this.callTracker=new Pt.ChannelzCallTracker,this.childrenTracker=new Pt.ChannelzChildrenTracker,this.streamTracker=new Pt.ChannelzCallTracker),this.channelzRef=(0,Pt.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(i,void 0,2)),n._ref()}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){sc.trace(Ds.LogVerbosity.DEBUG,aC,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){sc.trace(Ds.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([Y.ConnectivityState.TRANSIENT_FAILURE],Y.ConnectivityState.CONNECTING):this.transitionToState([Y.ConnectivityState.TRANSIENT_FAILURE],Y.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let t=Math.min(this.keepaliveTime,oC);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.credentials,e).then(t=>{this.transitionToState([Y.ConnectivityState.CONNECTING],Y.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&&this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(i=>{this.transitionToState([Y.ConnectivityState.READY],Y.ConnectivityState.IDLE),i&&this.keepaliveTime>0&&(this.keepaliveTime*=2,sc.log(Ds.LogVerbosity.ERROR,`Connection to ${(0,nC.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=>{this.transitionToState([Y.ConnectivityState.CONNECTING],Y.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,i){var n,s;if(e.indexOf(this.connectivityState)===-1)return!1;i?this.trace(Y.ConnectivityState[this.connectivityState]+" -> "+Y.ConnectivityState[t]+' with error "'+i+'"'):this.trace(Y.ConnectivityState[this.connectivityState]+" -> "+Y.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+Y.ConnectivityState[t]);let o=this.connectivityState;switch(this.connectivityState=t,t){case Y.ConnectivityState.READY:this.stopBackoff();break;case Y.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case Y.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(n=this.transport)===null||n===void 0||n.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case Y.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let l of this.stateListeners)l(this,o,t,this.keepaliveTime,i);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,Pt.unregisterChannelzRef)(this.channelzRef),this.credentials._unref(),process.nextTick(()=>{this.transitionToState([Y.ConnectivityState.CONNECTING,Y.ConnectivityState.READY],Y.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,i,n){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let s;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),s={onCallEnd:a(o=>{o.code===Ds.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},"onCallEnd")}):s={},this.transport.createCall(e,t,i,n,s)}startConnecting(){process.nextTick(()=>{this.transitionToState([Y.ConnectivityState.IDLE],Y.ConnectivityState.CONNECTING)||this.connectivityState===Y.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([Y.ConnectivityState.TRANSIENT_FAILURE],Y.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}};Ls.Subchannel=ac});var qp=m(qs=>{"use strict";var oc;Object.defineProperty(qs,"__esModule",{value:!0});qs.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;qs.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((oc=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&oc!==void 0?oc:"false")==="true"});var hc=m(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.setup=ur.DEFAULT_PORT=void 0;var Fp=_t(),lc=G("dns"),lC=So(),cc=U(),uc=we(),cC=te(),uC=U(),cr=Ue(),Bp=G("net"),dC=Ui(),Up=qp(),hC="dns_resolver";function Nt(r){cC.trace(uC.LogVerbosity.DEBUG,hC,r)}a(Nt,"trace");ur.DEFAULT_PORT=443;var fC=3e4,dc=class{static{a(this,"DnsResolver")}constructor(e,t,i){var n,s,o;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new lc.promises.Resolver,Nt("Resolver constructed for target "+(0,cr.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let l=(0,cr.splitHostPort)(e.path);l===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,Bp.isIPv4)(l.host)||(0,Bp.isIPv6)(l.host)?(this.ipResult=[{addresses:[{host:l.host,port:(n=l.port)!==null&&n!==void 0?n:ur.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=l.host,this.port=(s=l.port)!==null&&s!==void 0?s:ur.DEFAULT_PORT),this.percentage=Math.random()*100,i["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:cc.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,cr.uriToString)(this.target)}`,metadata:new uc.Metadata};let c={initialDelay:i["grpc.initial_reconnect_backoff_ms"],maxDelay:i["grpc.max_reconnect_backoff_ms"]};this.backoff=new dC.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(o=i["grpc.dns_min_time_between_resolutions_ms"])!==null&&o!==void 0?o:fC,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(Nt("Returning IP address for target "+(0,cr.uriToString)(this.target)),setImmediate(()=>{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Nt("Failed to parse DNS address "+(0,cr.uriToString)(this.target)),setImmediate(()=>{this.listener.onError({code:cc.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,cr.uriToString)(this.target)}`,metadata:new uc.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Nt("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(n=>({addresses:[n]}));let i="["+t.map(n=>n.host+":"+n.port).join(",")+"]";if(Nt("Resolved addresses for target "+(0,cr.uriToString)(this.target)+": "+i),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=>{this.pendingLookupPromise!==null&&(Nt("Resolution error for target "+(0,cr.uriToString)(this.target)+": "+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=>{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,lC.extractAndSelectServiceConfig)(t,this.percentage)}catch(i){this.latestServiceConfigError={code:cc.Status.UNAVAILABLE,details:`Parsing service config failed with error ${i.message}`,metadata:new uc.Metadata}}this.latestLookupResult!==null&&this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=>{}))}}async lookup(e){if(Up.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Nt("Using alternative DNS resolver.");let i=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(i.every(n=>n.status==="rejected"))throw new Error(i[0].reason);return i.reduce((n,s)=>s.status==="fulfilled"?[...n,...s.value]:n,[]).map(n=>({host:n,port:+this.port}))}return(await lc.promises.lookup(e,{all:!0})).map(i=>({host:i.address,port:+this.port}))}async resolveTxt(e){return Up.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(Nt("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):lc.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?Nt('resolution update delayed by "min time between resolutions" rate limit'):Nt("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function pC(){(0,Fp.registerResolver)("dns",dc),(0,Fp.registerDefaultScheme)("dns")}a(pC,"setup");ur.setup=pC});var fc=m(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.getProxiedConnection=vi.mapProxyName=void 0;var un=te(),gi=U(),gC=_t(),mC=G("http"),vC=G("tls"),yC=te(),zp=Je(),mi=Ue(),_C=G("url"),SC=hc(),CC="proxy";function dr(r){yC.trace(gi.LogVerbosity.DEBUG,CC,r)}a(dr,"trace");function EC(){let r="",e="";if(process.env.grpc_proxy)e="grpc_proxy",r=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",r=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",r=process.env.http_proxy;else return{};let t;try{t=new _C.URL(r)}catch{return(0,un.log)(gi.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(t.protocol!=="http:")return(0,un.log)(gi.LogVerbosity.ERROR,`"${t.protocol}" scheme not supported in proxy URI`),{};let i=null;t.username&&(t.password?((0,un.log)(gi.LogVerbosity.INFO,"userinfo found in proxy URI"),i=decodeURIComponent(`${t.username}:${t.password}`)):i=t.username);let n=t.hostname,s=t.port;s===""&&(s="80");let o={address:`${n}:${s}`};return i&&(o.creds=i),dr("Proxy server "+o.address+" set by environment variable "+e),o}a(EC,"getProxyInfo");function bC(){let r=process.env.no_grpc_proxy,e="no_grpc_proxy";return r||(r=process.env.no_proxy,e="no_proxy"),r?(dr("No proxy server list set by environment variable "+e),r.split(",")):[]}a(bC,"getNoProxyHostList");function TC(r,e){var t;let i={target:r,extraOptions:{}};if(((t=e["grpc.enable_http_proxy"])!==null&&t!==void 0?t:1)===0||r.scheme==="unix")return i;let n=EC();if(!n.address)return i;let s=(0,mi.splitHostPort)(r.path);if(!s)return i;let o=s.host;for(let c of bC())if(c===o)return dr("Not using proxy for target in no_proxy list: "+(0,mi.uriToString)(r)),i;let l={"grpc.http_connect_target":(0,mi.uriToString)(r)};return n.creds&&(l["grpc.http_connect_creds"]=n.creds),{target:{scheme:"dns",path:n.address},extraOptions:l}}a(TC,"mapProxyName");vi.mapProxyName=TC;function wC(r,e,t){var i;if(!("grpc.http_connect_target"in e))return Promise.resolve({});let n=e["grpc.http_connect_target"],s=(0,mi.parseUri)(n);if(s===null)return Promise.resolve({});let o=(0,mi.splitHostPort)(s.path);if(o===null)return Promise.resolve({});let l=`${o.host}:${(i=o.port)!==null&&i!==void 0?i:SC.DEFAULT_PORT}`,c={method:"CONNECT",path:l},u={Host:l};(0,zp.isTcpSubchannelAddress)(r)?(c.host=r.host,c.port=r.port):c.socketPath=r.path,"grpc.http_connect_creds"in e&&(u["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),c.headers=u;let d=(0,zp.subchannelAddressToString)(r);return dr("Using proxy "+d+" to connect to "+c.path),new Promise((h,p)=>{let g=mC.request(c);g.once("connect",(y,v,C)=>{var S;if(g.removeAllListeners(),v.removeAllListeners(),y.statusCode===200)if(dr("Successfully connected to "+c.path+" through proxy "+d),C.length>0&&v.unshift(C),"secureContext"in t){let _=(0,gC.getDefaultAuthority)(s),P=(0,mi.splitHostPort)(_),A=(S=P?.host)!==null&&S!==void 0?S:_,L=vC.connect(Object.assign({host:A,servername:A,socket:v},t),()=>{dr("Successfully established a TLS connection to "+c.path+" through proxy "+d),h({socket:L,realTarget:s})});L.on("error",D=>{dr("Failed to establish a TLS connection to "+c.path+" through proxy "+d+" with error "+D.message),p()})}else dr("Successfully established a plaintext connection to "+c.path+" through proxy "+d),h({socket:v,realTarget:s});else(0,un.log)(gi.LogVerbosity.ERROR,"Failed to connect to "+c.path+" through proxy "+d+" with status "+y.statusCode),p()}),g.once("error",y=>{g.removeAllListeners(),(0,un.log)(gi.LogVerbosity.ERROR,"Failed to connect to proxy "+d+" with error "+y.message),p()}),g.end()})}a(wC,"getProxiedConnection");vi.getProxiedConnection=wC});var gc=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.StreamDecoder=void 0;var kt;(function(r){r[r.NO_DATA=0]="NO_DATA",r[r.READING_SIZE=1]="READING_SIZE",r[r.READING_MESSAGE=2]="READING_MESSAGE"})(kt||(kt={}));var pc=class{static{a(this,"StreamDecoder")}constructor(e){this.maxReadMessageLength=e,this.readState=kt.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,i,n=[];for(;t<e.length;)switch(this.readState){case kt.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=kt.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case kt.READING_SIZE:if(i=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+i),this.readSizeRemaining-=i,t+=i,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=kt.READING_MESSAGE;else{let s=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=kt.NO_DATA,n.push(s)}}break;case kt.READING_MESSAGE:if(i=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+i)),this.readMessageRemaining-=i,t+=i,this.readMessageRemaining===0){let s=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),o=Buffer.concat(s,this.readMessageSize+5);this.readState=kt.NO_DATA,n.push(o)}break;default:throw new Error("Unexpected read state")}return n}};Fs.StreamDecoder=pc});var jp=m(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.Http2SubchannelCall=void 0;var jt=G("http2"),RC=G("os"),K=U(),Gt=we(),AC=gc(),OC=te(),MC=U(),PC="subchannel_call";function NC(r){for(let[e,t]of Object.entries(RC.constants.errno))if(t===r)return e;return"Unknown system error "+r}a(NC,"getSystemErrorName");function Hp(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=K.Status.INTERNAL;break;case 401:t=K.Status.UNAUTHENTICATED;break;case 403:t=K.Status.PERMISSION_DENIED;break;case 404:t=K.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=K.Status.UNAVAILABLE;break;default:t=K.Status.UNKNOWN}return{code:t,details:e,metadata:new Gt.Metadata}}a(Hp,"mapHttpStatusCode");var mc=class{static{a(this,"Http2SubchannelCall")}constructor(e,t,i,n,s){var o;this.http2Stream=e,this.callEventTracker=t,this.listener=i,this.transport=n,this.callId=s,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1;let l=(o=n.getOptions()["grpc.max_receive_message_length"])!==null&&o!==void 0?o:K.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new AC.StreamDecoder(l),e.on("response",(c,u)=>{let d="";for(let h of Object.keys(c))d+=" "+h+": "+c[h]+`
17
+ `;if(this.trace(`Received server headers:
18
+ `+d),this.httpStatusCode=c[":status"],u&jt.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(c);else{let h;try{h=Gt.Metadata.fromHttp2Headers(c)}catch(p){this.endCall({code:K.Status.UNKNOWN,details:p.message,metadata:new Gt.Metadata});return}this.listener.onReceiveMetadata(h)}}),e.on("trailers",c=>{this.handleTrailers(c)}),e.on("data",c=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+c.length);let u;try{u=this.decoder.write(c)}catch(d){this.cancelWithStatus(K.Status.RESOURCE_EXHAUSTED,d.message);return}for(let d of u)this.trace("parsed message of length "+d.length),this.callEventTracker.addMessageReceived(),this.tryPush(d)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var c;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((c=this.finalStatus)===null||c===void 0?void 0:c.code)===K.Status.OK)return;let u,d="";switch(e.rstCode){case jt.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let h=Hp(this.httpStatusCode);u=h.code,d=h.details}else u=K.Status.INTERNAL,d=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case jt.constants.NGHTTP2_REFUSED_STREAM:u=K.Status.UNAVAILABLE,d="Stream refused by server";break;case jt.constants.NGHTTP2_CANCEL:u=K.Status.CANCELLED,d="Call cancelled";break;case jt.constants.NGHTTP2_ENHANCE_YOUR_CALM:u=K.Status.RESOURCE_EXHAUSTED,d="Bandwidth exhausted or memory limit exceeded";break;case jt.constants.NGHTTP2_INADEQUATE_SECURITY:u=K.Status.PERMISSION_DENIED,d="Protocol not secure enough";break;case jt.constants.NGHTTP2_INTERNAL_ERROR:u=K.Status.INTERNAL,this.internalError===null?d=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(u=K.Status.UNAVAILABLE,d=this.internalError.message):d=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:u=K.Status.INTERNAL,d=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:u,details:d,metadata:new Gt.Metadata,rstCode:e.rstCode})})}),e.on("error",c=>{c.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+c.message+" code="+c.code+" errno="+NC(c.errno)+" syscall="+c.syscall),this.internalError=c),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.endCall({code:K.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Gt.Metadata})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){OC.trace(MC.LogVerbosity.DEBUG,PC,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===K.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==K.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t="";for(let o of Object.keys(e))t+=" "+o+": "+e[o]+`
19
+ `;this.trace(`Received server trailers:
20
+ `+t);let i;try{i=Gt.Metadata.fromHttp2Headers(e)}catch{i=new Gt.Metadata}let n=i.getMap(),s;if(typeof n["grpc-status"]=="string"){let o=Number(n["grpc-status"]);this.trace("received status code "+o+" from server"),i.remove("grpc-status");let l="";if(typeof n["grpc-message"]=="string"){try{l=decodeURI(n["grpc-message"])}catch{l=n["grpc-message"]}i.remove("grpc-message"),this.trace('received status details string "'+l+'" from server')}s={code:o,details:l,metadata:i}}else this.httpStatusCode?(s=Hp(this.httpStatusCode),s.metadata=i):s={code:K.Status.UNKNOWN,details:"No status information received",metadata:i};this.endCall(s)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===K.Status.OK?t=jt.constants.NGHTTP2_NO_ERROR:t=jt.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.endCall({code:e,details:t,metadata:new Gt.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==K.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);let i=a(n=>{process.nextTick(()=>{var s;let o=K.Status.UNAVAILABLE;n?.code==="ERR_STREAM_WRITE_AFTER_END"&&(o=K.Status.INTERNAL),n&&this.cancelWithStatus(o,`Write error: ${n.message}`),(s=e.callback)===null||s===void 0||s.call(e)})},"cb");this.trace("sending data chunk of length "+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,i)}catch(n){this.endCall({code:K.Status.UNAVAILABLE,details:`Write failed with error ${n.message}`,metadata:new Gt.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};Bs.Http2SubchannelCall=mc});var vc=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.getNextCallNumber=void 0;var kC=0;function IC(){return kC++}a(IC,"getNextCallNumber");Us.getNextCallNumber=IC});var $p=m(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.Http2SubchannelConnector=void 0;var Cc=G("http2"),Gp=G("tls"),zs=kr(),dn=U(),xC=fc(),_i=te(),Wp=_t(),Hs=Je(),yi=Ue(),DC=G("net"),LC=jp(),qC=vc(),yc="transport",FC="transport_flowctrl",BC=to().version,{HTTP2_HEADER_AUTHORITY:UC,HTTP2_HEADER_CONTENT_TYPE:zC,HTTP2_HEADER_METHOD:HC,HTTP2_HEADER_PATH:jC,HTTP2_HEADER_TE:GC,HTTP2_HEADER_USER_AGENT:WC}=Cc.constants,$C=2e4,VC=Buffer.from("too_many_pings","ascii"),_c=class{static{a(this,"Http2Transport")}constructor(e,t,i,n){this.session=e,this.options=i,this.remoteName=n,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,Hs.subchannelAddressToString)(t),i["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new zs.ChannelzCallTrackerStub):this.streamTracker=new zs.ChannelzCallTracker,this.channelzRef=(0,zs.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[i["grpc.primary_user_agent"],`grpc-node-js/${BC}`,i["grpc.secondary_user_agent"]].filter(s=>s).join(" "),"grpc.keepalive_time_ms"in i?this.keepaliveTimeMs=i["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in i?this.keepaliveTimeoutMs=i["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=$C,"grpc.keepalive_permit_without_calls"in i?this.keepaliveWithoutCalls=i["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(s,o,l)=>{let c=!1;s===Cc.constants.NGHTTP2_ENHANCE_YOUR_CALM&&l&&l.equals(VC)&&(c=!0),this.trace("connection closed by GOAWAY with code "+s+" and data "+l?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",s=>{this.trace("connection closed with error "+s.message),this.handleDisconnect()}),_i.isTracerEnabled(yc)&&(e.on("remoteSettings",s=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))}),e.on("localSettings",s=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,i;let n=this.session.socket,s=n.remoteAddress?(0,Hs.stringToSubchannelAddress)(n.remoteAddress,n.remotePort):null,o=n.localAddress?(0,Hs.stringToSubchannelAddress)(n.localAddress,n.localPort):null,l;if(this.session.encrypted){let u=n,d=u.getCipher(),h=u.getCertificate(),p=u.getPeerCertificate();l={cipherSuiteStandardName:(e=d.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:d.standardName?null:d.name,localCertificate:h&&"raw"in h?h.raw:null,remoteCertificate:p&&"raw"in p?p.raw:null}}else l=null;return{remoteAddress:s,localAddress:o,security:l,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(t=this.session.state.localWindowSize)!==null&&t!==void 0?t:null,remoteFlowControlWindow:(i=this.session.state.remoteWindowSize)!==null&&i!==void 0?i:null}}trace(e){_i.trace(dn.LogVerbosity.DEBUG,yc,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){_i.trace(dn.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){_i.trace(dn.LogVerbosity.DEBUG,FC,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){_i.trace(dn.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.disconnectHandled||(this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1),setImmediate(()=>{for(let e of this.activeCalls)e.onDisconnect();this.session.destroy()}))}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let i="";try{this.session.ping((s,o,l)=>{this.clearKeepaliveTimeout(),s?(this.keepaliveTrace("Ping failed with error "+s.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(i="Ping returned false")}catch(n){i=(n instanceof Error?n.message:"")||"Unknown error"}i&&(this.keepaliveTrace("Ping send failed: "+i),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,i,n,s){let o=e.toHttp2Headers();o[UC]=t,o[WC]=this.userAgent,o[zC]="application/grpc",o[HC]="POST",o[jC]=i,o[GC]="trailers";let l;try{l=this.session.request(o)}catch(d){throw this.handleDisconnect(),d}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let c,u;return this.channelzEnabled?(this.streamTracker.addCallStarted(),c={addMessageSent:a(()=>{var d;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(d=s.addMessageSent)===null||d===void 0||d.call(s)},"addMessageSent"),addMessageReceived:a(()=>{var d;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(d=s.addMessageReceived)===null||d===void 0||d.call(s)},"addMessageReceived"),onCallEnd:a(d=>{var h;(h=s.onCallEnd)===null||h===void 0||h.call(s,d),this.removeActiveCall(u)},"onCallEnd"),onStreamEnd:a(d=>{var h;d?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(h=s.onStreamEnd)===null||h===void 0||h.call(s,d)},"onStreamEnd")}):c={addMessageSent:a(()=>{var d;(d=s.addMessageSent)===null||d===void 0||d.call(s)},"addMessageSent"),addMessageReceived:a(()=>{var d;(d=s.addMessageReceived)===null||d===void 0||d.call(s)},"addMessageReceived"),onCallEnd:a(d=>{var h;(h=s.onCallEnd)===null||h===void 0||h.call(s,d),this.removeActiveCall(u)},"onCallEnd"),onStreamEnd:a(d=>{var h;(h=s.onStreamEnd)===null||h===void 0||h.call(s,d)},"onStreamEnd")},u=new LC.Http2SubchannelCall(l,c,n,this,(0,qC.getNextCallNumber)()),this.addActiveCall(u),u}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,zs.unregisterChannelzRef)(this.channelzRef)}},Sc=class{static{a(this,"Http2SubchannelConnector")}constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){_i.trace(dn.LogVerbosity.DEBUG,yc,(0,yi.uriToString)(this.channelTarget)+" "+e)}createSession(e,t,i,n){return this.isShutdown?Promise.reject():new Promise((s,o)=>{var l,c,u,d;let h;n.realTarget?(h=(0,yi.uriToString)(n.realTarget),this.trace("creating HTTP/2 session through proxy to "+(0,yi.uriToString)(n.realTarget))):(h=null,this.trace("creating HTTP/2 session to "+(0,Hs.subchannelAddressToString)(e)));let p=(0,Wp.getDefaultAuthority)((l=n.realTarget)!==null&&l!==void 0?l:this.channelTarget),g=t._getConnectionOptions();if(!g){o("Credentials not loaded");return}g.maxSendHeaderBlockLength=Number.MAX_SAFE_INTEGER,"grpc-node.max_session_memory"in i?g.maxSessionMemory=i["grpc-node.max_session_memory"]:g.maxSessionMemory=Number.MAX_SAFE_INTEGER;let y="http://";if("secureContext"in g){if(y="https://",i["grpc.ssl_target_name_override"]){let _=i["grpc.ssl_target_name_override"],P=(c=g.checkServerIdentity)!==null&&c!==void 0?c:Gp.checkServerIdentity;g.checkServerIdentity=(A,L)=>P(_,L),g.servername=_}else{let _=(d=(u=(0,yi.splitHostPort)(p))===null||u===void 0?void 0:u.host)!==null&&d!==void 0?d:"localhost";g.servername=_}n.socket&&(g.createConnection=(_,P)=>n.socket)}else g.createConnection=(_,P)=>n.socket?n.socket:DC.connect(e);g=Object.assign(Object.assign(Object.assign({},g),e),{enableTrace:i["grpc-node.tls_enable_trace"]===1});let v=Cc.connect(y+p,g);this.session=v;let C="Failed to connect",S=!1;v.unref(),v.once("connect",()=>{v.removeAllListeners(),s(new _c(v,e,i,h)),this.session=null}),v.once("close",()=>{this.session=null,setImmediate(()=>{S||(S=!0,o(`${C} (${new Date().toISOString()})`))})}),v.once("error",_=>{C=_.message,this.trace("connection failed with error "+C),S||(S=!0,o(`${C} (${new Date().toISOString()})`))})})}connect(e,t,i){var n,s,o;if(this.isShutdown)return Promise.reject();let l=t._getConnectionOptions();if(!l)return Promise.reject("Credentials not loaded");if("secureContext"in l){if(l.ALPNProtocols=["h2"],i["grpc.ssl_target_name_override"]){let c=i["grpc.ssl_target_name_override"],u=(n=l.checkServerIdentity)!==null&&n!==void 0?n:Gp.checkServerIdentity;l.checkServerIdentity=(d,h)=>u(c,h),l.servername=c}else if("grpc.http_connect_target"in i){let c=(0,Wp.getDefaultAuthority)((s=(0,yi.parseUri)(i["grpc.http_connect_target"]))!==null&&s!==void 0?s:{path:"localhost"}),u=(0,yi.splitHostPort)(c);l.servername=(o=u?.host)!==null&&o!==void 0?o:c}i["grpc-node.tls_enable_trace"]&&(l.enableTrace=!0)}return(0,xC.getProxiedConnection)(e,i,l).then(c=>this.createSession(e,t,i,c))}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};js.Http2SubchannelConnector=Sc});var Vp=m(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.getSubchannelPool=Si.SubchannelPool=void 0;var JC=Cd(),YC=Lp(),KC=Je(),XC=Ue(),QC=$p(),ZC=1e4,hn=class{static{a(this,"SubchannelPool")}constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let n=this.pool[t].filter(s=>!s.subchannel.unrefIfOneRef());n.length>0&&(e=!1),this.pool[t]=n}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},ZC),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,i,n){this.ensureCleanupTask();let s=(0,XC.uriToString)(e);if(s in this.pool){let l=this.pool[s];for(let c of l)if((0,KC.subchannelAddressEqual)(t,c.subchannelAddress)&&(0,JC.channelOptionsEqual)(i,c.channelArguments)&&n._equals(c.channelCredentials))return c.subchannel}let o=new YC.Subchannel(e,t,i,n,new QC.Http2SubchannelConnector(e));return s in this.pool||(this.pool[s]=[]),this.pool[s].push({subchannelAddress:t,channelArguments:i,channelCredentials:n,subchannel:o}),o.ref(),o}};Si.SubchannelPool=hn;var eE=new hn;function tE(r){return r?eE:new hn}a(tE,"getSubchannelPool");Si.getSubchannelPool=tE});var bc=m(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.FilterStackFactory=Ci.FilterStack=void 0;var Gs=class{static{a(this,"FilterStack")}constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let i=0;i<this.filters.length;i++)t=this.filters[i].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let i=this.filters.length-1;i>=0;i--)t=this.filters[i].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let i=0;i<this.filters.length;i++)t=this.filters[i].sendMessage(t);return t}receiveMessage(e){let t=e;for(let i=this.filters.length-1;i>=0;i--)t=this.filters[i].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let i=this.filters.length-1;i>=0;i--)t=this.filters[i].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Ci.FilterStack=Gs;var Ec=class r{static{a(this,"FilterStackFactory")}constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new Gs(this.factories.map(e=>e.createFilter()))}};Ci.FilterStackFactory=Ec});var Tc=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.CompressionAlgorithms=void 0;var Jp;(function(r){r[r.identity=0]="identity",r[r.deflate=1]="deflate",r[r.gzip=2]="gzip"})(Jp||(Ws.CompressionAlgorithms=Jp={}))});var Rc=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.BaseFilter=void 0;var wc=class{static{a(this,"BaseFilter")}async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};$s.BaseFilter=wc});var Xp=m(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CompressionFilterFactory=Ti.CompressionFilter=void 0;var Vs=G("zlib"),Kp=Tc(),Ei=U(),rE=Rc(),iE=te(),nE=a(r=>typeof r=="number"&&typeof Kp.CompressionAlgorithms[r]=="string","isCompressionAlgorithmKey"),bi=class{static{a(this,"CompressionHandler")}async writeMessage(e,t){let i=e;t&&(i=await this.compressMessage(i));let n=Buffer.allocUnsafe(i.length+5);return n.writeUInt8(t?1:0,0),n.writeUInt32BE(i.length,1),i.copy(n,5),n}async readMessage(e){let t=e.readUInt8(0)===1,i=e.slice(5);return t&&(i=await this.decompressMessage(i)),i}},Ir=class extends bi{static{a(this,"IdentityHandler")}async compressMessage(e){return e}async writeMessage(e,t){let i=Buffer.allocUnsafe(e.length+5);return i.writeUInt8(0,0),i.writeUInt32BE(e.length,1),e.copy(i,5),i}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},Ac=class extends bi{static{a(this,"DeflateHandler")}constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,i)=>{Vs.deflate(e,(n,s)=>{n?i(n):t(s)})})}decompressMessage(e){return new Promise((t,i)=>{let n=0,s=[],o=Vs.createInflate();o.on("data",l=>{s.push(l),n+=l.byteLength,this.maxRecvMessageLength!==-1&&n>this.maxRecvMessageLength&&(o.destroy(),i({code:Ei.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{t(Buffer.concat(s))}),o.write(e),o.end()})}},Oc=class extends bi{static{a(this,"GzipHandler")}constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,i)=>{Vs.gzip(e,(n,s)=>{n?i(n):t(s)})})}decompressMessage(e){return new Promise((t,i)=>{let n=0,s=[],o=Vs.createGunzip();o.on("data",l=>{s.push(l),n+=l.byteLength,this.maxRecvMessageLength!==-1&&n>this.maxRecvMessageLength&&(o.destroy(),i({code:Ei.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{t(Buffer.concat(s))}),o.write(e),o.end()})}},Mc=class extends bi{static{a(this,"UnknownHandler")}constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function Yp(r,e){switch(r){case"identity":return new Ir;case"deflate":return new Ac(e);case"gzip":return new Oc(e);default:return new Mc(r)}}a(Yp,"getCompressionHandler");var Js=class extends rE.BaseFilter{static{a(this,"CompressionFilter")}constructor(e,t){var i,n,s;super(),this.sharedFilterConfig=t,this.sendCompression=new Ir,this.receiveCompression=new Ir,this.currentCompressionAlgorithm="identity";let o=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(i=e["grpc.max_receive_message_length"])!==null&&i!==void 0?i:Ei.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(n=e["grpc.max_send_message_length"])!==null&&n!==void 0?n:Ei.DEFAULT_MAX_SEND_MESSAGE_LENGTH,o!==void 0)if(nE(o)){let l=Kp.CompressionAlgorithms[o],c=(s=t.serverSupportedEncodingHeader)===null||s===void 0?void 0:s.split(",");(!c||c.includes(l))&&(this.currentCompressionAlgorithm=l,this.sendCompression=Yp(this.currentCompressionAlgorithm,-1))}else iE.log(Ei.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${o}`)}async sendMetadata(e){let t=await e;return t.set("grpc-accept-encoding","identity,deflate,gzip"),t.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?t.remove("grpc-encoding"):t.set("grpc-encoding",this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get("grpc-encoding");if(t.length>0){let n=t[0];typeof n=="string"&&(this.receiveCompression=Yp(n,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let i=e.get("grpc-accept-encoding")[0];return i&&(this.sharedFilterConfig.serverSupportedEncodingHeader=i,i.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Ir,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var t;let i=await e;if(this.maxSendMessageLength!==-1&&i.message.length>this.maxSendMessageLength)throw{code:Ei.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let n;return this.sendCompression instanceof Ir?n=!1:n=(((t=i.flags)!==null&&t!==void 0?t:0)&2)===0,{message:await this.sendCompression.writeMessage(i.message,n),flags:i.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};Ti.CompressionFilter=Js;var Pc=class{static{a(this,"CompressionFilterFactory")}constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new Js(this.options,this.sharedFilterConfig)}};Ti.CompressionFilterFactory=Pc});var fn=m(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.formatDateDifference=rt.deadlineToString=rt.getRelativeTimeout=rt.getDeadlineTimeoutString=rt.minDeadline=void 0;function sE(...r){let e=1/0;for(let t of r){let i=t instanceof Date?t.getTime():t;i<e&&(e=i)}return e}a(sE,"minDeadline");rt.minDeadline=sE;var aE=[["m",1],["S",1e3],["M",60*1e3],["H",60*60*1e3]];function oE(r){let e=new Date().getTime();r instanceof Date&&(r=r.getTime());let t=Math.max(r-e,0);for(let[i,n]of aE){let s=t/n;if(s<1e8)return String(Math.ceil(s))+i}throw new Error("Deadline is too far in the future")}a(oE,"getDeadlineTimeoutString");rt.getDeadlineTimeoutString=oE;var lE=2147483647;function cE(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),i=e-t;return i<0?0:i>lE?1/0:i}a(cE,"getRelativeTimeout");rt.getRelativeTimeout=cE;function uE(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?""+r:e.toISOString()}}a(uE,"deadlineToString");rt.deadlineToString=uE;function dE(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+"s"}a(dE,"formatDateDifference");rt.formatDateDifference=dE});var Ks=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.restrictControlPlaneStatusCode=void 0;var It=U(),hE=[It.Status.OK,It.Status.INVALID_ARGUMENT,It.Status.NOT_FOUND,It.Status.ALREADY_EXISTS,It.Status.FAILED_PRECONDITION,It.Status.ABORTED,It.Status.OUT_OF_RANGE,It.Status.DATA_LOSS];function fE(r,e){return hE.includes(r)?{code:It.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${It.Status[r]} ${e}`}:{code:r,details:e}}a(fE,"restrictControlPlaneStatusCode");Ys.restrictControlPlaneStatusCode=fE});var eg=m(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.LoadBalancingCall=void 0;var Qp=$e(),Xs=U(),Zp=fn(),Qs=we(),pn=Qt(),pE=Ue(),gE=te(),Nc=Ks(),mE=G("http2"),vE="load_balancing_call",kc=class{static{a(this,"LoadBalancingCall")}constructor(e,t,i,n,s,o,l){var c,u;this.channel=e,this.callConfig=t,this.methodName=i,this.host=n,this.credentials=s,this.deadline=o,this.callNumber=l,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let d=this.methodName.split("/"),h="";d.length>=2&&(h=d[1]);let p=(u=(c=(0,pE.splitHostPort)(this.host))===null||c===void 0?void 0:c.host)!==null&&u!==void 0?u:"localhost";this.serviceUrl=`https://${p}/${h}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let i=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&i.push("wait_for_ready"),i.push(`LB pick: ${(0,Zp.formatDateDifference)(this.startTime,this.childStartTime)}`)),i.push(...this.child.getDeadlineInfo()),i):(!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady&&i.push("wait_for_ready"),i.push("Waiting for LB pick"),i)}trace(e){gE.trace(Xs.LogVerbosity.DEBUG,vE,"["+this.callNumber+"] "+e)}outputStatus(e,t){var i,n;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let s=Object.assign(Object.assign({},e),{progress:t});(i=this.listener)===null||i===void 0||i.onReceiveStatus(s),(n=this.onCallEnded)===null||n===void 0||n.call(this,s.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let i=this.metadata.clone(),n=this.channel.doPick(i,this.callConfig.pickInformation),s=n.subchannel?"("+n.subchannel.getChannelzRef().id+") "+n.subchannel.getAddress():""+n.subchannel;switch(this.trace("Pick result: "+pn.PickResultType[n.pickResultType]+" subchannel: "+s+" status: "+((e=n.status)===null||e===void 0?void 0:e.code)+" "+((t=n.status)===null||t===void 0?void 0:t.details)),n.pickResultType){case pn.PickResultType.COMPLETE:this.credentials.generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(c=>{var u,d,h;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(i.merge(c),i.get("authorization").length>1&&this.outputStatus({code:Xs.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new Qs.Metadata},"PROCESSED"),n.subchannel.getConnectivityState()!==Qp.ConnectivityState.READY){this.trace("Picked subchannel "+s+" has state "+Qp.ConnectivityState[n.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&i.set("grpc-timeout",(0,Zp.getDeadlineTimeoutString)(this.deadline));try{this.child=n.subchannel.getRealSubchannel().createCall(i,this.host,this.methodName,{onReceiveMetadata:a(p=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(p)},"onReceiveMetadata"),onReceiveMessage:a(p=>{this.trace("Received message"),this.listener.onReceiveMessage(p)},"onReceiveMessage"),onReceiveStatus:a(p=>{this.trace("Received status"),p.rstCode===mE.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(p,"REFUSED"):this.outputStatus(p,"PROCESSED")},"onReceiveStatus")}),this.childStartTime=new Date}catch(p){this.trace("Failed to start call on picked subchannel "+s+" with error "+p.message),this.outputStatus({code:Xs.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+p.message,metadata:new Qs.Metadata},"NOT_STARTED");return}(d=(u=this.callConfig).onCommitted)===null||d===void 0||d.call(u),(h=n.onCallStarted)===null||h===void 0||h.call(n),this.onCallEnded=n.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},c=>{let{code:u,details:d}=(0,Nc.restrictControlPlaneStatusCode)(typeof c.code=="number"?c.code:Xs.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${c.message}`);this.outputStatus({code:u,details:d,metadata:new Qs.Metadata},"PROCESSED")});break;case pn.PickResultType.DROP:let{code:o,details:l}=(0,Nc.restrictControlPlaneStatusCode)(n.status.code,n.status.details);setImmediate(()=>{this.outputStatus({code:o,details:l,metadata:n.status.metadata},"DROP")});break;case pn.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:c,details:u}=(0,Nc.restrictControlPlaneStatusCode)(n.status.code,n.status.details);setImmediate(()=>{this.outputStatus({code:c,details:u,metadata:n.status.metadata},"PROCESSED")})}break;case pn.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var i;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(i=this.child)===null||i===void 0||i.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Qs.Metadata},"PROCESSED")}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}};Zs.LoadBalancingCall=kc});var rg=m(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.ResolvingCall=void 0;var xr=U(),Dr=fn(),tg=we(),yE=te(),_E=Ks(),SE="resolving_call",Ic=class{static{a(this,"ResolvingCall")}constructor(e,t,i,n,s,o){this.channel=e,this.method=t,this.filterStackFactory=n,this.credentials=s,this.callNumber=o,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.deadline=i.deadline,this.host=i.host,i.parentCall&&(i.flags&xr.Propagate.CANCELLATION&&i.parentCall.on("cancelled",()=>{this.cancelWithStatus(xr.Status.CANCELLED,"Cancelled by parent call")}),i.flags&xr.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+i.parentCall.getDeadline()),this.deadline=(0,Dr.minDeadline)(this.deadline,i.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){yE.trace(xr.LogVerbosity.DEBUG,SE,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,Dr.deadlineToString)(this.deadline));let e=(0,Dr.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let t=a(()=>{if(!this.deadlineStartTime){this.cancelWithStatus(xr.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let i=[],n=new Date;i.push(`Deadline exceeded after ${(0,Dr.formatDateDifference)(this.deadlineStartTime,n)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&i.push(`name resolution: ${(0,Dr.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&i.push(`metadata filters: ${(0,Dr.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):i.push("waiting for metadata filters")):i.push("waiting for name resolution"),this.child&&i.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(xr.Status.DEADLINE_EXCEEDED,i.join(","))},"handleDeadline");e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+t.code+' details="'+t.details+'"'),this.statusWatchers.forEach(i=>i(t)),process.nextTick(()=>{var i;(i=this.listener)===null||i===void 0||i.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let i=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(n=>{this.writeFilterPending=!1,i.sendMessageWithContext(e,n.message),this.pendingHalfClose&&i.halfClose()},n=>{this.cancelWithStatus(n.code,n.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==xr.Status.OK){let{code:i,details:n}=(0,_E.restrictControlPlaneStatusCode)(t.status,"Failed to route call to method "+this.method);this.outputStatus({code:i,details:n,metadata:new tg.Metadata});return}if(t.methodConfig.timeout){let i=new Date;i.setSeconds(i.getSeconds()+t.methodConfig.timeout.seconds),i.setMilliseconds(i.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,Dr.minDeadline)(this.deadline,i),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(i=>{this.child=this.channel.createInnerCall(t,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(i,{onReceiveMetadata:a(n=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(n))},"onReceiveMetadata"),onReceiveMessage:a(n=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(n).then(s=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(s),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},s=>{this.cancelWithStatus(s.code,s.details)})},"onReceiveMessage"),onReceiveStatus:a(n=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=n:this.outputStatus(n)},"onReceiveStatus")}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},i=>{this.outputStatus(i)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var i;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(i=this.child)===null||i===void 0||i.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new tg.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=this.credentials.compose(e)}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}};ea.ResolvingCall=Ic});var ig=m(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.RetryingCall=hr.MessageBufferTracker=hr.RetryThrottler=void 0;var ta=U(),CE=fn(),EE=we(),bE=te(),TE="retrying_call",Dc=class{static{a(this,"RetryThrottler")}constructor(e,t,i){this.maxTokens=e,this.tokenRatio=t,i?this.tokens=i.tokens*(e/i.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.max(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.min(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};hr.RetryThrottler=Dc;var Lc=class{static{a(this,"MessageBufferTracker")}constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var i;let n=(i=this.allocatedPerCall.get(t))!==null&&i!==void 0?i:0;return this.limitPerCall-n<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,n+e),this.totalAllocated+=e,!0)}free(e,t){var i;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let n=(i=this.allocatedPerCall.get(t))!==null&&i!==void 0?i:0;if(n<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${n}`);this.allocatedPerCall.set(t,n-e)}freeAll(e){var t;let i=(t=this.allocatedPerCall.get(e))!==null&&t!==void 0?t:0;if(this.totalAllocated<i)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${i} > total allocated ${this.totalAllocated}`);this.totalAllocated-=i,this.allocatedPerCall.delete(e)}};hr.MessageBufferTracker=Lc;var xc="grpc-previous-rpc-attempts",wE=5,qc=class{static{a(this,"RetryingCall")}constructor(e,t,i,n,s,o,l,c,u){var d;this.channel=e,this.callConfig=t,this.methodName=i,this.host=n,this.credentials=s,this.deadline=o,this.callNumber=l,this.bufferTracker=c,this.retryThrottler=u,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let h=(d=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&d!==void 0?d:wE;if(t.methodConfig.retryPolicy){this.state="RETRY";let p=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(p.initialBackoff.substring(0,p.initialBackoff.length-1)),this.maxAttempts=Math.min(p.maxAttempts,h)}else t.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,h)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,CE.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){bE.trace(ta.LogVerbosity.DEBUG,TE,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)===null||t===void 0||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.reportStatus({code:e,details:t,metadata:new EE.Metadata});for(let{call:i}of this.underlyingCalls)i.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&&t!==void 0?t:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let i=this.getBufferEntry(t);i.allocated&&this.bufferTracker.free(i.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){if(this.state!=="COMMITTED"&&this.underlyingCalls[e].state!=="COMPLETED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",this.committedCallIndex=e;for(let t=0;t<this.underlyingCalls.length;t++)t!==e&&this.underlyingCalls[t].state!=="COMPLETED"&&(this.underlyingCalls[t].state="COMPLETED",this.underlyingCalls[t].call.cancelWithStatus(ta.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,t=-1;for(let[i,n]of this.underlyingCalls.entries())n.state==="ACTIVE"&&n.nextMessageToSend>e&&(e=n.nextMessageToSend,t=i);t===-1?this.state="TRANSPARENT_ONLY":this.commitCall(t)}isStatusCodeInList(e,t){return e.some(i=>{var n;return i===t||i.toString().toLowerCase()===((n=ta.Status[t])===null||n===void 0?void 0:n.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let i=Math.random()*this.nextRetryBackoffSec*1e3,n=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,n),i}maybeRetryCall(e,t){if(this.state!=="RETRY"){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let i;if(e===null)i=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",t(!1);return}else i=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var n,s;if(this.state!=="RETRY"){t(!1);return}(!((s=(n=this.retryThrottler)===null||n===void 0?void 0:n.canRetryCall())!==null&&s!==void 0)||s)&&(t(!0),this.attempts+=1,this.startNewAttempt())},i)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)t?.state==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,t,i){var n,s,o;switch(this.state){case"COMMITTED":case"TRANSPARENT_ONLY":this.commitCall(t),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((n=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&n!==void 0?n:[],e.code)){(s=this.retryThrottler)===null||s===void 0||s.addCallFailed();let l;if(i===null)l=0;else if(i<0){this.state="TRANSPARENT_ONLY",this.commitCall(t),this.reportStatus(e);return}else l=i;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},l)}else this.commitCall(t),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((o=this.retryThrottler)===null||o===void 0||o.addCallFailed(),this.maybeRetryCall(i,l=>{l||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get("grpc-retry-pushback-ms");if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var i;if(this.underlyingCalls[t].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[t].call.getCallNumber()+"] in state "+this.underlyingCalls[t].state),this.underlyingCalls[t].state="COMPLETED",e.code===ta.Status.OK){(i=this.retryThrottler)===null||i===void 0||i.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let n=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,t,n):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(t),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,t,n);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,i;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let n=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let s=(e=n.hedgingDelay)!==null&&e!==void 0?e:"0s",o=Number(s.substring(0,s.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},o*1e3),(i=(t=this.hedgingTimer).unref)===null||i===void 0||i.call(t)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let i=this.attempts-1,n=this.initialMetadata.clone();i>0&&n.set(xc,`${i}`);let s=!1;e.start(n,{onReceiveMetadata:a(o=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(t),s=!0,i>0&&o.set(xc,`${i}`),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMetadata(o)},"onReceiveMetadata"),onReceiveMessage:a(o=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(t),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMessage(o)},"onReceiveMessage"),onReceiveStatus:a(o=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!s&&i>0&&o.metadata.set(xc,`${i}`),this.handleChildStatus(o,t)},"onReceiveStatus")}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace("start called"),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e){var t,i;let n=this.underlyingCalls[e],s=n.nextMessageToSend;(i=(t=this.getBufferEntry(s)).callback)===null||i===void 0||i.call(t),this.clearSentMessages(),n.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!=="COMPLETED"&&this.getBufferEntry(t.nextMessageToSend)){let i=this.getBufferEntry(t.nextMessageToSend);switch(i.entryType){case"MESSAGE":t.call.sendMessageWithContext({callback:a(n=>{this.handleChildWriteCompleted(e)},"callback")},i.message.message);break;case"HALF_CLOSE":t.nextMessageToSend+=1,t.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,t){var i;this.trace("write() called with message of length "+t.length);let n={message:t,flags:e.flags},s=this.getNextBufferIndex(),o={entryType:"MESSAGE",message:n,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(o),o.allocated){(i=e.callback)===null||i===void 0||i.call(e);for(let[l,c]of this.underlyingCalls.entries())c.state==="ACTIVE"&&c.nextMessageToSend===s&&c.call.sendMessageWithContext({callback:a(u=>{this.handleChildWriteCompleted(l)},"callback")},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let l=this.underlyingCalls[this.committedCallIndex];o.callback=e.callback,l.state==="ACTIVE"&&l.nextMessageToSend===s&&l.call.sendMessageWithContext({callback:a(c=>{this.handleChildWriteCompleted(this.committedCallIndex)},"callback")},t)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let t of this.underlyingCalls)t?.state==="ACTIVE"&&t.nextMessageToSend===e&&(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}};hr.RetryingCall=qc});var ia=m(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.BaseSubchannelWrapper=void 0;var Fc=class{static{a(this,"BaseSubchannelWrapper")}constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}};ra.BaseSubchannelWrapper=Fc});var sg=m(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.InternalChannel=void 0;var RE=Fi(),AE=Sd(),OE=Vp(),zc=Qt(),ME=we(),fr=U(),PE=bc(),NE=Xp(),ng=_t(),na=te(),kE=fc(),sa=Ue(),pt=$e(),gn=kr(),IE=eg(),xE=fn(),DE=rg(),Bc=vc(),LE=Ks(),Uc=ig(),qE=ia(),FE=2147483647,BE=1e3,UE=30*60*1e3,aa=new Map,zE=1<<24,HE=1<<20,Hc=class extends qE.BaseSubchannelWrapper{static{a(this,"ChannelSubchannelWrapper")}constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(i,n,s,o)=>{t.throttleKeepalive(o)},e.addConnectivityStateListener(this.subchannelStateListener)}ref(){this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},jc=class{static{a(this,"ShutdownPicker")}pick(e){return{pickResultType:zc.PickResultType.DROP,status:{code:fr.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new ME.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}},Gc=class{static{a(this,"InternalChannel")}constructor(e,t,i){var n,s,o,l,c,u,d,h;if(this.credentials=t,this.options=i,this.connectivityState=pt.ConnectivityState.IDLE,this.currentPicker=new zc.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.callTracker=new gn.ChannelzCallTracker,this.childrenTracker=new gn.ChannelzChildrenTracker,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof RE.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(i&&typeof i!="object")throw new TypeError("Channel options must be an object");this.originalTarget=e;let p=(0,sa.parseUri)(e);if(p===null)throw new Error(`Could not parse target name "${e}"`);let g=(0,ng.mapUriDefaultScheme)(p);if(g===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.callRefTimer=setInterval(()=>{},FE),(s=(n=this.callRefTimer).unref)===null||s===void 0||s.call(n),this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzTrace=new gn.ChannelzTrace,this.channelzRef=(0,gn.registerChannelzChannel)(e,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,ng.getDefaultAuthority)(g);let y=(0,kE.mapProxyName)(g,i);this.target=y.target,this.options=Object.assign({},this.options,y.extraOptions),this.subchannelPool=(0,OE.getSubchannelPool)(((o=i["grpc.use_local_subchannel_pool"])!==null&&o!==void 0?o:0)===0),this.retryBufferTracker=new Uc.MessageBufferTracker((l=i["grpc.retry_buffer_size"])!==null&&l!==void 0?l:zE,(c=i["grpc.per_rpc_retry_buffer_size"])!==null&&c!==void 0?c:HE),this.keepaliveTime=(u=i["grpc.keepalive_time_ms"])!==null&&u!==void 0?u:-1,this.idleTimeoutMs=Math.max((d=i["grpc.client_idle_timeout_ms"])!==null&&d!==void 0?d:UE,BE);let v={createSubchannel:a((S,_,P)=>{let A=this.subchannelPool.getOrCreateSubchannel(this.target,S,Object.assign({},this.options,_),P??this.credentials);A.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Created subchannel or used existing subchannel",A.getChannelzRef());let L=new Hc(A,this);return this.wrappedSubchannels.add(L),L},"createSubchannel"),updateState:a((S,_)=>{this.currentPicker=_;let P=this.pickQueue.slice();this.pickQueue=[],P.length>0&&this.callRefTimerUnref();for(let A of P)A.doPick();this.updateState(S)},"updateState"),requestReresolution:a(()=>{throw new Error("Resolving load balancer should never call requestReresolution")},"requestReresolution"),addChannelzChild:a(S=>{this.channelzEnabled&&this.childrenTracker.refChild(S)},"addChannelzChild"),removeChannelzChild:a(S=>{this.channelzEnabled&&this.childrenTracker.unrefChild(S)},"removeChannelzChild")};this.resolvingLoadBalancer=new AE.ResolvingLoadBalancer(this.target,v,t,i,(S,_)=>{S.retryThrottling?aa.set(this.getTarget(),new Uc.RetryThrottler(S.retryThrottling.maxTokens,S.retryThrottling.tokenRatio,aa.get(this.getTarget()))):aa.delete(this.getTarget()),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Address resolution succeeded"),this.configSelector=_,this.currentResolutionError=null,process.nextTick(()=>{let P=this.configSelectionQueue;this.configSelectionQueue=[],P.length>0&&this.callRefTimerUnref();for(let A of P)A.getConfig()})},S=>{this.channelzEnabled&&this.channelzTrace.addTrace("CT_WARNING","Address resolution failed with code "+S.code+' and details "'+S.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,LE.restrictControlPlaneStatusCode)(S.code,S.details)),{metadata:S.metadata}));let _=this.configSelectionQueue;this.configSelectionQueue=[],_.length>0&&this.callRefTimerUnref();for(let P of _)P.reportResolverError(S)}),this.filterStackFactory=new PE.FilterStackFactory([new NE.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(i,void 0,2));let C=new Error;(0,na.isTracerEnabled)("channel_stacktrace")&&(0,na.trace)(fr.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
21
+ `+((h=C.stack)===null||h===void 0?void 0:h.substring(C.stack.indexOf(`
22
+ `)+1))),this.lastActivityTimestamp=new Date}getChannelzInfo(){return{target:this.originalTarget,state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}}trace(e,t){(0,na.trace)(t??fr.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,sa.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,t,i,n;!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&&t.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(i=this.callRefTimer).ref)===null||n===void 0||n.call(i))}callRefTimerUnref(){var e,t;(!this.callRefTimer.hasRef||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(t=(e=this.callRefTimer).unref)===null||t===void 0||t.call(e))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(i=>i===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,na.trace)(fr.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,sa.uriToString)(this.target)+" "+pt.ConnectivityState[this.connectivityState]+" -> "+pt.ConnectivityState[e]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+pt.ConnectivityState[e]),this.connectivityState=e;let t=this.connectivityStateWatchers.slice();for(let i of t)e!==i.currentState&&(i.timer&&clearTimeout(i.timer),this.removeConnectivityStateWatcher(i),i.callback());e!==pt.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==pt.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector(e,t,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(pt.ConnectivityState.IDLE),this.currentPicker=new zc.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}startIdleTimeout(e){var t,i;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let s=new Date().valueOf()-this.lastActivityTimestamp.valueOf();s>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-s)},e),(i=(t=this.idleTimer).unref)===null||i===void 0||i.call(t)}maybeStartIdleTimer(){this.connectivityState!==pt.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===fr.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,i,n,s){let o=(0,Bc.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+o+'] method="'+t+'"'),new IE.LoadBalancingCall(this,e,t,i,n,s,o)}createRetryingCall(e,t,i,n,s){let o=(0,Bc.getNextCallNumber)();return this.trace("createRetryingCall ["+o+'] method="'+t+'"'),new Uc.RetryingCall(this,e,t,i,n,s,o,this.retryBufferTracker,aa.get(this.getTarget()))}createInnerCall(e,t,i,n,s){return this.options["grpc.enable_retries"]===0?this.createLoadBalancingCall(e,t,i,n,s):this.createRetryingCall(e,t,i,n,s)}createResolvingCall(e,t,i,n,s){let o=(0,Bc.getNextCallNumber)();this.trace("createResolvingCall ["+o+'] method="'+e+'", deadline='+(0,xE.deadlineToString)(t));let l={deadline:t,flags:s??fr.Propagate.DEFAULTS,host:i??this.defaultAuthority,parentCall:n},c=new DE.ResolvingCall(this,e,l,this.filterStackFactory.clone(),this.credentials._getCallCredentials(),o);return this.onCallStart(),c.addStatusWatcher(u=>{this.onCallEnd(u)}),c}close(){this.resolvingLoadBalancer.destroy(),this.updateState(pt.ConnectivityState.SHUTDOWN),this.currentPicker=new jc;for(let e of this.configSelectionQueue)e.cancelWithStatus(fr.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let e of this.pickQueue)e.cancelWithStatus(fr.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,gn.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels()}getTarget(){return(0,sa.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,i){if(this.connectivityState===pt.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let n=null;if(t!==1/0){let o=t instanceof Date?t:new Date(t),l=new Date;if(t===-1/0||o<=l){process.nextTick(i,new Error("Deadline passed without connectivity state change"));return}n=setTimeout(()=>{this.removeConnectivityStateWatcher(s),i(new Error("Deadline passed without connectivity state change"))},o.getTime()-l.getTime())}let s={currentState:e,callback:i,timer:n};this.connectivityStateWatchers.push(s)}getChannelzRef(){return this.channelzRef}createCall(e,t,i,n,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===pt.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,t,i,n,s)}getOptions(){return this.options}};oa.InternalChannel=Gc});var Vo=m(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.ChannelImplementation=void 0;var jE=Fi(),GE=sg(),Wc=class{static{a(this,"ChannelImplementation")}constructor(e,t,i){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof jE.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(i&&typeof i!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new GE.InternalChannel(e,t,i)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,i){this.internalChannel.watchConnectivityState(e,t,i)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,i,n,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,t,i,n,s)}};la.ChannelImplementation=Wc});var og=m(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.ServerDuplexStreamImpl=it.ServerWritableStreamImpl=it.ServerReadableStreamImpl=it.ServerUnaryCallImpl=it.serverErrorToStatus=void 0;var WE=G("events"),Kc=G("stream"),Xc=U(),ag=we();function Qc(r,e){var t;let i={code:Xc.Status.UNKNOWN,details:"message"in r?r.message:"Unknown Error",metadata:(t=e??r.metadata)!==null&&t!==void 0?t:null};return"code"in r&&typeof r.code=="number"&&Number.isInteger(r.code)&&(i.code=r.code,"details"in r&&typeof r.details=="string"&&(i.details=r.details)),i}a(Qc,"serverErrorToStatus");it.serverErrorToStatus=Qc;var $c=class extends WE.EventEmitter{static{a(this,"ServerUnaryCallImpl")}constructor(e,t,i,n){super(),this.path=e,this.call=t,this.metadata=i,this.request=n,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};it.ServerUnaryCallImpl=$c;var Vc=class extends Kc.Readable{static{a(this,"ServerReadableStreamImpl")}constructor(e,t,i){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=i,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}};it.ServerReadableStreamImpl=Vc;var Jc=class extends Kc.Writable{static{a(this,"ServerWritableStreamImpl")}constructor(e,t,i,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=i,this.request=n,this.pendingStatus={code:Xc.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new ag.Metadata,this.on("error",s=>{this.pendingStatus=Qc(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_write(e,t,i){this.call.sendMessage(e,i)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};it.ServerWritableStreamImpl=Jc;var Yc=class extends Kc.Duplex{static{a(this,"ServerDuplexStreamImpl")}constructor(e,t,i){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=i,this.pendingStatus={code:Xc.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new ag.Metadata,this.on("error",n=>{this.pendingStatus=Qc(n),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}_read(e){this.call.startRead()}_write(e,t,i){this.call.sendMessage(e,i)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};it.ServerDuplexStreamImpl=Yc});var ca=m(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.createServerCredentialsWithInterceptors=pr.createCertificateProviderServerCredentials=pr.ServerCredentials=void 0;var lg=go(),Lr=class{static{a(this,"ServerCredentials")}constructor(){this.watchers=new Set,this.latestContextOptions=null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let t of this.watchers)t(this.latestContextOptions)}_getSettings(){return this.latestContextOptions}_getInterceptors(){return[]}static createInsecure(){return new Zc}static createSsl(e,t,i=!1){var n;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(t))throw new TypeError("keyCertPairs must be an array");if(typeof i!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let s=[],o=[];for(let l=0;l<t.length;l++){let c=t[l];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${l}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${l}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${l}].cert_chain must be a Buffer`);s.push(c.cert_chain),o.push(c.private_key)}return new eu({ca:(n=e??(0,lg.getDefaultRootsData)())!==null&&n!==void 0?n:void 0,cert:s,key:o,requestCert:i,ciphers:lg.CIPHER_SUITES})}};pr.ServerCredentials=Lr;var Zc=class r extends Lr{static{a(this,"InsecureServerCredentials")}_isSecure(){return!1}_getSettings(){return null}_equals(e){return e instanceof r}},eu=class r extends Lr{static{a(this,"SecureServerCredentials")}constructor(e){super(),this.options=e}_isSecure(){return!0}_getSettings(){return this.options}_equals(e){if(this===e)return!0;if(!(e instanceof r))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t<this.options.cert.length;t++){let i=this.options.cert[t],n=e.options.cert[t];if(Buffer.isBuffer(i)&&Buffer.isBuffer(n)){if(!i.equals(n))return!1}else if(i!==n)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t<this.options.key.length;t++){let i=this.options.key[t],n=e.options.key[t];if(Buffer.isBuffer(i)&&Buffer.isBuffer(n)){if(!i.equals(n))return!1}else if(i!==n)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},tu=class r extends Lr{static{a(this,"CertificateProviderServerCredentials")}constructor(e,t,i){super(),this.identityCertificateProvider=e,this.caCertificateProvider=t,this.requireClientCertificate=i,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:this.latestIdentityUpdate.certificate,key:this.latestIdentityUpdate.privateKey,requestCert:this.latestIdentityUpdate!==null,rejectUnauthorized:this.requireClientCertificate}}finalizeUpdate(){this.updateSecureContextOptions(this.calculateSecureContextOptions())}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function $E(r,e,t){return new tu(r,e,t)}a($E,"createCertificateProviderServerCredentials");pr.createCertificateProviderServerCredentials=$E;var ru=class r extends Lr{static{a(this,"InterceptorServerCredentials")}constructor(e,t){super(),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t<this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}};function VE(r,e){return new ru(r,e)}a(VE,"createServerCredentialsWithInterceptors");pr.createServerCredentialsWithInterceptors=VE});var cu=m(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.getServerInterceptingCall=qe.BaseServerInterceptingCall=qe.ServerInterceptingCall=qe.ResponderBuilder=qe.isInterceptingServerListener=qe.ServerListenerBuilder=void 0;var cg=we(),Le=U(),wi=G("http2"),ug=Dn(),dg=G("zlib"),JE=gc(),gg=te(),mg="server_call";function qr(r){gg.trace(Le.LogVerbosity.DEBUG,mg,r)}a(qr,"trace");var nu=class{static{a(this,"ServerListenerBuilder")}constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};qe.ServerListenerBuilder=nu;function YE(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}a(YE,"isInterceptingServerListener");qe.isInterceptingServerListener=YE;var su=class{static{a(this,"InterceptingServerListenerImpl")}constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},au=class{static{a(this,"ResponderBuilder")}constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};qe.ResponderBuilder=au;var ua={onReceiveMetadata:a((r,e)=>{e(r)},"onReceiveMetadata"),onReceiveMessage:a((r,e)=>{e(r)},"onReceiveMessage"),onReceiveHalfClose:a(r=>{r()},"onReceiveHalfClose"),onCancel:a(()=>{},"onCancel")},da={start:a(r=>{r()},"start"),sendMetadata:a((r,e)=>{e(r)},"sendMetadata"),sendMessage:a((r,e)=>{e(r)},"sendMessage"),sendStatus:a((r,e)=>{e(r)},"sendStatus")},ou=class{static{a(this,"ServerInterceptingCall")}constructor(e,t){var i,n,s,o;this.nextCall=e,this.processingMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(i=t?.start)!==null&&i!==void 0?i:da.start,sendMetadata:(n=t?.sendMetadata)!==null&&n!==void 0?n:da.sendMetadata,sendMessage:(s=t?.sendMessage)!==null&&s!==void 0?s:da.sendMessage,sendStatus:(o=t?.sendStatus)!==null&&o!==void 0?o:da.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=>{var i,n,s,o;let l={onReceiveMetadata:(i=t?.onReceiveMetadata)!==null&&i!==void 0?i:ua.onReceiveMetadata,onReceiveMessage:(n=t?.onReceiveMessage)!==null&&n!==void 0?n:ua.onReceiveMessage,onReceiveHalfClose:(s=t?.onReceiveHalfClose)!==null&&s!==void 0?s:ua.onReceiveHalfClose,onCancel:(o=t?.onCancel)!==null&&o!==void 0?o:ua.onCancel},c=new su(l,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.responder.sendMetadata(e,t=>{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.responder.sendMessage(e,i=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=i,this.pendingMessageCallback=t):this.nextCall.sendMessage(i,t)})}sendStatus(e){this.responder.sendStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};qe.ServerInterceptingCall=ou;var vg="grpc-accept-encoding",lu="grpc-encoding",hg="grpc-message",fg="grpc-status",iu="grpc-timeout",KE=/(\d{1,8})\s*([HMSmun])/,XE={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},QE={[vg]:"identity,deflate,gzip",[lu]:"identity"},pg={[wi.constants.HTTP2_HEADER_STATUS]:wi.constants.HTTP_STATUS_OK,[wi.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},ZE={waitForTrailers:!0},ha=class{static{a(this,"BaseServerInterceptingCall")}constructor(e,t,i,n,s){var o;this.stream=e,this.callEventTracker=i,this.handler=n,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Le.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Le.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.stream.once("error",d=>{}),this.stream.once("close",()=>{var d;qr("Request to method "+((d=this.handler)===null||d===void 0?void 0:d.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:Le.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",d=>{this.handleDataFrame(d)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in s&&(this.maxSendMessageSize=s["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in s&&(this.maxReceiveMessageSize=s["grpc.max_receive_message_length"]),this.host=(o=t[":authority"])!==null&&o!==void 0?o:t.host,this.decoder=new JE.StreamDecoder(this.maxReceiveMessageSize);let l=cg.Metadata.fromHttp2Headers(t);gg.isTracerEnabled(mg)&&qr("Request to "+this.handler.path+" received headers "+JSON.stringify(l.toJSON()));let c=l.get(iu);c.length>0&&this.handleTimeoutHeader(c[0]);let u=l.get(lu);u.length>0&&(this.incomingEncoding=u[0]),l.remove(iu),l.remove(lu),l.remove(vg),l.remove(wi.constants.HTTP2_HEADER_ACCEPT_ENCODING),l.remove(wi.constants.HTTP2_HEADER_TE),l.remove(wi.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=l}handleTimeoutHeader(e){let t=e.toString().match(KE);if(t===null){let s={code:Le.Status.INTERNAL,details:`Invalid ${iu} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(s)});return}let i=+t[1]*XE[t[2]]|0,n=new Date;this.deadline=n.setMilliseconds(n.getMilliseconds()+i),this.deadlineTimer=setTimeout(()=>{let s={code:Le.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(s)},i)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new cg.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),i=t.byteLength,n=Buffer.allocUnsafe(i+5);return n.writeUInt8(0,0),n.writeUInt32BE(i,1),t.copy(n,5),n}decompressMessage(e,t){let i=e.subarray(5);if(t==="identity")return i;if(t==="deflate"||t==="gzip"){let n;return t==="deflate"?n=dg.createInflate():n=dg.createGunzip(),new Promise((s,o)=>{let l=0,c=[];n.on("data",u=>{c.push(u),l+=u.byteLength,this.maxReceiveMessageSize!==-1&&l>this.maxReceiveMessageSize&&(n.destroy(),o({code:Le.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),n.on("end",()=>{s(Buffer.concat(c))}),n.write(i),n.end()})}else return Promise.reject({code:Le.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let i=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",n;try{n=await this.decompressMessage(e.compressedMessage,i)}catch(s){this.sendStatus(s);return}try{e.parsedMessage=this.handler.deserialize(n)}catch(s){this.sendStatus({code:Le.Status.INTERNAL,details:`Error deserializing request: ${s.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;qr("Request to "+this.handler.path+" received data frame of size "+e.length);let i;try{i=this.decoder.write(e)}catch(n){this.sendStatus({code:Le.Status.RESOURCE_EXHAUSTED,details:n.message});return}for(let n of i){this.stream.pause();let s={type:"COMPRESSED",compressedMessage:n,parsedMessage:null};this.readQueue.push(s),this.decompressAndMaybePush(s),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){qr("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,i=Object.assign(Object.assign(Object.assign({},pg),QE),t);this.stream.respond(i,ZE)}sendMessage(e,t){if(this.checkCancelled())return;let i;try{i=this.serializeMessage(e)}catch(n){this.sendStatus({code:Le.Status.INTERNAL,details:`Error serializing response: ${(0,ug.getErrorMessage)(n)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&i.length-5>this.maxSendMessageSize){this.sendStatus({code:Le.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${i.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),qr("Request to "+this.handler.path+" sent data frame of size "+i.length),this.stream.write(i,n=>{var s;if(n){this.sendStatus({code:Le.Status.INTERNAL,details:`Error writing message: ${(0,ug.getErrorMessage)(n)}`,metadata:null});return}(s=this.callEventTracker)===null||s===void 0||s.addMessageSent(),t()})}sendStatus(e){var t,i;if(!this.checkCancelled())if(qr("Request to method "+((t=this.handler)===null||t===void 0?void 0:t.path)+" ended with status code: "+Le.Status[e.code]+" details: "+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var n;this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign({[fg]:e.code,[hg]:encodeURI(e.details)},(n=e.metadata)===null||n===void 0?void 0:n.toHttp2Headers());this.stream.sendTrailers(s),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let n=Object.assign(Object.assign({[fg]:e.code,[hg]:encodeURI(e.details)},pg),(i=e.metadata)===null||i===void 0?void 0:i.toHttp2Headers());this.stream.respond(n,{endStream:!0}),this.notifyOnCancel()}}startRead(){qr("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t?.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}};qe.BaseServerInterceptingCall=ha;function eb(r,e,t,i,n,s){let o={path:n.path,requestStream:n.type==="clientStream"||n.type==="bidi",responseStream:n.type==="serverStream"||n.type==="bidi",requestDeserialize:n.deserialize,responseSerialize:n.serialize},l=new ha(e,t,i,n,s);return r.reduce((c,u)=>u(o,c),l)}a(eb,"getServerInterceptingCall");qe.getServerInterceptingCall=eb});var Tg=m(mr=>{"use strict";var tb=mr&&mr.__runInitializers||function(r,e,t){for(var i=arguments.length>2,n=0;n<e.length;n++)t=i?e[n].call(r,t):e[n].call(r);return i?t:void 0},rb=mr&&mr.__esDecorate||function(r,e,t,i,n,s){function o(S){if(S!==void 0&&typeof S!="function")throw new TypeError("Function expected");return S}a(o,"accept");for(var l=i.kind,c=l==="getter"?"get":l==="setter"?"set":"value",u=!e&&r?i.static?r:r.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),h,p=!1,g=t.length-1;g>=0;g--){var y={};for(var v in i)y[v]=v==="access"?{}:i[v];for(var v in i.access)y.access[v]=i.access[v];y.addInitializer=function(S){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(S||null))};var C=(0,t[g])(l==="accessor"?{get:d.get,set:d.set}:d[c],y);if(l==="accessor"){if(C===void 0)continue;if(C===null||typeof C!="object")throw new TypeError("Object expected");(h=o(C.get))&&(d.get=h),(h=o(C.set))&&(d.set=h),(h=o(C.init))&&n.unshift(h)}else(h=o(C))&&(l==="field"?n.unshift(h):d[c]=h)}u&&Object.defineProperty(u,i.name,d),p=!0};Object.defineProperty(mr,"__esModule",{value:!0});mr.Server=void 0;var Fe=G("http2"),ib=G("util"),fe=U(),Ai=og(),yg=ca(),_g=_t(),fa=te(),gr=Je(),gt=Ue(),Se=kr(),Sg=cu(),Ri=~(1<<31),uu=~(1<<31),nb=2e4,Cg=~(1<<31),{HTTP2_HEADER_PATH:Eg}=Fe.constants,sb="server",bg=Buffer.from("max_age");function ab(){}a(ab,"noop");function ob(r){return function(e,t){return ib.deprecate(e,r)}}a(ob,"deprecate");function du(r){return{code:fe.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}a(du,"getUnimplementedStatusResponse");function lb(r,e){let t=du(e);switch(r){case"unary":return(i,n)=>{n(t,null)};case"clientStream":return(i,n)=>{n(t,null)};case"serverStream":return i=>{i.emit("error",t)};case"bidi":return i=>{i.emit("error",t)};default:throw new Error(`Invalid handlerType ${r}`)}}a(lb,"getDefaultHandler");var cb=(()=>{var r;let e=[],t;return r=class{static{a(this,"Server")}constructor(n){var s,o,l,c,u,d;this.boundPorts=(tb(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=n??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Se.ChannelzTraceStub,this.callTracker=new Se.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Se.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Se.ChannelzChildrenTrackerStub):(this.channelzTrace=new Se.ChannelzTrace,this.callTracker=new Se.ChannelzCallTracker,this.listenerChildrenTracker=new Se.ChannelzChildrenTracker,this.sessionChildrenTracker=new Se.ChannelzChildrenTracker),this.channelzRef=(0,Se.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(s=this.options["grpc.max_connection_age_ms"])!==null&&s!==void 0?s:Ri,this.maxConnectionAgeGraceMs=(o=this.options["grpc.max_connection_age_grace_ms"])!==null&&o!==void 0?o:Ri,this.keepaliveTimeMs=(l=this.options["grpc.keepalive_time_ms"])!==null&&l!==void 0?l:uu,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:nb,this.sessionIdleTimeout=(u=this.options["grpc.max_connection_idle_ms"])!==null&&u!==void 0?u:Cg,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(d=this.options.interceptors)!==null&&d!==void 0?d:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(n){var s,o,l;let c=this.sessions.get(n),u=n.socket,d=u.remoteAddress?(0,gr.stringToSubchannelAddress)(u.remoteAddress,u.remotePort):null,h=u.localAddress?(0,gr.stringToSubchannelAddress)(u.localAddress,u.localPort):null,p;if(n.encrypted){let y=u,v=y.getCipher(),C=y.getCertificate(),S=y.getPeerCertificate();p={cipherSuiteStandardName:(s=v.standardName)!==null&&s!==void 0?s:null,cipherSuiteOtherName:v.standardName?null:v.name,localCertificate:C&&"raw"in C?C.raw:null,remoteCertificate:S&&"raw"in S?S.raw:null}}else p=null;return{remoteAddress:d,localAddress:h,security:p,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(o=n.state.localWindowSize)!==null&&o!==void 0?o:null,remoteFlowControlWindow:(l=n.state.remoteWindowSize)!==null&&l!==void 0?l:null}}trace(n){fa.trace(fe.LogVerbosity.DEBUG,sb,"("+this.channelzRef.id+") "+n)}keepaliveTrace(n){fa.trace(fe.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+n)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(n,s){if(n===null||typeof n!="object"||s===null||typeof s!="object")throw new Error("addService() requires two objects as arguments");let o=Object.keys(n);if(o.length===0)throw new Error("Cannot add an empty service to a server");o.forEach(l=>{let c=n[l],u;c.requestStream?c.responseStream?u="bidi":u="clientStream":c.responseStream?u="serverStream":u="unary";let d=s[l],h;if(d===void 0&&typeof c.originalName=="string"&&(d=s[c.originalName]),d!==void 0?h=d.bind(s):h=lb(u,l),this.register(c.path,h,c.responseSerialize,c.requestDeserialize,u)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(n){if(n===null||typeof n!="object")throw new Error("removeService() requires object as argument");Object.keys(n).forEach(o=>{let l=n[o];this.unregister(l.path)})}bind(n,s){throw new Error("Not implemented. Use bindAsync() instead")}registerListenerToChannelz(n){return(0,Se.registerChannelzSocket)((0,gr.subchannelAddressToString)(n),()=>({localAddress:n,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}createHttp2Server(n){let s;if(n._isSecure()){let o=n._getSettings(),l=Object.assign(Object.assign(Object.assign({},this.commonServerOptions),o),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),c=o!==null;s=Fe.createSecureServer(l),s.on("connection",d=>{c||d.destroy()}),s.on("secureConnection",d=>{d.on("error",h=>{this.trace("An incoming TLS connection closed with error: "+h.message)})});let u=a(d=>{d&&s.setSecureContext(d),c=d!==null},"credsWatcher");n._addWatcher(u),s.on("close",()=>{n._removeWatcher(u)})}else s=Fe.createServer(this.commonServerOptions);return s.setTimeout(0,ab),this._setupHandlers(s,n._getInterceptors()),s}bindOneAddress(n,s){this.trace("Attempting to bind "+(0,gr.subchannelAddressToString)(n));let o=this.createHttp2Server(s.credentials);return new Promise((l,c)=>{let u=a(d=>{this.trace("Failed to bind "+(0,gr.subchannelAddressToString)(n)+" with error "+d.message),l({port:"port"in n?n.port:1,error:d.message})},"onError");o.once("error",u),o.listen(n,()=>{let d=o.address(),h;typeof d=="string"?h={path:d}:h={host:d.address,port:d.port};let p=this.registerListenerToChannelz(h);this.listenerChildrenTracker.refChild(p),this.http2Servers.set(o,{channelzRef:p,sessions:new Set}),s.listeningServers.add(o),this.trace("Successfully bound "+(0,gr.subchannelAddressToString)(h)),l({port:"port"in h?h.port:1}),o.removeListener("error",u)})})}async bindManyPorts(n,s){if(n.length===0)return{count:0,port:0,errors:[]};if((0,gr.isTcpSubchannelAddress)(n[0])&&n[0].port===0){let o=await this.bindOneAddress(n[0],s);if(o.error){let l=await this.bindManyPorts(n.slice(1),s);return Object.assign(Object.assign({},l),{errors:[o.error,...l.errors]})}else{let l=n.slice(1).map(d=>(0,gr.isTcpSubchannelAddress)(d)?{host:d.host,port:o.port}:d),c=await Promise.all(l.map(d=>this.bindOneAddress(d,s))),u=[o,...c];return{count:u.filter(d=>d.error===void 0).length,port:o.port,errors:u.filter(d=>d.error).map(d=>d.error)}}}else{let o=await Promise.all(n.map(l=>this.bindOneAddress(l,s)));return{count:o.filter(l=>l.error===void 0).length,port:o[0].port,errors:o.filter(l=>l.error).map(l=>l.error)}}}async bindAddressList(n,s){let o=await this.bindManyPorts(n,s);if(o.count>0)return o.count<n.length&&fa.log(fe.LogVerbosity.INFO,`WARNING Only ${o.count} addresses added out of total ${n.length} resolved`),o.port;{let l=`No address added out of total ${n.length} resolved`;throw fa.log(fe.LogVerbosity.ERROR,l),new Error(`${l} errors: [${o.errors.join(",")}]`)}}resolvePort(n){return new Promise((s,o)=>{let l={onSuccessfulResolution:a((u,d,h)=>{l.onSuccessfulResolution=()=>{};let p=[].concat(...u.map(g=>g.addresses));if(p.length===0){o(new Error(`No addresses resolved for port ${n}`));return}s(p)},"onSuccessfulResolution"),onError:a(u=>{o(new Error(u.details))},"onError")};(0,_g.createResolver)(n,l,this.options).updateResolution()})}async bindPort(n,s){let o=await this.resolvePort(n);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");let l=await this.bindAddressList(o,s);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");return l}normalizePort(n){let s=(0,gt.parseUri)(n);if(s===null)throw new Error(`Could not parse port "${n}"`);let o=(0,_g.mapUriDefaultScheme)(s);if(o===null)throw new Error(`Could not get a default scheme for port "${n}"`);return o}bindAsync(n,s,o){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof n!="string")throw new TypeError("port must be a string");if(s===null||!(s instanceof yg.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof o!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+n);let l=this.normalizePort(n),c=a((p,g)=>{process.nextTick(()=>o(p,g))},"deferredCallback"),u=this.boundPorts.get((0,gt.uriToString)(l));if(u){if(!s._equals(u.credentials)){c(new Error(`${n} already bound with incompatible credentials`),0);return}u.cancelled=!1,u.completionPromise?u.completionPromise.then(p=>o(null,p),p=>o(p,0)):c(null,u.portNumber);return}u={mapKey:(0,gt.uriToString)(l),originalUri:l,completionPromise:null,cancelled:!1,portNumber:0,credentials:s,listeningServers:new Set};let d=(0,gt.splitHostPort)(l.path),h=this.bindPort(l,u);u.completionPromise=h,d?.port===0?h.then(p=>{let g={scheme:l.scheme,authority:l.authority,path:(0,gt.combineHostPort)({host:d.host,port:p})};u.mapKey=(0,gt.uriToString)(g),u.completionPromise=null,u.portNumber=p,this.boundPorts.set(u.mapKey,u),o(null,p)},p=>{o(p,0)}):(this.boundPorts.set(u.mapKey,u),h.then(p=>{u.completionPromise=null,u.portNumber=p,o(null,p)},p=>{o(p,0)}))}registerInjectorToChannelz(){return(0,Se.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}createConnectionInjector(n){if(n===null||!(n instanceof yg.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let s=this.createHttp2Server(n),o=this.registerInjectorToChannelz();this.channelzEnabled&&this.listenerChildrenTracker.refChild(o);let l=new Set;return this.http2Servers.set(s,{channelzRef:o,sessions:l}),{injectConnection:a(c=>{s.emit("connection",c)},"injectConnection"),drain:a(c=>{var u,d;for(let h of l)this.closeSession(h);(d=(u=setTimeout(()=>{for(let h of l)h.destroy(Fe.constants.NGHTTP2_CANCEL)},c)).unref)===null||d===void 0||d.call(u)},"drain"),destroy:a(()=>{this.closeServer(s);for(let c of l)this.closeSession(c)},"destroy")}}closeServer(n,s){this.trace("Closing server with address "+JSON.stringify(n.address()));let o=this.http2Servers.get(n);n.close(()=>{o&&(this.listenerChildrenTracker.unrefChild(o.channelzRef),(0,Se.unregisterChannelzRef)(o.channelzRef)),this.http2Servers.delete(n),s?.()})}closeSession(n,s){var o;this.trace("Closing session initiated by "+((o=n.socket)===null||o===void 0?void 0:o.remoteAddress));let l=this.sessions.get(n),c=a(()=>{l&&(this.sessionChildrenTracker.unrefChild(l.ref),(0,Se.unregisterChannelzRef)(l.ref)),s?.()},"closeCallback");n.closed?queueMicrotask(c):n.close(c)}completeUnbind(n){for(let s of n.listeningServers){let o=this.http2Servers.get(s);if(this.closeServer(s,()=>{n.listeningServers.delete(s)}),o)for(let l of o.sessions)this.closeSession(l)}this.boundPorts.delete(n.mapKey)}unbind(n){this.trace("unbind port="+n);let s=this.normalizePort(n),o=(0,gt.splitHostPort)(s.path);if(o?.port===0)throw new Error("Cannot unbind port 0");let l=this.boundPorts.get((0,gt.uriToString)(s));l&&(this.trace("unbinding "+l.mapKey+" originally bound as "+(0,gt.uriToString)(l.originalUri)),l.completionPromise?l.cancelled=!0:this.completeUnbind(l))}drain(n,s){var o,l;this.trace("drain port="+n+" graceTimeMs="+s);let c=this.normalizePort(n),u=(0,gt.splitHostPort)(c.path);if(u?.port===0)throw new Error("Cannot drain port 0");let d=this.boundPorts.get((0,gt.uriToString)(c));if(!d)return;let h=new Set;for(let p of d.listeningServers){let g=this.http2Servers.get(p);if(g)for(let y of g.sessions)h.add(y),this.closeSession(y,()=>{h.delete(y)})}(l=(o=setTimeout(()=>{for(let p of h)p.destroy(Fe.constants.NGHTTP2_CANCEL)},s)).unref)===null||l===void 0||l.call(o)}forceShutdown(){for(let n of this.boundPorts.values())n.cancelled=!0;this.boundPorts.clear();for(let n of this.http2Servers.keys())this.closeServer(n);this.sessions.forEach((n,s)=>{this.closeSession(s),s.destroy(Fe.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Se.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(n,s,o,l,c){return this.handlers.has(n)?!1:(this.handlers.set(n,{func:s,serialize:o,deserialize:l,type:c,path:n}),!0)}unregister(n){return this.handlers.delete(n)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(n=>!n.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(n){var s;let o=a(u=>{(0,Se.unregisterChannelzRef)(this.channelzRef),n(u)},"wrappedCallback"),l=0;function c(){l--,l===0&&o()}a(c,"maybeCallback"),this.shutdown=!0;for(let[u,d]of this.http2Servers.entries()){l++;let h=d.channelzRef.name;this.trace("Waiting for server "+h+" to close"),this.closeServer(u,()=>{this.trace("Server "+h+" finished closing"),c()});for(let p of d.sessions.keys()){l++;let g=(s=p.socket)===null||s===void 0?void 0:s.remoteAddress;this.trace("Waiting for session "+g+" to close"),this.closeSession(p,()=>{this.trace("Session "+g+" finished closing"),c()})}}l===0&&o()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(n,s){let o=s[Fe.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof o!="string"||!o.startsWith("application/grpc")?(n.respond({[Fe.constants.HTTP2_HEADER_STATUS]:Fe.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(n){this.trace("Received call to method "+n+" at address "+this.serverAddressString);let s=this.handlers.get(n);return s===void 0?(this.trace("No handler registered for method "+n+". Sending UNIMPLEMENTED status."),null):s}_respondWithError(n,s,o=null){var l,c;let u=Object.assign({"grpc-status":(l=n.code)!==null&&l!==void 0?l:fe.Status.INTERNAL,"grpc-message":n.details,[Fe.constants.HTTP2_HEADER_STATUS]:Fe.constants.HTTP_STATUS_OK,[Fe.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=n.metadata)===null||c===void 0?void 0:c.toHttp2Headers());s.respond(u,{endStream:!0}),this.callTracker.addCallFailed(),o?.streamTracker.addCallFailed()}_channelzHandler(n,s,o){this.onStreamOpened(s);let l=this.sessions.get(s.session);if(this.callTracker.addCallStarted(),l?.streamTracker.addCallStarted(),!this._verifyContentType(s,o)){this.callTracker.addCallFailed(),l?.streamTracker.addCallFailed();return}let c=o[Eg],u=this._retrieveHandler(c);if(!u){this._respondWithError(du(c),s,l);return}let d={addMessageSent:a(()=>{l&&(l.messagesSent+=1,l.lastMessageSentTimestamp=new Date)},"addMessageSent"),addMessageReceived:a(()=>{l&&(l.messagesReceived+=1,l.lastMessageReceivedTimestamp=new Date)},"addMessageReceived"),onCallEnd:a(p=>{p.code===fe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},"onCallEnd"),onStreamEnd:a(p=>{l&&(p?l.streamTracker.addCallSucceeded():l.streamTracker.addCallFailed())},"onStreamEnd")},h=(0,Sg.getServerInterceptingCall)([...n,...this.interceptors],s,o,d,u,this.options);this._runHandlerForCall(h,u)||(this.callTracker.addCallFailed(),l?.streamTracker.addCallFailed(),h.sendStatus({code:fe.Status.INTERNAL,details:`Unknown handler type: ${u.type}`}))}_streamHandler(n,s,o){if(this.onStreamOpened(s),this._verifyContentType(s,o)!==!0)return;let l=o[Eg],c=this._retrieveHandler(l);if(!c){this._respondWithError(du(l),s,null);return}let u=(0,Sg.getServerInterceptingCall)([...n,...this.interceptors],s,o,null,c,this.options);this._runHandlerForCall(u,c)||u.sendStatus({code:fe.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(n,s){let{type:o}=s;if(o==="unary")ub(n,s);else if(o==="clientStream")db(n,s);else if(o==="serverStream")hb(n,s);else if(o==="bidi")fb(n,s);else return!1;return!0}_setupHandlers(n,s){if(n===null)return;let o=n.address(),l="null";o&&(typeof o=="string"?l=o:l=o.address+":"+o.port),this.serverAddressString=l;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,u=this.channelzEnabled?this._channelzSessionHandler(n):this._sessionHandler(n);n.on("stream",c.bind(this,s)),n.on("session",u)}_sessionHandler(n){return s=>{var o,l;(o=this.http2Servers.get(n))===null||o===void 0||o.sessions.add(s);let c=null,u=null,d=null,h=!1,p=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==Ri){let S=this.maxConnectionAgeMs/10,_=Math.random()*S*2-S;c=setTimeout(()=>{var P,A;h=!0,this.trace("Connection dropped by max connection age: "+((P=s.socket)===null||P===void 0?void 0:P.remoteAddress));try{s.goaway(Fe.constants.NGHTTP2_NO_ERROR,~(1<<31),bg)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==Ri&&(u=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(A=u.unref)===null||A===void 0||A.call(u))},this.maxConnectionAgeMs+_),(l=c.unref)===null||l===void 0||l.call(c)}let g=a(()=>{d&&(clearTimeout(d),d=null)},"clearKeepaliveTimeout"),y=a(()=>!s.destroyed&&this.keepaliveTimeMs<uu&&this.keepaliveTimeMs>0,"canSendPing"),v,C=a(()=>{var S;y()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),d=setTimeout(()=>{g(),v()},this.keepaliveTimeMs),(S=d.unref)===null||S===void 0||S.call(d))},"maybeStartKeepalivePingTimer");v=a(()=>{var S;if(!y())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let _="";try{s.ping((A,L,D)=>{g(),A?(this.keepaliveTrace("Ping failed with error: "+A.message),h=!0,s.close()):(this.keepaliveTrace("Received ping response"),C())})||(_="Ping returned false")}catch(P){_=(P instanceof Error?P.message:"")||"Unknown error"}if(_){this.keepaliveTrace("Ping send failed: "+_),this.trace("Connection dropped due to ping send error: "+_),h=!0,s.close();return}d=setTimeout(()=>{g(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),h=!0,s.close()},this.keepaliveTimeoutMs),(S=d.unref)===null||S===void 0||S.call(d)},"sendPing"),C(),s.on("close",()=>{var S,_;h||this.trace(`Connection dropped by client ${(S=s.socket)===null||S===void 0?void 0:S.remoteAddress}`),c&&clearTimeout(c),u&&clearTimeout(u),g(),p!==null&&(clearTimeout(p.timeout),this.sessionIdleTimeouts.delete(s)),(_=this.http2Servers.get(n))===null||_===void 0||_.sessions.delete(s)})}}_channelzSessionHandler(n){return s=>{var o,l,c,u;let d=(0,Se.registerChannelzSocket)((l=(o=s.socket)===null||o===void 0?void 0:o.remoteAddress)!==null&&l!==void 0?l:"unknown",this.getChannelzSessionInfo.bind(this,s),this.channelzEnabled),h={ref:d,streamTracker:new Se.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(n))===null||c===void 0||c.sessions.add(s),this.sessions.set(s,h);let p=`${s.socket.remoteAddress}:${s.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+p),this.trace("Connection established by client "+p),this.sessionChildrenTracker.refChild(d);let g=null,y=null,v=null,C=!1,S=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==Ri){let D=this.maxConnectionAgeMs/10,B=Math.random()*D*2-D;g=setTimeout(()=>{var Z;C=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+p);try{s.goaway(Fe.constants.NGHTTP2_NO_ERROR,~(1<<31),bg)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==Ri&&(y=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(Z=y.unref)===null||Z===void 0||Z.call(y))},this.maxConnectionAgeMs+B),(u=g.unref)===null||u===void 0||u.call(g)}let _=a(()=>{v&&(clearTimeout(v),v=null)},"clearKeepaliveTimeout"),P=a(()=>!s.destroyed&&this.keepaliveTimeMs<uu&&this.keepaliveTimeMs>0,"canSendPing"),A,L=a(()=>{var D;P()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),v=setTimeout(()=>{_(),A()},this.keepaliveTimeMs),(D=v.unref)===null||D===void 0||D.call(v))},"maybeStartKeepalivePingTimer");A=a(()=>{var D;if(!P())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let B="";try{s.ping((se,V,E)=>{_(),se?(this.keepaliveTrace("Ping failed with error: "+se.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+se.message+" return in "+V),C=!0,s.close()):(this.keepaliveTrace("Received ping response"),L())})||(B="Ping returned false")}catch(Z){B=(Z instanceof Error?Z.message:"")||"Unknown error"}if(B){this.keepaliveTrace("Ping send failed: "+B),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+B),C=!0,s.close();return}h.keepAlivesSent+=1,v=setTimeout(()=>{_(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+p),C=!0,s.close()},this.keepaliveTimeoutMs),(D=v.unref)===null||D===void 0||D.call(v)},"sendPing"),L(),s.on("close",()=>{var D;C||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+p),this.sessionChildrenTracker.unrefChild(d),(0,Se.unregisterChannelzRef)(d),g&&clearTimeout(g),y&&clearTimeout(y),_(),S!==null&&(clearTimeout(S.timeout),this.sessionIdleTimeouts.delete(s)),(D=this.http2Servers.get(n))===null||D===void 0||D.sessions.delete(s),this.sessions.delete(s)})}}enableIdleTimeout(n){var s,o;if(this.sessionIdleTimeout>=Cg)return null;let l={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,n),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,n)};(o=(s=l.timeout).unref)===null||o===void 0||o.call(s),this.sessionIdleTimeouts.set(n,l);let{socket:c}=n;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),l}onIdleTimeout(n,s){let{socket:o}=s,l=n.sessionIdleTimeouts.get(s);l!==void 0&&l.activeStreams===0&&(Date.now()-l.lastIdle>=n.sessionIdleTimeout?(n.trace("Session idle timeout triggered for "+o?.remoteAddress+":"+o?.remotePort+" last idle at "+l.lastIdle),n.closeSession(s)):l.timeout.refresh())}onStreamOpened(n){let s=n.session,o=this.sessionIdleTimeouts.get(s);o&&(o.activeStreams+=1,n.once("close",o.onClose))}onStreamClose(n){var s,o;let l=this.sessionIdleTimeouts.get(n);l&&(l.activeStreams-=1,l.activeStreams===0&&(l.lastIdle=Date.now(),l.timeout.refresh(),this.trace("Session onStreamClose"+((s=n.socket)===null||s===void 0?void 0:s.remoteAddress)+":"+((o=n.socket)===null||o===void 0?void 0:o.remotePort)+" at "+l.lastIdle)))}},(()=>{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ob("Calling start() is no longer necessary. It can be safely omitted.")],rb(r,null,t,{kind:"method",name:"start",static:!1,private:!1,access:{has:a(n=>"start"in n,"has"),get:a(n=>n.start,"get")},metadata:i},null,e),i&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),r})();mr.Server=cb;async function ub(r,e){let t;function i(o,l,c,u){if(o){r.sendStatus((0,Ai.serverErrorToStatus)(o,c));return}r.sendMessage(l,()=>{r.sendStatus({code:fe.Status.OK,details:"OK",metadata:c??null})})}a(i,"respond");let n,s=null;r.start({onReceiveMetadata(o){n=o,r.startRead()},onReceiveMessage(o){if(s){r.sendStatus({code:fe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=o,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:fe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Ai.ServerWritableStreamImpl(e.path,r,n,s);try{e.func(t,i)}catch(o){r.sendStatus({code:fe.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"))}})}a(ub,"handleUnary");function db(r,e){let t;function i(n,s,o,l){if(n){r.sendStatus((0,Ai.serverErrorToStatus)(n,o));return}r.sendMessage(s,()=>{r.sendStatus({code:fe.Status.OK,details:"OK",metadata:o??null})})}a(i,"respond"),r.start({onReceiveMetadata(n){t=new Ai.ServerDuplexStreamImpl(e.path,r,n);try{e.func(t,i)}catch(s){r.sendStatus({code:fe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(n){t.push(n)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}a(db,"handleClientStreaming");function hb(r,e){let t,i,n=null;r.start({onReceiveMetadata(s){i=s,r.startRead()},onReceiveMessage(s){if(n){r.sendStatus({code:fe.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}n=s,r.startRead()},onReceiveHalfClose(){if(!n){r.sendStatus({code:fe.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new Ai.ServerWritableStreamImpl(e.path,r,i,n);try{e.func(t)}catch(s){r.sendStatus({code:fe.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}a(hb,"handleServerStreaming");function fb(r,e){let t;r.start({onReceiveMetadata(i){t=new Ai.ServerDuplexStreamImpl(e.path,r,i);try{e.func(t)}catch(n){r.sendStatus({code:fe.Status.UNKNOWN,details:`Server method handler threw error ${n.message}`,metadata:null})}},onReceiveMessage(i){t.push(i)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}a(fb,"handleBidiStreaming")});var wg=m(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.StatusBuilder=void 0;var hu=class{static{a(this,"StatusBuilder")}constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};pa.StatusBuilder=hu});var fu=m(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.parseDuration=xt.isDuration=xt.durationToMs=xt.msToDuration=void 0;function pb(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}a(pb,"msToDuration");xt.msToDuration=pb;function gb(r){return r.seconds*1e3+r.nanos/1e6|0}a(gb,"durationToMs");xt.durationToMs=gb;function mb(r){return typeof r.seconds=="number"&&typeof r.nanos=="number"}a(mb,"isDuration");xt.isDuration=mb;var vb=/^(\d+)(?:\.(\d+))?s$/;function yb(r){let e=r.match(vb);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}a(yb,"parseDuration");xt.parseDuration=yb});var ga=m(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.setup=nt.LeafLoadBalancer=nt.PickFirstLoadBalancer=nt.shuffled=nt.PickFirstLoadBalancingConfig=void 0;var pu=Tr(),pe=$e(),Oi=Qt(),Rg=Je(),_b=te(),Sb=U(),Ag=Je(),Og=G("net"),Cb="pick_first";function mn(r){_b.trace(Sb.LogVerbosity.DEBUG,Cb,r)}a(mn,"trace");var vn="pick_first",Eb=250,Mi=class r{static{a(this,"PickFirstLoadBalancingConfig")}constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return vn}toJsonObject(){return{[vn]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new r(e.shuffleAddressList===!0)}};nt.PickFirstLoadBalancingConfig=Mi;var gu=class{static{a(this,"PickFirstPicker")}constructor(e){this.subchannel=e}pick(e){return{pickResultType:Oi.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function Mg(r){let e=r.slice();for(let t=e.length-1;t>1;t--){let i=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[i],e[i]=n}return e}a(Mg,"shuffled");nt.shuffled=Mg;function bb(r){let e=[],t=[],i=[],n=(0,Ag.isTcpSubchannelAddress)(r[0])&&(0,Og.isIPv6)(r[0].host);for(let l of r)(0,Ag.isTcpSubchannelAddress)(l)&&(0,Og.isIPv6)(l.host)?t.push(l):i.push(l);let s=n?t:i,o=n?i:t;for(let l=0;l<Math.max(s.length,o.length);l++)l<s.length&&e.push(s[l]),l<o.length&&e.push(o[l]);return e}a(bb,"interleaveAddressFamilies");var Pg="grpc-node.internal.pick-first.report_health_status",yn=class{static{a(this,"PickFirstLoadBalancer")}constructor(e,t,i){this.channelControlHelper=e,this.children=[],this.currentState=pe.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(n,s,o,l,c)=>{this.onSubchannelStateUpdate(n,s,o,c)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.lastError=null,this.latestAddressList=null,this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout),this.reportHealthStatus=i[Pg]}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){this.currentPick?this.reportHealthStatus&&!this.currentPick.isHealthy()?this.updateState(pe.ConnectivityState.TRANSIENT_FAILURE,new Oi.UnavailablePicker({details:`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`})):this.updateState(pe.ConnectivityState.READY,new gu(this.currentPick)):this.children.length===0?this.updateState(pe.ConnectivityState.IDLE,new Oi.QueuePicker(this)):this.stickyTransientFailureMode?this.updateState(pe.ConnectivityState.TRANSIENT_FAILURE,new Oi.UnavailablePicker({details:`No connection established. Last error: ${this.lastError}`})):this.updateState(pe.ConnectivityState.CONNECTING,new Oi.QueuePicker(this))}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,i,n){var s;if(!((s=this.currentPick)===null||s===void 0)&&s.realSubchannelEquals(e)){i!==pe.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[o,l]of this.children.entries())if(e.realSubchannelEquals(l.subchannel)){i===pe.ConnectivityState.READY&&this.pickSubchannel(l.subchannel),i===pe.ConnectivityState.TRANSIENT_FAILURE&&(l.hasReportedTransientFailure=!0,n&&(this.lastError=n),this.maybeEnterStickyTransientFailureMode(),o===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(o+1)),l.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,i]of this.children.entries())if(t>=e){let n=i.subchannel.getConnectivityState();if(n===pe.ConnectivityState.IDLE||n===pe.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,i;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===pe.ConnectivityState.IDLE&&(mn("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var n;(n=this.children[e])===null||n===void 0||n.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},Eb),(i=(t=this.connectionDelayTimeout).unref)===null||i===void 0||i.call(t)}pickSubchannel(e){mn("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t){mn(pe.ConnectivityState[this.currentState]+" -> "+pe.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e){mn("connectToAddressList(["+e.map(i=>(0,Rg.subchannelAddressToString)(i))+"])");let t=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,{},null),hasReportedTransientFailure:!1}));for(let{subchannel:i}of t)if(i.getConnectivityState()===pe.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of t)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=t;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===pe.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t){if(!(t instanceof Mi))return;t.getShuffleAddressList()&&(e=Mg(e));let i=[].concat(...e.map(s=>s.addresses));if(mn("updateAddressList(["+i.map(s=>(0,Rg.subchannelAddressToString)(s))+"])"),i.length===0)throw new Error("No addresses in endpoint list passed to pick_first");let n=bb(i);this.latestAddressList=n,this.connectToAddressList(n)}exitIdle(){this.currentState===pe.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return vn}};nt.PickFirstLoadBalancer=yn;var Tb=new Mi(!1),mu=class{static{a(this,"LeafLoadBalancer")}constructor(e,t,i,n){this.endpoint=e,this.latestState=pe.ConnectivityState.IDLE;let s=(0,pu.createChildChannelControlHelper)(t,{updateState:a((o,l)=>{this.latestState=o,this.latestPicker=l,t.updateState(o,l)},"updateState")});this.pickFirstBalancer=new yn(s,i,Object.assign(Object.assign({},n),{[Pg]:!0})),this.latestPicker=new Oi.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],Tb)}updateEndpoint(e){this.endpoint=e,this.latestState!==pe.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};nt.LeafLoadBalancer=mu;function wb(){(0,pu.registerLoadBalancerType)(vn,yn,Mi),(0,pu.registerDefaultLoadBalancerType)(vn)}a(wb,"setup");nt.setup=wb});var Ng=m(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.FileWatcherCertificateProvider=void 0;var Rb=G("fs"),Ab=te(),Ob=U(),Mb=G("util"),Pb="certificate_provider";function ma(r){Ab.trace(Ob.LogVerbosity.DEBUG,Pb,r)}a(ma,"trace");var vu=(0,Mb.promisify)(Rb.readFile),yu=class{static{a(this,"FileWatcherCertificateProvider")}constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=null,this.caListeners=new Set,this.latestIdentityUpdate=null,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");ma("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?vu(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?vu(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?vu(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,i])=>{if(this.refreshTimer){ma("File watcher read certificates certificate"+(e?"!=":"==")+"null, privateKey"+(t?"!=":"==")+"null, CA certificate"+(i?"!=":"==")+"null"),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&t.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,i.status==="fulfilled"&&(this.latestCaUpdate={caCertificate:i.value});for(let n of this.identityListeners)n(this.latestIdentityUpdate);for(let n of this.caListeners)n(this.latestCaUpdate)}}),ma("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=null,this.latestIdentityUpdate=null),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),ma("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};va.FileWatcherCertificateProvider=yu});var Su=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.createCertificateProviderChannelCredentials=N.FileWatcherCertificateProvider=N.createCertificateProviderServerCredentials=N.createServerCredentialsWithInterceptors=N.BaseSubchannelWrapper=N.registerAdminService=N.FilterStackFactory=N.BaseFilter=N.PickResultType=N.QueuePicker=N.UnavailablePicker=N.ChildLoadBalancerHandler=N.EndpointMap=N.endpointHasAddress=N.endpointToString=N.subchannelAddressToString=N.LeafLoadBalancer=N.isLoadBalancerNameRegistered=N.parseLoadBalancingConfig=N.selectLbConfigFromList=N.registerLoadBalancerType=N.createChildChannelControlHelper=N.BackoffTimeout=N.parseDuration=N.durationToMs=N.splitHostPort=N.uriToString=N.createResolver=N.registerResolver=N.log=N.trace=void 0;var kg=te();Object.defineProperty(N,"trace",{enumerable:!0,get:a(function(){return kg.trace},"get")});Object.defineProperty(N,"log",{enumerable:!0,get:a(function(){return kg.log},"get")});var Ig=_t();Object.defineProperty(N,"registerResolver",{enumerable:!0,get:a(function(){return Ig.registerResolver},"get")});Object.defineProperty(N,"createResolver",{enumerable:!0,get:a(function(){return Ig.createResolver},"get")});var xg=Ue();Object.defineProperty(N,"uriToString",{enumerable:!0,get:a(function(){return xg.uriToString},"get")});Object.defineProperty(N,"splitHostPort",{enumerable:!0,get:a(function(){return xg.splitHostPort},"get")});var Dg=fu();Object.defineProperty(N,"durationToMs",{enumerable:!0,get:a(function(){return Dg.durationToMs},"get")});Object.defineProperty(N,"parseDuration",{enumerable:!0,get:a(function(){return Dg.parseDuration},"get")});var Nb=Ui();Object.defineProperty(N,"BackoffTimeout",{enumerable:!0,get:a(function(){return Nb.BackoffTimeout},"get")});var _n=Tr();Object.defineProperty(N,"createChildChannelControlHelper",{enumerable:!0,get:a(function(){return _n.createChildChannelControlHelper},"get")});Object.defineProperty(N,"registerLoadBalancerType",{enumerable:!0,get:a(function(){return _n.registerLoadBalancerType},"get")});Object.defineProperty(N,"selectLbConfigFromList",{enumerable:!0,get:a(function(){return _n.selectLbConfigFromList},"get")});Object.defineProperty(N,"parseLoadBalancingConfig",{enumerable:!0,get:a(function(){return _n.parseLoadBalancingConfig},"get")});Object.defineProperty(N,"isLoadBalancerNameRegistered",{enumerable:!0,get:a(function(){return _n.isLoadBalancerNameRegistered},"get")});var kb=ga();Object.defineProperty(N,"LeafLoadBalancer",{enumerable:!0,get:a(function(){return kb.LeafLoadBalancer},"get")});var ya=Je();Object.defineProperty(N,"subchannelAddressToString",{enumerable:!0,get:a(function(){return ya.subchannelAddressToString},"get")});Object.defineProperty(N,"endpointToString",{enumerable:!0,get:a(function(){return ya.endpointToString},"get")});Object.defineProperty(N,"endpointHasAddress",{enumerable:!0,get:a(function(){return ya.endpointHasAddress},"get")});Object.defineProperty(N,"EndpointMap",{enumerable:!0,get:a(function(){return ya.EndpointMap},"get")});var Ib=Vn();Object.defineProperty(N,"ChildLoadBalancerHandler",{enumerable:!0,get:a(function(){return Ib.ChildLoadBalancerHandler},"get")});var _u=Qt();Object.defineProperty(N,"UnavailablePicker",{enumerable:!0,get:a(function(){return _u.UnavailablePicker},"get")});Object.defineProperty(N,"QueuePicker",{enumerable:!0,get:a(function(){return _u.QueuePicker},"get")});Object.defineProperty(N,"PickResultType",{enumerable:!0,get:a(function(){return _u.PickResultType},"get")});var xb=Rc();Object.defineProperty(N,"BaseFilter",{enumerable:!0,get:a(function(){return xb.BaseFilter},"get")});var Db=bc();Object.defineProperty(N,"FilterStackFactory",{enumerable:!0,get:a(function(){return Db.FilterStackFactory},"get")});var Lb=Kn();Object.defineProperty(N,"registerAdminService",{enumerable:!0,get:a(function(){return Lb.registerAdminService},"get")});var qb=ia();Object.defineProperty(N,"BaseSubchannelWrapper",{enumerable:!0,get:a(function(){return qb.BaseSubchannelWrapper},"get")});var Lg=ca();Object.defineProperty(N,"createServerCredentialsWithInterceptors",{enumerable:!0,get:a(function(){return Lg.createServerCredentialsWithInterceptors},"get")});Object.defineProperty(N,"createCertificateProviderServerCredentials",{enumerable:!0,get:a(function(){return Lg.createCertificateProviderServerCredentials},"get")});var Fb=Ng();Object.defineProperty(N,"FileWatcherCertificateProvider",{enumerable:!0,get:a(function(){return Fb.FileWatcherCertificateProvider},"get")});var Bb=Fi();Object.defineProperty(N,"createCertificateProviderChannelCredentials",{enumerable:!0,get:a(function(){return Bb.createCertificateProviderChannelCredentials},"get")})});var qg=m(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.setup=void 0;var Ub=_t(),Cu=class{static{a(this,"UdsResolver")}constructor(e,t,i){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let n;e.authority===""?n="/"+e.path:n=e.path,this.endpoints=[{addresses:[{path:n}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function zb(){(0,Ub.registerResolver)("unix",Cu)}a(zb,"setup");_a.setup=zb});var Hg=m(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.setup=void 0;var Fg=G("net"),Sa=U(),Eu=we(),Bg=_t(),Ug=Ue(),Hb=te(),jb="ip_resolver";function zg(r){Hb.trace(Sa.LogVerbosity.DEBUG,jb,r)}a(zg,"trace");var bu="ipv4",Tu="ipv6",Gb=443,Ca=class{static{a(this,"IpResolver")}constructor(e,t,i){var n;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,zg("Resolver constructed for target "+(0,Ug.uriToString)(e));let s=[];if(!(e.scheme===bu||e.scheme===Tu)){this.error={code:Sa.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new Eu.Metadata};return}let o=e.path.split(",");for(let l of o){let c=(0,Ug.splitHostPort)(l);if(c===null){this.error={code:Sa.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${l}`,metadata:new Eu.Metadata};return}if(e.scheme===bu&&!(0,Fg.isIPv4)(c.host)||e.scheme===Tu&&!(0,Fg.isIPv6)(c.host)){this.error={code:Sa.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${l}`,metadata:new Eu.Metadata};return}s.push({host:c.host,port:(n=c.port)!==null&&n!==void 0?n:Gb})}this.endpoints=s.map(l=>({addresses:[l]})),zg("Parsed "+e.scheme+" address list "+s)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function Wb(){(0,Bg.registerResolver)(bu,Ca),(0,Bg.registerResolver)(Tu,Ca)}a(Wb,"setup");Ea.setup=Wb});var $g=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.setup=Pi.RoundRobinLoadBalancer=void 0;var Wg=Tr(),ke=$e(),wu=Qt(),$b=te(),Vb=U(),jg=Je(),Jb=ga(),Yb="round_robin";function Gg(r){$b.trace(Vb.LogVerbosity.DEBUG,Yb,r)}a(Gg,"trace");var ba="round_robin",Ru=class r{static{a(this,"RoundRobinLoadBalancingConfig")}getLoadBalancerName(){return ba}constructor(){}toJsonObject(){return{[ba]:{}}}static createFromJson(e){return new r}},Au=class{static{a(this,"RoundRobinPicker")}constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}},Ta=class{static{a(this,"RoundRobinLoadBalancer")}constructor(e,t,i){this.channelControlHelper=e,this.credentials=t,this.options=i,this.children=[],this.currentState=ke.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,Wg.createChildChannelControlHelper)(e,{updateState:a((n,s)=>{this.currentState===ke.ConnectivityState.READY&&n!==ke.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),this.calculateAndUpdateState()},"updateState")})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(ke.ConnectivityState.READY)>0){let e=this.children.filter(i=>i.getConnectivityState()===ke.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let i=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(n=>(0,jg.endpointEqual)(n.getEndpoint(),i)),t<0&&(t=0)}this.updateState(ke.ConnectivityState.READY,new Au(e.map(i=>({endpoint:i.getEndpoint(),picker:i.getPicker()})),t))}else this.countChildrenWithState(ke.ConnectivityState.CONNECTING)>0?this.updateState(ke.ConnectivityState.CONNECTING,new wu.QueuePicker(this)):this.countChildrenWithState(ke.ConnectivityState.TRANSIENT_FAILURE)>0?this.updateState(ke.ConnectivityState.TRANSIENT_FAILURE,new wu.UnavailablePicker({details:`No connection established. Last error: ${this.lastError}`})):this.updateState(ke.ConnectivityState.IDLE,new wu.QueuePicker(this));for(let e of this.children)e.getConnectivityState()===ke.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t){Gg(ke.ConnectivityState[this.currentState]+" -> "+ke.ConnectivityState[e]),e===ke.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t){this.resetSubchannelList(),Gg("Connect to endpoint list "+e.map(jg.endpointToString)),this.updatesPaused=!0,this.children=e.map(i=>new Jb.LeafLoadBalancer(i,this.childChannelControlHelper,this.credentials,this.options));for(let i of this.children)i.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return ba}};Pi.RoundRobinLoadBalancer=Ta;function Kb(){(0,Wg.registerLoadBalancerType)(ba,Ta,Ru)}a(Kb,"setup");Pi.setup=Kb});var Yg=m(vr=>{"use strict";var Ou;Object.defineProperty(vr,"__esModule",{value:!0});vr.setup=vr.OutlierDetectionLoadBalancer=vr.OutlierDetectionLoadBalancingConfig=void 0;var Xb=$e(),Vg=U(),Fr=fu(),Jg=Su(),Qb=Tr(),Zb=Vn(),eT=Qt(),Mu=Je(),tT=ia(),rT=te(),iT="outlier_detection";function be(r){rT.trace(Vg.LogVerbosity.DEBUG,iT,r)}a(be,"trace");var Du="outlier_detection",nT=((Ou=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&Ou!==void 0?Ou:"true")==="true",sT={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},aT={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Ni(r,e,t,i){if(e in r&&r[e]!==void 0&&typeof r[e]!==t){let n=i?`${i}.${e}`:e;throw new Error(`outlier detection config ${n} parse error: expected ${t}, got ${typeof r[e]}`)}}a(Ni,"validateFieldType");function Pu(r,e,t){let i=t?`${t}.${e}`:e;if(e in r&&r[e]!==void 0){if(!(0,Fr.isDuration)(r[e]))throw new Error(`outlier detection config ${i} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds>=0&&r[e].seconds<=315576e6&&r[e].nanos>=0&&r[e].nanos<=999999999))throw new Error(`outlier detection config ${i} parse error: values out of range for non-negative Duaration`)}}a(Pu,"validatePositiveDuration");function wa(r,e,t){let i=t?`${t}.${e}`:e;if(Ni(r,e,"number",t),e in r&&r[e]!==void 0&&!(r[e]>=0&&r[e]<=100))throw new Error(`outlier detection config ${i} parse error: value out of range for percentage (0-100)`)}a(wa,"validatePercentage");var Sn=class r{static{a(this,"OutlierDetectionLoadBalancingConfig")}constructor(e,t,i,n,s,o,l){if(this.childPolicy=l,l.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=i??3e5,this.maxEjectionPercent=n??10,this.successRateEjection=s?Object.assign(Object.assign({},sT),s):null,this.failurePercentageEjection=o?Object.assign(Object.assign({},aT),o):null}getLoadBalancerName(){return Du}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Fr.msToDuration)(this.intervalMs),base_ejection_time:(0,Fr.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Fr.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&&t!==void 0?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(Pu(e,"interval"),Pu(e,"base_ejection_time"),Pu(e,"max_ejection_time"),wa(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Ni(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),wa(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Ni(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Ni(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");wa(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),wa(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Ni(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Ni(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let i=(0,Qb.selectLbConfigFromList)(e.child_policy);if(!i)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new r(e.interval?(0,Fr.durationToMs)(e.interval):null,e.base_ejection_time?(0,Fr.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Fr.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&&t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,i)}};vr.OutlierDetectionLoadBalancingConfig=Sn;var ku=class extends tT.BaseSubchannelWrapper{static{a(this,"OutlierDetectionSubchannelWrapper")}constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function Nu(){return{success:0,failure:0}}a(Nu,"createEmptyBucket");var Iu=class{static{a(this,"CallCounter")}constructor(){this.activeBucket=Nu(),this.inactiveBucket=Nu()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=Nu()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},xu=class{static{a(this,"OutlierDetectionPicker")}constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===eT.PickResultType.COMPLETE){let i=t.subchannel,n=i.getMapEntry();if(n){let s=t.onCallEnded;return this.countCalls&&(s=a(o=>{var l;o===Vg.Status.OK?n.counter.addSuccess():n.counter.addFailure(),(l=t.onCallEnded)===null||l===void 0||l.call(t,o)},"onCallEnded")),Object.assign(Object.assign({},t),{subchannel:i.getWrappedSubchannel(),onCallEnded:s})}else return Object.assign(Object.assign({},t),{subchannel:i.getWrappedSubchannel()})}else return t}},Ra=class{static{a(this,"OutlierDetectionLoadBalancer")}constructor(e,t,i){this.entryMap=new Mu.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new Zb.ChildLoadBalancerHandler((0,Jg.createChildChannelControlHelper)(e,{createSubchannel:a((n,s,o)=>{let l=e.createSubchannel(n,s,o),c=this.entryMap.getForSubchannelAddress(n),u=new ku(l,c);return c?.currentEjectionTimestamp!==null&&u.eject(),c?.subchannelWrappers.push(u),u},"createSubchannel"),updateState:a((n,s)=>{n===Xb.ConnectivityState.READY?e.updateState(n,new xu(s,this.isCountingEnabled())):e.updateState(n,s)},"updateState")}),t,i),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;be("Running success rate check");let i=t.request_volume,n=0,s=[];for(let[h,p]of this.entryMap.entries()){let g=p.counter.getLastSuccesses(),y=p.counter.getLastFailures();be("Stats for "+(0,Mu.endpointToString)(h)+": successes="+g+" failures="+y+" targetRequestVolume="+i),g+y>=i&&(n+=1,s.push(g/(g+y)))}if(be("Found "+n+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+s+"]"),n<t.minimum_hosts)return;let o=s.reduce((h,p)=>h+p)/s.length,l=0;for(let h of s){let p=h-o;l+=p*p}let c=l/s.length,u=Math.sqrt(c),d=o-u*(t.stdev_factor/1e3);be("stdev="+u+" ejectionThreshold="+d);for(let[h,p]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let g=p.counter.getLastSuccesses(),y=p.counter.getLastFailures();if(g+y<i)continue;let v=g/(g+y);if(be("Checking candidate "+h+" successRate="+v),v<d){let C=Math.random()*100;be("Candidate "+h+" randomNumber="+C+" enforcement_percentage="+t.enforcement_percentage),C<t.enforcement_percentage&&(be("Ejecting candidate "+h),this.eject(p,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;be("Running failure percentage check. threshold="+t.threshold+" request volume threshold="+t.request_volume);let i=0;for(let n of this.entryMap.values()){let s=n.counter.getLastSuccesses(),o=n.counter.getLastFailures();s+o>=t.request_volume&&(i+=1)}if(!(i<t.minimum_hosts))for(let[n,s]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let o=s.counter.getLastSuccesses(),l=s.counter.getLastFailures();if(be("Candidate successes="+o+" failures="+l),o+l<t.request_volume)continue;if(l*100/(l+o)>t.threshold){let u=Math.random()*100;be("Candidate "+n+" randomNumber="+u+" enforcement_percentage="+t.enforcement_percentage),u<t.enforcement_percentage&&(be("Ejecting candidate "+n),this.eject(s,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let i of e.subchannelWrappers)i.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,i;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(i=(t=this.ejectionTimer).unref)===null||i===void 0||i.call(t)}runChecks(){let e=new Date;if(be("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,i]of this.entryMap.entries())if(i.currentEjectionTimestamp===null)i.ejectionTimeMultiplier>0&&(i.ejectionTimeMultiplier-=1);else{let n=this.latestConfig.getBaseEjectionTimeMs(),s=this.latestConfig.getMaxEjectionTimeMs(),o=new Date(i.currentEjectionTimestamp.getTime());o.setMilliseconds(o.getMilliseconds()+Math.min(n*i.ejectionTimeMultiplier,Math.max(n,s))),o<new Date&&(be("Unejecting "+t),this.uneject(i))}}}updateAddressList(e,t,i){if(!(t instanceof Sn))return;for(let s of e)this.entryMap.has(s)||(be("Adding map entry for "+(0,Mu.endpointToString)(s)),this.entryMap.set(s,{counter:new Iu,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let n=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,n,i),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){be("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let s=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(s)}else be("Starting new timer"),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{be("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let s of this.entryMap.values())this.uneject(s),s.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return Du}};vr.OutlierDetectionLoadBalancer=Ra;function oT(){nT&&(0,Jg.registerLoadBalancerType)(Du,Ra,Sn)}a(oT,"setup");vr.setup=oT});var yr=m(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.experimental=M.ServerInterceptingCall=M.ResponderBuilder=M.ServerListenerBuilder=M.addAdminServicesToServer=M.getChannelzHandlers=M.getChannelzServiceDefinition=M.InterceptorConfigurationError=M.InterceptingCall=M.RequesterBuilder=M.ListenerBuilder=M.StatusBuilder=M.getClientChannel=M.ServerCredentials=M.Server=M.setLogVerbosity=M.setLogger=M.load=M.loadObject=M.CallCredentials=M.ChannelCredentials=M.waitForClientReady=M.closeClient=M.Channel=M.makeGenericClientConstructor=M.makeClientConstructor=M.loadPackageDefinition=M.Client=M.compressionAlgorithms=M.propagate=M.connectivityState=M.status=M.logVerbosity=M.Metadata=M.credentials=void 0;var Aa=fo();Object.defineProperty(M,"CallCredentials",{enumerable:!0,get:a(function(){return Aa.CallCredentials},"get")});var lT=Vo();Object.defineProperty(M,"Channel",{enumerable:!0,get:a(function(){return lT.ChannelImplementation},"get")});var cT=Tc();Object.defineProperty(M,"compressionAlgorithms",{enumerable:!0,get:a(function(){return cT.CompressionAlgorithms},"get")});var uT=$e();Object.defineProperty(M,"connectivityState",{enumerable:!0,get:a(function(){return uT.ConnectivityState},"get")});var Oa=Fi();Object.defineProperty(M,"ChannelCredentials",{enumerable:!0,get:a(function(){return Oa.ChannelCredentials},"get")});var Kg=$o();Object.defineProperty(M,"Client",{enumerable:!0,get:a(function(){return Kg.Client},"get")});var Lu=U();Object.defineProperty(M,"logVerbosity",{enumerable:!0,get:a(function(){return Lu.LogVerbosity},"get")});Object.defineProperty(M,"status",{enumerable:!0,get:a(function(){return Lu.Status},"get")});Object.defineProperty(M,"propagate",{enumerable:!0,get:a(function(){return Lu.Propagate},"get")});var Xg=te(),qu=Yo();Object.defineProperty(M,"loadPackageDefinition",{enumerable:!0,get:a(function(){return qu.loadPackageDefinition},"get")});Object.defineProperty(M,"makeClientConstructor",{enumerable:!0,get:a(function(){return qu.makeClientConstructor},"get")});Object.defineProperty(M,"makeGenericClientConstructor",{enumerable:!0,get:a(function(){return qu.makeClientConstructor},"get")});var dT=we();Object.defineProperty(M,"Metadata",{enumerable:!0,get:a(function(){return dT.Metadata},"get")});var hT=Tg();Object.defineProperty(M,"Server",{enumerable:!0,get:a(function(){return hT.Server},"get")});var fT=ca();Object.defineProperty(M,"ServerCredentials",{enumerable:!0,get:a(function(){return fT.ServerCredentials},"get")});var pT=wg();Object.defineProperty(M,"StatusBuilder",{enumerable:!0,get:a(function(){return pT.StatusBuilder},"get")});M.credentials={combineChannelCredentials:a((r,...e)=>e.reduce((t,i)=>t.compose(i),r),"combineChannelCredentials"),combineCallCredentials:a((r,...e)=>e.reduce((t,i)=>t.compose(i),r),"combineCallCredentials"),createInsecure:Oa.ChannelCredentials.createInsecure,createSsl:Oa.ChannelCredentials.createSsl,createFromSecureContext:Oa.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:Aa.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:Aa.CallCredentials.createFromGoogleCredential,createEmpty:Aa.CallCredentials.createEmpty};var gT=a(r=>r.close(),"closeClient");M.closeClient=gT;var mT=a((r,e,t)=>r.waitForReady(e,t),"waitForClientReady");M.waitForClientReady=mT;var vT=a((r,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")},"loadObject");M.loadObject=vT;var yT=a((r,e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")},"load");M.load=yT;var _T=a(r=>{Xg.setLogger(r)},"setLogger");M.setLogger=_T;var ST=a(r=>{Xg.setLoggerVerbosity(r)},"setLogVerbosity");M.setLogVerbosity=ST;var CT=a(r=>Kg.Client.prototype.getChannel.call(r),"getClientChannel");M.getClientChannel=CT;var Ma=jo();Object.defineProperty(M,"ListenerBuilder",{enumerable:!0,get:a(function(){return Ma.ListenerBuilder},"get")});Object.defineProperty(M,"RequesterBuilder",{enumerable:!0,get:a(function(){return Ma.RequesterBuilder},"get")});Object.defineProperty(M,"InterceptingCall",{enumerable:!0,get:a(function(){return Ma.InterceptingCall},"get")});Object.defineProperty(M,"InterceptorConfigurationError",{enumerable:!0,get:a(function(){return Ma.InterceptorConfigurationError},"get")});var Qg=kr();Object.defineProperty(M,"getChannelzServiceDefinition",{enumerable:!0,get:a(function(){return Qg.getChannelzServiceDefinition},"get")});Object.defineProperty(M,"getChannelzHandlers",{enumerable:!0,get:a(function(){return Qg.getChannelzHandlers},"get")});var ET=Kn();Object.defineProperty(M,"addAdminServicesToServer",{enumerable:!0,get:a(function(){return ET.addAdminServicesToServer},"get")});var Fu=cu();Object.defineProperty(M,"ServerListenerBuilder",{enumerable:!0,get:a(function(){return Fu.ServerListenerBuilder},"get")});Object.defineProperty(M,"ResponderBuilder",{enumerable:!0,get:a(function(){return Fu.ResponderBuilder},"get")});Object.defineProperty(M,"ServerInterceptingCall",{enumerable:!0,get:a(function(){return Fu.ServerInterceptingCall},"get")});var bT=Su();M.experimental=bT;var TT=hc(),wT=qg(),RT=Hg(),AT=ga(),OT=$g(),MT=Yg(),PT=kr();TT.setup(),wT.setup(),RT.setup(),AT.setup(),OT.setup(),MT.setup(),PT.setup()});var Zg=m(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.isGrpcJsServiceDefinition=ki.fromGrpcJsServiceDefinition=void 0;function NT(r){let e={};for(let[t,i]of Object.entries(r))e[t]={path:i.path,requestStream:i.requestStream,responseStream:i.responseStream,requestDeserialize:a(n=>i.requestDeserialize(Buffer.from(n)),"requestDeserialize"),requestSerialize:i.requestSerialize,responseDeserialize:a(n=>i.responseDeserialize(Buffer.from(n)),"responseDeserialize"),responseSerialize:i.responseSerialize,options:{}};return e}a(NT,"fromGrpcJsServiceDefinition");ki.fromGrpcJsServiceDefinition=NT;function kT(r){return Object.values(r).every(e=>typeof e=="object"&&e!=null&&typeof e.path=="string")}a(kT,"isGrpcJsServiceDefinition");ki.isGrpcJsServiceDefinition=kT});var em=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.isTsProtoServiceDefinition=Ii.fromTsProtoServiceDefinition=void 0;function IT(r){let e={};for(let[t,i]of Object.entries(r.methods)){let n=i.requestType.encode,s=i.requestType.fromPartial,o=i.responseType.encode,l=i.responseType.fromPartial;e[t]={path:`/${r.fullName}/${i.name}`,requestStream:i.requestStream,responseStream:i.responseStream,requestDeserialize:i.requestType.decode,requestSerialize:s!=null?c=>n(s(c)).finish():c=>n(c).finish(),responseDeserialize:i.responseType.decode,responseSerialize:l!=null?c=>o(l(c)).finish():c=>o(c).finish(),options:i.options}}return e}a(IT,"fromTsProtoServiceDefinition");Ii.fromTsProtoServiceDefinition=IT;function xT(r){return"name"in r&&"fullName"in r&&"methods"in r}a(xT,"isTsProtoServiceDefinition");Ii.isTsProtoServiceDefinition=xT});var Br=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.toGrpcJsMethodDefinition=_r.toGrpcJsServiceDefinition=_r.normalizeServiceDefinition=void 0;var tm=Zg(),rm=em();function DT(r){return(0,tm.isGrpcJsServiceDefinition)(r)?(0,tm.fromGrpcJsServiceDefinition)(r):(0,rm.isTsProtoServiceDefinition)(r)?(0,rm.fromTsProtoServiceDefinition)(r):r}a(DT,"normalizeServiceDefinition");_r.normalizeServiceDefinition=DT;function LT(r){let e={};for(let[t,i]of Object.entries(r))e[t]=im(i);return e}a(LT,"toGrpcJsServiceDefinition");_r.toGrpcJsServiceDefinition=LT;function im(r){return{path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,requestDeserialize:r.requestDeserialize,requestSerialize:a(e=>Buffer.from(r.requestSerialize(e)),"requestSerialize"),responseDeserialize:r.responseDeserialize,responseSerialize:a(e=>Buffer.from(r.responseSerialize(e)),"responseSerialize")}}a(im,"toGrpcJsMethodDefinition");_r.toGrpcJsMethodDefinition=im});function je(r){return typeof r=="object"&&r!==null&&r.name==="AbortError"}function qT(r){if(r.aborted)throw new Ie}function Bu(r){if(je(r))throw r}function Ur(r){if(!je(r))throw r}var Ie,Wt=Me(()=>{"use strict";Ie=class extends Error{static{a(this,"AbortError")}constructor(){super("The operation has been aborted"),this.message="The operation has been aborted",this.name="AbortError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,this.constructor)}};a(je,"isAbortError");a(qT,"throwIfAborted");a(Bu,"rethrowAbortError");a(Ur,"catchAbortError")});function mt(r,e){return new Promise((t,i)=>{if(r.aborted){i(new Ie);return}let n,s=!1;function o(){s||(s=!0,n?.())}a(o,"finish");let l=e(c=>{t(c),o()},c=>{i(c),o()});if(!s){let c=a(()=>{let u=l();u==null?i(new Ie):u.then(()=>{i(new Ie)},d=>{i(d)}),o()},"listener");r.addEventListener("abort",c),n=a(()=>{r.removeEventListener("abort",c)},"removeAbortListener")}})}var zr=Me(()=>{"use strict";Wt();a(mt,"execute")});function FT(r,e){if(r.aborted){let t=a(()=>{},"noop");e.then(t,t)}return mt(r,(t,i)=>(e.then(t,i),()=>{}))}var nm=Me(()=>{"use strict";zr();a(FT,"abortable")});function Cn(r,e){return mt(r,t=>{let i=typeof e=="number"?e:e.getTime()-Date.now(),n=setTimeout(t,i);return()=>{clearTimeout(n)}})}var Pa=Me(()=>{"use strict";zr();a(Cn,"delay")});function BT(r){return mt(r,()=>()=>{})}var sm=Me(()=>{"use strict";zr();a(BT,"forever")});function UT(r,e,t,i){return mt(r,n=>{let s,o=!1;return s=zT(e,t,a((...c)=>{n(c.length>1?c:c[0]),o=!0,s?.()},"handler"),i),o&&s(),()=>{o=!0,s?.()}})}function zT(r,e,t,i){if(GT(r))return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i);if(jT(r))return r.on(e,t),()=>r.off(e,t);if(HT(r))return r.addListener(e,t),()=>r.removeListener(e,t);throw new Error("Invalid event target")}function HT(r){return xi(r.addListener)&&xi(r.removeListener)}function jT(r){return xi(r.on)&&xi(r.off)}function GT(r){return xi(r.addEventListener)&&xi(r.removeEventListener)}var xi,am=Me(()=>{"use strict";zr();a(UT,"waitForEvent");a(zT,"listen");a(HT,"isNodeStyleEventEmitter");a(jT,"isJQueryStyleEventEmitter");a(GT,"isEventTarget");xi=a(r=>typeof r=="function","isFunction")});function WT(r,e){return new Promise((t,i)=>{if(r.aborted){i(new Ie);return}let n=new AbortController,s=e(n.signal);if(s.length===0){t([]);return}let o=a(()=>{n.abort()},"abortListener");r.addEventListener("abort",o);let l,c=new Array(s.length),u=0;function d(){u+=1,u===s.length&&(r.removeEventListener("abort",o),l!=null?i(l.reason):t(c))}a(d,"settled");for(let[h,p]of s.entries())p.then(g=>{c[h]=g,d()},g=>{n.abort(),(l==null||!je(g)&&je(l.reason))&&(l={reason:g}),d()})})}var om=Me(()=>{"use strict";Wt();a(WT,"all")});function $T(r,e){return new Promise((t,i)=>{if(r.aborted){i(new Ie);return}let n=new AbortController,s=e(n.signal),o=a(()=>{n.abort()},"abortListener");r.addEventListener("abort",o);let l=0;function c(d){n.abort(),l+=1,l===s.length&&(r.removeEventListener("abort",o),d.status==="fulfilled"?t(d.value):i(d.reason))}a(c,"settled");let u;for(let d of s)d.then(h=>{u==null&&(u={status:"fulfilled",value:h}),c(u)},h=>{(u==null||!je(h)&&(u.status==="fulfilled"||je(u.reason)))&&(u={status:"rejected",reason:h}),c(u)})})}var lm=Me(()=>{"use strict";Wt();a($T,"race")});async function VT(r,e,t={}){let{baseMs:i=1e3,maxDelayMs:n=3e4,onError:s,maxAttempts:o=1/0}=t,l=0,c=a(()=>{l=-1},"reset");for(;;)try{return await e(r,l,c)}catch(u){if(Bu(u),l>=o)throw u;let d;if(l===-1)d=0;else{let h=Math.min(n,Math.pow(2,l)*i);d=Math.round(h*(1+Math.random())/2)}s&&s(u,l,d),d!==0&&await Cn(r,d),l+=1}}var cm=Me(()=>{"use strict";Pa();Wt();a(VT,"retry")});function JT(r,e){if(r.aborted)return Promise.reject(new Ie);let t=[],i=new AbortController,n=i.signal,s=a(()=>{i.abort()},"abortSpawn");r.addEventListener("abort",s);let o=a(()=>{r.removeEventListener("abort",s)},"removeAbortListener"),l=new Set,c=a(()=>{for(let h of l)h.abort()},"abortTasks");n.addEventListener("abort",c);let u=a(()=>{n.removeEventListener("abort",c)},"removeSpawnAbortListener"),d=new Promise((h,p)=>{let g,y;v(C=>e(C,{defer(S){t.push(S)},fork:v})).join().then(C=>{i.abort(),g={value:C}},C=>{i.abort(),(!je(C)||y==null)&&(y={error:C})});function v(C){if(n.aborted)return{abort(){},async join(){throw new Ie}};let S=new AbortController,_=S.signal,P=C(_),A={abort(){S.abort()},join:a(()=>P,"join")};return l.add(A),P.catch(Ur).catch(L=>{y={error:L},i.abort()}).finally(()=>{l.delete(A),l.size===0&&(y!=null?p(y.error):h(g.value))}),A}a(v,"fork")});return d=d.finally(()=>{o(),u();let h=Promise.resolve();for(let p=t.length-1;p>=0;p--)h=h.finally(t[p]);return h}),d}var um=Me(()=>{"use strict";Wt();a(JT,"spawn")});function YT(r){let e=new AbortController,t=r(e.signal).catch(Ur);return()=>(e.abort(),t)}var dm=Me(()=>{"use strict";Wt();a(YT,"run")});function KT(r,e,t={}){let{baseMs:i=1e3,onError:n,maxAttempts:s=1/0}=t;return mt(r,(o,l)=>{let c=new AbortController,u=!1,d=new Map;function h(y){c.abort(),d.clear(),o(y)}a(h,"handleFulfilled");function p(y,v){if(d.delete(v),u&&d.size===0){l(y);return}if(!je(y)&&n)try{n(y,v)}catch(C){c.abort(),d.clear(),l(C)}}a(p,"handleRejected");async function g(y){for(let v=0;;v++){let C=e(y,v);if(d.set(v,C),C.then(h,P=>p(P,v)),v+1>=s)break;let S=Math.pow(2,v)*i,_=Math.round(S*(1+Math.random())/2);await Cn(y,_)}u=!0}return a(g,"makeAttempts"),g(c.signal).catch(Ur),()=>{c.abort()}})}var hm=Me(()=>{"use strict";Wt();Pa();zr();a(KT,"proactiveRetry")});var Sr={};Ya(Sr,{AbortError:()=>Ie,abortable:()=>FT,all:()=>WT,catchAbortError:()=>Ur,delay:()=>Cn,execute:()=>mt,forever:()=>BT,isAbortError:()=>je,proactiveRetry:()=>KT,race:()=>$T,rethrowAbortError:()=>Bu,retry:()=>VT,run:()=>YT,spawn:()=>JT,throwIfAborted:()=>qT,waitForEvent:()=>UT});var Cr=Me(()=>{"use strict";nm();Wt();Pa();zr();sm();am();om();lm();cm();um();dm();hm()});var Dt=m(st=>{"use strict";var XT=st&&st.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),QT=st&&st.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ZT=st&&st.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&XT(e,r,t);return QT(e,r),e};Object.defineProperty(st,"__esModule",{value:!0});st.convertMetadataFromGrpcJs=st.convertMetadataToGrpcJs=void 0;var ew=ZT(yr()),tw=Ge();function rw(r){let e=new ew.Metadata;for(let[t,i]of r)for(let n of i)e.add(t,typeof n=="string"?n:Buffer.from(n));return e}a(rw,"convertMetadataToGrpcJs");st.convertMetadataToGrpcJs=rw;function iw(r){let e=(0,tw.Metadata)();for(let t of Object.keys(r.getMap())){let i=r.get(t);e.set(t,i)}return e}a(iw,"convertMetadataFromGrpcJs");st.convertMetadataFromGrpcJs=iw});var $t=m(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.isAsyncIterable=void 0;function nw(r){return r!=null&&Symbol.asyncIterator in r}a(nw,"isAsyncIterable");Na.isAsyncIterable=nw});var En=m(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.readableToAsyncIterable=void 0;var fm=!1;function sw(r){if(fm)return!0;let e=r&&typeof r=="object"&&"errored"in r&&"errorEmitted"in r&&"endEmitted"in r&&"closeEmitted"in r&&typeof r.errorEmitted=="boolean"&&typeof r.endEmitted=="boolean"&&typeof r.closeEmitted=="boolean";return fm=e,e}a(sw,"nodejsInternalsAccessible");async function*aw(r){let e=pm;function t(c){this===r?(e(),e=pm):e=c}a(t,"next");let i=r._readableState;if(!sw(i))throw new Error("nice-grpc: _readableState members incompatible");let n=i.errored,s=i.errorEmitted,o=i.endEmitted,l=i.closeEmitted;for(r.on("readable",t).on("error",function(c){n=c,s=!0,t.call(this)}).on("end",function(){o=!0,t.call(this)}).on("close",function(){l=!0,t.call(this)});;){let c=r.destroyed?null:r.read();if(c!==null)yield c;else{if(s)throw n;if(o)break;if(l)break;await new Promise(t)}}}a(aw,"readableToAsyncIterable");ka.readableToAsyncIterable=aw;var pm=a(()=>{},"nop")});var bn=m(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.createCallContext=void 0;var gm=Ge(),mm=Dt();function ow(r){let e=new AbortController,t={signal:e.signal,cancel(){e.abort()}},i=(0,gm.Metadata)(),n=(0,gm.Metadata)();r.cancelled?(t.cancel?.(),t.cancel=void 0):(r.on("close",()=>{t.cancel=void 0}),r.on("finish",()=>{t.cancel=void 0}),r.on("cancelled",()=>{t.cancel?.(),t.cancel=void 0}));let s=!1;return{context:{metadata:(0,mm.convertMetadataFromGrpcJs)(r.metadata),peer:r.getPeer(),header:i,sendHeader(){s||(r.sendMetadata((0,mm.convertMetadataToGrpcJs)(i)),s=!0)},trailer:n,signal:t.signal},maybeCancel:t}}a(ow,"createCallContext");Ia.createCallContext=ow});var Tn=m(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.createErrorStatusObject=void 0;var vm=yr(),lw=(Cr(),vt(Sr)),cw=Ge();function uw(r,e,t){return e instanceof cw.ServerError?{code:e.code,details:e.details,metadata:t}:(0,lw.isAbortError)(e)?{code:vm.status.CANCELLED,details:"The operation was cancelled",metadata:t}:(process.emitWarning(`${r}: Uncaught error in server implementation method. Server methods should only throw ServerError or AbortError. ${e instanceof Error?e.stack:e}`),{code:vm.status.UNKNOWN,details:"Unknown server error occurred",metadata:t})}a(uw,"createErrorStatusObject");xa.createErrorStatusObject=uw});var Sm=m(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createBidiStreamingMethodHandler=void 0;var ym=(Cr(),vt(Sr)),_m=Dt(),dw=$t(),hw=En(),fw=bn(),pw=Tn();function gw(r,e,t){let i={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*n(o,l){if(!(0,dw.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");yield*e(o,l)}a(n,"bidiStreamingMethodHandler");let s=t==null?n:(o,l)=>t({method:i,requestStream:!0,request:o,responseStream:!0,next:n},l);return o=>{let{context:l,maybeCancel:c}=(0,fw.createCallContext)(o);Promise.resolve().then(async()=>{let d=s((0,hw.readableToAsyncIterable)(o),l)[Symbol.asyncIterator]();try{let h=await d.next();for(;;){if(!h.done){try{l.sendHeader(),o.write(h.value)||await(0,ym.waitForEvent)(l.signal,o,"drain")}catch(p){h=(0,ym.isAbortError)(p)?await d.return():await d.throw(p);continue}h=await d.next();continue}if(h.value!=null){h=await d.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method"));continue}break}}finally{c.cancel=void 0,l.sendHeader()}}).then(()=>{o.end((0,_m.convertMetadataToGrpcJs)(l.trailer))},u=>{o.emit("error",(0,pw.createErrorStatusObject)(r.path,u,(0,_m.convertMetadataToGrpcJs)(l.trailer)))})}}a(gw,"createBidiStreamingMethodHandler");Da.createBidiStreamingMethodHandler=gw});var Em=m(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.createClientStreamingMethodHandler=void 0;var Cm=Dt(),mw=$t(),vw=En(),yw=bn(),_w=Tn();function Sw(r,e,t){let i={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*n(o,l){if(!(0,mw.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");return await e(o,l)}a(n,"clientStreamingMethodHandler");let s=t==null?n:(o,l)=>t({method:i,requestStream:!0,request:o,responseStream:!1,next:n},l);return(o,l)=>{let{context:c,maybeCancel:u}=(0,yw.createCallContext)(o);Promise.resolve().then(async()=>{let h=s((0,vw.readableToAsyncIterable)(o),c)[Symbol.asyncIterator]();try{let p=await h.next();for(;;){if(!p.done){p=await h.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(p.value==null){p=await h.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return p.value}}finally{u.cancel=void 0,c.sendHeader()}}).then(d=>{l(null,d,(0,Cm.convertMetadataToGrpcJs)(c.trailer))},d=>{l((0,_w.createErrorStatusObject)(r.path,d,(0,Cm.convertMetadataToGrpcJs)(c.trailer)))})}}a(Sw,"createClientStreamingMethodHandler");La.createClientStreamingMethodHandler=Sw});var wm=m(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.createServerStreamingMethodHandler=void 0;var bm=(Cr(),vt(Sr)),Tm=Dt(),Cw=$t(),Ew=bn(),bw=Tn();function Tw(r,e,t){let i={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*n(o,l){if((0,Cw.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");yield*e(o,l)}a(n,"serverStreamingMethodHandler");let s=t==null?n:(o,l)=>t({method:i,requestStream:!1,request:o,responseStream:!0,next:n},l);return o=>{let{context:l,maybeCancel:c}=(0,Ew.createCallContext)(o);Promise.resolve().then(async()=>{let d=s(o.request,l)[Symbol.asyncIterator]();try{let h=await d.next();for(;;){if(!h.done){try{l.sendHeader(),o.write(h.value)||await(0,bm.waitForEvent)(l.signal,o,"drain")}catch(p){h=(0,bm.isAbortError)(p)?await d.return():await d.throw(p);continue}h=await d.next();continue}if(h.value!=null){h=await d.throw(new Error("A middleware returned a message, but expected to return void for server streaming method"));continue}break}}finally{c.cancel=void 0,l.sendHeader()}}).then(()=>{o.end((0,Tm.convertMetadataToGrpcJs)(l.trailer))},u=>{o.emit("error",(0,bw.createErrorStatusObject)(r.path,u,(0,Tm.convertMetadataToGrpcJs)(l.trailer)))})}}a(Tw,"createServerStreamingMethodHandler");qa.createServerStreamingMethodHandler=Tw});var Am=m(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.createUnaryMethodHandler=void 0;var Rm=Dt(),ww=$t(),Rw=bn(),Aw=Tn();function Ow(r,e,t){let i={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*n(o,l){if((0,ww.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");return await e(o,l)}a(n,"unaryMethodHandler");let s=t==null?n:(o,l)=>t({method:i,requestStream:!1,request:o,responseStream:!1,next:n},l);return(o,l)=>{let{context:c,maybeCancel:u}=(0,Rw.createCallContext)(o);Promise.resolve().then(async()=>{let h=s(o.request,c)[Symbol.asyncIterator]();try{let p=await h.next();for(;;){if(!p.done){p=await h.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(p.value==null){p=await h.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return p.value}}finally{u.cancel=void 0,c.sendHeader()}}).then(d=>{l(null,d,(0,Rm.convertMetadataToGrpcJs)(c.trailer))},d=>{l((0,Aw.createErrorStatusObject)(r.path,d,(0,Rm.convertMetadataToGrpcJs)(c.trailer)))})}}a(Ow,"createUnaryMethodHandler");Fa.createUnaryMethodHandler=Ow});var km=m(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.createServer=void 0;var Om=yr(),Mm=Ge(),Pm=Br(),Mw=Sm(),Pw=Em(),Nw=wm(),kw=Am();function Iw(r={}){return Nm(r)}a(Iw,"createServer");Ba.createServer=Iw;function Nm(r,e){let t=[],i;function n(s){return{with(o){return n(s==null?o:(0,Mm.composeServerMiddleware)(s,o))},add(o,l){if(i!=null)throw new Error("server.add() must be used before listen()");t.push({definition:(0,Pm.normalizeServiceDefinition)(o),middleware:s,implementation:l})}}}return a(n,"createAddBuilder"),{use(s){if(i!=null)throw new Error("server.use() must be used before listen()");if(t.length>0)throw new Error("server.use() must be used before adding any services");return Nm(r,e==null?s:(0,Mm.composeServerMiddleware)(e,s))},...n(e),async listen(s,o){if(i!=null)throw new Error("server.listen() has already been called");i=new Om.Server(r);for(let{definition:c,middleware:u,implementation:d}of t){let h={};for(let[p,g]of Object.entries(c)){let y=d[p].bind(d);g.requestStream?g.responseStream?h[p]=(0,Mw.createBidiStreamingMethodHandler)(g,y,u):h[p]=(0,Pw.createClientStreamingMethodHandler)(g,y,u):g.responseStream?h[p]=(0,Nw.createServerStreamingMethodHandler)(g,y,u):h[p]=(0,kw.createUnaryMethodHandler)(g,y,u)}i.addService((0,Pm.toGrpcJsServiceDefinition)(c),h)}let l=await new Promise((c,u)=>{i.bindAsync(s,o??Om.ServerCredentials.createInsecure(),(d,h)=>{d!=null?(i=void 0,u(d)):c(h)})});return i.start(),l},async shutdown(){i!=null&&(await new Promise((s,o)=>{i.tryShutdown(l=>{l!=null?o(l):s()})}),i=void 0)},forceShutdown(){i!=null&&(i.forceShutdown(),i=void 0)}}}a(Nm,"createServerWithMiddleware")});var xm=m(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0})});var Dm=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.waitForChannelReady=Di.createChannel=void 0;var Ua=yr(),xw=new Set(["http","https"]);function Dw(r,e,t={}){let i=/^(?:([^:]+):\/\/)?(.*?)(?::(\d+))?$/.exec(r);if(i==null)throw new Error(`Invalid address: '${r}'`);let[,n,s,o]=i,l=!n||xw.has(n),c=e?._isSecure()||n?.includes("https");e??(e=c?Ua.ChannelCredentials.createSsl():Ua.ChannelCredentials.createInsecure()),o??(o=c?"443":"80");let u=l?`${s}:${o}`:r;return new Ua.Channel(u,e,t)}a(Dw,"createChannel");Di.createChannel=Dw;async function Lw(r,e){for(;;){let t=r.getConnectivityState(!0);if(t===Ua.connectivityState.READY)return;await new Promise((i,n)=>{r.watchConnectivityState(t,e,s=>{s!=null?n(s):i()})})}}a(Lw,"waitForChannelReady");Di.waitForChannelReady=Lw});var wn=m(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.wrapClientError=void 0;var qw=Ge(),Fw=yr();function Bw(r,e){return Uw(r)?new qw.ClientError(e,r.code,r.details):r}a(Bw,"wrapClientError");za.wrapClientError=Bw;function Uw(r){return typeof r=="object"&&r!==null&&typeof r.code=="number"&&typeof r.details=="string"&&r.metadata instanceof Fw.Metadata}a(Uw,"isStatusObject")});var Lm=m(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.createBidiStreamingMethod=void 0;var Ha=(Cr(),vt(Sr)),zw=Ge(),Hw=Br(),Uu=Dt(),jw=$t(),Gw=En(),Ww=wn();function $w(r,e,t,i){let n=(0,Hw.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,u){if(!(0,jw.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");let{metadata:d=(0,zw.Metadata)(),onHeader:h,onTrailer:p}=u,g=u.signal??new AbortController().signal,y=new AbortController,v=e.makeBidiStreamRequest(n.path,n.requestSerialize,n.responseDeserialize,(0,Uu.convertMetadataToGrpcJs)(d));v.on("metadata",_=>{h?.((0,Uu.convertMetadataFromGrpcJs)(_))}),v.on("status",_=>{p?.((0,Uu.convertMetadataFromGrpcJs)(_.metadata))});let C;Vw(y.signal,c,v).then(()=>{v.end()},_=>{(0,Ha.isAbortError)(_)||(C=_,v.cancel())});let S=a(()=>{y.abort(),v.cancel()},"abortListener");g.addEventListener("abort",S);try{yield*(0,Gw.readableToAsyncIterable)(v)}catch(_){throw(0,Ww.wrapClientError)(_,r.path)}finally{if(y.abort(),g.removeEventListener("abort",S),(0,Ha.throwIfAborted)(g),v.cancel(),C)throw C}}a(o,"bidiStreamingMethod");let l=t==null?o:(c,u)=>t({method:s,requestStream:!0,request:c,responseStream:!0,next:o},u);return(c,u)=>{let h=l(c,{...i,...u})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let p=await h.next();return p.done&&p.value!=null?await h.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method")):p},return(){return h.return()},throw(p){return h.throw(p)}}}}}}a($w,"createBidiStreamingMethod");ja.createBidiStreamingMethod=$w;async function Vw(r,e,t){for await(let i of e)(0,Ha.throwIfAborted)(r),t.write(i)||await(0,Ha.waitForEvent)(r,t,"drain")}a(Vw,"pipeRequest")});var qm=m(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.createClientStreamingMethod=void 0;var Ga=(Cr(),vt(Sr)),Jw=Ge(),Yw=Br(),zu=Dt(),Kw=$t(),Xw=wn();function Qw(r,e,t,i){let n=(0,Yw.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,u){if(!(0,Kw.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");let{metadata:d=(0,Jw.Metadata)(),signal:h=new AbortController().signal,onHeader:p,onTrailer:g}=u;return await(0,Ga.execute)(h,(y,v)=>{let C=new AbortController,S=e.makeClientStreamRequest(n.path,n.requestSerialize,n.responseDeserialize,(0,zu.convertMetadataToGrpcJs)(d),(_,P)=>{C.abort(),_!=null?v((0,Xw.wrapClientError)(_,r.path)):y(P)});return S.on("metadata",_=>{p?.((0,zu.convertMetadataFromGrpcJs)(_))}),S.on("status",_=>{g?.((0,zu.convertMetadataFromGrpcJs)(_.metadata))}),Zw(C.signal,c,S).then(()=>{S.end()},_=>{(0,Ga.isAbortError)(_)||(v(_),S.cancel())}),()=>{C.abort(),S.cancel()}})}a(o,"clientStreamingMethod");let l=t==null?o:(c,u)=>t({method:s,requestStream:!0,request:c,responseStream:!1,next:o},u);return async(c,u)=>{let h=l(c,{...i,...u})[Symbol.asyncIterator](),p=await h.next();for(;;){if(!p.done){p=await h.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(p.value==null){p=await h.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return p.value}}}a(Qw,"createClientStreamingMethod");Wa.createClientStreamingMethod=Qw;async function Zw(r,e,t){for await(let i of e)(0,Ga.throwIfAborted)(r),t.write(i)||await(0,Ga.waitForEvent)(r,t,"drain")}a(Zw,"pipeRequest")});var Fm=m($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.createServerStreamingMethod=void 0;var eR=(Cr(),vt(Sr)),tR=Ge(),rR=Br(),Hu=Dt(),iR=$t(),nR=En(),sR=wn();function aR(r,e,t,i){let n=(0,rR.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,u){if((0,iR.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");let{metadata:d=(0,tR.Metadata)(),onHeader:h,onTrailer:p}=u,g=u.signal??new AbortController().signal,y=e.makeServerStreamRequest(n.path,n.requestSerialize,n.responseDeserialize,c,(0,Hu.convertMetadataToGrpcJs)(d));y.on("metadata",C=>{h?.((0,Hu.convertMetadataFromGrpcJs)(C))}),y.on("status",C=>{p?.((0,Hu.convertMetadataFromGrpcJs)(C.metadata))});let v=a(()=>{y.cancel()},"abortListener");g.addEventListener("abort",v);try{yield*(0,nR.readableToAsyncIterable)(y)}catch(C){throw(0,sR.wrapClientError)(C,r.path)}finally{g.removeEventListener("abort",v),(0,eR.throwIfAborted)(g),y.cancel()}}a(o,"serverStreamingMethod");let l=t==null?o:(c,u)=>t({method:s,requestStream:!1,request:c,responseStream:!0,next:o},u);return(c,u)=>{let h=l(c,{...i,...u})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let p=await h.next();return p.done&&p.value!=null?await h.throw(new Error("A middleware returned a message, but expected to return void for server streaming method")):p},return(){return h.return()},throw(p){return h.throw(p)}}}}}}a(aR,"createServerStreamingMethod");$a.createServerStreamingMethod=aR});var Bm=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.createUnaryMethod=void 0;var oR=(Cr(),vt(Sr)),lR=Ge(),cR=Br(),ju=Dt(),uR=$t(),dR=wn();function hR(r,e,t,i){let n=(0,cR.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,u){if((0,uR.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");let{metadata:d=(0,lR.Metadata)(),signal:h=new AbortController().signal,onHeader:p,onTrailer:g}=u;return await(0,oR.execute)(h,(y,v)=>{let C=e.makeUnaryRequest(n.path,n.requestSerialize,n.responseDeserialize,c,(0,ju.convertMetadataToGrpcJs)(d),(S,_)=>{S!=null?v((0,dR.wrapClientError)(S,r.path)):y(_)});return C.on("metadata",S=>{p?.((0,ju.convertMetadataFromGrpcJs)(S))}),C.on("status",S=>{g?.((0,ju.convertMetadataFromGrpcJs)(S.metadata))}),()=>{C.cancel()}})}a(o,"unaryMethod");let l=t==null?o:(c,u)=>t({method:s,requestStream:!1,request:c,responseStream:!1,next:o},u);return async(c,u)=>{let h=l(c,{...i,...u})[Symbol.asyncIterator](),p=await h.next();for(;;){if(!p.done){p=await h.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(p.value==null){p=await h.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return p.value}}}a(hR,"createUnaryMethod");Va.createUnaryMethod=hR});var Hm=m(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.createClient=Li.createClientFactory=void 0;var fR=yr(),pR=Ge(),gR=Br(),mR=Lm(),vR=qm(),yR=Fm(),_R=Bm();function Um(){return zm()}a(Um,"createClientFactory");Li.createClientFactory=Um;function SR(r,e,t){return Um().create(r,e,t)}a(SR,"createClient");Li.createClient=SR;function zm(r){return{use(e){return zm(r==null?e:(0,pR.composeClientMiddleware)(r,e))},create(e,t,i={}){let n=(0,fR.makeClientConstructor)({},""),s=new n("",null,{channelOverride:t}),o={},l=Object.entries((0,gR.normalizeServiceDefinition)(e));for(let[c,u]of l){let d={...i["*"],...i[c]};u.requestStream?u.responseStream?o[c]=(0,mR.createBidiStreamingMethod)(u,s,r,d):o[c]=(0,vR.createClientStreamingMethod)(u,s,r,d):u.responseStream?o[c]=(0,yR.createServerStreamingMethod)(u,s,r,d):o[c]=(0,_R.createUnaryMethod)(u,s,r,d)}return o}}}a(zm,"createClientFactoryWithMiddleware")});var Gm=m(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0})});var ER=m(ge=>{"use strict";var CR=ge&&ge.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),Rn=ge&&ge.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&CR(e,r,t)};Object.defineProperty(ge,"__esModule",{value:!0});ge.ChannelCredentials=ge.Channel=ge.waitForChannelReady=ge.createChannel=void 0;Rn(Ge(),ge);Rn(km(),ge);Rn(xm(),ge);var Wm=Dm();Object.defineProperty(ge,"createChannel",{enumerable:!0,get:a(function(){return Wm.createChannel},"get")});Object.defineProperty(ge,"waitForChannelReady",{enumerable:!0,get:a(function(){return Wm.waitForChannelReady},"get")});var $m=yr();Object.defineProperty(ge,"Channel",{enumerable:!0,get:a(function(){return $m.Channel},"get")});Object.defineProperty(ge,"ChannelCredentials",{enumerable:!0,get:a(function(){return $m.ChannelCredentials},"get")});Rn(Hm(),ge);Rn(Gm(),ge)});export{Kh as a,ER as b};
23
+ /*! Bundled license information:
24
+
25
+ @grpc/proto-loader/build/src/util.js:
26
+ (**
27
+ * @license
28
+ * Copyright 2018 gRPC authors.
29
+ *
30
+ * Licensed under the Apache License, Version 2.0 (the "License");
31
+ * you may not use this file except in compliance with the License.
32
+ * You may obtain a copy of the License at
33
+ *
34
+ * http://www.apache.org/licenses/LICENSE-2.0
35
+ *
36
+ * Unless required by applicable law or agreed to in writing, software
37
+ * distributed under the License is distributed on an "AS IS" BASIS,
38
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
+ * See the License for the specific language governing permissions and
40
+ * limitations under the License.
41
+ *
42
+ *)
43
+
44
+ long/umd/index.js:
45
+ (**
46
+ * @license
47
+ * Copyright 2009 The Closure Library Authors
48
+ * Copyright 2020 Daniel Wirtz / The long.js Authors.
49
+ *
50
+ * Licensed under the Apache License, Version 2.0 (the "License");
51
+ * you may not use this file except in compliance with the License.
52
+ * You may obtain a copy of the License at
53
+ *
54
+ * http://www.apache.org/licenses/LICENSE-2.0
55
+ *
56
+ * Unless required by applicable law or agreed to in writing, software
57
+ * distributed under the License is distributed on an "AS IS" BASIS,
58
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
+ * See the License for the specific language governing permissions and
60
+ * limitations under the License.
61
+ *
62
+ * SPDX-License-Identifier: Apache-2.0
63
+ *)
64
+
65
+ @grpc/proto-loader/build/src/index.js:
66
+ (**
67
+ * @license
68
+ * Copyright 2018 gRPC authors.
69
+ *
70
+ * Licensed under the Apache License, Version 2.0 (the "License");
71
+ * you may not use this file except in compliance with the License.
72
+ * You may obtain a copy of the License at
73
+ *
74
+ * http://www.apache.org/licenses/LICENSE-2.0
75
+ *
76
+ * Unless required by applicable law or agreed to in writing, software
77
+ * distributed under the License is distributed on an "AS IS" BASIS,
78
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
79
+ * See the License for the specific language governing permissions and
80
+ * limitations under the License.
81
+ *
82
+ *)
83
+ */
84
+ //# sourceMappingURL=chunk-QGIFUSFI.js.map